mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-22 06:12:32 -06:00
Syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@2188 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
cc7afd3f5d
commit
48689f040a
5 changed files with 249 additions and 152 deletions
|
|
@ -1,74 +1,68 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct App : TopWindow {
|
||||
ArrayCtrl a, b;
|
||||
Splitter s;
|
||||
|
||||
void DnD(PasteClip& d)
|
||||
{
|
||||
if(AcceptText(d))
|
||||
a.Add(GetString(d), GetString(d));
|
||||
}
|
||||
|
||||
void DnDInsert(int line, PasteClip& d)
|
||||
{
|
||||
if(AcceptInternal<ArrayCtrl>(d, "array"))
|
||||
a.InsertDrop(line, d);
|
||||
if(AcceptText(d)) {
|
||||
a.Insert(line);
|
||||
a.Set(line, 0, GetString(d));
|
||||
a.SetCursor(line);
|
||||
}
|
||||
}
|
||||
|
||||
void DnDInsertB(int line, PasteClip& d)
|
||||
{
|
||||
if(AcceptInternal()<ArrayCtrl>(d, "array"))
|
||||
b.InsertDrop(line, d);
|
||||
}
|
||||
|
||||
void Drag()
|
||||
{
|
||||
if(DoDragAndDrop(InternalClip(a, "array")) == DND_MOVE)
|
||||
a.RemoveSelection();
|
||||
}
|
||||
|
||||
void DragB()
|
||||
{
|
||||
if(DoDragAndDrop(InternalClip(b, "array")) == DND_MOVE)
|
||||
b.RemoveSelection();
|
||||
}
|
||||
|
||||
typedef App CLASSNAME;
|
||||
|
||||
App() {
|
||||
a.AddColumn("Text");
|
||||
a.MultiSelect();
|
||||
a.NoGrid();
|
||||
a.WhenDropInsert = THISBACK(DnDInsert);
|
||||
a.WhenDrop = THISBACK(DnD);
|
||||
a.WhenDrag = THISBACK(Drag);
|
||||
|
||||
b.AddColumn("Text");
|
||||
b.MultiSelect();
|
||||
b.WhenDropInsert = THISBACK(DnDInsertB);
|
||||
b.WhenDrag = THISBACK(DragB);
|
||||
|
||||
Add(s.Horz(a, b));
|
||||
for(int i = 0; i < 200; i++) {
|
||||
a.Add(i);
|
||||
b.Add(FormatIntRoman(i, true));
|
||||
if((i & 3) == 0)
|
||||
a.AddSeparator();
|
||||
}
|
||||
Sizeable();
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
DUMP("Test");
|
||||
App().Run();
|
||||
}
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct App : TopWindow {
|
||||
ArrayCtrl a, b;
|
||||
Splitter s;
|
||||
|
||||
void DnD(PasteClip& d)
|
||||
{
|
||||
if(AcceptText(d))
|
||||
a.Add(GetString(d), GetString(d));
|
||||
}
|
||||
|
||||
void DnDInsert(int line, PasteClip& d)
|
||||
{
|
||||
if(AcceptInternal<ArrayCtrl>(d, "array"))
|
||||
a.InsertDrop(line, d);
|
||||
if(AcceptText(d)) {
|
||||
a.Insert(line);
|
||||
a.Set(line, 0, GetString(d));
|
||||
a.SetCursor(line);
|
||||
}
|
||||
}
|
||||
|
||||
void DnDInsertB(int line, PasteClip& d)
|
||||
{
|
||||
}
|
||||
|
||||
void Drag()
|
||||
{
|
||||
}
|
||||
|
||||
void DragB()
|
||||
{
|
||||
}
|
||||
|
||||
typedef App CLASSNAME;
|
||||
|
||||
App() {
|
||||
a.AddColumn("Text");
|
||||
a.MultiSelect();
|
||||
a.NoGrid();
|
||||
a.WhenDropInsert = THISBACK(DnDInsert);
|
||||
a.WhenDrop = THISBACK(DnD);
|
||||
a.WhenDrag = THISBACK(Drag);
|
||||
|
||||
b.AddColumn("Text");
|
||||
b.MultiSelect();
|
||||
b.WhenDropInsert = THISBACK(DnDInsertB);
|
||||
b.WhenDrag = THISBACK(DragB);
|
||||
|
||||
Add(s.Horz(a, b));
|
||||
for(int i = 0; i < 200; i++) {
|
||||
a.Add(i);
|
||||
b.Add(FormatIntRoman(i, true));
|
||||
if((i & 3) == 0)
|
||||
a.AddSeparator();
|
||||
}
|
||||
Sizeable();
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
DUMP("Test");
|
||||
App().Run();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue