Bazaar: ExpandFrame example package added

git-svn-id: svn://ultimatepp.org/upp/trunk@532 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
mrjt 2008-10-14 10:21:20 +00:00
parent 7c22c7b4bb
commit b445adebc4
4 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,55 @@
#include <CtrlLib/CtrlLib.h>
#include <ExpandFrame/ExpandFrame.h>
using namespace Upp;
#define LAYOUTFILE <ExpandFrameExample/ExpandFrameExample.lay>
#include <CtrlCore/lay.h>
// Simple window definition
class ExpandFrameExample : public TopWindow {
public:
typedef ExpandFrameExample CLASSNAME;
ExpandFrameExample();
void OnHorz();
private:
ExpanderCtrl expander;
WithPane1Layout<ParentCtrl> pane1;
WithPane2Layout<ParentCtrl> pane2;
DocEdit editor;
};
ExpandFrameExample::ExpandFrameExample()
{
Size sz = Size(400, 500);
Title("Expandable Frame Example").Sizeable();
SetMinSize(sz);
SetRect(sz);
// Add ExpanderCtrl to the window
Add(expander.SizePos());
// Adding layouts to the expanderctrl
CtrlLayout(pane1);
pane1.horz <<= THISBACK(OnHorz);
expander.AddExpander(pane1, true).SetTitle("Pane 1"); // Open
CtrlLayout(pane2);
expander.AddExpander(pane2, false).SetTitle("Pane 2"); // Not open
// Add a DocEdit to the ExpanderCtrl
editor <<= "ExpanderCtrl example application";
expander.AddExpander(editor, true, 300).SetTitle("Editor");
}
void ExpandFrameExample::OnHorz()
{
expander.Horz(pane1.horz);
}
GUI_APP_MAIN
{
ExpandFrameExample().Run();
}