diff --git a/uppdev/RichTextLayoutTracer/RichTextLayoutTracer.upp b/uppdev/RichTextLayoutTracer/RichTextLayoutTracer.upp new file mode 100644 index 000000000..3b0cdc211 --- /dev/null +++ b/uppdev/RichTextLayoutTracer/RichTextLayoutTracer.upp @@ -0,0 +1,13 @@ +description "Demonstrates using RichTextLayoutTracer to count number of table rows per report page\377"; + +uses + CtrlLib, + Report, + Painter; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/RichTextLayoutTracer/init b/uppdev/RichTextLayoutTracer/init new file mode 100644 index 000000000..15261af79 --- /dev/null +++ b/uppdev/RichTextLayoutTracer/init @@ -0,0 +1,6 @@ +#ifndef _RichTextLayoutTracer_icpp_init_stub +#define _RichTextLayoutTracer_icpp_init_stub +#include "CtrlLib/init" +#include "Report/init" +#include "Painter/init" +#endif diff --git a/uppdev/RichTextLayoutTracer/main.cpp b/uppdev/RichTextLayoutTracer/main.cpp new file mode 100644 index 000000000..b77171092 --- /dev/null +++ b/uppdev/RichTextLayoutTracer/main.cpp @@ -0,0 +1,34 @@ +#include + +using namespace Upp; + +struct TableRowTracer : RichTextLayoutTracer { + VectorMap pgr; + + virtual void TableCell(const Rect& page, PageY py, int i, int j, const RichTable& table, PageY npy) + { + if(j == 0) + for(int i = py.page; i <= npy.page; i++) + pgr.GetAdd(i, 0)++; + } +}; + +GUI_APP_MAIN +{ + Report r; + r.Footer("[R1 "); + TableRowTracer t; + r.SetRichTextLayoutTracer(t); + String qtf = LoadFile("D:\\log.qtf"); + r.Put(qtf); + + Report rr; + for(int i = 0; i < r.GetCount(); i++) { + if(i) + rr.NewPage(); + rr.Footer("[R1 There is " + AsString(t.pgr.Get(i, 0)) + " table rows on this page"); + rr.DrawDrawing(r.GetPageSize(), r[i]); + } + + Perform(rr); +} diff --git a/uppdev/testOnglet/init b/uppdev/testOnglet/init new file mode 100644 index 000000000..577539b50 --- /dev/null +++ b/uppdev/testOnglet/init @@ -0,0 +1,5 @@ +#ifndef _testOnglet_icpp_init_stub +#define _testOnglet_icpp_init_stub +#include "CtrlLib/init" +#include "Docking/init" +#endif diff --git a/uppdev/testOnglet/main.cpp b/uppdev/testOnglet/main.cpp new file mode 100644 index 000000000..d509a6791 --- /dev/null +++ b/uppdev/testOnglet/main.cpp @@ -0,0 +1,47 @@ +#include "testOnglet.h" + + + +testOnglet::testOnglet() +{ + CtrlLayout(*this, "Window title"); + Sizeable(); + //Add(tabs.SizePos()); + CtrlLayout(tab1); + CtrlLayout(tab2); + + tabs.Add(tab1, "first"); + tabs.Add(tab2, "second"); + + WithTab1* dynTab = new WithTab1(); + CtrlLayout(*dynTab); + dynTab->SizePos(); + tabs.Add(*dynTab, "third"); + + // MENU BAR + AddFrame(menuBar); + menuBar.Set(THISBACK(mainBar)); + + // BOTTOM STATUS BAR +// statusBar.SetFrame(TopSeparatorFrame()); + AddFrame(statusBar); + + bClose << THISBACK(closeOnglet); +} + +void testOnglet::closeOnglet() +{ + if (tabs.GetCount() > 0) tabs.Remove(0); +} + +void testOnglet::mainBar(Bar& bar) +{ + bar.Add(t_("File"), THISBACK(Close)); + bar.Add(t_("Data"), THISBACK(Close)); +} + +GUI_APP_MAIN +{ + testOnglet().Run(); +} + diff --git a/uppdev/testOnglet/testOnglet.h b/uppdev/testOnglet/testOnglet.h new file mode 100644 index 000000000..06c9c1b9a --- /dev/null +++ b/uppdev/testOnglet/testOnglet.h @@ -0,0 +1,24 @@ +#ifndef _testOnglet_testOnglet_h +#define _testOnglet_testOnglet_h + +#include + +using namespace Upp; + +#define LAYOUTFILE +#include + +class testOnglet : public WithtestOngletLayout { +public: + StatusBar statusBar; + MenuBar menuBar; + + void mainBar(Bar& bar); + + void closeOnglet(); + typedef testOnglet CLASSNAME; + testOnglet(); +}; + +#endif + diff --git a/uppdev/testOnglet/testOnglet.lay b/uppdev/testOnglet/testOnglet.lay new file mode 100644 index 000000000..6f12987d1 --- /dev/null +++ b/uppdev/testOnglet/testOnglet.lay @@ -0,0 +1,16 @@ +LAYOUT(Tab1, 400, 200) + ITEM(Clock, dv___0, HSizePosZ(216, 34).VSizePosZ(12, 32)) + ITEM(Button, dv___1, LeftPosZ(36, 72).TopPosZ(12, 28)) +END_LAYOUT + +LAYOUT(Tab2, 400, 200) + ITEM(Calendar, dv___0, HSizePosZ(76, 88).VSizePosZ(12, 32)) +END_LAYOUT + +LAYOUT(testOngletLayout, 568, 484) + ITEM(TabCtrl, tabs, HSizePosZ(124, 22).VSizePosZ(8, 12)) + ITEM(WithTab1, tab1, LeftPosZ(132, 404).TopPosZ(40, 428)) + ITEM(WithTab2, tab2, LeftPosZ(132, 404).TopPosZ(40, 428)) + ITEM(Button, bClose, SetLabel(t_("close")).HSizePosZ(24, 460).VSizePosZ(156, 280)) +END_LAYOUT + diff --git a/uppdev/testOnglet/testOnglet.upp b/uppdev/testOnglet/testOnglet.upp new file mode 100644 index 000000000..784544f32 --- /dev/null +++ b/uppdev/testOnglet/testOnglet.upp @@ -0,0 +1,11 @@ +uses + CtrlLib; + +file + testOnglet.h, + main.cpp, + testOnglet.lay; + +mainconfig + "" = "GUI MT"; +