Skip to content

Controls

sthairno edited this page Dec 13, 2020 · 6 revisions

コントロール一覧

タブ

tab

switch (gui.tab({ U"Tab1",U"Tab2",U"Tab3" }))
{
	case 0:
		gui.newLine();
		gui.label(U"Item1");
		break;
	case 1:
		gui.newLine();
		gui.label(U"Item2");
		break;
	case 2:
		gui.newLine();
		gui.label(U"Item3");
		break;
}

チェックボックス

checkbox

bool checked = true;
gui.checkBox(checked, U"Checked");

ラジオボタン

radiobutton

int32 radioItem = 0;
gui.radioButton(radioItem, 0, U"Item0"); gui.newLine();
gui.radioButton(radioItem, 1, U"Item1"); gui.newLine();
gui.radioButton(radioItem, 2, U"Item2"); gui.newLine();

ラベル

label

gui.label(U"HogeHoge"); gui.label(U"FugaFuga", Palette::Red);

ドロップダウンリスト

dropdownlist

String dropDownText;
gui.dropdownList(dropDownText, { U"ValueA",U"ValueB",U"ValueC" }); gui.newLine();
gui.label(U"dropDownText:{}"_fmt(dropDownText));

テキストボックス

textbox

String text1 = U"";
String text2 = U"";
gui.textBox(text1, U"1行", SasaGUI::TextInputFlag::All); gui.newLine();
gui.textBox(text2, U"複数行", SasaGUI::TextInputFlag::All | SasaGUI::TextInputFlag::MultiLine);

ボタン

button

Texture barsIcon(Icon(0xf0c9, 20));
if (gui.button(U"Button"))
{
	//~~~~~
}
gui.newLine();
if (gui.button(barsIcon, Palette::Gray))
{
	//~~~~~
}

スピンボックス

spinbox

double spinBoxVal = 20;
gui.spinBox(spinBoxVal, 0.0, 100.0, 0.1);

スライダー

slider

int32 sliderVal = 20;
gui.slider(sliderVal, 0, 100); gui.newLine();
gui.label(U"sliderVal:{}"_fmt(sliderVal));

プログレスバー

progressbar

gui.progressBar(Periodic::Sine0_1(30s), 0.0, 1.0); gui.newLine();
gui.progressBar(Periodic::Sine0_1(20s), 0.0, 1.0, 200, Palette::Yellow);

カラーピッカー

colorpicker

HSV hsvCol = Palette::Red;
gui.colorPicker(hsvCol);

ツリーノード

treenode

if (gui.treeNode(U"最初から展開しているノード", true))
{
	gui.newLine();
	gui.groupBegin();
	{
		gui.label(U"Hoge");
	}
	gui.groupEnd();
}
gui.newLine();
if (gui.treeNode(U"Node1"))
{
	gui.newLine();
	gui.groupBegin();
	{
		if (gui.treeNode(U"Node2"))
		{
			gui.newLine();
			gui.groupBegin();
			{
				gui.label(U"Fuga");
			}
			gui.groupEnd();
		}
	}
	gui.groupEnd();
}

画像

image

Texture windmill(U"example/windmill.png");
gui.image(windmill);

分割線

split

gui.split(); gui.newLine();
gui.space(SizeF(200, 0));//分割線のサイズが可変なため横幅200の空白を追加

リンク

link

if(gui.link(U"Link"))
{
	//~~~~~
}

空白