2000-03-05 19:58:08 +00:00
|
|
|
|
/* ----------- watch.c ----------- */
|
|
|
|
|
|
|
|
|
|
#include "dflat.h"
|
|
|
|
|
|
2003-06-19 02:48:13 +00:00
|
|
|
|
int DfWatchIconProc(DFWINDOW wnd, DFMESSAGE msg, DF_PARAM p1, DF_PARAM p2)
|
2000-03-05 19:58:08 +00:00
|
|
|
|
{
|
|
|
|
|
int rtn;
|
|
|
|
|
switch (msg) {
|
2003-06-19 02:48:13 +00:00
|
|
|
|
case DFM_CREATE_WINDOW:
|
|
|
|
|
rtn = DfDefaultWndProc(wnd, msg, p1, p2);
|
|
|
|
|
DfSendMessage(wnd, DFM_CAPTURE_MOUSE, 0, 0);
|
|
|
|
|
DfSendMessage(wnd, DFM_CAPTURE_KEYBOARD, 0, 0);
|
2000-03-05 19:58:08 +00:00
|
|
|
|
return rtn;
|
2003-06-19 02:48:13 +00:00
|
|
|
|
case DFM_PAINT:
|
|
|
|
|
DfSetStandardColor(wnd);
|
|
|
|
|
DfWriteLine(wnd, " R ", 1, 1, FALSE);
|
2000-03-05 19:58:08 +00:00
|
|
|
|
return TRUE;
|
2003-06-19 02:48:13 +00:00
|
|
|
|
case DFM_BORDER:
|
|
|
|
|
rtn = DfDefaultWndProc(wnd, msg, p1, p2);
|
|
|
|
|
DfWriteLine(wnd, "<EFBFBD>", 2, 0, FALSE);
|
2000-03-05 19:58:08 +00:00
|
|
|
|
return rtn;
|
|
|
|
|
case MOUSE_MOVED:
|
|
|
|
|
DfSendMessage(wnd, DFM_HIDE_WINDOW, 0, 0);
|
2003-06-19 02:48:13 +00:00
|
|
|
|
DfSendMessage(wnd, DFM_MOVE, p1, p2);
|
|
|
|
|
DfSendMessage(wnd, DFM_SHOW_WINDOW, 0, 0);
|
2000-03-05 19:58:08 +00:00
|
|
|
|
return TRUE;
|
2003-06-19 02:48:13 +00:00
|
|
|
|
case DFM_CLOSE_WINDOW:
|
|
|
|
|
DfSendMessage(wnd, DFM_RELEASE_MOUSE, 0, 0);
|
|
|
|
|
DfSendMessage(wnd, DFM_RELEASE_KEYBOARD, 0, 0);
|
2000-03-05 19:58:08 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-06-19 02:48:13 +00:00
|
|
|
|
return DfDefaultWndProc(wnd, msg, p1, p2);
|
2000-03-05 19:58:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-06-19 02:48:13 +00:00
|
|
|
|
DFWINDOW DfWatchIcon(void)
|
2000-03-05 19:58:08 +00:00
|
|
|
|
{
|
|
|
|
|
int mx, my;
|
|
|
|
|
DFWINDOW wnd;
|
|
|
|
|
|
|
|
|
|
/* this won't work !! */
|
|
|
|
|
// DfSendMessage(NULL, DFM_CURRENT_MOUSE_CURSOR,
|
2003-06-19 02:48:13 +00:00
|
|
|
|
// (DF_PARAM) &mx, (DF_PARAM) &my);
|
2000-03-05 19:58:08 +00:00
|
|
|
|
|
2003-06-19 02:48:13 +00:00
|
|
|
|
mx = 0;//DF_SCREENWIDTH / 2;
|
|
|
|
|
mx = 0;//DF_SCREENHEIGHT / 2;
|
|
|
|
|
wnd = DfDfCreateWindow(
|
|
|
|
|
DF_BOX,
|
2000-03-05 19:58:08 +00:00
|
|
|
|
NULL,
|
|
|
|
|
mx, my, 3, 5,
|
|
|
|
|
NULL,NULL,
|
2003-06-19 02:48:13 +00:00
|
|
|
|
DfWatchIconProc,
|
|
|
|
|
DF_VISIBLE | DF_HASBORDER | DF_SHADOW | DF_SAVESELF);
|
2000-03-05 19:58:08 +00:00
|
|
|
|
return wnd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* EOF */
|