diff --git a/uppdev/SQL_PostgreSql/Postgres.cpp b/uppdev/SQL_PostgreSql/Postgres.cpp index 96088e3a0..358a3c3fd 100644 --- a/uppdev/SQL_PostgreSql/Postgres.cpp +++ b/uppdev/SQL_PostgreSql/Postgres.cpp @@ -23,6 +23,9 @@ bool PostgreSQLTest::OpenDB() return false; } m_array.SetSession(m_session); + + SQLCommander(m_session); + return false; #ifdef _DEBUG m_session.SetTrace(); diff --git a/uppdev/SplitString/SplitString.cpp b/uppdev/SplitString/SplitString.cpp new file mode 100644 index 000000000..ef6a0f652 --- /dev/null +++ b/uppdev/SplitString/SplitString.cpp @@ -0,0 +1,8 @@ +#include + +using namespace Upp; + +CONSOLE_APP_MAIN { + Vector s = Split("John Doe Had A Dog", "Had"); + DUMPC(s); +} \ No newline at end of file diff --git a/uppdev/SplitString/SplitString.upp b/uppdev/SplitString/SplitString.upp new file mode 100644 index 000000000..b2309f3a4 --- /dev/null +++ b/uppdev/SplitString/SplitString.upp @@ -0,0 +1,9 @@ +uses + Core; + +file + SplitString.cpp; + +mainconfig + "" = ""; + diff --git a/uppdev/SplitString/init b/uppdev/SplitString/init new file mode 100644 index 000000000..60794ffdd --- /dev/null +++ b/uppdev/SplitString/init @@ -0,0 +1,4 @@ +#ifndef _SplitString_icpp_init_stub +#define _SplitString_icpp_init_stub +#include "Core/init" +#endif diff --git a/uppdev/TreeCtrlDnd2/TreeCtrlDnD.upp b/uppdev/TreeCtrlDnd2/TreeCtrlDnD.upp index 851e3bb73..6d4b1ace6 100644 --- a/uppdev/TreeCtrlDnd2/TreeCtrlDnD.upp +++ b/uppdev/TreeCtrlDnd2/TreeCtrlDnD.upp @@ -1,11 +1,11 @@ -description "Drag & Drop with TreeCtrl as target"; - -uses - CtrlLib; - -file - main.cpp; - -mainconfig - "" = "GUI"; - +description "Drag & Drop with TreeCtrl as target"; + +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/TreeCtrlDnd2/main.cpp b/uppdev/TreeCtrlDnd2/main.cpp index e60864e3b..8cb7a4c84 100644 --- a/uppdev/TreeCtrlDnd2/main.cpp +++ b/uppdev/TreeCtrlDnd2/main.cpp @@ -1,67 +1,24 @@ #include "CtrlLib/CtrlLib.h" - -#define DEBUG3 1 // Debug für Test in den Methoden - -#if DEBUG3 != 0 // Debug für Test in den Methoden - #define D3(x) RLOG("[" << GetSysTime() << "." << int(GetTickCount() % 10000u) << "] " << x) -#else - #define D3(x) -#endif - - - using namespace Upp; struct App : TopWindow { TreeCtrl tree; - Vector parent, parent2; - int i; + Array edit; typedef App CLASSNAME; void DropInsert(int parent, int ii, PasteClip& d) { -// if (0 == parent) - if (1 < parent) - return; - - + tree.AdjustAction(parent, d); if(AcceptInternal(d, "mytreedrag")) { -// if (7 < parent) -// { -// if(PromptOKCancel("Dialog")) -// { -// tree.CancelMode(); - //return; -// sort = true; -// } -// } - - - tree.AdjustAction(parent, d); - - const TreeCtrl &src = GetInternal(d); // JT - Vector sel = src.GetSel(); // JT - // Etc. - for(int i=0;i(d, 'mytreedrag'): parent: %2d, ii %2d", parent, ii)); return; } if(AcceptText(d)) { - tree.AdjustAction(parent, d); tree.SetCursor(tree.Insert(parent, ii, Image(), GetString(d))); tree.SetFocus(); - D3(Sprintf("AcceptText(d): parent: %2d, ii %2d", parent, ii)); return; } } @@ -70,74 +27,26 @@ struct App : TopWindow { { if(tree.DoDragAndDrop(InternalClip(tree, "mytreedrag"), tree.GetDragSample()) == DND_MOVE) - { tree.RemoveSelection(); - D3(Sprintf("DoDragAndDrop")); - i++; - } - - /** - for (int x = 0; x < parent.GetCount(); x++) - D3(Sprintf("Element Nr.: %3d, mit Wert: %3d ",x,parent[x] )); - */ - - D3(Sprintf("Elements: %d",tree.GetLineCount())); - if (0 && PromptOKCancel("Sortieren?")) - { - Value i = 1; - tree.Sort(0); - for (int i = 1; i <= tree.GetChildCount(0); i++) - { - int n = tree.GetItemAtLine(i); - Value a = tree.GetValue(n); - Value b = tree.GetValue(i); - D3(" sorted (" << i << ") get with i: " << b << "\t get with n " << n << ": " << a); - } - } - else - { - for (int i = 1; i <= tree.GetChildCount(0); i++) - { - int n = tree.GetItemAtLine(i); - Value a = tree.GetValue(n); - Value b = tree.GetValue(i); - D3(Sprintf(" unsorted (%2d) get with i: ", i) + String(b) + "\t get with n: " +String(a)); - } - } } - App() { - int i = 0; Add(tree.SizePos()); + Vector parent, parent2; parent.Add(0); - //tree.SetRoot(Image(), "The Tree"); - tree.NoRoot(); - for(int i = 1; i < 10; i++) { - /** + tree.SetRoot(CtrlImg::menu_window(), "Groups"); + for(int i = 1; i < 100/*000*/; i++) { + EditString & es = edit.Add(); + es.SetText(FormatIntRoman(i, true)); parent.Add(tree.Add(parent[rand() % parent.GetCount()], Image(), - FormatIntRoman(i, true))); + es)); if((rand() & 3) == 0) tree.Open(parent.Top()); - */ - parent.Add(tree.Add(0, Image(),FormatIntRoman(i, true))); -// TreeCtrl::Node tmp(i,FormatIntRoman(i, true)); - -// parent.Add(tree.Insert(0,i+10,tmp)); - } tree.Open(0); tree.WhenDropInsert = THISBACK(DropInsert); tree.WhenDrag = THISBACK(Drag); tree.MultiSelect(); - D3(Sprintf("Elements: %d",tree.GetLineCount())); - for (int i = 1; i <= tree.GetChildCount(0); i++) - { - int n = tree.GetItemAtLine(i); - Value a = tree.GetValue(n); - Value b = tree.GetValue(i); - D3(Sprintf(" just created (%2d) get with i: ", i) + String(b) + "\t get with n: " +String(a)); - } Sizeable(); } };