refererence: Events, DropFiles updated

git-svn-id: svn://ultimatepp.org/upp/trunk@5702 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-01-03 21:06:36 +00:00
parent c4d784c5c8
commit 94c8d9f735
4 changed files with 26 additions and 10 deletions

View file

@ -5,7 +5,7 @@ using namespace Upp;
struct DndTest : public TopWindow {
virtual void Paint(Draw &w);
virtual void DragAndDrop(Point p, PasteClip& d);
virtual bool Key(dword key, int count);
Vector<String> files;
DndTest();
@ -29,6 +29,16 @@ void DndTest::DragAndDrop(Point p, PasteClip& d)
}
}
bool DndTest::Key(dword key, int count)
{
if(key == K_CTRL_V) {
files = GetFiles(Ctrl::Clipboard());
Refresh();
return true;
}
return false;
}
DndTest::DndTest()
{
Title("I need files!");

View file

@ -2,6 +2,14 @@
using namespace Upp;
String GetKeyDescEx(int key)
{
String desc = GetKeyDesc(key & ~K_KEYUP);
if(key & K_KEYUP)
desc << " UP";
return desc;
}
struct App : TopWindow {
ArrayCtrl log;
@ -164,13 +172,7 @@ struct App : TopWindow {
virtual bool Key(dword key, int count)
{
Log(Format("Key(%x, %d) ", (int)key, count) + GetKeyDesc(key));
return false;
}
virtual bool WKey(dword key, int count)
{
Log(Format("WKey(%x, %d) ", (int)key, count) + GetKeyDesc(key));
Log(Format("Key(%x, %d) ", (int)key, count) + GetKeyDescEx(key));
return false;
}
@ -186,7 +188,7 @@ struct App : TopWindow {
virtual bool HotKey(dword key)
{
Log(Format("HotKey(%x) ", (int)key) + GetKeyDesc(key));
Log(Format("HotKey(%x) ", (int)key) + GetKeyDescEx(key));
return false;
}

View file

@ -1,4 +1,4 @@
description "Demonstration of basic input events";
description "Demonstration of basic input events\377";
uses
CtrlLib;

4
reference/Events/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _Events_icpp_init_stub
#define _Events_icpp_init_stub
#include "CtrlLib/init"
#endif