mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-24 06:12:52 -06:00
changed svn layout
git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
commit
263ff5f895
2665 changed files with 642923 additions and 0 deletions
40
examples/Button/Button.cpp
Normal file
40
examples/Button/Button.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
// http://java.sun.com/docs/books/tutorial/uiswing/start/swingTour.html
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct ButtonApp : TopWindow {
|
||||
int count;
|
||||
Button button;
|
||||
Label label;
|
||||
|
||||
void RefreshLabel()
|
||||
{
|
||||
label = Format("Number of button clicks %d", count);
|
||||
}
|
||||
void Click()
|
||||
{
|
||||
++count;
|
||||
RefreshLabel();
|
||||
}
|
||||
|
||||
typedef ButtonApp CLASSNAME;
|
||||
|
||||
ButtonApp()
|
||||
{
|
||||
count = 0;
|
||||
button <<= THISBACK(Click);
|
||||
button.SetLabel("&I'm an Ultimate++ button!");
|
||||
Add(button.VCenterPos(20).HCenterPos(200));
|
||||
Add(label.BottomPos(0, 20).HCenterPos(200));
|
||||
label.SetAlign(ALIGN_CENTER);
|
||||
Sizeable().Zoomable();
|
||||
RefreshLabel();
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
ButtonApp().Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue