HelpViewer::HelpViewer() { // adds toolbar AddFrame(toolBar); // setups splitter and its contents Add(splitter); splitter.Horz(tocPane, contentsPane).SetPos(2500); contentsPane.AutoHideSb(); contentsPane.SetZoom(Zoom(1,1)); contentsPane.HMargins(20); tocPane.Add(mainTocTree.NoRoot().SizePos()); // setup TOC link callback mainTocTree.WhenSel = THISBACK(tocLinkCb); contentsPane.WhenLink << THISBACK(contentLinkCb); // initialize link stack stack.Clear(); tos = -1; Sizeable().Zoomable(); // loads toolbar toolBar.Set(THISBACK(toolBarCb)); }
XmlView::XmlView() { xml.NoRoot(); error.SetFont(Arial(20)).SetInk(Red); errorbg.Height(25).Add(error.SizePos()); view.AddFrame(errorbg); view.SetReadOnly(); view.SetColor(LineEdit::PAPER_READONLY, SColorPaper()); xml.Hide(); view.Hide(); data.Add(xml.SizePos()); data.Add(view.SizePos()); splitter.Horz(files, data.SizePos()); splitter.SetPos(2700); Add(splitter.SizePos()); files.WhenEnterItem = THISBACK(Enter); files.WhenLeftDouble = THISBACK(DoDir); Sizeable().Zoomable(); dir = GetCurrentDirectory(); Icon(XmlImg::Icon()); xml.WhenLeftDouble = THISBACK(CopyPath); }
App() { splitter.Horz(tree, array); Add(splitter); splitter.SetPos(1500); // << SetPos seems to be guilty of the crashes. Sizeable().Zoomable(); }
cyclic::cyclic() { CtrlLayout(*this, "Színek"); colnum.SetData(16); okb <<= THISBACK(Click); Sizeable(); }
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(); }
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); }
BoostPyTest::BoostPyTest() { CtrlLayout(*this, "Boost Test"); Sizeable().Zoomable(); InitPyEnv(); }
VisualTest::VisualTest() { CtrlLayoutOKCancel(*this, "Window title"); list.HeaderObject().Absolute(); for(int i = 0; i < 5; i++) list.AddColumn(AsString(i), 100).HeaderTab().WhenAction = callback(Test); for(int i = 0; i < 100; i++) { list.Add(i); droplist.Add(i); } tabs.Add().Text("A"); tabs.Add().Text("B"); // tabs.Add().Text("BVB"); // tabs.Add().Text("Baas"); // tabs.Add().Text("Basdasd"); // tabs.Add().Text("Basdasdasd"); // tabs.Add().Text("Basdasdasdasdasd"); Sizeable().Zoomable(); disabled.Disable(); pi.Set(44, 0); slider.Range(100); slider <<= THISBACK(PI); bo.SetImage(CtrlImg::cut()); exit.Exit(); bo.Disable(); SetTimeCallback(-50, THISBACK(PI)); dc.AddList("Test"); }
NavDlg::NavDlg() { CtrlLayoutOKCancel(*this, "Navigator"); dlgmode = true; search.WhenEnter.Clear(); Sizeable().Zoomable(); Icon(IdeImg::Navigator()); }
ShowQtf::ShowQtf() { qtf <<= "{{1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1@(192.192.192)-4 ICO:: :: :: :: ::@(255.255.255)-4 25613405:: :: :: :: ::@(192.192.192)-4 DIC:: :: :: :: ::@(255.255.255)-4 :: :: :: :: ::@(192.192.192)-4 Jm:: :: :: :: ::@(255.255.255)-14 Amida`, s`.r`.o`.:: :: :: :: :: :: :: :: :: :: :: :: :: :: ::@(192.192.192)-4 Of:: :: :: :: ::@(255.255.255)-14 :: :: :: :: :: :: :: :: :: :: :: :: :: :: }}"; text <<= THISBACK(Text); split.Vert(text, qtf); Add(split.SizePos()); Sizeable().Zoomable(); }
Test1::Test1() { Title("Test"); Add(lbl1.SetText(t_("Hello")).TopPos(2,22).HSizePos(22,22)); Add(lbl2.SetText(t_("World")).VSizePos(24,24).HSizePos(2,2)); Add(lbl3.SetText(t_("Save")).BottomPos(2,22).HSizePos(22,22)); Sizeable().Zoomable(); }
App() { Add(tab.SizePos()); // tab.Add(spl.Horz(grid, edit), "Sheet 1"); tab.Add(spl1, "Sheet 2"); Sizeable().Zoomable(); }
RectCtrlTest::RectCtrlTest() { CtrlLayout(*this, "Window title"); Sizeable().Zoomable(); Rect r = rc.GetRect(); r.Deflate(r.Width()/4, r.Height()/4); rc.SetData(r); }
SqlObjectTree::SqlObjectTree(SqlSession& sess) : session(sess) { Title(t_("SQL object tree")); Sizeable().MaximizeBox(); Add(schema.SizePos()); schema.WhenOpen = THISBACK(Open); schema.SetRoot(CtrlImg::Computer(), Item(OBJ_SCHEMA), t_("Schemas")); schema.WhenBar = THISBACK(ToolLocal); }
SelectPackageDlg::SelectPackageDlg(const char *title, bool selectvars_, bool main) : selectvars(selectvars_) { CtrlLayoutOKCancel(*this, title); Sizeable().Zoomable(); Icon(IdeImg::MainPackage(), IdeImg::PackageLarge()); base.AutoHideSb(); base.NoGrid(); base.AddColumn("Assembly"); base.WhenCursor = THISBACK(OnBase); base.WhenBar = THISBACK(ToolBase); base.WhenLeftDouble = THISBACK(OnBaseEdit); ok.WhenAction = clist.WhenLeftDouble = alist.WhenLeftDouble = THISBACK(OnOK); cancel.WhenAction = WhenClose = THISBACK(OnCancel); clist.Columns(4); clist.WhenEnterItem = clist.WhenKillCursor = THISBACK(ListCursor); alist.AddColumn("Package").Add(3); alist.AddColumn("Nest"); alist.AddColumn("Description"); alist.AddIndex(); alist.ColumnWidths("108 79 317"); alist.WhenCursor = THISBACK(ListCursor); alist.EvenRowColor(); alist.SetLineCy(max(Zy(16), Draw::GetStdFontCy())); list.Add(clist.SizePos()); list.Add(alist.SizePos()); splitter.Horz(base, list); splitter.SetPos(2000); splitter.Zoom(selectvars ? -1 : 1); newu <<= THISBACK(OnNew); filter <<= THISBACK(OnFilter); filter.Add(MAIN|FIRST, "Main packages of first nest"); filter.Add(MAIN, "All main packages"); filter.Add(FIRST, "All packages of first nest"); filter.Add(0, "All packages"); filter <<= main ? MAIN|FIRST : 0; progress.Hide(); brief <<= THISBACK(SyncBrief); search.NullText("Search (Ctrl+K)", StdFont().Italic(), SColorDisabled()); search <<= THISBACK(SyncList); search.SetFilter(CharFilterDefaultToUpperAscii); SyncBrief(); description.NullText("Package description (Alt+Enter)", StdFont().Italic(), SColorDisabled()); description <<= THISBACK(ChangeDescription); ActiveFocus(brief ? (Ctrl&)clist : (Ctrl&)alist); clist.BackPaintHint(); alist.BackPaintHint(); base.BackPaintHint(); loadi = 0; loading = false; clist.WhenBar = alist.WhenBar = THISBACK(PackageMenu); }
DispatcherTest::DispatcherTest() { CtrlLayout(*this, "Window title"); splitv1.Vert(); for(int i = 0; i < 10; i++) { MyEditInt* pctrl = new MyEditInt(); ctrls.Add(pctrl); pctrl->MinMax(0, 100); disp.Register(*pctrl); dispi.Register(*pctrl); //disp.Unregister(*pctrl); //dispi.Unregister(*pctrl); splitv1 << *pctrl; } splitv2.Vert(); for(int i = 0; i < 10; i++) { MyProgressIndicator* pctrl = new MyProgressIndicator(); ctrls.Add(pctrl); pctrl->SetTotal(100); disp.Register(*pctrl); dispi.Register(*pctrl); //disp.Unregister(*pctrl); //dispi.Unregister(*pctrl); splitv2 << *pctrl; } splith.Horz() << splitv1 << splitv2; Add(splith.HSizePos().VSizePos(50, 0)); Sizeable().Zoomable(); sl.MinMax(0,100); sl <<= THISBACK(sliderCB); sli.MinMax(0,100); sli <<= THISBACK(slideriCB); //for beauty only, send once to see stuff already sl.SetData(75); sliderCB(); sli.SetData(75); }
TemplateDlg::TemplateDlg() { CtrlLayoutOKCancel(*this, "Create new package"); Sizeable().Zoomable(); description <<= THISBACK(Preview); delay <<= THISBACK(Preview); delay.SetDelay(300); templist.AddColumn("Template"); templist.WhenEnterRow = THISBACK(EnterTemplate); ok.Disable(); package <<= THISBACK(EnableCreate); package.SetFilter(FilterPackageName); Icon(IdeImg::CreatePackage()); }
//============================================================================================== LogWin::LogWin() { // One exit button CtrlLayoutExit(*this, "Log"); Sizeable().Zoomable(); Icon(MyImages::logwin16()); TopMost(); // Force stayontop setting Transparent(); //logText.Transparent(); CenterScreen(); activated = false; UrpEdit &re = logText; re.ShowCodes(Null); // Hide space/newline icon indicators http://www.ultimatepp.org/forum/index.php?t=msg&goto=2453& re.SetQTF("[%00-00 "); // Disable spell checker. http://www.ultimatepp.org/forum/index.php?t=msg&goto=2453& }
ScatterCtrl_Demo::ScatterCtrl_Demo() { CtrlLayout(*this, "Scatter Test"); for (int i = 0; i < Examples().GetCount(); ++i) Examples()[i].ctrl()->Init(); examplesList.NoHorzGrid().NoVertGrid(); examplesList.AddColumn("Example name"); for (int i = 0; i < Examples().GetCount(); ++i) { examplesList.Add(Examples()[i].name); Add((*(Examples()[i].ctrl())).HSizePosZ(180, 4).VSizePosZ(4, 8)); examplesRects.Add(Examples()[i].ctrl()); } examplesList.Add("Pie chart"); tabPie.Init(); Add(tabPie.HSizePosZ(180, 4).VSizePosZ(4, 8)); examplesRects.Add(&tabPie); for (int i = 0; i < examplesRects.GetCount(); ++i) examplesRects[i]->Hide(); bPreview <<= THISBACK(Preview); bSavePNG <<= THISBACK(SavePNG); bSaveJPG <<= THISBACK(SaveJPG); #ifdef PLATFORM_WIN32 bSaveEMF <<= THISBACK(SaveEMF); #else bSaveEMF.Hide(); #endif bCopyClipboard <<= THISBACK(CopyClipboard); paintMode.Add(ScatterDraw::MD_ANTIALIASED, "Painter Antialiased") .Add(ScatterDraw::MD_NOAA, "Painter No-Antialiased") .Add(ScatterDraw::MD_SUBPIXEL, "Painter Subpixel") .Add(ScatterDraw::MD_DRAW, "Draw"); paintMode <<= THISBACK(SetMode); paintMode.SetData(ScatterDraw::MD_ANTIALIASED); SetMode(); examplesList.WhenSel = THISBACK(OnSel); examplesList.SetCursor(13); OnSel(); Sizeable().Zoomable().Icon(MyImages::i1()); }
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(); }
ReportWindow::ReportWindow() { CtrlLayoutCancel(*this, ""); sw <<= ReportView::PG1; sw <<= THISBACK(Pages); numbers <<= THISBACK(Numbers); pg.WhenGoPage = THISBACK(GoPage); lbl.SetFont(Arial(20).Italic()); lbl.SetAlign(ALIGN_CENTER); pg.WhenAction = THISBACK(ShowPage); Sizeable(); MaximizeBox(); Icon(CtrlImg::smallreporticon()); SetButton(0, t_("&Print"), 999995); pdf.Show(GetDrawingToPdfFn()); pdf <<= THISBACK(Pdf); }
PropertiesDlg::PropertiesDlg(ScatterCtrl& scatter, int itab) : scatter(scatter) { CtrlLayout(*this); Sizeable().Zoomable(); Title(t_("Scatter properties")); tab.Add(measures, t_("Measures")); tab.Add(texts, t_("Texts")); tab.Add(legend, t_("Legend")); tab.Add(series, t_("Series")); tab.Set(itab); OnTab(); tab <<= THISBACK(OnTab); close <<= THISBACK(OnClose); close.Exit(); }
DlgCompareDir::DlgCompareDir() { CtrlLayout(*this, "Compare directories"); Sizeable().Zoomable(); refresh <<= THISBACK(CmdRefresh); splitter.Vert(tree, editor); editor << lineedit.SizePos() << qtf.SizePos(); qtf.Background(White()); qtf.SetFrame(InsetFrame()); path_a.AddFrame(browse_a); browse_a.SetImage(CtrlImg::right_arrow()); browse_a <<= THISBACK1(DoBrowse, &path_a); path_b.AddFrame(browse_b); browse_b.SetImage(CtrlImg::right_arrow()); browse_b <<= THISBACK1(DoBrowse, &path_b); file_mask <<= "*.cpp *.h *.hpp *.c *.C *.cxx *.cc *.lay *.iml *.upp *.sch *.dph"; tree.WhenCursor = THISBACK(DoTreeCursor); lineedit.SetReadOnly(); lineedit.SetFont(Courier(14)); }
PropertiesWindow::PropertiesWindow() { Sizeable().MaximizeBox(); _Item = NULL; _Index = -1; Add(_Headers.HSizePosZ().TopPos(0, _Headers.GD_ROW_HEIGHT)); _Headers.SetFrame(NullFrame()); _Headers.Editing().OneClickEdit(); _Headers.AddColumn(t_("Property")).SetDisplay(_TypeDisplay); _Headers.AddColumn(t_("Value")).SetDisplay(_TypeDisplay).Edit(_DropList); _Headers.Sorting(false); _Headers.HideRow(0); _Headers.FullColResizing(false); _DropList.Add("Button"); _DropList.Add("Label"); _DropList.Add("EditField"); _DropList.Add("EditInt"); _DropList.Add("DropDate"); _DropList.Add("TabCtrl"); _DropList.Add("GridCtrl"); _DropList.Add("ProgressBar"); _DropList.Add("Form"); _DropList.WhenAction = THISBACK1(OnEndEdit, 1); Add(_Options.HSizePosZ().VSizePos(_Headers.GD_ROW_HEIGHT, 0)); _Options.SetFrame(NullFrame()); _Options.Editing().OneClickEdit(); _Options.AddColumn(t_("Property")); _Options.AddColumn(t_("Value")).SetDisplay(_Display); _Options.SetInfo(t_("No properties")); _Options.HideRow(0); _Options.SetInfoOffset(_Options.GD_HDR_HEIGHT); _Options.FullColResizing(false); _Options.WhenChangeRow = THISBACK(OnStartEdit); _Options.WhenUpdateCell = THISBACK1(OnEndEdit, 0); }
RasterCtrlTestWindow::RasterCtrlTestWindow() { // sets up frame, menu and statusbar AddFrame( menu ); AddFrame( TopSeparatorFrame() ); AddFrame( status ); AddFrame( InsetFrame() ); // populates menu menu.Set( THISBACK( MainMenu ) ); // adds raster control Add(rasterCtrl.HSizePos().VSizePos()); Sizeable().Zoomable(); BackPaint(); // view.Open("/home/massimo/sources/uppdev/gatofax/fax000000002.tif"); // view.Open("/home/massimo/pluto.tif"); Refresh(); }
HelpWindow::HelpWindow() { tree_view.Horz(tree, view); tree_view.SetPos(3000); Add(tree_view.SizePos()); tree_view.Zoom(1); Sizeable().Zoomable(); Title(t_("Help")); BackPaint(); view.WhenLink = THISBACK(GoTo); AddFrame(toolbar); view.SetZoom(Zoom(1, 1)); zoom.m = 160; SetZoom(); view.Margins(Rect(12, 0, 12, 0)); SetRect(Ctrl::GetWorkArea().Deflated(80)); tree.WhenSel = THISBACK(TreeCursor); tree.NoRoot(); Icon(CtrlImg::help()); SetBar(); tree.BackPaint(); view.BackPaintHint(); }
cyclic_space::cyclic_space() { Sizeable().Zoomable(); SetRect(100, 100, 640, 480); col[0] = LtGreen; col[1] = LtBlue; col[2] = Green; col[3] = Red; col[4] = LtMagenta; col[5] = Yellow; col[6] = Cyan; col[7] = LtRed; col[8] = LtCyan; col[9] = Magenta; col[10] = White; col[11] = LtYellow; col[12] = Blue; col[13] = Gray; col[14] = LtGray; col[15] = Black; BackPaint(); reset(16); }
Test() { n <<= 0; n <<= THISBACK(DoRefresh); Add(n.RightPos(0, 50).BottomPos(0, 20)); Sizeable(); }
XMLMenuEditor::XMLMenuEditor(XMLMenuInterface *_iFace) : iFace(_iFace) { CtrlLayout(*this); // setup ok and cancel handlers okButton.Ok() <<= THISBACK(okCb); cancelButton.Cancel() <<= THISBACK(cancelCb); // get command pane size, that one will be fixed in width cmdSize = cmdPane.GetLayoutSize(); // gets menu/bar editor minimum sizes editorSize = menusEditor.GetMinSize(); // now calculate tabctrl minimum sizes int tx = editorSize.cx; int ty = cmdSize.cy; tabCtrlSize = Size(tx, ty); // gets button vertical neede size buttonVertSize = GetLayoutSize().cy - horzSplitter.GetSize().cy; // adds items to horz splitter horzSplitter.Horz(cmdPane, tabCtrl); // adds items to tabctrl tabCtrl.Add(menusEditor.SizePos(), t_("Menus")); tabCtrl.Add(barsEditor.SizePos(), t_("ToolBars")); // adds layout to all ctrls CtrlLayout(cmdPane); // set title for selector panes menusEditor.SetTitle(t_("Available menus")); barsEditor.SetTitle(t_("Available toolbars")); // adjust window width to accomodate at least itemPane and cmdPane minWidth = cmdSize.cx + tabCtrlSize.cx; // adjust window height to accomodate cmdPane minHeight = cmdSize.cy; SetMinSize(Size(minWidth, minHeight)); int w = max(GetSize().cx, minWidth); int h = max(GetSize().cy - buttonVertSize, minHeight); int wr = w; int hr = h + buttonVertSize; SetRect(GetRect().left, GetRect().top, wr, hr); Sizeable(); // reads the commands and put them into list commands <<= iFace->GetCommands(); FillCmdList(); // sets toolbars in bars editors menusEditor.SetToolBars(iFace->GetMenuBars()); barsEditor.SetToolBars(iFace->GetToolBars()); // setup handlers for command pane cmdPane.commandList.WhenLeftDouble << THISBACK(cmdDblClickCb); cmdPane.commandList.WhenBar << THISBACK(cmdContextCb); }
PyConsoleCtrlTest::PyConsoleCtrlTest() { CtrlLayout(*this, "Window title"); Sizeable().Zoomable(); }