diff --git a/uppdev/ArrayCtrlCtrls/ArrayCtrlCtrls.upp b/uppdev/ArrayCtrlCtrls/ArrayCtrlCtrls.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/uppdev/ArrayCtrlCtrls/ArrayCtrlCtrls.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/ArrayCtrlCtrls/main.cpp b/uppdev/ArrayCtrlCtrls/main.cpp new file mode 100644 index 000000000..fb6ed2a52 --- /dev/null +++ b/uppdev/ArrayCtrlCtrls/main.cpp @@ -0,0 +1,49 @@ +#include + +using namespace Upp; + +struct EditStringSpecial : EditString { + ArrayCtrl *GetArrayCtrl() { + for(Ctrl *q = GetParent(); q; q = q->GetParent()) + if(ArrayCtrl *a = dynamic_cast(q)) + return a; + return NULL; + } + + static void DoMenu(EditStringSpecial *x) { + MenuBar bar; + x->StdBar(bar); + ArrayCtrl *a = x->GetArrayCtrl(); + if(a) { + bar.Separator(); + a->WhenBar(bar); + } + bar.Execute(); + } + + void MyBar(Bar& bar) + { + PostCallback(callback1(DoMenu, this)); + } + + typedef EditStringSpecial CLASSNAME; + + EditStringSpecial() { + WhenBar = THISBACK(MyBar); + } +}; + +GUI_APP_MAIN +{ + ArrayCtrl a; + a.Appending().Removing(); + a.AddColumn("Text").Ctrls(); + for(int i = 0; i < 300; i++) + a.Add(AsString(i)); + a.SetLineCy(Draw::GetStdFontCy() + 8); + + TopWindow app; + app.Add(a.SizePos()); + app.Sizeable(); + app.Run(); +} diff --git a/uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.cpp b/uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.cpp new file mode 100644 index 000000000..2574cb399 --- /dev/null +++ b/uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.cpp @@ -0,0 +1,10 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + ArrayMap x, y; + BREAK_WHEN_PICKED(x); + x = y; +} diff --git a/uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.upp b/uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.upp new file mode 100644 index 000000000..686cbae62 --- /dev/null +++ b/uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + BREAK_ON_PICKED.cpp; + +mainconfig + "" = ""; + diff --git a/uppdev/CParserb/CParserb.cpp b/uppdev/CParserb/CParserb.cpp index abadd5829..fcf3d3ac0 100644 --- a/uppdev/CParserb/CParserb.cpp +++ b/uppdev/CParserb/CParserb.cpp @@ -2,10 +2,18 @@ using namespace Upp; +int compactcommandline() +/**/{ + int goo; + + go + +int i,j; +} + +void MyTest() {} + CONSOLE_APP_MAIN { - CParser p("i if while 12345 alfa"); - __BREAK__; - int q = p.Id("i") + p.Id("if") + p.Id("while"); - Cout() << q; + MyTes(*) } diff --git a/uppdev/GetLanguages/GetLanguages.cpp b/uppdev/GetLanguages/GetLanguages.cpp new file mode 100644 index 000000000..98225b11a --- /dev/null +++ b/uppdev/GetLanguages/GetLanguages.cpp @@ -0,0 +1,7 @@ +#include + +CONSOLE_APP_MAIN +{ + +} + diff --git a/uppdev/GetLanguages/GetLanguages.upp b/uppdev/GetLanguages/GetLanguages.upp new file mode 100644 index 000000000..e0b3fda65 --- /dev/null +++ b/uppdev/GetLanguages/GetLanguages.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + GetLanguages.cpp; + +mainconfig + "" = ""; + diff --git a/uppdev/GetTranslationLanguages/GetTranslationLanguages.cpp b/uppdev/GetTranslationLanguages/GetTranslationLanguages.cpp new file mode 100644 index 000000000..8fe3380aa --- /dev/null +++ b/uppdev/GetTranslationLanguages/GetTranslationLanguages.cpp @@ -0,0 +1,11 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN +{ + Index x = GetLngSet(); + for(int i = 0; i < x.GetCount(); i++) + DDUMP(LNGAsText(x[i])); +} + diff --git a/uppdev/GetTranslationLanguages/GetTranslationLanguages.upp b/uppdev/GetTranslationLanguages/GetTranslationLanguages.upp new file mode 100644 index 000000000..c416f1932 --- /dev/null +++ b/uppdev/GetTranslationLanguages/GetTranslationLanguages.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + GetTranslationLanguages.cpp; + +mainconfig + "" = ""; + diff --git a/uppdev/SplitterBug/SplitterBug.upp b/uppdev/SplitterBug/SplitterBug.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/uppdev/SplitterBug/SplitterBug.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/SplitterBug/main.cpp b/uppdev/SplitterBug/main.cpp new file mode 100644 index 000000000..2edd305f0 --- /dev/null +++ b/uppdev/SplitterBug/main.cpp @@ -0,0 +1,37 @@ +#include + +using namespace Upp; + +class TestSplitter : public TopWindow +{ + private: + // pages column list + ColumnList pageList; + + // page container + StaticRect pagePane; + + // the splitter + Splitter splitter; + + public: + TestSplitter(); +}; + +TestSplitter::TestSplitter() +{ + // adds the splitter +// SizePos(); + Add(splitter); + + // setup pagelist appearance + pageList.Columns(1).SizePos(); + + // adds the columnlist on left + splitter.Horz(pageList, pagePane).SetPos(100); +} + +GUI_APP_MAIN +{ + TestSplitter().Run(); +} diff --git a/uppdev/TreeCtrlCanOpen/TreeCtrlCanOpen.upp b/uppdev/TreeCtrlCanOpen/TreeCtrlCanOpen.upp new file mode 100644 index 000000000..5872304d3 --- /dev/null +++ b/uppdev/TreeCtrlCanOpen/TreeCtrlCanOpen.upp @@ -0,0 +1,9 @@ +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/TreeCtrlCanOpen/main.cpp b/uppdev/TreeCtrlCanOpen/main.cpp new file mode 100644 index 000000000..26517fa52 --- /dev/null +++ b/uppdev/TreeCtrlCanOpen/main.cpp @@ -0,0 +1,53 @@ +#include "CtrlLib/CtrlLib.h" + +using namespace Upp; + +struct App : TopWindow { + TreeCtrl tree; + + typedef App CLASSNAME; + + void OpenDir(int id) { + String path = tree[id]; + + for(FindFile ff(AppendFileName(path, "*.*")); ff; ff.Next()) { + String n = ff.GetName(); + + if(n != "." && n != ".." && ff.IsFolder()) { + tree.Add(id, CtrlImg::Dir(), + AppendFileName(path, n), n, true); + } + } + + // I expect to get the +/- sign removed if a folder does not contain other folders + // using the following code: + if (tree.GetChildCount(id) == 0) + { + TreeCtrl::Node node = tree.GetNode(id); + node.CanOpen(false); + tree.SetNode(id, node); + } + } + + void CloseDir(int id) { + tree.RemoveChildren(id); + } + + App() { + Add(tree.SizePos()); + + tree.WhenOpen = THISBACK(OpenDir); + tree.WhenClose = THISBACK(CloseDir); + + String dir = "u:/upp.src"; + + tree.SetRoot(CtrlImg::Dir(), dir); + + Sizeable(); + } +}; + +GUI_APP_MAIN +{ + App().Run(); +} diff --git a/uppdev/XmlizeTest/XmlizeTest.cpp b/uppdev/XmlizeTest/XmlizeTest.cpp new file mode 100644 index 000000000..145f7be56 --- /dev/null +++ b/uppdev/XmlizeTest/XmlizeTest.cpp @@ -0,0 +1,20 @@ +#include + +using namespace Upp; + +template +struct MyVector : public Vector { + void Foo() {} + + void Xmlize(XmlIO xml) { + Upp::Xmlize(xml, *this); + } +}; + +CONSOLE_APP_MAIN +{ + MyVector x; + x.Add(10); + DDUMP(StoreAsXML(x, "test")); + LOG("XXX"); +} diff --git a/uppdev/XmlizeTest/XmlizeTest.upp b/uppdev/XmlizeTest/XmlizeTest.upp new file mode 100644 index 000000000..d73b7659f --- /dev/null +++ b/uppdev/XmlizeTest/XmlizeTest.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + XmlizeTest.cpp; + +mainconfig + "" = ""; + diff --git a/uppdev/tt/tt.cpp b/uppdev/tt/tt.cpp new file mode 100644 index 000000000..3d333b48e --- /dev/null +++ b/uppdev/tt/tt.cpp @@ -0,0 +1,23 @@ +#include + +using namespace Upp; + +struct tt_char { + const char *s; + + String ToString() const { return GetLngString(s); } + operator const char *() const { return ToString(); } +}; + +CONSOLE_APP_MAIN +{ + static tt_char x[] = { + tt_("Aborted by user."), + tt_("Two"), + tt_("Three") + }; + + SetLanguage(LNG_('I','T','I','T')); + DDUMP(x[0]); +} + diff --git a/uppdev/tt/tt.upp b/uppdev/tt/tt.upp new file mode 100644 index 000000000..82d2c3d0f --- /dev/null +++ b/uppdev/tt/tt.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + tt.cpp; + +mainconfig + "" = ""; +