ultimatepp/uppdev/PopUp/main.cpp
cxl 351994a6cc Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2008-08-15 08:36:24 +00:00

33 lines
572 B
C++

#include "PopUp.h"
popup::popup()
{
CtrlLayout(*this);
CtrlLayout(dlg);
Title("Popups");
button.WhenPush = THISBACK(PopDlg);
dlg.button <<= THISBACK(DlgClose);
button.Tip("Tip!");
dlg.button.Tip("Tip!");
dlg.SetFrame(BlackFrame()); //comment this to stop changing size of dlg
}
void popup::PopDlg()
{
if (dlg.IsOpen())
return;
Size sz = dlg.GetSize();
Rect rc = button.GetScreenRect();
dlg.SetRect(rc.right, rc.top, sz.cx, sz.cy);
dlg.PopUp();
}
void popup::DlgClose()
{
dlg.Close();
}
GUI_APP_MAIN
{
popup().Run();
}