// 画面のレイアウトなど const int SLIDER_WINDOW_WIDTH = 150; const int SLIDER_WINDOW_HEIGHT = 600; const int GRAPH_WINDOW_WIDTH = 700; const int GRAPH_WINDOW_HEIGHT = 600; const int FREE_END_BOX_X = 10; const int FREE_END_BOX_Y = 10; const int FREE_END_BOX_WIDTH = 150; const int FREE_END_BOX_HEIGHT = 30; const int SLIDER_X = 0; const int SLIDER_Y = 100; const int SLIDER_WIDTH = SLIDER_WINDOW_WIDTH - 20; const int SLIDER_HEIGHT = SLIDER_WINDOW_HEIGHT - SLIDER_Y - FREE_END_BOX_HEIGHT - FREE_END_BOX_Y - 30; // GUIコンポーネントのIDを保持する変数 int sliderWindow; int slider; int freeEndBox; /** * 画面の構築を行います。 */ void createUI(){ // スライダーウィンドウを生成 sliderWindow = newWindow(0, 0, SLIDER_WINDOW_WIDTH, SLIDER_WINDOW_HEIGHT, ""); // 自由端の選択ボックスを生成 string boxTitle = "自由端 (右)"; bool boxInitState = false; freeEndBox = newCheckBox( FREE_END_BOX_X, FREE_END_BOX_Y, FREE_END_BOX_WIDTH, FREE_END_BOX_HEIGHT, boxTitle, boxInitState ); // 自由端の選択ボックスをスライダーウィンドウに配置 mountComponent(freeEndBox, sliderWindow); // 垂直スライダーを生成 float initValue = 0.0; float maxValue = SLIDER_AMPLITUDE; float minValue = -SLIDER_AMPLITUDE; slider = newVerticalSlider( SLIDER_X, SLIDER_Y, SLIDER_WIDTH, SLIDER_HEIGHT, initValue, minValue, maxValue ); // 垂直スライダーをスライダーウィンドウに配置 mountComponent(slider, sliderWindow); }