DataDlg::DataDlg(ScatterCtrl& scatter) { CtrlLayout(*this); Sizeable().Zoomable(); Title(t_("Scatter data")); close <<= THISBACK(OnClose); close.Exit(); pscatter = &scatter; tab.Reset(); series.Clear(); for(int c = 0; c < scatter.GetCount(); c++) if (!IsNull(scatter.GetCount(c))) { WithDataSeries <StaticRect> &dataseries = series.Add(); CtrlLayout(dataseries); dataseries.scatterIndex.Hide(); dataseries.scatterIndex = c; tab.Add(dataseries.SizePos(), scatter.GetLegend(c)); } OnTab(); tab <<= THISBACK(OnTab); }
DockBase::DockBase() { skinindex = layoutindex = 0; tabsicons = tabsclose = tabsautoalign = true; tabsnested = false; autohideicons = autohideclose = true; isready = false; panesize.Clear(); LeftPos(0, 0).TopPos(0,0); CtrlLayout(listtab); CtrlLayout(grouptab); CtrlLayout(controlpanel); controlpanel.CenterScreen().Sizeable().Zoomable().Title(t_("Settings")); listtab.list.AddColumn(); listtab.list.AddColumn(t_("Window Title")); listtab.list.AddColumn(t_("Alignment")); listtab.list.AddColumn(t_("State")); listtab.list.AddColumn(t_("Position")); listtab.list.EvenRowColor(); listtab.list.SetLineCy(16); grouptab.grouptree.MultiSelect(); controlpanel.panel.Add(listtab.SizePos(), t_("Status")); controlpanel.panel.Add(grouptab.SizePos(), t_("Group Manager")); controlpanel.skinlist.Add(0, String(t_("Default"))).Add(1, String(t_("Classic"))).Add(2, String(t_("Enhanced"))).SetIndex(skinindex); controlpanel.skinlist.WhenAction = THISBACK(OnSelectSkin); controlpanel.layoutlist.WhenAction = THISBACK(OnSelectLayout); listtab.list.WhenLeftClick = THISBACK(OnPanelAction); grouptab.grouptree.WhenDropInsert = THISBACK(GroupDrop); grouptab.grouptree.WhenDrag = THISBACK(GroupDrag); grouptab.grouptree.WhenBar = THISBACK(GroupMenu); grouptab.grouptree.WhenCursor = THISBACK(GroupSelect); grouptab.groupadd <<= THISBACK(OnAddNewGroup); grouptab.groupdelete <<= THISBACK(OnDeleteGroup); controlpanel.layoutbutton <<= THISBACK(ResetWidgetLayout); controlpanel.layoutadd <<= THISBACK(OnAddNewLayout); controlpanel.layoutdelete <<= THISBACK(OnDeleteLayout); controlpanel.TabOptionAlignment <<= THISBACK(RefreshWidgetLayout); controlpanel.TabOptionIcon <<= THISBACK(RefreshWidgetLayout); controlpanel.TabOptionClose <<= THISBACK(RefreshWidgetLayout); controlpanel.AutoOptionClose <<= THISBACK(RefreshWidgetLayout); controlpanel.AutoOptionIcon <<= THISBACK(RefreshWidgetLayout); controlpanel.TabOptionIcon <<= tabsicons; controlpanel.TabOptionClose <<= tabsclose; controlpanel.TabOptionNest <<= tabsnested; controlpanel.TabOptionAlignment <<= tabsautoalign; controlpanel.AutoOptionIcon <<= autohideicons; controlpanel.AutoOptionClose <<= autohideclose; grouptab.groupdelete.Disable(); SetKey(K_CTRL_HOME); }
///////////////////////////////////////////////////////////////////////////////////// // constructor class TPdfFrontend TPdfFrontend::TPdfFrontend() { // clears document list and documents DocumentList.Clear(); Documents.Clear(); // setup button handlers CreateButton <<= THISBACK(onCreate); CancelButton <<= THISBACK(onCancel); // install the SIGHUP handler Signals().Handle(SIGHUP, THISBACK(onSIGHUP)); // restores fax documents left from previous run, if any String DataPath = GetPdfDataPath(); FindFile ff(DataPath + "*-*"); while(ff) { if(ff.GetName() != "seqf") Documents.Add(DataPath + ff.GetName()); ff.Next(); } Sort(Documents); for(int i = 0; i < Documents.GetCount(); i++) { // inside list puts just the document name, skipping // the sequence number (4 digits) // nnnn-s-name DocumentList.Add(GetFileName(Documents[i]).Mid(5)); } CtrlLayout(*this, "MaxPdf"); }
PyConsoleCtrl::PyConsoleCtrl() : idx(0) { CtrlLayout(*this); exec.AddFrame(sb); sb.inc.WhenRepeat = sb.inc.WhenAction = THISBACK(Dec); //reverse because of history sb.dec.WhenRepeat = sb.dec.WhenAction = THISBACK(Inc); cmd <<= THISBACK(Dirtify); spl.Vert(log, cmd); spl.SetPos(6600); Add(spl.HSizePos().VSizePos(0,20)); load <<= THISBACK(LoadDlg); save <<= THISBACK(SaveDlg); clear <<= THISBACK(Clear); exec <<= THISBACK(Exec); cmd.WhenCmdDone = THISBACK(Exec); savelog <<= THISBACK(SaveLog); clearlog <<= THISBACK(ClearLog); clonex.SetLabel("AutoCl"); clonex.Set(1); PyCon::SetStream(log); PyCon::Init(); }
GUISample1::GUISample1() { CtrlLayout(*this, "Window title"); MainTB.Set(THISBACK(InitToolbar)); S1.Horz(); F1.Color(Color(0x80, 0x80, 0x80)); TB1.Set(THISBACK(InitToolbar)); L1.SetMinSize(Size(100,0)); L1.SetText("Uzdevumi"); L1.SetInk(Color(0xff, 0xff, 0xff)); F1.Add(L1); L1.HSizePos(); L1.TopPos(0, 28); TB1.SetMinSize(Size(100,100)); F1.Add(TB1); TB1.HSizePos(); TB1.TopPos(28, 56); F1.Add(AC1); AC1.HSizePos(); AC1.VSizePos(56, 0); //this adds only ~380px S1.SetMinPixels(0, 200); S1 << F1 << AC2 << AC3; }
Player::Player() { CtrlLayout(*this); increase <<= THISBACK(add); decrease <<= THISBACK(substract); amount <<= THISBACK(validate); }
ProtectClientDemo::ProtectClientDemo() { CtrlLayout(*this, "Protect client demo"); // setup client url and key client .SetURL("localhost/scgi/testing") // .SetURL("localhost/scgi") // .SetURL("timberstruct.it/scgi/testing") .SetCommunicationKey(ScanHexString("aabbccddeeff00112233445566778899")) ; // gets eventually previously stored activation key from client activationKey <<= client.GetActivationKey(); registerButton <<= THISBACK1(onAction, PROTECT_REGISTER); connectButton <<= THISBACK1(onAction, PROTECT_CONNECT); refreshButton <<= THISBACK1(onAction, PROTECT_REFRESH); disconnectButton <<= THISBACK1(onAction, PROTECT_DISCONNECT); getKeyButton <<= THISBACK1(onAction, PROTECT_GETLICENSEKEY); getInfoButton <<= THISBACK1(onAction, PROTECT_GETLICENSEINFO); setInfoButton <<= THISBACK1(onAction, PROTECT_UPDATEUSERDATA); quitButton <<= Breaker(); emailEdit <<= "*****@*****.**"; }
FileTabsExample::FileTabsExample() { CtrlLayout(*this, "FileTabs Example"); Sizeable().Zoomable(); for (int i = 0; i < 4; i++) bar[i].SetAlign((i+1) % 4); AddFrame(bar[0]); bar[0] <<= THISBACK(OnCursor); addfile <<= THISBACK(OnAdd); insert <<= THISBACK(OnInsert); grouping <<= THISBACK(OnGrouping); groupsort <<= THISBACK(OnGroupSort); separators <<= THISBACK(OnSeparators); stacking <<= THISBACK(OnStacking); normalicons <<= THISBACK(OnIcons); stackedicons <<= THISBACK(OnIcons); prompt <<= THISBACK(OnPrompt); allalign <<= THISBACK(OnAllAlign); valuesort <<= THISBACK(OnValueSort); keysort <<= THISBACK(OnKeySort); grouping <<= true; inactive <<= true; normalicons <<= true; OnInsert(); OnCursor(); }
void Progress::Init() { CtrlLayout(*this, t_("Working...")); stop <<= callback(this, &Progress::Cancel); info.SetAlign(ALIGN_CENTER); owner = NULL; Reset(); }
BoostPyTest::BoostPyTest() { CtrlLayout(*this, "Boost Test"); Sizeable().Zoomable(); InitPyEnv(); }
cyclic::cyclic() { CtrlLayout(*this, "Színek"); colnum.SetData(16); okb <<= THISBACK(Click); Sizeable(); }
PropertyTest::PropertyTest() //initializer space for constant Properties or Accessors #pragma warning(push) #pragma warning(disable:4355) : vp( THISBACK(SetD), THISBACK(GetD) ) , va( THISBACK(SetDa), THISBACK(GetDa) ) #pragma warning(pop) { CtrlLayout(*this, "Window title"); //setting, will call SetD vp = 123; //getting, will call GetD Value v = vp; RLOG(v); /// bool b; b = va.Set(456); //will call SetDa v = Value(); b = va.Get(v); //will call GetDa if(b) RLOG(v); }
void Tab12_Linked::Init() { CtrlLayout(*this); SizePos(); scatter1.SetRange(1000, 40).SetXYMin(0, -20); scatter1.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2); scatter2.SetRange(1000, 40).SetXYMin(0, -20); scatter2.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2); scatter3.SetRange(1000, 40).SetXYMin(0, -20); scatter3.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2); for (int t = 0; t < 1000; ++t) { s1 << Pointf(t, 20*sin(6*M_PI*t/500)); s2 << Pointf(t, 20*sin(6*1.1*M_PI*t/500)); s3 << Pointf(t, 20*sin(6*1.2*M_PI*t/500)); } scatter1.AddSeries(s1).Legend("Series 1").NoMark().Stroke(2, LtRed()); scatter2.AddSeries(s2).Legend("Series 2").NoMark().Stroke(2, LtBlue()); scatter3.AddSeries(s3).Legend("Series 3").NoMark().Stroke(2, LtGreen()); scatter1.ShowInfo(); scatter2.ShowInfo(); scatter3.ShowInfo(); link = true; OnLink(); link.WhenAction = THISBACK(OnLink); }
DataListDefinitionDlg::DataListDefinitionDlg() { CtrlLayout(*this, t_("Name and Field definition")); edListName.SetData( theDefList.name ) ; labelInfo.SetQTF( t_( "[ $$0,0#00000000000000000000000000000000:Default]" "[s0;1 The 2 first fields are obligatory and they are not possible " "to be modified.&]" "[s0;1 You can create new fields to personalize its list.]" )) ; grid.Appending().Removing().EditCell().AddColumn(t_("field")).Edit(edCell) ; grid.AddRow(theDefList.fields.GetCount()) ; grid.GetRow(0).Editable(false) ; grid.GetRow(1).Editable(false) ; for (int i = 0; i < theDefList.fields.GetCount(); i++) grid.Set(i,0, theDefList.fields[i]) ; //grid.SetFixedRows(3) ; btCancel.WhenAction = Breaker(IDCANCEL) ; btSave.WhenAction = THISBACK(OnSave) ; }
void TextsTab::Init(ScatterCtrl& scatter) { CtrlLayout(*this); SizePos(); pscatter = &scatter; title <<= scatter.GetTitle(); title <<= THISBACK(Change); xLabel <<= scatter.GetLabelX(); xLabel <<= THISBACK(Change); yLabel <<= scatter.GetLabelY(); yLabel <<= THISBACK(Change); yLabel2 <<= scatter.GetLabelY2(); yLabel2 <<= THISBACK(Change); leftMargin <<= scatter.GetPlotAreaLeftMargin(); leftMargin <<= THISBACK(Change); rightMargin <<= scatter.GetPlotAreaRightMargin(); rightMargin <<= THISBACK(Change); topMargin <<= scatter.GetPlotAreaTopMargin(); topMargin <<= THISBACK(Change); bottomMargin <<= scatter.GetPlotAreaBottomMargin(); bottomMargin <<= THISBACK(Change); Change(); }
void Tab1_Basic::Init() { CtrlLayout(*this); SizePos(); s1 << Pointf(10, 26) << Pointf(20, 37) << Pointf(30, 31) << Pointf(40, 33) << Pointf(50, 28); scatter.AddSeries(s1).Legend("Series 1").Opacity(0.3).Fill().MarkBorderColor(); s2y[0] = 22; s2y[1] = 33; s2y[2] = 27; s2y[3] = 29; s2y[4] = 24; scatter.AddSeries(s2y, 5, 10, 10).Legend("Series 2").Id(SERIE2).PlotStyle<LineSeriesPlot>() .Dash("").MarkColor(Red()).Fill().Opacity(0.5).MarkBorderColor(); s3y[0] = 18; s3y[1] = 29; s3y[2] = 23; s3y[3] = 25; s3y[4] = 20; s3x[0] = 10; s3x[1] = 20; s3x[2] = 30; s3x[3] = 40; s3x[4] = 50; scatter.AddSeries(s3x, s3y, 5).Legend("Series 3").MarkBorderColor(); s4y << 14 << 25 << 19 << 21 << 16; s4x << 10 << 20 << 30 << 40 << 50; scatter.AddSeries(s4x, s4y).Legend("Series 4").PlotStyle<StaggeredSeriesPlot>().Dash("").NoMark().Fill().Stroke(3, LtRed()); s5.Add(10, 10); s5.Add(20, 21); s5.Add(30, 15); s5.Add(40, 16); s5.Add(50, 12); int barWidth = 4; scatter.AddSeries(s5).Legend("Series 5").PlotStyle<BarSeriesPlot>(barWidth).Dash("").NoMark().Fill(); scatter.SetRange(60, 50).SetMajorUnits(10, 10); scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().ShowProcessDlg().SetPopText("h", "v", "v2").SetMouseHandling(true, true); scatter.SetLegendPos(Point(20, 20)); }
void MResizable::SetLayoutAnchor( HWND hwndCtrl, MSize sizLA_1, MSize sizLA_2/* = mzcLA_NO_ANCHOR*/) { assert(m_hwndParent); assert(::IsWindow(m_hwndParent)); assert(sizLA_1 != mzcLA_NO_ANCHOR); MRect ClientRect, ChildRect; ::GetClientRect(m_hwndParent, &ClientRect); ::GetWindowRect(hwndCtrl, &ChildRect); ::MapWindowPoints(NULL, m_hwndParent, reinterpret_cast<LPPOINT>(&ChildRect), 2); if (sizLA_2 == mzcLA_NO_ANCHOR) sizLA_2 = sizLA_1; MSize sizMargin1, sizMargin2; sizMargin1.cx = ChildRect.left - ClientRect.Width() * sizLA_1.cx / 100; sizMargin1.cy = ChildRect.top - ClientRect.Height() * sizLA_1.cy / 100; sizMargin2.cx = ChildRect.right - ClientRect.Width() * sizLA_2.cx / 100; sizMargin2.cy = ChildRect.bottom - ClientRect.Height() * sizLA_2.cy / 100; // search hwndCtrl layout_type *pLayout = CtrlLayout(hwndCtrl); if (pLayout) return; // if not found layout_type layout(hwndCtrl, sizLA_1, sizMargin1, sizLA_2, sizMargin2); m_layouts.push_back(layout); }
VegaTab2::VegaTab2() { CtrlLayout(*this); SizePos(); //id, label, width arrp.AddColumn("Board", "Board", 5) ; //0 arrp.AddColumn("WhitePlayer", "White Player", 15); //1 arrp.AddColumn("ScoreW", " ", 5); //3 arrp.AddColumn("BlackPlayer", "Black Player", 15); //1 arrp.AddColumn("ScoreB", " ", 5); //3 arrp.AddColumn("IDW", "ID white", 5); //3 arrp.AddColumn("IDB", "ID black", 5); //3 //arr.WhenLeftClick = THISBACK(PromptCell); //arr.WhenLeftDouble = THISBACK(SortRecord); // color even rows arrp.EvenRowColor(); //avoid two identical row //arr.NoDuplicating(); //doesn't work! //set the callback for the Add_Player button //btnAdd <<= THISBACK(AddPlayer); /* btnAdd <<= THISBACK(AddPlayer); btnModify <<= THISBACK(ModifyPlayer); btnClear <<= THISBACK(MaskDefaultValue); */ }
CtrlPosTest::CtrlPosTest() { SetRect(Size(400,400)); Sizeable().Zoomable(); CtrlLayout(vis); CtrlLayout(sb); sb.Width(sb.GetSize().cx); vis.AddFrame(sb); vis.pc.Add(es.HCenterPos(50).VCenterPos(20)); st.SetText("STATIC"); vis.pc.Add(st.LeftPos(10,50).TopPos(20,20)); CtrlLayout(ft); ft.Height(ft.GetSize().cy); AddFrame(ft); CtrlLayout(bot); bot.Height(50); vis.pc.AddFrame(bot); ft.visit <<= THISBACK(VisitCB); ft.clear <<= THISBACK(ClearCB); ft.enable <<= THISBACK(EnableCB); ft.disable <<= THISBACK(DisableCB); ft.deep <<= THISBACK(DeepCB); ft.frame <<= THISBACK(FrameCB); ft.view <<= THISBACK(ViewCB); ft.deep <<= true; DeepCB(); ft.frame <<= true; FrameCB(); ft.view <<= true; ViewCB(); Add(sc.SizePos()); sc.AddPane(vis); sc.WhenScrolled = callback(&hk, &CtrlPos::Update); hk.WhenLeftSelect = THISBACK(OnSelect); hk.SetSource(&vis); hk.SetFocus(); }
//--------------------------------------------------------------------------- Kmedis::Kmedis() { CtrlLayout(*this, TOP_WINDOW_TITLE); CenterScreen(); //---------------------------------------------------------- SetTimeCallback(1500, THISBACK(Close)); }
RectCtrlTest::RectCtrlTest() { CtrlLayout(*this, "Window title"); Sizeable().Zoomable(); Rect r = rc.GetRect(); r.Deflate(r.Width()/4, r.Height()/4); rc.SetData(r); }
void TabPie::Init() { CtrlLayout(*this); chart.ShowPercent(); chart.AddCategory("Sunny", 8, ::Color(90, 150, 255)); chart.AddCategory("Cloudy", 4, ::Color(90, 255, 150)); chart.AddCategory("Rainy", 2, ::Color(250, 150, 90)); }
GridEx::GridEx() { CtrlLayout(*this, "Window title"); grid.SetToolBar(); grid.Searching(); grid.AddColumn("Grid Test With One Big Column -------------------------------"); grid.Inserting().Removing().Chameleon(); grid.Appending().Editing(); }
WithEnterActionTest::WithEnterActionTest() { CtrlLayout(*this, "Window title"); Add(ed.HSizePos(8,8).TopPos(10,20)); ed <<= THISBACK(Change); ed2 <<= THISBACK(Change2); ed.Key(K_ENTER, 1); }
DateFmtCtrl::DateFmtCtrl() { CtrlLayout(*this, "Window title"); lang.Add(LNG_('E','N','U','S'), "ENUS"); lang.Add(LNG_('C','S','C','Z'), "CSCZ"); date <<= THISBACK(Print); lang <<= THISBACK(Language); date = GetSysDate(); Print(); }
j2::j2() { qtfx = "Joachim [@4 Green text]{@40}.1&"; CtrlLayout(*this, "Joachim 0.1"); SetLanguage( LNG_('D','E','D','E') ); SetDefaultCharset(CHARSET_UTF8); e.SetQTF(qtfx); mbu <<= THISBACK(Quit); a << THISBACK(DragEnter); a << THISBACK(GotFocus); }
void DataTab::Init(ScatterCtrl& scatter) { CtrlLayout(*this); SizePos(); pscatter = &scatter; tab.Reset(); series.Clear(); for(int c = 0; c < scatter.GetCount(); c++) if (!IsNull(scatter.GetCount(c))) { WithDataSeries <StaticRect> &dataseries = series.Add(); CtrlLayout(dataseries); tab.Add(dataseries.SizePos(), scatter.GetLegend(c)); } OnTab(); tab <<= THISBACK(OnTab); }
TestApp::TestApp() { CtrlLayout(*this, "Window title"); // grid.AddColumn("Test").Edit(editstring); b1.SetLabel("Button1"); b2.SetLabel("Butto2"); b2.Show(); gridremove.WhenAction = THISBACK(Remove); toolbar.Wrap(); toolbar.Set(THISBACK(sigBar)); }
ImageMT::ImageMT() { CtrlLayout(*this, "Window title"); buttonLoad <<= THISBACK(LoadImage); m_fPower.SetData(2.3); buttonSquare <<= THISBACK(Square); }
VegaTab2::VegaTab2() { CtrlLayout(*this); SizePos(); //id, label, width arrp.AddColumn("Board", "Board", 4) ; //0 arrp.AddColumn("White", "White Player", 25); //1 arrp.AddColumn("Black", "Black Player", 25); //1 arrp.AddColumn("ID", "IDW-IDB", 8); //3 arrp.EvenRowColor(); arrp.SetLineCy(19); //option image adjustment... }