mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-21 22:04:56 -06:00
Syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1644 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9589fe6d31
commit
fc03d51e52
6 changed files with 43 additions and 110 deletions
|
|
@ -23,6 +23,9 @@ bool PostgreSQLTest::OpenDB()
|
|||
return false;
|
||||
}
|
||||
m_array.SetSession(m_session);
|
||||
|
||||
SQLCommander(m_session);
|
||||
return false;
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_session.SetTrace();
|
||||
|
|
|
|||
8
uppdev/SplitString/SplitString.cpp
Normal file
8
uppdev/SplitString/SplitString.cpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN {
|
||||
Vector<String> s = Split("John Doe Had A Dog", "Had");
|
||||
DUMPC(s);
|
||||
}
|
||||
9
uppdev/SplitString/SplitString.upp
Normal file
9
uppdev/SplitString/SplitString.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
SplitString.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
4
uppdev/SplitString/init
Normal file
4
uppdev/SplitString/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _SplitString_icpp_init_stub
|
||||
#define _SplitString_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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<int> parent, parent2;
|
||||
int i;
|
||||
Array<EditString> 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<TreeCtrl>(d, "mytreedrag")) {
|
||||
// if (7 < parent)
|
||||
// {
|
||||
// if(PromptOKCancel("Dialog"))
|
||||
// {
|
||||
// tree.CancelMode();
|
||||
//return;
|
||||
// sort = true;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
tree.AdjustAction(parent, d);
|
||||
|
||||
const TreeCtrl &src = GetInternal<TreeCtrl>(d); // JT
|
||||
Vector<int> sel = src.GetSel(); // JT
|
||||
// Etc.
|
||||
for(int i=0;i<sel.GetCount();i++)
|
||||
{
|
||||
DUMP(parent);
|
||||
DUMP(ii);
|
||||
DUMP(sel[i]);
|
||||
}
|
||||
|
||||
|
||||
tree.InsertDrop(parent, ii, d);
|
||||
tree.SetFocus();
|
||||
D3(Sprintf("AcceptInternal<TreeCtrl>(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<int> 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();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue