![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Simple demo program of SeekBar, NumericLabel, and ButtonGroup. SeekBar, NumericLabel, ButtonGroup の簡単な使い方の例.
main.cpp
- Committer:
- MikamiUitOpen
- Date:
- 2016-11-19
- Revision:
- 0:5ee6e4aa18fc
- Child:
- 1:81cfe85b6544
File content as of revision 0:5ee6e4aa18fc:
//----------------------------------------------------- // Label, NumericLabel, SeekBar のデモプログラム // Demo program of Label, NumericLabel, and SeekBar // // 2016/11/19, Copyright (c) 2016 MIKAMI, Naoki //----------------------------------------------------- #include "F746_GUI.hpp" using namespace Mikami; int main() { Label label1(240, 40, "Example", Label::CENTER, Font16); Label label2(240, 60, "SeekBar, NumericLabel, ButtonGroup", Label::CENTER, Font16); SeekBar myBar(100, 200, 250, -1,1, 0, "-1", "0", "1"); NumericLabel<float> myLabel(210, 150, "%5.2f", 0); ButtonGroup bG(400, 200, 50, 30, 2, (string[]){"ON", "OFF"}, 0, 5, 1, 0); while (true) { float val = myBar.GetValue(); // Slide thumb on SeekBar // If thumb is not touched printf() is not executed if (myBar.Slide()) printf("val = %f\r\n", val); myLabel.Draw(val); int num; if (bG.GetTouchedNumber(num)) { if (num == 0) myBar.Activate(); else myBar.Inactivate(); } wait(0.05f); } }