Testing/Source/Manual/UI_Generate.cpp

Sun, 15 Mar 2020 11:12:38 +0200

author
cemkalyoncu
date
Sun, 15 Mar 2020 11:12:38 +0200
branch
4.x-dev
changeset 1380
8ea1cd4f856e
parent 1378
7b1849a92ed8
child 1382
09855b608a89
permissions
-rwxr-xr-x

* To<float/double> will no longer cause exceptions
* X11 numpad key 9 now works

1372
d3449b82e33d #122: Smoothed borders
cemkalyoncu
parents: 1371
diff changeset
1 #include "GraphicsHelper.h"
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
2
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
3 #include <Gorgon/UI/ComponentStack.h>
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
4 #include <Gorgon/Widgets/Generator.h>
1257
2375635390be * UI::Window to handle UI needs
cemkalyoncu
parents: 1256
diff changeset
5 #include <Gorgon/UI/Window.h>
2375635390be * UI::Window to handle UI needs
cemkalyoncu
parents: 1256
diff changeset
6 #include <Gorgon/Widgets/Button.h>
1263
40f0f87dcce9 * Checkbox widget
cemkalyoncu
parents: 1262
diff changeset
7 #include <Gorgon/Widgets/Checkbox.h>
1266
0fc123e9734c * RadioButtons widget
cemkalyoncu
parents: 1264
diff changeset
8 #include <Gorgon/Widgets/RadioButtons.h>
1271
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
9 #include <Gorgon/Widgets/Label.h>
1273
123c1df8bb80 * Basic panel is now working
cemkalyoncu
parents: 1271
diff changeset
10 #include <Gorgon/Widgets/Panel.h>
1339
308d6cabe504 #11: Inputbox variants for easy use
cemkalyoncu
parents: 1333
diff changeset
11 #include <Gorgon/Widgets/Textbox.h>
308d6cabe504 #11: Inputbox variants for easy use
cemkalyoncu
parents: 1333
diff changeset
12 #include <Gorgon/Widgets/Numberbox.h>
308d6cabe504 #11: Inputbox variants for easy use
cemkalyoncu
parents: 1333
diff changeset
13 #include <Gorgon/Widgets/GeometryBoxes.h>
1264
c0f9c97332e8 * Radiocontrol to create radio button groups from checkboxes
cemkalyoncu
parents: 1263
diff changeset
14 #include <Gorgon/UI/RadioControl.h>
1286
939598d3a5d1 * Organizer support for containers
cemkalyoncu
parents: 1284
diff changeset
15 #include <Gorgon/UI/Organizers/List.h>
1290
a42718335689 * A bug in positioning component stack is solved
cemkalyoncu
parents: 1286
diff changeset
16 #include <Gorgon/Graphics/BlankImage.h>
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
17
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
18 std::string helptext =
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
19 "Key list:\n"
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
20 "d\tToggle disabled\n"
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
21 "1-2\tChange Values\n"
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
22 "esc\tClose\n"
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
23 ;
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
24
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
25 using namespace Gorgon;
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
26
1271
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
27 Graphics::Bitmap &prep(Graphics::Bitmap &bmp) {
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
28 bmp.Prepare();
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
29
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
30 return bmp;
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
31 }
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
32
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
33 int main() {
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
34 basic_Application<UI::Window> app("uitest", "UI Generator Test", helptext, 1, 0x80);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
35
1378
7b1849a92ed8 #108: Scrolling with arrow keys and page up/down
cemkalyoncu
parents: 1377
diff changeset
36 Widgets::SimpleGenerator gen(15, "DejavuSans");
1376
e15204b22280 * Readonly support for Inputbox
cemkalyoncu
parents: 1375
diff changeset
37 Widgets::SimpleGenerator gen2(10);
1372
d3449b82e33d #122: Smoothed borders
cemkalyoncu
parents: 1371
diff changeset
38 gen.UpdateBorders();
1363
b98d42b2f8ae #122: Automatic widget sizing
cemkalyoncu
parents: 1356
diff changeset
39 gen.UpdateDimensions();
1366
7eea05431e78 #122: Simple generator borders are rearranged
cemkalyoncu
parents: 1363
diff changeset
40 gen2.Focus.Color = Graphics::Color::Red;
1372
d3449b82e33d #122: Smoothed borders
cemkalyoncu
parents: 1371
diff changeset
41 gen2.UpdateBorders(false);
d3449b82e33d #122: Smoothed borders
cemkalyoncu
parents: 1371
diff changeset
42 gen2.UpdateDimensions();
1377
4efed976367f #123: Inputlayer ordering issue
cemkalyoncu
parents: 1376
diff changeset
43
1368
9135822b5605 * Letter size for fonts
cemkalyoncu
parents: 1367
diff changeset
44 std::cout << "font height: " << gen.RegularFont.GetGlyphRenderer().GetLetterHeight(true).second << std::endl;
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
45
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
46 auto btntemp = gen.Button();
1356
b949126ed5e5 * Reorganized UIGenerate test
cemkalyoncu
parents: 1339
diff changeset
47 auto radtemp = gen.RadioButton();
b949126ed5e5 * Reorganized UIGenerate test
cemkalyoncu
parents: 1339
diff changeset
48 auto chktemp = gen.Checkbox();
1367
b125e0e6452d #122: CheckboxButton
cemkalyoncu
parents: 1366
diff changeset
49 auto chktemp2 = gen.CheckboxButton();
1356
b949126ed5e5 * Reorganized UIGenerate test
cemkalyoncu
parents: 1339
diff changeset
50 auto icobtntemp = gen.IconButton();
b949126ed5e5 * Reorganized UIGenerate test
cemkalyoncu
parents: 1339
diff changeset
51 auto lbltemp = gen.Label();
b949126ed5e5 * Reorganized UIGenerate test
cemkalyoncu
parents: 1339
diff changeset
52 auto pnltemp = gen.BlankPanel();
1375
aecc98e01d8a #122: Cleanup checkbox and panel code
cemkalyoncu
parents: 1374
diff changeset
53 auto pnltemp2 = gen.TopPanel();
1366
7eea05431e78 #122: Simple generator borders are rearranged
cemkalyoncu
parents: 1363
diff changeset
54 auto inptemp = gen2.Inputbox();
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
55
1372
d3449b82e33d #122: Smoothed borders
cemkalyoncu
parents: 1371
diff changeset
56 Widgets::Button btn(btntemp, "Helloo_...", []() { std::cout<<"Hello..."<<std::endl; });
1281
9745bf66b7a3 * Texture animation
cemkalyoncu
parents: 1280
diff changeset
57 btn.Move(5,5);
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
58
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
59 app.wind.Add(btn);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
60 btn.Focus();
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
61
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
62 Widgets::Button btn2(btntemp, "Exit", [&app]() { app.wind.Quit(); });
1259
b04982c1a489 * Focus transfer is fixed
cemkalyoncu
parents: 1258
diff changeset
63
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
64 btn2.Move({5, btn.GetSize().Height + 10});
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
65 app.wind.Add(btn2);
1263
40f0f87dcce9 * Checkbox widget
cemkalyoncu
parents: 1262
diff changeset
66
1271
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
67 std::cout<<"Height: "<<gen.RegularFont.GetGlyphRenderer().GetSize('A').Height<<std::endl;
1263
40f0f87dcce9 * Checkbox widget
cemkalyoncu
parents: 1262
diff changeset
68
1266
0fc123e9734c * RadioButtons widget
cemkalyoncu
parents: 1264
diff changeset
69 Widgets::RadioButtons<int> rad(radtemp);
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
70
1368
9135822b5605 * Letter size for fonts
cemkalyoncu
parents: 1367
diff changeset
71 rad.Add(0, u8"√Ājmericano");
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
72 rad.Add(1, "Latte");
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
73 rad.Add(2);
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
74
1370
be2cd62a4c20 #122: Disabled states are now generated
cemkalyoncu
parents: 1369
diff changeset
75 rad.Disable(2);
be2cd62a4c20 #122: Disabled states are now generated
cemkalyoncu
parents: 1369
diff changeset
76
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
77 app.wind.Add(rad);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
78 rad.Move(150, 4);
1264
c0f9c97332e8 * Radiocontrol to create radio button groups from checkboxes
cemkalyoncu
parents: 1263
diff changeset
79
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
80
1270
fee6860768b4 * RadioButtons widget missing functions
cemkalyoncu
parents: 1266
diff changeset
81
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
82 Widgets::Checkbox chk(chktemp, "Sugar", [](bool state) {
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
83 std::cout<<(state ? "with sugar" : "without sugar")<<std::endl;
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
84 });
1270
fee6860768b4 * RadioButtons widget missing functions
cemkalyoncu
parents: 1266
diff changeset
85
1369
5e3e8482f94b #68: Enabled/disabled states for widgets
cemkalyoncu
parents: 1368
diff changeset
86 rad.ChangedEvent.Register([&](int val) {
5e3e8482f94b #68: Enabled/disabled states for widgets
cemkalyoncu
parents: 1368
diff changeset
87 std::cout<<"Changed to "<<val<<std::endl;
5e3e8482f94b #68: Enabled/disabled states for widgets
cemkalyoncu
parents: 1368
diff changeset
88 chk.ToggleEnabled();
5e3e8482f94b #68: Enabled/disabled states for widgets
cemkalyoncu
parents: 1368
diff changeset
89 });
5e3e8482f94b #68: Enabled/disabled states for widgets
cemkalyoncu
parents: 1368
diff changeset
90
1311
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
91 //chk.Hide();
1270
fee6860768b4 * RadioButtons widget missing functions
cemkalyoncu
parents: 1266
diff changeset
92
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
93 chk.BoundsChangedEvent.Register([] {
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
94 std::cout << "Bounds changed" << std::endl;
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
95 });
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
96 rad.ChangedEvent.Register([&chk]{ chk.Show(); });
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
97 chk.FocusEvent.Register([]{ std::cout << "Focus changed." << std::endl; });
1280
b045bad2d50e * BoundsChanged and FocusEvents
cemkalyoncu
parents: 1279
diff changeset
98
1290
a42718335689 * A bug in positioning component stack is solved
cemkalyoncu
parents: 1286
diff changeset
99 chk.Move(rad.GetLocation() + Gorgon::Geometry::Point(0, rad.GetSize().Height + 4));
a42718335689 * A bug in positioning component stack is solved
cemkalyoncu
parents: 1286
diff changeset
100
a42718335689 * A bug in positioning component stack is solved
cemkalyoncu
parents: 1286
diff changeset
101 Widgets::Button ib(icobtntemp);
a42718335689 * A bug in positioning component stack is solved
cemkalyoncu
parents: 1286
diff changeset
102 auto ico = Graphics::BlankImage({16, 16}, Graphics::Color::Black);
a42718335689 * A bug in positioning component stack is solved
cemkalyoncu
parents: 1286
diff changeset
103 //ico.Prepare();
1291
62a6b45a4668 * Panel mouse scroll (limits is still not working)
cemkalyoncu
parents: 1290
diff changeset
104 ib.SetIcon(ico);
1290
a42718335689 * A bug in positioning component stack is solved
cemkalyoncu
parents: 1286
diff changeset
105 ib.Move(chk.GetLocation() + Gorgon::Geometry::Point(0, chk.GetSize().Height + 4));
a42718335689 * A bug in positioning component stack is solved
cemkalyoncu
parents: 1286
diff changeset
106 app.wind.Add(ib);
1370
be2cd62a4c20 #122: Disabled states are now generated
cemkalyoncu
parents: 1369
diff changeset
107
1273
123c1df8bb80 * Basic panel is now working
cemkalyoncu
parents: 1271
diff changeset
108
123c1df8bb80 * Basic panel is now working
cemkalyoncu
parents: 1271
diff changeset
109 Widgets::Panel pnl(pnltemp);
1366
7eea05431e78 #122: Simple generator borders are rearranged
cemkalyoncu
parents: 1363
diff changeset
110 pnl.Resize(350, 300);
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
111 Widgets::Panel mainpanel(pnltemp);
1366
7eea05431e78 #122: Simple generator borders are rearranged
cemkalyoncu
parents: 1363
diff changeset
112 mainpanel.Resize(350, 700);
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
113 app.wind.Add(mainpanel);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
114 Widgets::Panel sub(pnltemp2);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
115 sub.Resize(300, 50);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
116 Widgets::Button increase(btntemp);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
117 Widgets::Button decrease(btntemp);
1278
0c7e542abfc4 UI panel clipping bug
Yakup Beyoglu
parents: 1277
diff changeset
118
0c7e542abfc4 UI panel clipping bug
Yakup Beyoglu
parents: 1277
diff changeset
119
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
120 mainpanel.Add(sub);
1375
aecc98e01d8a #122: Cleanup checkbox and panel code
cemkalyoncu
parents: 1374
diff changeset
121 sub.Move(0, 0);
1278
0c7e542abfc4 UI panel clipping bug
Yakup Beyoglu
parents: 1277
diff changeset
122
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
123 Widgets::Label valuelabel(lbltemp);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
124 valuelabel.SetText("Bug test : ");
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
125 increase.SetText("+");
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
126 decrease.SetText("-");
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
127
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
128 sub.Add(increase);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
129 sub.Add(decrease);
1375
aecc98e01d8a #122: Cleanup checkbox and panel code
cemkalyoncu
parents: 1374
diff changeset
130 sub.Add(valuelabel);
1286
939598d3a5d1 * Organizer support for containers
cemkalyoncu
parents: 1284
diff changeset
131 sub.CreateOrganizer<Gorgon::UI::Organizers::List>();
939598d3a5d1 * Organizer support for containers
cemkalyoncu
parents: 1284
diff changeset
132
939598d3a5d1 * Organizer support for containers
cemkalyoncu
parents: 1284
diff changeset
133 sub.SetWidth(100);
1299
ec4c9548925b * An input layer bug is solved
cemkalyoncu
parents: 1296
diff changeset
134 sub.SetScrollDistance(15);
1296
f05e499282c4 * Panel scroll settings
cemkalyoncu
parents: 1293
diff changeset
135 sub.SetOverscroll(200);
1283
3d3657c964b5 * Absolute positioning mode is changed, previous absolute is now AbsoluteSliding
cemkalyoncu
parents: 1281
diff changeset
136
3d3657c964b5 * Absolute positioning mode is changed, previous absolute is now AbsoluteSliding
cemkalyoncu
parents: 1281
diff changeset
137 increase.ClickEvent.Register([&]() {
1291
62a6b45a4668 * Panel mouse scroll (limits is still not working)
cemkalyoncu
parents: 1290
diff changeset
138 sub.ScrollBy(100);
1283
3d3657c964b5 * Absolute positioning mode is changed, previous absolute is now AbsoluteSliding
cemkalyoncu
parents: 1281
diff changeset
139 });
1284
a66e180a235e * Click repeat for button
cemkalyoncu
parents: 1283
diff changeset
140
a66e180a235e * Click repeat for button
cemkalyoncu
parents: 1283
diff changeset
141 decrease.ClickEvent.Register([&]() {
1291
62a6b45a4668 * Panel mouse scroll (limits is still not working)
cemkalyoncu
parents: 1290
diff changeset
142 sub.ScrollBy(-100);
1284
a66e180a235e * Click repeat for button
cemkalyoncu
parents: 1283
diff changeset
143 std::cout<<"-"<<std::endl;
a66e180a235e * Click repeat for button
cemkalyoncu
parents: 1283
diff changeset
144 });
a66e180a235e * Click repeat for button
cemkalyoncu
parents: 1283
diff changeset
145 decrease.ActivateClickRepeat();
1279
88657b8e826c * Show/Hide functionality for widgets
cemkalyoncu
parents: 1278
diff changeset
146
1367
b125e0e6452d #122: CheckboxButton
cemkalyoncu
parents: 1366
diff changeset
147 Widgets::Checkbox chk1(chktemp2, "Su?");
1279
88657b8e826c * Show/Hide functionality for widgets
cemkalyoncu
parents: 1278
diff changeset
148
1311
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
149 //app.wind.Add(chk1);
1279
88657b8e826c * Show/Hide functionality for widgets
cemkalyoncu
parents: 1278
diff changeset
150 chk1.Move(300, 0);
88657b8e826c * Show/Hide functionality for widgets
cemkalyoncu
parents: 1278
diff changeset
151
1273
123c1df8bb80 * Basic panel is now working
cemkalyoncu
parents: 1271
diff changeset
152 app.wind.Add(pnl);
1279
88657b8e826c * Show/Hide functionality for widgets
cemkalyoncu
parents: 1278
diff changeset
153 pnl.Move(150, 0);
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
154 app.wind.Add(mainpanel);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
155 mainpanel.Move(0, 90);
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
156
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
157 auto errortemp = gen.ErrorLabel();
1271
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
158
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
159 Widgets::Label lbl(lbltemp, "This is a label");
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
160 Widgets::Label error(errortemp, "This is an Error label");
1271
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
161
1339
308d6cabe504 #11: Inputbox variants for easy use
cemkalyoncu
parents: 1333
diff changeset
162 Widgets::Pointbox inp(inptemp);
308d6cabe504 #11: Inputbox variants for easy use
cemkalyoncu
parents: 1333
diff changeset
163 inp={5, 2};
1366
7eea05431e78 #122: Simple generator borders are rearranged
cemkalyoncu
parents: 1363
diff changeset
164 pnl.Add(inp);
1363
b98d42b2f8ae #122: Automatic widget sizing
cemkalyoncu
parents: 1356
diff changeset
165 inp.Move(5, 80);
1313
1478e9339163 * Fixed tag location in ComponentStack #18
cemkalyoncu
parents: 1312
diff changeset
166 inp.SelectAll();
1376
e15204b22280 * Readonly support for Inputbox
cemkalyoncu
parents: 1375
diff changeset
167 inp.ChangedEvent.Register([](Geometry::Point val) {
e15204b22280 * Readonly support for Inputbox
cemkalyoncu
parents: 1375
diff changeset
168 std::cout << val << std::endl;
e15204b22280 * Readonly support for Inputbox
cemkalyoncu
parents: 1375
diff changeset
169 });
1380
8ea1cd4f856e * To<float/double> will no longer cause exceptions
cemkalyoncu
parents: 1378
diff changeset
170 //inp.Readonly = true;
1369
5e3e8482f94b #68: Enabled/disabled states for widgets
cemkalyoncu
parents: 1368
diff changeset
171
5e3e8482f94b #68: Enabled/disabled states for widgets
cemkalyoncu
parents: 1368
diff changeset
172 pnl.Add(chk);
1273
123c1df8bb80 * Basic panel is now working
cemkalyoncu
parents: 1271
diff changeset
173 pnl.Add(lbl);
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
174 pnl.Add(error);
1311
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
175 pnl.Add(rad);
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
176 pnl.Add(ib);
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
177 pnl.SetHeight(500);
1373
5f3afebfbe50 #122: Side borders
cemkalyoncu
parents: 1372
diff changeset
178 mainpanel.Resize(140, 550);
1371
32c8eb3b3ded * Automatic object size detection
cemkalyoncu
parents: 1370
diff changeset
179 //pnl.Disable();
1311
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
180
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
181 pnl.CreateOrganizer<Gorgon::UI::Organizers::List>();
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
182
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
183
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
184 //lbl.Move(chk.GetLocation() + Gorgon::Geometry::Point(0, chk.GetSize().Height + 4));
85301c623691 * Improved focus handling
cemkalyoncu
parents: 1308
diff changeset
185 //error.Move(lbl.GetLocation().X,lbl.GetLocation().Y + 25);
1271
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
186 lbl.OwnIcon(prep(*new Graphics::Bitmap(Triangle(8, 8))));
711bdc94ccac * Label
cemkalyoncu
parents: 1270
diff changeset
187
1372
d3449b82e33d #122: Smoothed borders
cemkalyoncu
parents: 1371
diff changeset
188
1257
2375635390be * UI::Window to handle UI needs
cemkalyoncu
parents: 1256
diff changeset
189 app.wind.Run();
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
190
1293
7828e722b16a * Panel scroll limits
cemkalyoncu
parents: 1291
diff changeset
191 return 0;
1251
b0655bf8d5c7 * Automatic UI generation framework
cemkalyoncu
parents:
diff changeset
192 }

mercurial