mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-29 06:12:18 -06:00
changed svn layout
git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
commit
263ff5f895
2665 changed files with 642923 additions and 0 deletions
40
reference/DropFiles/main.cpp
Normal file
40
reference/DropFiles/main.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct DndTest : public TopWindow {
|
||||
virtual void Paint(Draw &w);
|
||||
virtual void DragAndDrop(Point p, PasteClip& d);
|
||||
|
||||
Vector<String> files;
|
||||
|
||||
DndTest();
|
||||
};
|
||||
|
||||
void DndTest::Paint(Draw &w)
|
||||
{
|
||||
w.DrawRect(GetSize(), SColorPaper());
|
||||
if(files.GetCount())
|
||||
for(int i = 0; i < files.GetCount(); i++)
|
||||
w.DrawText(2, 2 + i * Draw::GetStdFontCy(), files[i]);
|
||||
else
|
||||
w.DrawText(2, 2, "None");
|
||||
}
|
||||
|
||||
void DndTest::DragAndDrop(Point p, PasteClip& d)
|
||||
{
|
||||
if (AcceptFiles(d)) {
|
||||
files = GetFiles(d);
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
DndTest::DndTest()
|
||||
{
|
||||
Title("I need files!");
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
DndTest().Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue