現在地メニュー >> NVIDIA_SDK >> NVIDIA_SDK_06 >> NVIDIA_SDK_06::Part3

コンボボックス、リストボックス


コンボボックス、リストボックスは「doListBoxメソッド」「doComboBoxメソッド」を使う
bool doListBox(const Rect & rect, int numOptions, const char * options[], int * selected, int style = 0);
bool doComboBox(const Rect & rect, int numOptions, const char * options[], int * selected, int style = 0);
【rect】
コンボボックス、リストボックスのサイズ。

【numOptions】
選択項目の数

【options】
選択項目の文字列

【selected】
選択項目の値を格納する

【style】
描画スタイル

※コンボボックス、リストボックスに変化があると、「true」が返り値としてくる。

【例】
const char *comboStr[]={"red","green","blue"};
const char *liststr[]={"teapot","cube","sphere"};
int comboMethod;
int listMethod;

... ...
g_ui.begin();
{
	//コンボボックス
	g_ui.beginGroup(nv::GroupFlags_GrowDownFromRight);
	{
		g_ui.doComboBox(nv::Rect(),3,comboStr,&comboMethod,1);
	}
	g_ui.endGroup();

	//リストボックス
	g_ui.beginGroup(nv::GroupFlags_GrowDownFromLeft);
	{
		g_ui.doListBox(nv::Rect(),3,liststr,&listMethod,1);
	}
	g_ui.endGroup();   
}
g_ui.end();
... ...

サンプルコード

目次

― その他 ―

Wiki内検索

計測中...(07.10.8〜)

Save The World






▲よろしければ広告のクリックもお願いします


▲ランキングに参加しました

管理人/副管理人のみ編集できます