Mercurial > dwindows
annotate dwtest.c @ 333:b6491cefa512
Add test for switch-page signal.
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 09 Apr 2003 09:55:10 +0000 |
parents | e00aff2b899e |
children | 97029f1f29de |
rev | line source |
---|---|
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
1 #include <stdlib.h> |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
2 #include <string.h> |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
3 #include <stdio.h> |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
4 #include "dw.h" |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
5 |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
6 /* Select a fixed width font for our platform */ |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
7 #ifdef __OS2__ |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
8 #define FIXEDFONT "5.System VIO" |
305
32ad8a0dc06b
Escape backslashes so icons under Windows and OS/2 can be found.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
304
diff
changeset
|
9 #define FOLDER_ICON_NAME "os2\\folder" |
32ad8a0dc06b
Escape backslashes so icons under Windows and OS/2 can be found.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
304
diff
changeset
|
10 #define FILE_ICON_NAME "os2\\file" |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
11 #elif defined(__WIN32__) |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
12 #define FIXEDFONT "10.Terminal" |
305
32ad8a0dc06b
Escape backslashes so icons under Windows and OS/2 can be found.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
304
diff
changeset
|
13 #define FOLDER_ICON_NAME "win\\folder" |
32ad8a0dc06b
Escape backslashes so icons under Windows and OS/2 can be found.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
304
diff
changeset
|
14 #define FILE_ICON_NAME "win\\file" |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
15 #elif GTK_MAJOR_VERSION > 1 |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
16 #define FIXEDFONT "monospace 10" |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
17 #define FOLDER_ICON_NAME "gtk/folder" |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
18 #define FILE_ICON_NAME "gtk/file" |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
19 #else |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
20 #define FIXEDFONT "fixed" |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
21 #define FOLDER_ICON_NAME "gtk/folder" |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
22 #define FILE_ICON_NAME "gtk/file" |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
23 #endif |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
24 |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
25 #define SCROLLBARWIDTH 14 |
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
26 |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
27 unsigned long flStyle = DW_FCF_SYSMENU | DW_FCF_TITLEBAR | |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
28 DW_FCF_SHELLPOSITION | DW_FCF_TASKLIST | DW_FCF_DLGBORDER; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
29 |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
30 HWND mainwindow, |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
31 entryfield, |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
32 okbutton, |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
33 cancelbutton, |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
34 lbbox, |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
35 notebookbox, |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
36 notebookbox1, |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
37 notebookbox2, |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
38 notebookbox3, |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
39 notebookbox4, |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
40 notebook, |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
41 vscrollbar, |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
42 hscrollbar, |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
43 status, status1, |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
44 container_status, |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
45 tree_status, |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
46 stext, |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
47 tree, |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
48 container, |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
49 pagebox, |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
50 treebox, |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
51 containerbox, |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
52 textbox1, textbox2, textboxA, |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
53 gap_box, |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
54 buttonbox; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
55 |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
56 HPIXMAP text1pm,text2pm; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
57 unsigned long fileicon,foldericon; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
58 |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
59 int font_width = 8; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
60 int font_height=12; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
61 int font_gap = 2; |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
62 int rows=100,width1=6,cols=80; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
63 char *current_file = NULL; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
64 int timerid; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
65 int num_lines=0; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
66 int max_linewidth=0; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
67 int current_row=0,current_col=0; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
68 |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
69 FILE *fp=NULL; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
70 char **lp; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
71 |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
72 char *resolve_keyname( int vk ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
73 { |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
74 char *keyname; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
75 switch(vk) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
76 { |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
77 case VK_LBUTTON : keyname = "VK_LBUTTON"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
78 case VK_RBUTTON : keyname = "VK_RBUTTON"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
79 case VK_CANCEL : keyname = "VK_CANCEL"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
80 case VK_MBUTTON : keyname = "VK_MBUTTON"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
81 /* case VK_BACK : keyname = "VK_BACK"; break;*/ |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
82 case VK_TAB : keyname = "VK_TAB"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
83 case VK_CLEAR : keyname = "VK_CLEAR"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
84 case VK_RETURN : keyname = "VK_RETURN"; break; |
300
4559a2fd2db2
Keypress handler fixes, more need to be done, because I screwed up and
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
297
diff
changeset
|
85 /* case VK_MENU : keyname = "VK_MENU"; break;*/ |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
86 case VK_PAUSE : keyname = "VK_PAUSE"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
87 case VK_CAPITAL : keyname = "VK_CAPITAL"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
88 case VK_ESCAPE : keyname = "VK_ESCAPE"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
89 case VK_SPACE : keyname = "VK_SPACE"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
90 case VK_PRIOR : keyname = "VK_PRIOR"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
91 case VK_NEXT : keyname = "VK_NEXT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
92 case VK_END : keyname = "VK_END"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
93 case VK_HOME : keyname = "VK_HOME"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
94 case VK_LEFT : keyname = "VK_LEFT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
95 case VK_UP : keyname = "VK_UP"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
96 case VK_RIGHT : keyname = "VK_RIGHT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
97 case VK_DOWN : keyname = "VK_DOWN"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
98 case VK_SELECT : keyname = "VK_SELECT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
99 case VK_PRINT : keyname = "VK_PRINT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
100 case VK_EXECUTE : keyname = "VK_EXECUTE"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
101 case VK_SNAPSHOT: keyname = "VK_SNAPSHOT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
102 case VK_INSERT : keyname = "VK_INSERT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
103 case VK_DELETE : keyname = "VK_DELETE"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
104 case VK_HELP : keyname = "VK_HELP"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
105 case VK_LWIN : keyname = "VK_LWIN"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
106 case VK_RWIN : keyname = "VK_RWIN"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
107 case VK_NUMPAD0 : keyname = "VK_NUMPAD0"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
108 case VK_NUMPAD1 : keyname = "VK_NUMPAD1"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
109 case VK_NUMPAD2 : keyname = "VK_NUMPAD2"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
110 case VK_NUMPAD3 : keyname = "VK_NUMPAD3"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
111 case VK_NUMPAD4 : keyname = "VK_NUMPAD4"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
112 case VK_NUMPAD5 : keyname = "VK_NUMPAD5"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
113 case VK_NUMPAD6 : keyname = "VK_NUMPAD6"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
114 case VK_NUMPAD7 : keyname = "VK_NUMPAD7"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
115 case VK_NUMPAD8 : keyname = "VK_NUMPAD8"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
116 case VK_NUMPAD9 : keyname = "VK_NUMPAD9"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
117 case VK_MULTIPLY: keyname = "VK_MULTIPLY"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
118 case VK_ADD : keyname = "VK_ADD"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
119 case VK_SEPARATOR: keyname = "VK_SEPARATOR"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
120 case VK_SUBTRACT: keyname = "VK_SUBTRACT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
121 case VK_DECIMAL : keyname = "VK_DECIMAL"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
122 case VK_DIVIDE : keyname = "VK_DIVIDE"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
123 case VK_F1 : keyname = "VK_F1"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
124 case VK_F2 : keyname = "VK_F2"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
125 case VK_F3 : keyname = "VK_F3"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
126 case VK_F4 : keyname = "VK_F4"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
127 case VK_F5 : keyname = "VK_F5"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
128 case VK_F6 : keyname = "VK_F6"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
129 case VK_F7 : keyname = "VK_F7"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
130 case VK_F8 : keyname = "VK_F8"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
131 case VK_F9 : keyname = "VK_F9"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
132 case VK_F10 : keyname = "VK_F10"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
133 case VK_F11 : keyname = "VK_F11"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
134 case VK_F12 : keyname = "VK_F12"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
135 case VK_F13 : keyname = "VK_F13"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
136 case VK_F14 : keyname = "VK_F14"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
137 case VK_F15 : keyname = "VK_F15"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
138 case VK_F16 : keyname = "VK_F16"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
139 case VK_F17 : keyname = "VK_F17"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
140 case VK_F18 : keyname = "VK_F18"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
141 case VK_F19 : keyname = "VK_F19"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
142 case VK_F20 : keyname = "VK_F20"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
143 case VK_F21 : keyname = "VK_F21"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
144 case VK_F22 : keyname = "VK_F22"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
145 case VK_F23 : keyname = "VK_F23"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
146 case VK_F24 : keyname = "VK_F24"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
147 case VK_NUMLOCK : keyname = "VK_NUMLOCK"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
148 case VK_SCROLL : keyname = "VK_SCROLL"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
149 case VK_LSHIFT : keyname = "VK_LSHIFT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
150 case VK_RSHIFT : keyname = "VK_RSHIFT"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
151 case VK_LCONTROL: keyname = "VK_LCONTROL"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
152 case VK_RCONTROL: keyname = "VK_RCONTROL"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
153 /* case VK_LMENU : keyname = "VK_LMENU"; break; */ |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
154 /* case VK_RMENU : keyname = "VK_RMENU"; break;*/ |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
155 default: keyname = "<unknown>"; break; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
156 } |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
157 return keyname; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
158 } |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
159 |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
160 char *resolve_keymodifiers( int mask ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
161 { |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
162 if ( (mask & KC_CTRL) && (mask & KC_SHIFT) && (mask && KC_ALT) ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
163 return "KC_CTRL KC_SHIFT KC_ALT"; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
164 else if ( (mask & KC_CTRL) && (mask & KC_SHIFT) ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
165 return "KC_CTRL KC_SHIFT"; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
166 else if ( (mask & KC_CTRL) && (mask & KC_ALT) ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
167 return "KC_CTRL KC_ALT"; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
168 else if ( (mask & KC_SHIFT) && (mask & KC_ALT) ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
169 return "KC_SHIFT KC_ALT"; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
170 else if ( (mask & KC_SHIFT) ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
171 return "KC_SHIFT"; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
172 else if ( (mask & KC_CTRL) ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
173 return "KC_CTRL"; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
174 else if ( (mask & KC_ALT) ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
175 return "KC_ALT"; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
176 else return "none"; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
177 } |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
178 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
179 /* This gets called when a part of the graph needs to be repainted. */ |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
180 int DWSIGNAL text_expose(HWND hwnd, DWExpose *exp, void *data) |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
181 { |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
182 HPIXMAP hpm; |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
183 int width,height; |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
184 |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
185 if ( hwnd == textbox1 ) |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
186 hpm = text1pm; |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
187 else if ( hwnd == textbox2 ) |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
188 hpm = text2pm; |
266
5c5bee286d0e
Fixed some warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
257
diff
changeset
|
189 else |
5c5bee286d0e
Fixed some warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
257
diff
changeset
|
190 return TRUE; |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
191 |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
192 width = DW_PIXMAP_WIDTH(hpm); |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
193 height = DW_PIXMAP_HEIGHT(hpm); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
194 |
289
0e6f09149eaa
Fixed some EMX warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
284
diff
changeset
|
195 dw_pixmap_bitblt(hwnd, NULL, 0, 0, width, height, 0, hpm, 0, 0 ); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
196 dw_flush(); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
197 return TRUE; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
198 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
199 |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
200 void read_file( void ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
201 { |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
202 int i,len; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
203 fp = fopen( current_file, "r" ); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
204 lp = (char **)calloc( 1000,sizeof(char *)); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
205 /* should test for out of memory */ |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
206 max_linewidth=0; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
207 for ( i = 0; i < 1000; i++ ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
208 { |
227
5e6d8e024214
Use calloc instead of malloc so line buffers aren't filled with garbage.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
226
diff
changeset
|
209 lp[i] = (char *)calloc(1, 1025); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
210 if ( fgets( lp[i], 1024, fp ) == NULL ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
211 break; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
212 len = strlen( lp[i] ); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
213 if ( len > max_linewidth ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
214 max_linewidth = len; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
215 if ( lp[i][len - 1] == '\n' ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
216 lp[i][len - 1] = '\0'; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
217 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
218 num_lines = i; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
219 fclose( fp ); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
220 dw_scrollbar_set_range(hscrollbar, max_linewidth, cols); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
221 dw_scrollbar_set_pos(hscrollbar, 0); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
222 dw_scrollbar_set_range(vscrollbar, num_lines, rows); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
223 dw_scrollbar_set_pos(vscrollbar, 0); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
224 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
225 |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
226 void draw_file( int row, int col ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
227 { |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
228 char buf[10]; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
229 int i,y; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
230 char *pLine; |
226
2aee0b23e880
Removed unnecessary fprintf() statements.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
225
diff
changeset
|
231 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
232 if ( current_file ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
233 { |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
234 dw_color_foreground_set(DW_CLR_WHITE); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
235 dw_draw_rect(0, text1pm, TRUE, 0, 0, DW_PIXMAP_WIDTH(text1pm), DW_PIXMAP_HEIGHT(text1pm)); |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
236 dw_draw_rect(0, text2pm, TRUE, 0, 0, DW_PIXMAP_WIDTH(text2pm), DW_PIXMAP_HEIGHT(text2pm)); |
229
4166c18586e5
Fixed number of lines calculation in configure_event() taking into account
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
227
diff
changeset
|
237 for ( i = 0;(i < rows) && (i+row < num_lines); i++) |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
238 { |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
239 y = i*(font_height+font_gap); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
240 dw_color_foreground_set( i ); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
241 sprintf( buf, "%6.6d", i+row ); |
289
0e6f09149eaa
Fixed some EMX warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
284
diff
changeset
|
242 dw_draw_text( 0, text1pm, 0, y, buf); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
243 pLine = lp[i+row]; |
289
0e6f09149eaa
Fixed some EMX warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
284
diff
changeset
|
244 dw_draw_text( 0, text2pm, 0, y, pLine+col ); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
245 } |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
246 text_expose( textbox1, NULL, NULL); |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
247 text_expose( textbox2, NULL, NULL); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
248 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
249 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
250 |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
251 int DWSIGNAL beep_callback(HWND window, void *data) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
252 { |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
253 dw_timer_disconnect( timerid ); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
254 return TRUE; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
255 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
256 |
267
bf8b907f8a29
Added initial version of updated key_press_event callback.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
266
diff
changeset
|
257 int DWSIGNAL keypress_callback(HWND window, char ch, int vk, int state, void *data) |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
258 { |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
259 char tmpbuf[100]; |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
260 if ( ch ) |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
261 sprintf( tmpbuf, "Key: %c(%d) Modifiers: %s(%d)", ch, ch, resolve_keymodifiers(state), state ); |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
262 else |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
263 sprintf( tmpbuf, "Key: %s(%d) Modifiers: %s(%d)", resolve_keyname(vk), vk, resolve_keymodifiers(state), state ); |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
264 dw_window_set_text( status1, tmpbuf); |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
265 return 0; |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
266 } |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
267 |
192
d946e329670c
Added test application for OS/2, and allow dw_color_xxx_set() to use OS/2
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
191
diff
changeset
|
268 int DWSIGNAL exit_callback(HWND window, void *data) |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
269 { |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
270 dw_window_destroy((HWND)data); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
271 exit(0); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
272 return -1; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
273 } |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
274 |
192
d946e329670c
Added test application for OS/2, and allow dw_color_xxx_set() to use OS/2
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
191
diff
changeset
|
275 int DWSIGNAL test_callback(HWND window, void *data) |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
276 { |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
277 dw_window_destroy((HWND)data); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
278 if ( current_file ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
279 dw_free( current_file ); |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
280 exit(0); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
281 return -1; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
282 } |
192
d946e329670c
Added test application for OS/2, and allow dw_color_xxx_set() to use OS/2
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
191
diff
changeset
|
283 |
d946e329670c
Added test application for OS/2, and allow dw_color_xxx_set() to use OS/2
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
191
diff
changeset
|
284 int DWSIGNAL browse_callback(HWND window, void *data) |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
285 { |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
286 char *tmp; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
287 tmp = dw_file_browse("test string", NULL, "c", DW_FILE_OPEN ); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
288 if ( tmp ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
289 { |
231
a3775f5b877f
Only free current_file when we have a new file selected to show.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
229
diff
changeset
|
290 if ( current_file ) |
a3775f5b877f
Only free current_file when we have a new file selected to show.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
229
diff
changeset
|
291 { |
a3775f5b877f
Only free current_file when we have a new file selected to show.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
229
diff
changeset
|
292 dw_free( current_file ); |
a3775f5b877f
Only free current_file when we have a new file selected to show.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
229
diff
changeset
|
293 } |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
294 current_file = tmp; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
295 dw_window_set_text( entryfield, current_file ); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
296 read_file(); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
297 draw_file(0,0); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
298 } |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
299 return 0; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
300 } |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
301 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
302 /* Callback to handle user selection of the scrollbar position */ |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
303 void DWSIGNAL scrollbar_valuechanged(HWND hwnd, int value, void *data) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
304 { |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
305 if(data) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
306 { |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
307 HWND stext = (HWND)data; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
308 char tmpbuf[100]; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
309 if ( hwnd == vscrollbar ) |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
310 { |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
311 current_row = value; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
312 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
313 else |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
314 { |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
315 current_col = value; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
316 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
317 sprintf(tmpbuf, "Row:%d Col:%d Lines:%d Cols:%d", current_row,current_col,num_lines,max_linewidth); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
318 dw_window_set_text(stext, tmpbuf); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
319 draw_file( current_row, current_col); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
320 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
321 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
322 |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
323 /* Handle size change of the main render window */ |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
324 int DWSIGNAL configure_event(HWND hwnd, int width, int height, void *data) |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
325 { |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
326 HPIXMAP old1 = text1pm, old2 = text2pm; |
222
7bb6cb6f612c
Another minor change... create the first pixmap to the correct window
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
221
diff
changeset
|
327 int depth = dw_color_depth(); |
7bb6cb6f612c
Another minor change... create the first pixmap to the correct window
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
221
diff
changeset
|
328 |
229
4166c18586e5
Fixed number of lines calculation in configure_event() taking into account
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
227
diff
changeset
|
329 rows = height / (font_height+font_gap); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
330 cols = width / font_width; |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
331 |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
332 /* Create new pixmaps with the current sizes */ |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
333 text1pm = dw_pixmap_new(textbox1, (font_width*(width1+1)), height+1, depth); |
222
7bb6cb6f612c
Another minor change... create the first pixmap to the correct window
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
221
diff
changeset
|
334 text2pm = dw_pixmap_new(textbox2, width, height, depth); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
335 |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
336 /* Destroy the old pixmaps */ |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
337 dw_pixmap_destroy(old1); |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
338 dw_pixmap_destroy(old2); |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
339 |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
340 /* Update scrollbar ranges with new values */ |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
341 dw_scrollbar_set_range(hscrollbar, max_linewidth, cols); |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
342 dw_scrollbar_set_range(vscrollbar, num_lines, rows); |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
343 |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
344 /* Redraw the window */ |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
345 draw_file( current_row, current_col); |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
346 return TRUE; |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
347 } |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
348 |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
349 int DWSIGNAL item_enter_cb( HWND window, char *text, void *data ) |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
350 { |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
351 char buf[200]; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
352 HWND statline = (HWND)data; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
353 |
324
c13312a6b8dc
Clean up an errant printf().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
323
diff
changeset
|
354 sprintf(buf,"DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s", (unsigned int)window, text ); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
355 dw_window_set_text( statline, buf); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
356 return 0; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
357 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
358 |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
359 int DWSIGNAL item_context_cb( HWND window, char *text, int x, int y, void *data, void *itemdata ) |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
360 { |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
361 char buf[200]; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
362 HWND statline = (HWND)data; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
363 |
313
a3dee031d27e
Cleaned up unix warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
312
diff
changeset
|
364 sprintf(buf,"DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", (unsigned int)window, text, x, y, (unsigned int)itemdata ); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
365 dw_window_set_text( statline, buf); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
366 return 0; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
367 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
368 |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
369 int DWSIGNAL list_select_cb( HWND window, int item, void *data ) |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
370 { |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
371 char buf[200]; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
372 HWND statline = (HWND)data; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
373 |
313
a3dee031d27e
Cleaned up unix warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
312
diff
changeset
|
374 sprintf(buf,"DW_SIGNAL_LIST_SELECT: Window: %d Item: %d", (unsigned int)window, item ); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
375 dw_window_set_text( statline, buf); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
376 return 0; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
377 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
378 |
328
e00aff2b899e
Tree item handles are now of the type HTREEITEM instead of HWND since they
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
327
diff
changeset
|
379 int DWSIGNAL item_select_cb( HWND window, HTREEITEM item, char *text, void *data, void *itemdata ) |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
380 { |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
381 char buf[200]; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
382 HWND statline = (HWND)data; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
383 |
313
a3dee031d27e
Cleaned up unix warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
312
diff
changeset
|
384 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", (unsigned int)window, (unsigned int)item, text, (unsigned int)itemdata ); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
385 dw_window_set_text( statline, buf); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
386 return 0; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
387 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
388 |
333
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
389 int DWSIGNAL switch_page_cb( HWND window, int page_num, void *itemdata ) |
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
390 { |
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
391 FILE *fp=fopen("log","a"); |
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
392 fprintf(fp,"DW_SIGNAL_SWITCH_PAGE: Window: %x PageNum: %d Itemdata: %x\n", (unsigned int)window, (unsigned int)page_num, (unsigned int)itemdata ); |
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
393 fclose(fp); |
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
394 return 0; |
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
395 } |
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
396 |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
397 void archive_add(void) |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
398 { |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
399 HWND browsebutton, browsebox; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
400 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
401 lbbox = dw_box_new(BOXVERT, 10); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
402 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
403 dw_box_pack_start(notebookbox1, lbbox, 150, 70, TRUE, TRUE, 0); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
404 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
405 /* Archive Name */ |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
406 stext = dw_text_new("File to browse", 0); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
407 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
408 dw_window_set_style(stext, DW_DT_VCENTER, DW_DT_VCENTER); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
409 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
410 dw_box_pack_start(lbbox, stext, 130, 15, TRUE, TRUE, 2); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
411 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
412 browsebox = dw_box_new(BOXHORZ, 0); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
413 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
414 dw_box_pack_start(lbbox, browsebox, 0, 0, TRUE, TRUE, 0); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
415 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
416 entryfield = dw_entryfield_new("", 100L); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
417 |
308
f844a07c5915
Get it working on OS/2. :)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
305
diff
changeset
|
418 dw_entryfield_set_limit(entryfield, 260); |
f844a07c5915
Get it working on OS/2. :)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
305
diff
changeset
|
419 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
420 dw_box_pack_start(browsebox, entryfield, 100, 15, TRUE, TRUE, 4); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
421 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
422 browsebutton = dw_button_new("Browse", 1001L); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
423 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
424 dw_box_pack_start(browsebox, browsebutton, 30, 15, TRUE, TRUE, 0); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
425 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
426 dw_window_set_color(browsebox, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
427 dw_window_set_color(stext, DW_CLR_BLACK, DW_CLR_PALEGRAY); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
428 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
429 /* Buttons */ |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
430 buttonbox = dw_box_new(BOXHORZ, 10); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
431 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
432 dw_box_pack_start(lbbox, buttonbox, 0, 0, TRUE, TRUE, 0); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
433 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
434 okbutton = dw_button_new("Turn Off Annoying Beep!", 1001L); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
435 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
436 dw_box_pack_start(buttonbox, okbutton, 130, 30, TRUE, TRUE, 2); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
437 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
438 cancelbutton = dw_button_new("Exit", 1002L); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
439 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
440 dw_box_pack_start(buttonbox, cancelbutton, 130, 30, TRUE, TRUE, 2); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
441 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
442 /* Set some nice fonts and colors */ |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
443 dw_window_set_color(lbbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
444 dw_window_set_color(buttonbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
445 dw_window_set_color(okbutton, DW_CLR_PALEGRAY, DW_CLR_DARKCYAN); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
446 |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
447 dw_signal_connect(browsebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_callback), (void *)notebookbox1); |
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
448 dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(beep_callback), (void *)notebookbox1); |
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
449 dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
450 } |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
451 |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
452 |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
453 void text_add(void) |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
454 { |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
455 int depth = dw_color_depth(); |
252
eab1540444b2
Make an empty space where the scrollbars meet.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
232
diff
changeset
|
456 HWND vscrollbox; |
213
f8b50901ac45
Added verticle scrollbar test to the sample.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
207
diff
changeset
|
457 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
458 /* create a box to pack into the notebook page */ |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
459 pagebox = dw_box_new(BOXHORZ, 2); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
460 dw_box_pack_start( notebookbox2, pagebox, 0, 0, TRUE, TRUE, 0); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
461 /* now a status area under this box */ |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
462 status = dw_status_text_new("", 0); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
463 dw_box_pack_start( notebookbox2, status, 100, 20, TRUE, FALSE, 1); |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
464 /* and another one */ |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
465 status1 = dw_status_text_new("", 0); |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
466 dw_box_pack_start( notebookbox2, status1, 100, 20, TRUE, FALSE, 1); |
213
f8b50901ac45
Added verticle scrollbar test to the sample.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
207
diff
changeset
|
467 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
468 /* create render box for number pixmap */ |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
469 textbox1 = dw_render_new( 100 ); |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
470 dw_window_set_font(textbox1, FIXEDFONT); |
221
3fd010a0a33f
Fixed the expose_event with dynamic pixmaps.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
219
diff
changeset
|
471 dw_font_text_extents(textbox1, NULL, "O", &font_width, &font_height); |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
472 vscrollbox = dw_box_new(BOXVERT, 0); |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
473 dw_box_pack_start(vscrollbox, textbox1, font_width*width1, font_height*rows, FALSE, TRUE, 0); |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
474 dw_box_pack_start(vscrollbox, 0, (font_width*(width1+1)), SCROLLBARWIDTH, FALSE, FALSE, 0); |
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
475 dw_box_pack_start(pagebox, vscrollbox, 0, 0, FALSE, TRUE, 0); |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
476 |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
477 /* create render box for gap pixmap */ |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
478 /* create box for filecontents and horz scrollbar */ |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
479 textboxA = dw_box_new( BOXVERT,0 ); |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
480 dw_box_pack_start( pagebox, textboxA, 0, 0, TRUE, TRUE, 0); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
481 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
482 /* create render box for filecontents pixmap */ |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
483 textbox2 = dw_render_new( 101 ); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
484 dw_box_pack_start( textboxA, textbox2, 10, 10, TRUE, TRUE, 0); |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
485 dw_window_set_font(textbox2, FIXEDFONT); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
486 /* create horizonal scrollbar */ |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
487 hscrollbar = dw_scrollbar_new(FALSE, 100, 50); |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
488 dw_box_pack_start( textboxA, hscrollbar, 100, SCROLLBARWIDTH, TRUE, FALSE, 0); |
197
f3718165f0b2
Implemented scrollbars and timers on Windows, and added scrollbar to the
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
195
diff
changeset
|
489 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
490 /* create vertical scrollbar */ |
252
eab1540444b2
Make an empty space where the scrollbars meet.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
232
diff
changeset
|
491 vscrollbox = dw_box_new(BOXVERT, 0); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
492 vscrollbar = dw_scrollbar_new(TRUE, 100, 50); |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
493 dw_box_pack_start(vscrollbox, vscrollbar, SCROLLBARWIDTH, 100, FALSE, TRUE, 0); |
253
e041ce42659a
Added a comment describing how it works.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
252
diff
changeset
|
494 /* Pack an area of empty space 14x14 pixels */ |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
495 dw_box_pack_start(vscrollbox, 0, SCROLLBARWIDTH, SCROLLBARWIDTH, FALSE, FALSE, 0); |
252
eab1540444b2
Make an empty space where the scrollbars meet.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
232
diff
changeset
|
496 dw_box_pack_start(pagebox, vscrollbox, 0, 0, FALSE, TRUE, 0); |
206
f7911991c5df
Show info about the scrollbar in a status text control.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
203
diff
changeset
|
497 |
257
9ea4ac9a097f
Added dw_icon_load_from_file() on OS/2 and Windows. Added a stub on Unix
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
254
diff
changeset
|
498 text1pm = dw_pixmap_new( textbox1, (font_width*(width1+1)), font_height*rows, depth ); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
499 text2pm = dw_pixmap_new( textbox2, font_width*cols, font_height*rows, depth ); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
500 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
501 dw_messagebox("DWTest", "Width: %d Height: %d\n", font_width, font_height); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
502 dw_draw_rect(0, text1pm, TRUE, 0, 0, font_width*width1, font_height*rows); |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
503 dw_draw_rect(0, text2pm, TRUE, 0, 0, font_width*cols, font_height*rows); |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
504 dw_signal_connect(textbox1, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL); |
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
505 dw_signal_connect(textbox2, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL); |
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
506 dw_signal_connect(textbox2, DW_SIGNAL_CONFIGURE, DW_SIGNAL_FUNC(configure_event), text2pm); |
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
507 dw_signal_connect(hscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged), (void *)status); |
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
508 dw_signal_connect(vscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged), (void *)status); |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
509 |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
510 dw_signal_connect(mainwindow, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(keypress_callback), NULL); |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
511 } |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
512 |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
513 void tree_add(void) |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
514 { |
328
e00aff2b899e
Tree item handles are now of the type HTREEITEM instead of HWND since they
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
327
diff
changeset
|
515 HTREEITEM t1,t2,t3,t4,t5,t6; |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
516 |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
517 /* create a box to pack into the notebook page */ |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
518 treebox = dw_box_new(BOXHORZ, 2); |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
519 dw_box_pack_start( notebookbox3, treebox, 500, 200, TRUE, TRUE, 0); |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
520 |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
521 /* now a tree area under this box */ |
308
f844a07c5915
Get it working on OS/2. :)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
305
diff
changeset
|
522 tree = dw_tree_new(101); |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
523 dw_box_pack_start( notebookbox3, tree, 500, 200, TRUE, FALSE, 1); |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
524 |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
525 /* and a status area to see whats going on */ |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
526 tree_status = dw_status_text_new("", 0); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
527 dw_box_pack_start( notebookbox3, tree_status, 100, 20, TRUE, FALSE, 1); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
528 |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
529 foldericon = dw_icon_load_from_file( FOLDER_ICON_NAME ); |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
530 fileicon = dw_icon_load_from_file( FILE_ICON_NAME ); |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
531 |
323
3dab9f31aeff
Mark, we must connect signal handlers before populating the tree on GTK 1.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
313
diff
changeset
|
532 /* set up our signal trappers... */ |
3dab9f31aeff
Mark, we must connect signal handlers before populating the tree on GTK 1.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
313
diff
changeset
|
533 dw_signal_connect(tree, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), (void *)tree_status); |
3dab9f31aeff
Mark, we must connect signal handlers before populating the tree on GTK 1.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
313
diff
changeset
|
534 dw_signal_connect(tree, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(item_select_cb), (void *)tree_status); |
3dab9f31aeff
Mark, we must connect signal handlers before populating the tree on GTK 1.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
313
diff
changeset
|
535 |
312
ff8f23594b15
Make sure itemdata is NULL for container callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
311
diff
changeset
|
536 t1 = dw_tree_insert(tree, "tree folder 1", foldericon, NULL, (void *)1 ); |
ff8f23594b15
Make sure itemdata is NULL for container callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
311
diff
changeset
|
537 t2 = dw_tree_insert(tree, "tree folder 2", foldericon, NULL, (void *)2 ); |
ff8f23594b15
Make sure itemdata is NULL for container callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
311
diff
changeset
|
538 t3 = dw_tree_insert(tree, "tree file 1", fileicon, t1, (void *)3 ); |
ff8f23594b15
Make sure itemdata is NULL for container callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
311
diff
changeset
|
539 t4 = dw_tree_insert(tree, "tree file 2", fileicon, t1, (void *)4 ); |
ff8f23594b15
Make sure itemdata is NULL for container callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
311
diff
changeset
|
540 t5 = dw_tree_insert(tree, "tree file 3", fileicon, t2, (void *)5 ); |
ff8f23594b15
Make sure itemdata is NULL for container callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
311
diff
changeset
|
541 t6 = dw_tree_insert(tree, "tree file 4", fileicon, t2, (void *)6 ); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
542 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
543 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
544 void container_add(void) |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
545 { |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
546 char *titles[3]; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
547 char buffer[100]; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
548 unsigned long flags[3] = { DW_CFA_ULONG | DW_CFA_RIGHT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
549 DW_CFA_TIME | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
550 DW_CFA_DATE | DW_CFA_RIGHT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR }; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
551 void *containerinfo; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
552 int z; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
553 CTIME time; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
554 CDATE date; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
555 unsigned long size, thisicon; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
556 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
557 /* create a box to pack into the notebook page */ |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
558 containerbox = dw_box_new(BOXHORZ, 2); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
559 dw_box_pack_start( notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
560 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
561 /* now a container area under this box */ |
308
f844a07c5915
Get it working on OS/2. :)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
305
diff
changeset
|
562 container = dw_container_new(100); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
563 dw_box_pack_start( notebookbox4, container, 500, 200, TRUE, FALSE, 1); |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
564 |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
565 /* and a status area to see whats going on */ |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
566 container_status = dw_status_text_new("", 0); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
567 dw_box_pack_start( notebookbox4, container_status, 100, 20, TRUE, FALSE, 1); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
568 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
569 titles[0] = "Size"; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
570 titles[1] = "Time"; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
571 titles[2] = "Date"; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
572 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
573 dw_filesystem_setup(container, flags, titles, 3); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
574 containerinfo = dw_container_alloc(container, 3); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
575 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
576 for(z=0;z<3;z++) |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
577 { |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
578 size = z+100; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
579 sprintf(buffer, "Filename %d",z+1); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
580 if (z == 0 ) thisicon = foldericon; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
581 else thisicon = fileicon; |
327
3204b978e077
Removed strdup() since new container code on OS/2 no longer requires it.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
324
diff
changeset
|
582 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
583 dw_filesystem_set_item(container, containerinfo, 0, z, &size); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
584 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
585 time.seconds = z+10; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
586 time.minutes = z+10; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
587 time.hours = z+10; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
588 dw_filesystem_set_item(container, containerinfo, 1, z, &time); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
589 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
590 date.day = z+10; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
591 date.month = z+10; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
592 date.year = z+2000; |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
593 dw_filesystem_set_item(container, containerinfo, 2, z, &date); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
594 |
308
f844a07c5915
Get it working on OS/2. :)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
305
diff
changeset
|
595 dw_container_set_row_title(containerinfo, z, "Don't allocate from the stack"); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
596 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
597 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
598 dw_container_insert(container, containerinfo, 3); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
599 dw_container_optimize(container); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
600 |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
601 /* connect our event trappers... */ |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
602 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), (void *)container_status); |
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
603 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), (void *)container_status); |
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
604 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(item_select_cb), (void *)container_status); |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
605 } |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
606 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
607 /* Beep every second */ |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
608 int DWSIGNAL timer_callback(void *data) |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
609 { |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
610 dw_beep(200, 200); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
611 |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
612 /* Return TRUE so we get called again */ |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
613 return TRUE; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
614 } |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
615 |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
616 /* |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
617 * Let's demonstrate the functionality of this library. :) |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
618 */ |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
619 int main(int argc, char *argv[]) |
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
620 { |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
621 ULONG notebookpage1; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
622 ULONG notebookpage2; |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
623 ULONG notebookpage3; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
624 ULONG notebookpage4; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
625 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
626 dw_init(TRUE, argc, argv); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
627 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
628 mainwindow = dw_window_new( HWND_DESKTOP, "dwindows test", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX ); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
629 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
630 notebookbox = dw_box_new( BOXVERT, 5 ); |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
631 dw_box_pack_start( mainwindow, notebookbox, 0, 0, TRUE, TRUE, 0); |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
632 |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
633 notebook = dw_notebook_new( 1, TRUE ); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
634 dw_box_pack_start( notebookbox, notebook, 100, 100, TRUE, TRUE, 0); |
333
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
635 dw_signal_connect(notebook, DW_SIGNAL_SWITCH_PAGE, DW_SIGNAL_FUNC(switch_page_cb), NULL); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
636 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
637 notebookbox1 = dw_box_new( BOXVERT, 5 ); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
638 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE ); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
639 dw_notebook_pack( notebook, notebookpage1, notebookbox1 ); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
640 dw_notebook_page_set_text( notebook, notebookpage1, "buttons and entry"); |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
641 archive_add(); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
642 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
643 notebookbox2 = dw_box_new( BOXVERT, 5 ); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
644 notebookpage2 = dw_notebook_page_new( notebook, 1, FALSE ); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
645 dw_notebook_pack( notebook, notebookpage2, notebookbox2 ); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
646 dw_notebook_page_set_text( notebook, notebookpage2, "render"); |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
647 text_add(); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
648 |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
649 notebookbox3 = dw_box_new( BOXVERT, 5 ); |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
650 notebookpage3 = dw_notebook_page_new( notebook, 1, FALSE ); |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
651 dw_notebook_pack( notebook, notebookpage3, notebookbox3 ); |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
652 dw_notebook_page_set_text( notebook, notebookpage3, "tree"); |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
653 tree_add(); |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
654 |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
655 notebookbox4 = dw_box_new( BOXVERT, 5 ); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
656 notebookpage4 = dw_notebook_page_new( notebook, 1, FALSE ); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
657 dw_notebook_pack( notebook, notebookpage4, notebookbox4 ); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
658 dw_notebook_page_set_text( notebook, notebookpage4, "container"); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
659 container_add(); |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
660 |
311
24c1dfffe97e
Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
310
diff
changeset
|
661 dw_signal_connect(mainwindow, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow); |
199
b955228477b3
Removed the window parameter to dw_timer_connect() it was no needed.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
198
diff
changeset
|
662 timerid = dw_timer_connect(1000, DW_SIGNAL_FUNC(timer_callback), 0); |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
663 dw_window_set_usize(mainwindow, 640, 480); |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
664 dw_window_show(mainwindow); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
665 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
666 dw_main(); |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
667 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
668 return 0; |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
669 } |