ultimatepp/bazaar/DispatcherTest/main.cpp
kohait 91ce2e1c72 bazaar: CMeter: code artefact, Dispatcher: param is not nessesary actually, has been removed.
git-svn-id: svn://ultimatepp.org/upp/trunk@2648 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2010-09-01 08:54:09 +00:00

60 lines
962 B
C++

#include "DispatcherTest.h"
MyPane::MyPane()
{
CtrlLayout(*this);
ei.MinMax(0, 100);
pi.SetTotal(100);
for(int i = 0; i < 100; i++)
dl.Add(i);
}
void MyPane::Dispatch(const Value & o)
{
ei.SetData(o);
//pi.SetData(o);
pi.Set(o);
dl.SetData(o);
st.SetText(String().Cat() << o);
}
//
void DispatcherTest::sliderCB()
{
Value o = sl.GetData();
disp.DoDispatch(o);
}
DispatcherTest::DispatcherTest()
{
CtrlLayout(*this, "Window title");
splith1.Horz()
<< pane1 << pane2;
splith2.Horz()
<< pane3 << pane4;
splitv.Vert()
<< splith1 << splith2;
Add(splitv.HSizePos().VSizePos(50, 0));
Sizeable().Zoomable();
disp.Register(pane1);
disp.Register(pane2);
disp.Register(pane3);
disp.Register(pane4);
sl.MinMax(0,100);
sl <<= THISBACK(sliderCB);
//for beauty only, send once to see stuff already
sl.SetData(75);
sliderCB();
}
GUI_APP_MAIN
{
DispatcherTest().Run();
}