mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
.developing Gtk
git-svn-id: svn://ultimatepp.org/upp/trunk@5651 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7b3644828a
commit
e7e67654e2
14 changed files with 388 additions and 229 deletions
|
|
@ -7,5 +7,6 @@ file
|
|||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI SSE2 GTK";
|
||||
"" = "GUI SSE2 GTK",
|
||||
"" = "GUI SSE2";
|
||||
|
||||
|
|
|
|||
|
|
@ -68,11 +68,13 @@ struct MyApp : TopWindow {
|
|||
virtual bool Key(dword key, int count)
|
||||
{
|
||||
Log(GetKeyDesc(key).Cat() << ' ' << count);
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual void MouseMove(Point p, dword keyflags)
|
||||
{
|
||||
pos = p;
|
||||
SetCaret(p.x, 0, 5, 5);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +87,7 @@ struct MyApp : TopWindow {
|
|||
return Image::Hand();
|
||||
if(p.x < 3 * sz.cx / 4)
|
||||
return CtrlImg::ibeam0();
|
||||
return CtrlImg::HelpCursor0();
|
||||
return (msecs() / 500) & 1 ? CtrlImg::HelpCursor1() : CtrlImg::HelpCursor0();
|
||||
}
|
||||
|
||||
virtual void Paint(Draw& w) {
|
||||
|
|
@ -105,8 +107,9 @@ struct MyApp : TopWindow {
|
|||
w.DrawText(100, y, log[i]);
|
||||
y += fcy;
|
||||
}
|
||||
w.DrawRect(0, 0, 50, fcy * 3, InvertColor());
|
||||
}
|
||||
|
||||
EditString text;
|
||||
|
||||
MyApp() {
|
||||
Sizeable().Zoomable().Title("Event test");
|
||||
|
|
@ -115,19 +118,70 @@ struct MyApp : TopWindow {
|
|||
}
|
||||
};
|
||||
|
||||
struct MyApp2 : TopWindow {
|
||||
DocEdit text;
|
||||
/*
|
||||
virtual void Activate()
|
||||
{
|
||||
LOG("Activate");
|
||||
}
|
||||
|
||||
virtual void Deactivate()
|
||||
{
|
||||
LOG("Deactivate");
|
||||
}
|
||||
|
||||
virtual void Layout()
|
||||
{
|
||||
LOG("Layout");
|
||||
}
|
||||
|
||||
virtual void GotFocus()
|
||||
{
|
||||
LOG("GotFocus");
|
||||
}
|
||||
|
||||
virtual void LostFocus()
|
||||
{
|
||||
LOG("LostFocus");
|
||||
}
|
||||
*/
|
||||
MyApp2() {
|
||||
Zoomable().
|
||||
Sizeable().
|
||||
Title("Widget test");
|
||||
Add(text.SizePos());
|
||||
text <<= "Test\nHello World!";
|
||||
|
||||
DDUMP(Ctrl::GetWorkArea());
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Run();
|
||||
return;
|
||||
#if 0
|
||||
String txt = "Test";
|
||||
|
||||
EditText(txt, "Test", "Test");
|
||||
return;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
MyApp2().Run();
|
||||
return;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
PromptOK("Hello world!");
|
||||
return;
|
||||
#endif
|
||||
|
||||
/*
|
||||
#if 1
|
||||
RichEditWithToolBar edit;
|
||||
edit.SetQTF("[A500 Hello World!");
|
||||
edit.SetQTF("[A9 Hello World!");
|
||||
TopWindow win;
|
||||
win.Sizeable();
|
||||
win.Add(edit.SizePos());
|
||||
win.Run();
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue