annotate dwtest.c @ 934:13384e89964c

Put in a bounds check just on a hunch when editing containers on Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 26 Apr 2011 05:51:19 +0000
parents ae5d884af4ed
children cfb12bf3bb06
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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"
674
78f9aa6d6d89 Fixes or fonts and loading images from files. Added Mac specific settings to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 672
diff changeset
15 #elif defined(__MAC__)
746
0a364e76a7aa 9 point Monaco looks better than 8 point... so switching in dwtest...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 674
diff changeset
16 #define FIXEDFONT "9.Monaco"
674
78f9aa6d6d89 Fixes or fonts and loading images from files. Added Mac specific settings to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 672
diff changeset
17 #define FOLDER_ICON_NAME "mac/folder"
78f9aa6d6d89 Fixes or fonts and loading images from files. Added Mac specific settings to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 672
diff changeset
18 #define FILE_ICON_NAME "mac/file"
219
79968cf0f3b3 Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 218
diff changeset
19 #elif GTK_MAJOR_VERSION > 1
79968cf0f3b3 Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 218
diff changeset
20 #define FIXEDFONT "monospace 10"
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 #else
79968cf0f3b3 Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 218
diff changeset
24 #define FIXEDFONT "fixed"
297
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
25 #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
26 #define FILE_ICON_NAME "gtk/file"
219
79968cf0f3b3 Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 218
diff changeset
27 #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
28
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
29 #define SCROLLBARWIDTH 14
774
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
30 #define MAX_WIDGETS 20
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
31
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
32 unsigned long flStyle = DW_FCF_SYSMENU | DW_FCF_TITLEBAR |
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
33 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
34
567
81ca08481d49 Added the basics of the color chooser on OS/2. Needs some more logic to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 566
diff changeset
35 unsigned long current_color = DW_RGB(100,100,100);
566
f6de197ecbe9 Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 531
diff changeset
36
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
37 int iteration = 0;
774
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
38 void create_button( int);
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
39
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
40 HWND mainwindow,
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
41 entryfield,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
42 checkable_menuitem,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
43 noncheckable_menuitem,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
44 cursortogglebutton,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
45 colorchoosebutton,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
46 okbutton,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
47 cancelbutton,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
48 lbbox,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
49 combox,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
50 combobox1,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
51 combobox2,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
52 spinbutton,
627
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
53 slider,
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
54 notebookbox,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
55 notebookbox1,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
56 notebookbox2,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
57 notebookbox3,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
58 notebookbox4,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
59 notebookbox5,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
60 notebookbox6,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
61 notebookbox7,
774
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
62 notebookbox8,
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
63 html,
627
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
64 rawhtml,
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
65 notebook,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
66 vscrollbar,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
67 hscrollbar,
897
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
68 status,
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
69 container_status,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
70 tree_status,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
71 stext,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
72 tree,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
73 container,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
74 container_mle,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
75 pagebox,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
76 treebox,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
77 containerbox,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
78 textbox1, textbox2, textboxA,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
79 gap_box,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
80 buttonbox,
634
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
81 buttonsbox,
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
82 buttonboxperm,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
83 cal,
774
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
84 scrollbox,
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
85 labelarray[MAX_WIDGETS],
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
86 entryarray[MAX_WIDGETS],
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
87 filetoolbarbox;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
88
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
89 HMENUI mainmenubar,changeable_menu;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
90 #define CHECKABLE_MENUITEMID 2001
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
91 #define NONCHECKABLE_MENUITEMID 2002
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
92
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
93 void *containerinfo;
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
94
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
95
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
96 int menu_enabled = 1;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
97
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
98 HPIXMAP text1pm,text2pm;
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
99 HICN fileicon,foldericon;
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
100 int mle_point=-1;
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
101
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
102 int font_width = 8;
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
103 int font_height=12;
218
fe0ab0040ba2 Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 217
diff changeset
104 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
105 char *current_file = NULL;
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
106 int timerid;
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
107 int num_lines=0;
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
108 int max_linewidth=0;
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
109 int current_row=0,current_col=0;
391
2059f18e9c20 Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 385
diff changeset
110 int cursor_arrow = 1;
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
111
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
112 FILE *fp=NULL;
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
113 char **lp;
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
114
297
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
115 char *resolve_keyname( int vk )
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
116 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
117 char *keyname;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
118 switch(vk)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
119 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
120 case VK_LBUTTON : keyname = "VK_LBUTTON"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
121 case VK_RBUTTON : keyname = "VK_RBUTTON"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
122 case VK_CANCEL : keyname = "VK_CANCEL"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
123 case VK_MBUTTON : keyname = "VK_MBUTTON"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
124 /* case VK_BACK : keyname = "VK_BACK"; break;*/
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
125 case VK_TAB : keyname = "VK_TAB"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
126 case VK_CLEAR : keyname = "VK_CLEAR"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
127 case VK_RETURN : keyname = "VK_RETURN"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
128 /* case VK_MENU : keyname = "VK_MENU"; break;*/
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
129 case VK_PAUSE : keyname = "VK_PAUSE"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
130 case VK_CAPITAL : keyname = "VK_CAPITAL"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
131 case VK_ESCAPE : keyname = "VK_ESCAPE"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
132 case VK_SPACE : keyname = "VK_SPACE"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
133 case VK_PRIOR : keyname = "VK_PRIOR"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
134 case VK_NEXT : keyname = "VK_NEXT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
135 case VK_END : keyname = "VK_END"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
136 case VK_HOME : keyname = "VK_HOME"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
137 case VK_LEFT : keyname = "VK_LEFT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
138 case VK_UP : keyname = "VK_UP"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
139 case VK_RIGHT : keyname = "VK_RIGHT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
140 case VK_DOWN : keyname = "VK_DOWN"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
141 case VK_SELECT : keyname = "VK_SELECT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
142 case VK_PRINT : keyname = "VK_PRINT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
143 case VK_EXECUTE : keyname = "VK_EXECUTE"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
144 case VK_SNAPSHOT: keyname = "VK_SNAPSHOT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
145 case VK_INSERT : keyname = "VK_INSERT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
146 case VK_DELETE : keyname = "VK_DELETE"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
147 case VK_HELP : keyname = "VK_HELP"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
148 case VK_LWIN : keyname = "VK_LWIN"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
149 case VK_RWIN : keyname = "VK_RWIN"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
150 case VK_NUMPAD0 : keyname = "VK_NUMPAD0"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
151 case VK_NUMPAD1 : keyname = "VK_NUMPAD1"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
152 case VK_NUMPAD2 : keyname = "VK_NUMPAD2"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
153 case VK_NUMPAD3 : keyname = "VK_NUMPAD3"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
154 case VK_NUMPAD4 : keyname = "VK_NUMPAD4"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
155 case VK_NUMPAD5 : keyname = "VK_NUMPAD5"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
156 case VK_NUMPAD6 : keyname = "VK_NUMPAD6"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
157 case VK_NUMPAD7 : keyname = "VK_NUMPAD7"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
158 case VK_NUMPAD8 : keyname = "VK_NUMPAD8"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
159 case VK_NUMPAD9 : keyname = "VK_NUMPAD9"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
160 case VK_MULTIPLY: keyname = "VK_MULTIPLY"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
161 case VK_ADD : keyname = "VK_ADD"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
162 case VK_SEPARATOR: keyname = "VK_SEPARATOR"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
163 case VK_SUBTRACT: keyname = "VK_SUBTRACT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
164 case VK_DECIMAL : keyname = "VK_DECIMAL"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
165 case VK_DIVIDE : keyname = "VK_DIVIDE"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
166 case VK_F1 : keyname = "VK_F1"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
167 case VK_F2 : keyname = "VK_F2"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
168 case VK_F3 : keyname = "VK_F3"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
169 case VK_F4 : keyname = "VK_F4"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
170 case VK_F5 : keyname = "VK_F5"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
171 case VK_F6 : keyname = "VK_F6"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
172 case VK_F7 : keyname = "VK_F7"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
173 case VK_F8 : keyname = "VK_F8"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
174 case VK_F9 : keyname = "VK_F9"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
175 case VK_F10 : keyname = "VK_F10"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
176 case VK_F11 : keyname = "VK_F11"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
177 case VK_F12 : keyname = "VK_F12"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
178 case VK_F13 : keyname = "VK_F13"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
179 case VK_F14 : keyname = "VK_F14"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
180 case VK_F15 : keyname = "VK_F15"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
181 case VK_F16 : keyname = "VK_F16"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
182 case VK_F17 : keyname = "VK_F17"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
183 case VK_F18 : keyname = "VK_F18"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
184 case VK_F19 : keyname = "VK_F19"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
185 case VK_F20 : keyname = "VK_F20"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
186 case VK_F21 : keyname = "VK_F21"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
187 case VK_F22 : keyname = "VK_F22"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
188 case VK_F23 : keyname = "VK_F23"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
189 case VK_F24 : keyname = "VK_F24"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
190 case VK_NUMLOCK : keyname = "VK_NUMLOCK"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
191 case VK_SCROLL : keyname = "VK_SCROLL"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
192 case VK_LSHIFT : keyname = "VK_LSHIFT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
193 case VK_RSHIFT : keyname = "VK_RSHIFT"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
194 case VK_LCONTROL: keyname = "VK_LCONTROL"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
195 case VK_RCONTROL: keyname = "VK_RCONTROL"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
196 /* case VK_LMENU : keyname = "VK_LMENU"; break; */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
197 /* case VK_RMENU : keyname = "VK_RMENU"; break;*/
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
198 default: keyname = "<unknown>"; break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
199 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
200 return keyname;
297
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
201 }
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
202
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
203 char *resolve_keymodifiers( int mask )
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
204 {
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
205 if ( (mask & KC_CTRL) && (mask & KC_SHIFT) && (mask & KC_ALT) )
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
206 return "KC_CTRL KC_SHIFT KC_ALT";
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
207 else if ( (mask & KC_CTRL) && (mask & KC_SHIFT) )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
208 return "KC_CTRL KC_SHIFT";
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
209 else if ( (mask & KC_CTRL) && (mask & KC_ALT) )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
210 return "KC_CTRL KC_ALT";
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
211 else if ( (mask & KC_SHIFT) && (mask & KC_ALT) )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
212 return "KC_SHIFT KC_ALT";
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
213 else if ( (mask & KC_SHIFT) )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
214 return "KC_SHIFT";
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
215 else if ( (mask & KC_CTRL) )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
216 return "KC_CTRL";
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
217 else if ( (mask & KC_ALT) )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
218 return "KC_ALT";
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
219 else return "none";
297
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
220 }
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
221
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
222 /* 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
223 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
224 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
225 HPIXMAP hpm;
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
226 unsigned long width,height;
254
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
227
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
228 if ( hwnd == textbox1 )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
229 hpm = text1pm;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
230 else if ( hwnd == textbox2 )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
231 hpm = text2pm;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
232 else
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
233 return TRUE;
254
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
234
774
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
235 width = (int)DW_PIXMAP_WIDTH(hpm);
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
236 height = (int)DW_PIXMAP_HEIGHT(hpm);
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
237
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
238 dw_pixmap_bitblt(hwnd, NULL, 0, 0, (int)width, (int)height, 0, hpm, 0, 0 );
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
239 dw_flush();
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
240 return TRUE;
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
241 }
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
242
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
243 void read_file( void )
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
244 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
245 int i,len;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
246 fp = fopen( current_file, "r" );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
247 lp = (char **)calloc( 1000,sizeof(char *));
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
248 /* should test for out of memory */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
249 max_linewidth=0;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
250 for ( i = 0; i < 1000; i++ )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
251 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
252 lp[i] = (char *)calloc(1, 1025);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
253 if ( fgets( lp[i], 1024, fp ) == NULL )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
254 break;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
255 len = strlen( lp[i] );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
256 if ( len > max_linewidth )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
257 max_linewidth = len;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
258 if ( lp[i][len - 1] == '\n' )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
259 lp[i][len - 1] = '\0';
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
260 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
261 num_lines = i;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
262 fclose( fp );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
263 dw_scrollbar_set_range(hscrollbar, max_linewidth, cols);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
264 dw_scrollbar_set_pos(hscrollbar, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
265 dw_scrollbar_set_range(vscrollbar, num_lines, rows);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
266 dw_scrollbar_set_pos(vscrollbar, 0);
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
267 }
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
268
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
269 void draw_file( int row, int col )
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
270 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
271 char buf[10];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
272 int i,y,fileline;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
273 char *pLine;
226
2aee0b23e880 Removed unnecessary fprintf() statements.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 225
diff changeset
274
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
275 if ( current_file )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
276 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
277 dw_color_foreground_set(DW_CLR_WHITE);
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
278 dw_draw_rect(0, text1pm, TRUE, 0, 0, (int)DW_PIXMAP_WIDTH(text1pm), (int)DW_PIXMAP_HEIGHT(text1pm));
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
279 dw_draw_rect(0, text2pm, TRUE, 0, 0, (int)DW_PIXMAP_WIDTH(text2pm), (int)DW_PIXMAP_HEIGHT(text2pm));
380
fcb52d773ed2 Implement tests for setting background color on render boxes.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 378
diff changeset
280
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
281 for ( i = 0;(i < rows) && (i+row < num_lines); i++)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
282 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
283 fileline = i + row - 1;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
284 y = i*font_height;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
285 dw_color_background_set( 1 + (fileline % 15) );
893
39ab47d103c3 Fix for invalid data being passed to dw_color_foreground_set() on the first line of the file.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 864
diff changeset
286 dw_color_foreground_set( fileline < 0 ? DW_CLR_WHITE : fileline % 16 );
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
287 sprintf( buf, "%6.6d", i+row );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
288 dw_draw_text( 0, text1pm, 0, y, buf);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
289 pLine = lp[i+row];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
290 dw_draw_text( 0, text2pm, 0, y, pLine+col );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
291 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
292 text_expose( textbox1, NULL, NULL);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
293 text_expose( textbox2, NULL, NULL);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
294 }
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
295 }
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
296
566
f6de197ecbe9 Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 531
diff changeset
297
f6de197ecbe9 Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 531
diff changeset
298 int DWSIGNAL colorchoose_callback(HWND window, void *data)
f6de197ecbe9 Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 531
diff changeset
299 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
300 current_color = dw_color_choose(current_color);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
301 return FALSE;
566
f6de197ecbe9 Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 531
diff changeset
302 }
f6de197ecbe9 Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 531
diff changeset
303
391
2059f18e9c20 Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 385
diff changeset
304 int DWSIGNAL cursortoggle_callback(HWND window, void *data)
2059f18e9c20 Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 385
diff changeset
305 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
306 if(cursor_arrow)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
307 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
308 dw_window_set_text((HWND)cursortogglebutton,"Set Cursor pointer - ARROW");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
309 dw_window_set_pointer((HWND)data,DW_POINTER_CLOCK);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
310 cursor_arrow = 0;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
311 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
312 else
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
313 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
314 dw_window_set_text((HWND)cursortogglebutton,"Set Cursor pointer - CLOCK");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
315 dw_window_set_pointer((HWND)data,DW_POINTER_DEFAULT);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
316 cursor_arrow = 1;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
317 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
318 return FALSE;
391
2059f18e9c20 Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 385
diff changeset
319 }
2059f18e9c20 Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 385
diff changeset
320
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
321 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
322 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
323 dw_timer_disconnect( timerid );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
324 return TRUE;
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
325 }
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
326
267
bf8b907f8a29 Added initial version of updated key_press_event callback.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 266
diff changeset
327 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
328 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
329 char tmpbuf[100];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
330 if ( ch )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
331 sprintf( tmpbuf, "Key: %c(%d) Modifiers: %s(%d)", ch, ch, resolve_keymodifiers(state), state );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
332 else
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
333 sprintf( tmpbuf, "Key: %s(%d) Modifiers: %s(%d)", resolve_keyname(vk), vk, resolve_keymodifiers(state), state );
897
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
334 dw_window_set_text( status, tmpbuf);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
335 return 0;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
336 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
337
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
338 int DWSIGNAL menu_callback(HWND window, void *data)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
339 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
340 char buf[100];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
341
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
342 sprintf( buf, "%s menu item selected", (char *)data );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
343 dw_messagebox( "Menu Item Callback", DW_MB_OK | DW_MB_INFORMATION, buf );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
344 return 0;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
345 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
346
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
347 int DWSIGNAL menutoggle_callback(HWND window, void *data)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
348 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
349 if ( menu_enabled )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
350 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
351 dw_menu_item_set_state( changeable_menu, CHECKABLE_MENUITEMID, DW_MIS_DISABLED );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
352 dw_menu_item_set_state( changeable_menu, NONCHECKABLE_MENUITEMID, DW_MIS_DISABLED );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
353 menu_enabled = 0;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
354 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
355 else
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
356 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
357 dw_menu_item_set_state( changeable_menu, CHECKABLE_MENUITEMID, DW_MIS_ENABLED );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
358 dw_menu_item_set_state( changeable_menu, NONCHECKABLE_MENUITEMID, DW_MIS_ENABLED );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
359 menu_enabled = 1;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
360 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
361 return 0;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
362 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
363
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
364 int DWSIGNAL helpabout_callback(HWND window, void *data)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
365 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
366 char buf[100];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
367 DWEnv env;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
368
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
369 dw_environment_query(&env);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
370 sprintf( buf, "dwindows test\n\nOS: %s %s %s Version: %d.%d.%d.%d\n\ndwindows Version: %d.%d.%d",
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
371 env.osName, env.buildDate, env.buildTime,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
372 env.MajorVersion, env.MinorVersion, env.MajorBuild, env.MinorBuild,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
373 env.DWMajorVersion, env.DWMinorVersion, env.DWSubVersion );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
374 dw_messagebox( "About dwindows", DW_MB_OK | DW_MB_INFORMATION, buf );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
375 return 0;
254
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
376 }
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
377
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
378 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
379 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
380 dw_window_destroy((HWND)data);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
381 exit(0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
382 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
383 }
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
384
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
385 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
386 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
387 dw_window_destroy((HWND)data);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
388 if ( current_file )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
389 dw_free( current_file );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
390 exit(0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
391 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
392 }
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
393
905
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
394 int DWSIGNAL browse_file_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
395 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
396 char *tmp;
905
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
397 tmp = dw_file_browse("Pick a file", ".", "c", DW_FILE_OPEN );
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
398 if ( tmp )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
399 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
400 if ( current_file )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
401 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
402 dw_free( current_file );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
403 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
404 current_file = tmp;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
405 dw_window_set_text( entryfield, current_file );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
406 read_file();
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
407 draw_file(0,0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
408 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
409 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
410 }
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
905
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
412 int DWSIGNAL browse_folder_callback(HWND window, void *data)
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
413 {
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
414 char *tmp = dw_file_browse("Pick a folder", ".", "c", DW_DIRECTORY_OPEN );
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
415 printf("Folder picked: %s\n", tmp ? tmp : "None");
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
416 return 0;
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
417 }
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
418
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
419 int DWSIGNAL button_callback(HWND window, void *data)
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
420 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
421 unsigned int y,m,d;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
422 unsigned int idx;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
423 int len;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
424 long spvalue;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
425 char buf1[100];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
426 char buf2[100];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
427 char buf3[500];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
428
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
429 idx = dw_listbox_selected( combobox1 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
430 dw_listbox_get_text( combobox1, idx, buf1, 99 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
431 idx = dw_listbox_selected( combobox2 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
432 dw_listbox_get_text( combobox2, idx, buf2, 99 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
433 dw_calendar_get_date( cal, &y, &m, &d );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
434 spvalue = dw_spinbutton_get_pos( spinbutton );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
435 len = sprintf( buf3, "spinbutton: %ld\ncombobox1: \"%s\"\ncombobox2: \"%s\"\ncalendar: %d-%d-%d",
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
436 spvalue,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
437 buf1, buf2,
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
438 y, m, d );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
439 dw_messagebox( "Values", DW_MB_OK | DW_MB_INFORMATION, buf3 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
440 dw_clipboard_set_text( buf3, len );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
441 return 0;
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
442 }
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
443
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
444 int DWSIGNAL redraw_button_box_callback(HWND window, void *data)
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
445 {
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
446 #if 0
634
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
447
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
448 long x, y, width, height;
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
449 dw_window_get_pos_size(filetoolbarbox , &x, &y, &width, &height);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
450 dw_window_destroy( filetoolbarbox );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
451 create_button(1);
634
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
452 dw_window_set_pos_size(filetoolbarbox, x, y, width, height);
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
453 #else
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
454 dw_window_enable( window);
636
f6f887d2c5aa Add _dw_log() internal logging function
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 634
diff changeset
455 dw_window_destroy( noncheckable_menuitem );
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
456 #endif
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
457 return 0;
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
458 }
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
459
634
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
460 int DWSIGNAL change_color_red_callback(HWND window, void *data)
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
461 {
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
462 dw_window_set_color(buttonsbox, DW_CLR_RED, DW_CLR_RED);
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
463 return 0;
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
464 }
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
465
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
466 int DWSIGNAL change_color_yellow_callback(HWND window, void *data)
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
467 {
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
468 dw_window_set_color(buttonsbox, DW_CLR_YELLOW, DW_CLR_YELLOW);
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
469 return 0;
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
470 }
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
471
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
472
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
473 /* Callback to handle user selection of the scrollbar position */
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
474 void DWSIGNAL scrollbar_valuechanged_callback(HWND hwnd, int value, void *data)
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
475 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
476 if(data)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
477 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
478 HWND stext = (HWND)data;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
479 char tmpbuf[100];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
480 if ( hwnd == vscrollbar )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
481 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
482 current_row = value;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
483 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
484 else
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
485 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
486 current_col = value;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
487 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
488 sprintf(tmpbuf, "Row:%d Col:%d Lines:%d Cols:%d", current_row,current_col,num_lines,max_linewidth);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
489 dw_window_set_text(stext, tmpbuf);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
490 draw_file( current_row, current_col);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
491 }
217
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
492 }
7112c817573d Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 213
diff changeset
493
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
494 /* Callback to handle user selection of the spinbutton position */
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
495 void DWSIGNAL spinbutton_valuechanged_callback(HWND hwnd, int value, void *data)
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
496 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
497 dw_messagebox("DWTest", DW_MB_OK, "New value from spinbutton: %d\n", value);
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
498 }
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
499
627
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
500 /* Callback to handle user selection of the slider position */
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
501 void DWSIGNAL slider_valuechanged_callback(HWND hwnd, int value, void *data)
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
502 {
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
503 dw_messagebox("DWTest", DW_MB_OK, "New value from slider: %d\n", value);
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
504 }
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
505
218
fe0ab0040ba2 Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 217
diff changeset
506 /* 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
507 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
508 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
509 HPIXMAP old1 = text1pm, old2 = text2pm;
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
510 unsigned long depth = dw_color_depth_get();
222
7bb6cb6f612c Another minor change... create the first pixmap to the correct window
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 221
diff changeset
511
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
512 rows = height / font_height;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
513 cols = width / font_width;
218
fe0ab0040ba2 Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 217
diff changeset
514
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
515 /* Create new pixmaps with the current sizes */
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
516 text1pm = dw_pixmap_new(textbox1, (unsigned long)(font_width*(width1)), (unsigned long)height, (int)depth);
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
517 text2pm = dw_pixmap_new(textbox2, (unsigned long)width, (unsigned long)height, (int)depth);
218
fe0ab0040ba2 Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 217
diff changeset
518
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
519 /* Destroy the old pixmaps */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
520 dw_pixmap_destroy(old1);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
521 dw_pixmap_destroy(old2);
218
fe0ab0040ba2 Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 217
diff changeset
522
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
523 /* Update scrollbar ranges with new values */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
524 dw_scrollbar_set_range(hscrollbar, max_linewidth, cols);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
525 dw_scrollbar_set_range(vscrollbar, num_lines, rows);
218
fe0ab0040ba2 Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 217
diff changeset
526
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
527 /* Redraw the window */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
528 draw_file( current_row, current_col);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
529 return TRUE;
218
fe0ab0040ba2 Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 217
diff changeset
530 }
fe0ab0040ba2 Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 217
diff changeset
531
311
24c1dfffe97e Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 310
diff changeset
532 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
533 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
534 char buf[200];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
535 HWND statline = (HWND)data;
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
536
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
537 sprintf(buf,"DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s", (unsigned int)window, text );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
538 dw_window_set_text( statline, buf);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
539 return 0;
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
540 }
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
541
311
24c1dfffe97e Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 310
diff changeset
542 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
543 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
544 char buf[200];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
545 HWND statline = (HWND)data;
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
546
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
547 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 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
548 dw_window_set_text( statline, buf);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
549 return 0;
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
550 }
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
551
311
24c1dfffe97e Unified the callback functions for tree and container widgets.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 310
diff changeset
552 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
553 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
554 char buf[200];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
555 HWND statline = (HWND)data;
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
556
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
557 sprintf(buf,"DW_SIGNAL_LIST_SELECT: Window: %d Item: %d", (unsigned int)window, item );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
558 dw_window_set_text( statline, buf);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
559 return 0;
304
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
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
562 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
563 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
564 char buf[200];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
565 HWND statline = (HWND)data;
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
566
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
567 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", (unsigned int)window, (unsigned int)item, text, (unsigned int)itemdata );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
568 dw_window_set_text( statline, buf);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
569 return 0;
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
570 }
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
571
348
fa6aeb52d51a Added MLE for the container page to show what is going on in the item-select
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 346
diff changeset
572 int DWSIGNAL container_select_cb( HWND window, HTREEITEM item, char *text, void *data, void *itemdata )
fa6aeb52d51a Added MLE for the container page to show what is going on in the item-select
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 346
diff changeset
573 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
574 char buf[200];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
575 char *str;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
576 HWND statline = (HWND)data;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
577 unsigned long size;
348
fa6aeb52d51a Added MLE for the container page to show what is going on in the item-select
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 346
diff changeset
578
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
579 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", (unsigned int)window, (unsigned int)item, text, (unsigned int)itemdata );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
580 dw_window_set_text( statline, buf);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
581 sprintf(buf,"\r\nDW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x\r\n", (unsigned int)window, (unsigned int)item, text, (unsigned int)itemdata );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
582 mle_point = dw_mle_import( container_mle, buf, mle_point);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
583 str = dw_container_query_start(container, DW_CRA_SELECTED);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
584 while(str)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
585 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
586 sprintf(buf,"Selected: %s\r\n", str);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
587 mle_point = dw_mle_import( container_mle, buf, mle_point);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
588 str = dw_container_query_next(container, DW_CRA_SELECTED);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
589 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
590 /* Make the last inserted point the cursor location */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
591 dw_mle_set_cursor(container_mle, mle_point);
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
592 /* set the details of item 0 to new data */
508
078a40ba2e41 Added dw_container_get_column_type and dw_filesystem_get_column_type.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 503
diff changeset
593 fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)fileicon);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
594 dw_filesystem_change_file(container, 0, "new data", fileicon);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
595 size = 999;
508
078a40ba2e41 Added dw_container_get_column_type and dw_filesystem_get_column_type.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 503
diff changeset
596 fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)fileicon);
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
597 dw_filesystem_change_item(container, 1, 0, &size);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
598 return 0;
348
fa6aeb52d51a Added MLE for the container page to show what is going on in the item-select
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 346
diff changeset
599 }
fa6aeb52d51a Added MLE for the container page to show what is going on in the item-select
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 346
diff changeset
600
346
81fae15885d7 Implemented switch-page on OS/2, and changed the signal prototype to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 336
diff changeset
601 int DWSIGNAL switch_page_cb( HWND window, unsigned long page_num, void *itemdata )
333
b6491cefa512 Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 328
diff changeset
602 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
603 FILE *fp=fopen("log","a");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
604 fprintf(fp,"DW_SIGNAL_SWITCH_PAGE: Window: %x PageNum: %u Itemdata: %x\n", (unsigned int)window, (unsigned int)page_num, (unsigned int)itemdata );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
605 fclose(fp);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
606 return 0;
333
b6491cefa512 Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 328
diff changeset
607 }
b6491cefa512 Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 328
diff changeset
608
474
053211e0698b Add tracing code for column-click signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 459
diff changeset
609 int DWSIGNAL column_click_cb( HWND window, int column_num, void *data )
053211e0698b Add tracing code for column-click signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 459
diff changeset
610 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
611 char buf[200], buf1[100];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
612 HWND statline = (HWND)data;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
613 int column_type;
474
053211e0698b Add tracing code for column-click signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 459
diff changeset
614
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
615 if(column_num == 0)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
616 strcpy(buf1,"Filename");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
617 else
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
618 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
619 column_type = dw_filesystem_get_column_type( window, column_num-1 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
620 if( column_type == DW_CFA_STRING)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
621 strcpy(buf1,"String");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
622 else if( column_type == DW_CFA_ULONG)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
623 strcpy(buf1,"ULong");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
624 else if( column_type == DW_CFA_DATE)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
625 strcpy(buf1,"Date");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
626 else if( column_type == DW_CFA_TIME)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
627 strcpy(buf1,"Time");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
628 else if( column_type == DW_CFA_BITMAPORICON)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
629 strcpy(buf1,"BitmapOrIcon");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
630 else
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
631 strcpy(buf1,"Unknown");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
632 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
633 sprintf(buf,"DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Type: %s Itemdata: %x", (unsigned int)window, column_num, buf1, (unsigned int)data );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
634 dw_window_set_text( statline, buf);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
635 return 0;
474
053211e0698b Add tracing code for column-click signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 459
diff changeset
636 }
053211e0698b Add tracing code for column-click signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 459
diff changeset
637
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
638 int DWSIGNAL combobox_select_event_callback(HWND window, int index)
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
639 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
640 fprintf(stderr,"got combobox_select_event for index: %d, iteration: %d\n", index, iteration++);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
641 return FALSE;
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
642 }
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
643
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
644 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
645 {
905
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
646 HWND browsefilebutton, browsefolderbutton, 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
647
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
648 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
649
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
650 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
651
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
652 /* Archive Name */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
653 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
654
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
655 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
656
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
657 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
658
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
659 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
660
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
661 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
662
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
663 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
664
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
665 dw_entryfield_set_limit(entryfield, 260);
308
f844a07c5915 Get it working on OS/2. :)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 305
diff changeset
666
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
667 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
668
905
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
669 browsefilebutton = dw_button_new("Browse File", 1001L);
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
670
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
671 dw_box_pack_start(browsebox, browsefilebutton, 40, 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
672
905
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
673 browsefolderbutton = dw_button_new("Browse Folder", 1001L);
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
674
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
675 dw_box_pack_start(browsebox, browsefolderbutton, 40, 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
676
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
677 dw_window_set_color(browsebox, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
678 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
679
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
680 /* Buttons */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
681 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
682
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
683 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
684
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
685 cursortogglebutton = dw_button_new("Set Cursor pointer - CLOCK", 1003L);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
686 dw_box_pack_start(buttonbox, cursortogglebutton, 130, 30, TRUE, TRUE, 2);
391
2059f18e9c20 Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 385
diff changeset
687
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
688 colorchoosebutton = dw_button_new("Color Chooser Dialog", 1004L);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
689 dw_box_pack_start(buttonbox, colorchoosebutton, 130, 30, TRUE, TRUE, 2);
566
f6de197ecbe9 Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 531
diff changeset
690
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
691 okbutton = dw_button_new("Turn Off Annoying Beep!", 1001L);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
692 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
693
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
694 cancelbutton = dw_button_new("Exit", 1002L);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
695 dw_box_pack_start(buttonbox, cancelbutton, 130, 30, TRUE, TRUE, 2);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
696 dw_window_click_default( mainwindow, cancelbutton );
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
697
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
698 /* Set some nice fonts and colors */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
699 dw_window_set_color(lbbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
700 dw_window_set_color(buttonbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
701 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
702
905
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
703 dw_signal_connect(browsefilebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_file_callback), (void *)notebookbox1);
ae5d884af4ed Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 897
diff changeset
704 dw_signal_connect(browsefolderbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_folder_callback), (void *)notebookbox1);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
705 dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(beep_callback), (void *)notebookbox1);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
706 dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
707 dw_signal_connect(cursortogglebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(cursortoggle_callback), (void *)mainwindow);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
708 dw_signal_connect(colorchoosebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(colorchoose_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
709 }
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
710
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
711
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
712 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
713 {
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
714 unsigned long depth = dw_color_depth_get();
897
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
715 HWND vscrollbox,hbox,spin1,button1;
213
f8b50901ac45 Added verticle scrollbar test to the sample.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 207
diff changeset
716
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
717 /* create a box to pack into the notebook page */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
718 pagebox = dw_box_new(BOXHORZ, 2);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
719 dw_box_pack_start( notebookbox2, pagebox, 0, 0, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
720 /* now a status area under this box */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
721 status = dw_status_text_new("", 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
722 dw_box_pack_start( notebookbox2, status, 100, 20, TRUE, FALSE, 1);
897
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
723 /* a box with combobox and button */
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
724 hbox = dw_box_new(BOXHORZ, 1 );
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
725 dw_box_pack_start( notebookbox2, hbox, 100, 20, TRUE, FALSE, 1);
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
726 button1 = dw_button_new( "Does nothing", 1223L );
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
727 dw_box_pack_start( hbox, button1, 100, 20, TRUE, FALSE, 0);
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
728 spin1 = dw_spinbutton_new( "", 0 );
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
729 dw_box_pack_start( hbox, spin1, 100, 20, TRUE, FALSE, 0);
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
730 dw_spinbutton_set_limits( spin1, 100, 1 );
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
731 dw_spinbutton_set_pos( spin1, 1 );
213
f8b50901ac45 Added verticle scrollbar test to the sample.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 207
diff changeset
732
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
733 /* create render box for number pixmap */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
734 textbox1 = dw_render_new( 100 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
735 dw_window_set_font(textbox1, FIXEDFONT);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
736 dw_font_text_extents_get(textbox1, NULL, "(g", &font_width, &font_height);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
737 font_width = font_width / 2;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
738 vscrollbox = dw_box_new(BOXVERT, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
739 dw_box_pack_start(vscrollbox, textbox1, font_width*width1, font_height*rows, FALSE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
740 dw_box_pack_start(vscrollbox, 0, (font_width*(width1+1)), SCROLLBARWIDTH, FALSE, FALSE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
741 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
742
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
743 /* pack empty space 1 character wide */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
744 dw_box_pack_start(pagebox, 0, font_width, 0, FALSE, TRUE, 0);
380
fcb52d773ed2 Implement tests for setting background color on render boxes.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 378
diff changeset
745
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
746 /* create box for filecontents and horz scrollbar */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
747 textboxA = dw_box_new( BOXVERT,0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
748 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
749
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
750 /* create render box for filecontents pixmap */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
751 textbox2 = dw_render_new( 101 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
752 dw_box_pack_start( textboxA, textbox2, 10, 10, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
753 dw_window_set_font(textbox2, FIXEDFONT);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
754 /* create horizonal scrollbar */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
755 hscrollbar = dw_scrollbar_new(FALSE, 50);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
756 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
757
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
758 /* create vertical scrollbar */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
759 vscrollbox = dw_box_new(BOXVERT, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
760 vscrollbar = dw_scrollbar_new(TRUE, 50);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
761 dw_box_pack_start(vscrollbox, vscrollbar, SCROLLBARWIDTH, 100, FALSE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
762 /* Pack an area of empty space 14x14 pixels */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
763 dw_box_pack_start(vscrollbox, 0, SCROLLBARWIDTH, SCROLLBARWIDTH, FALSE, FALSE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
764 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
765
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
766 text1pm = dw_pixmap_new( textbox1, font_width*width1, font_height*rows, depth );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
767 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
768
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
769 dw_messagebox("DWTest", DW_MB_OK|DW_MB_INFORMATION, "Width: %d Height: %d\n", font_width, font_height);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
770 dw_draw_rect(0, text1pm, TRUE, 0, 0, font_width*width1, font_height*rows);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
771 dw_draw_rect(0, text2pm, TRUE, 0, 0, font_width*cols, font_height*rows);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
772 dw_signal_connect(textbox1, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
773 dw_signal_connect(textbox2, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
774 dw_signal_connect(textbox2, DW_SIGNAL_CONFIGURE, DW_SIGNAL_FUNC(configure_event), text2pm);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
775 dw_signal_connect(hscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged_callback), (void *)status);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
776 dw_signal_connect(vscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged_callback), (void *)status);
297
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
777
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
778 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
779 }
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
780
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
781 void tree_add(void)
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
782 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
783 HTREEITEM t1,t2,t3,t4,t5,t6;
845
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
784 HWND listbox;
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
785
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
786 /* create a box to pack into the notebook page */
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
787 listbox = dw_listbox_new(1024, TRUE);
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
788 dw_box_pack_start( notebookbox3, listbox, 500, 200, TRUE, TRUE, 0);
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
789 dw_listbox_append(listbox, "Test 1");
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
790 dw_listbox_append(listbox, "Test 2");
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
791 dw_listbox_append(listbox, "Test 3");
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
792 dw_listbox_append(listbox, "Test 4");
7331b7c9f1c9 Added listbox to the tree page... to test the tree view support...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 832
diff changeset
793 dw_listbox_append(listbox, "Test 5");
254
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
794
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
795 /* create a box to pack into the notebook page */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
796 treebox = dw_box_new(BOXHORZ, 2);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
797 dw_box_pack_start( notebookbox3, treebox, 500, 200, TRUE, TRUE, 0);
254
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
798
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
799 /* now a tree area under this box */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
800 tree = dw_tree_new(101);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
801 dw_box_pack_start( notebookbox3, tree, 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
802
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
803 /* and a status area to see whats going on */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
804 tree_status = dw_status_text_new("", 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
805 dw_box_pack_start( notebookbox3, tree_status, 100, 20, TRUE, FALSE, 1);
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
806
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
807 foldericon = dw_icon_load_from_file( FOLDER_ICON_NAME );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
808 fileicon = dw_icon_load_from_file( FILE_ICON_NAME );
297
5414d3d582e4 Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 293
diff changeset
809
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
810 /* set up our signal trappers... */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
811 dw_signal_connect(tree, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), (void *)tree_status);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
812 dw_signal_connect(tree, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(item_select_cb), (void *)tree_status);
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
813
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
814 t1 = dw_tree_insert(tree, "tree folder 1", foldericon, NULL, (void *)1 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
815 t2 = dw_tree_insert(tree, "tree folder 2", foldericon, NULL, (void *)2 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
816 t3 = dw_tree_insert(tree, "tree file 1", fileicon, t1, (void *)3 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
817 t4 = dw_tree_insert(tree, "tree file 2", fileicon, t1, (void *)4 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
818 t5 = dw_tree_insert(tree, "tree file 3", fileicon, t2, (void *)5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
819 t6 = dw_tree_insert(tree, "tree file 4", fileicon, t2, (void *)6 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
820 /* set the folder name and icon again to show error with dw_tree_item_change under GTK 2.0 */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
821 dw_tree_item_change(tree, t1, "tree folder 1", foldericon );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
822 dw_tree_item_change(tree, t2, "tree folder 2", foldericon );
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
823 }
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
824
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
825 void container_add(void)
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
826 {
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
827 char *titles[4];
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
828 char *names[3];
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
829 char buffer[100];
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
830 unsigned long flags[4] = { DW_CFA_BITMAPORICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR,
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
831 DW_CFA_ULONG | DW_CFA_RIGHT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR,
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
832 DW_CFA_TIME | DW_CFA_CENTER | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR,
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
833 DW_CFA_DATE | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR };
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
834 int z;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
835 CTIME time;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
836 CDATE date;
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
837 unsigned long size;
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
838 HICN thisicon;
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
839
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
840 /* create a box to pack into the notebook page */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
841 containerbox = dw_box_new(BOXHORZ, 2);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
842 dw_box_pack_start( notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0);
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
843
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
844 /* now a container area under this box */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
845 container = dw_container_new(100, TRUE);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
846 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
847
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
848 /* and a status area to see whats going on */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
849 container_status = dw_status_text_new("", 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
850 dw_box_pack_start( notebookbox4, container_status, 100, 20, TRUE, FALSE, 1);
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
851
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
852 titles[0] = "Type";
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
853 titles[1] = "Size";
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
854 titles[2] = "Time";
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
855 titles[3] = "Date";
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
856
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
857 dw_filesystem_setup(container, flags, titles, 4);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
858 containerinfo = dw_container_alloc(container, 3);
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
859
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
860 for(z=0;z<3;z++)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
861 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
862 names[z] = (char *)malloc( 100 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
863 /* yes, there is a memory leak here */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
864 sprintf(names[z],"Don't allocate from stack: Item: %d",z);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
865 size = z*100;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
866 sprintf(buffer, "Filename %d",z+1);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
867 if (z == 0 ) thisicon = foldericon;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
868 else thisicon = fileicon;
508
078a40ba2e41 Added dw_container_get_column_type and dw_filesystem_get_column_type.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 503
diff changeset
869 fprintf(stderr,"Initial: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)thisicon);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
870 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon);
897
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
871 dw_filesystem_set_item(container, containerinfo, 0, z, &thisicon);
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
872 dw_filesystem_set_item(container, containerinfo, 1, z, &size);
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
873
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
874 time.seconds = z+10;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
875 time.minutes = z+10;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
876 time.hours = z+10;
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
877 dw_filesystem_set_item(container, containerinfo, 2, z, &time);
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
878
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
879 date.day = z+10;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
880 date.month = z+10;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
881 date.year = z+2000;
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
882 dw_filesystem_set_item(container, containerinfo, 3, z, &date);
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
883
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
884 dw_container_set_row_title(containerinfo, z, names[z]);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
885 }
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
886
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
887 dw_container_insert(container, containerinfo, 3);
897
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
888
832
37cdfec6d3fa Fix for dw_filesystem_set_file() not working as designed on Windows...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 774
diff changeset
889 containerinfo = dw_container_alloc(container, 1);
37cdfec6d3fa Fix for dw_filesystem_set_file() not working as designed on Windows...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 774
diff changeset
890 dw_filesystem_set_file(container, containerinfo, 0, strdup("Yikes"), foldericon);
37cdfec6d3fa Fix for dw_filesystem_set_file() not working as designed on Windows...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 774
diff changeset
891 size = 324;
864
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
892 dw_filesystem_set_item(container, containerinfo, 0, 0, &foldericon);
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
893 dw_filesystem_set_item(container, containerinfo, 1, 0, &size);
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
894 dw_filesystem_set_item(container, containerinfo, 2, 0, &time);
ca01c7d95b80 Added some sanity checks for a couple of problem functions and default optimized container column width to 16 for image columns.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 845
diff changeset
895 dw_filesystem_set_item(container, containerinfo, 3, 0, &date);
832
37cdfec6d3fa Fix for dw_filesystem_set_file() not working as designed on Windows...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 774
diff changeset
896 dw_container_set_row_title(containerinfo, 0, strdup("Extra"));
897
2b07bf8ed95b Added enterable widget on render tab to test keypress callback
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 893
diff changeset
897
832
37cdfec6d3fa Fix for dw_filesystem_set_file() not working as designed on Windows...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 774
diff changeset
898 dw_container_insert(container, containerinfo, 1);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
899 dw_container_optimize(container);
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
900
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
901 container_mle = dw_mle_new( 111 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
902 dw_box_pack_start( containerbox, container_mle, 500, 200, TRUE, TRUE, 0);
348
fa6aeb52d51a Added MLE for the container page to show what is going on in the item-select
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 346
diff changeset
903
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
904 /* connect our event trappers... */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
905 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), (void *)container_status);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
906 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), (void *)container_status);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
907 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(container_select_cb), (void *)container_status);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
908 dw_signal_connect(container, DW_SIGNAL_COLUMN_CLICK, DW_SIGNAL_FUNC(column_click_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
909 }
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
910
195
b023d363fc09 Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 193
diff changeset
911 /* Beep every second */
b023d363fc09 Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 193
diff changeset
912 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
913 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
914 dw_beep(200, 200);
195
b023d363fc09 Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 193
diff changeset
915
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
916 /* Return TRUE so we get called again */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
917 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
918 }
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
919
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
920
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
921 void buttons_add(void)
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
922 {
672
388f2a48aaae Missed one function to typedef. Fixed errors in the test program and switched to using
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 643
diff changeset
923 HWND abutton1,abutton2,calbox;
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
924 int i;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
925 char **text;
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
926
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
927 /* create a box to pack into the notebook page */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
928 buttonsbox = dw_box_new(BOXVERT, 2);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
929 dw_box_pack_start( notebookbox5, buttonsbox, 25, 200, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
930 dw_window_set_color(buttonsbox, DW_CLR_RED, DW_CLR_RED);
600
d0e1db21e859 Add calendar widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 584
diff changeset
931
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
932 calbox = dw_box_new(DW_HORZ, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
933 dw_box_pack_start(notebookbox5, calbox, 500, 200, TRUE, TRUE, 1);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
934 cal = dw_calendar_new(100);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
935 dw_box_pack_start(calbox, cal, 180, 160, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
936 /*
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
937 dw_calendar_set_date(cal, 2001, 1, 1);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
938 */
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
939 /*
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
940 * Create our file toolbar boxes...
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
941 */
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
942 buttonboxperm = dw_box_new( BOXVERT, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
943 dw_box_pack_start( buttonsbox, buttonboxperm, 25, 0, FALSE, TRUE, 2 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
944 dw_window_set_color(buttonboxperm, DW_CLR_WHITE, DW_CLR_WHITE);
634
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
945 // abutton1 = dw_bitmapbutton_new_from_file( "Top Button", 0, FILE_ICON_NAME );
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
946 abutton1 = dw_bitmapbutton_new_from_file( "Top Button", 0, "z:\\projects\\RexxGd\\regina\\tile_up.png" );
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
947 dw_box_pack_start( buttonboxperm, abutton1, 100, 30, FALSE, FALSE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
948 dw_signal_connect( abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(button_callback), NULL );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
949 dw_box_pack_start( buttonboxperm, 0, 25, 5, FALSE, FALSE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
950 abutton2 = dw_bitmapbutton_new_from_file( "Bottom", 0, FOLDER_ICON_NAME );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
951 dw_box_pack_start( buttonsbox, abutton2, 25, 25, FALSE, FALSE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
952 dw_signal_connect( abutton2, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(button_callback), NULL );
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
953
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
954 create_button(0);
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
955 /* make a combobox */
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
956 combox = dw_box_new(BOXVERT, 2);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
957 dw_box_pack_start( notebookbox5, combox, 25, 200, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
958 combobox1 = dw_combobox_new( "fred", 0 ); /* no point in specifying an initial value */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
959 dw_listbox_append( combobox1, "fred" );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
960 dw_box_pack_start( combox, combobox1, 200, 20, TRUE, FALSE, 0);
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
961 /*
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
962 dw_window_set_text( combobox, "initial value");
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
963 */
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
964 dw_signal_connect( combobox1, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(combobox_select_event_callback), NULL );
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
965 #if 0
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
966 /* add LOTS of items */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
967 fprintf(stderr,"before appending 100 items to combobox using dw_listbox_append()\n");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
968 for( i = 0; i < 100; i++ )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
969 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
970 sprintf( buf, "item %d", i);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
971 dw_listbox_append( combobox1, buf );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
972 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
973 fprintf(stderr,"after appending 100 items to combobox\n");
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
974 #endif
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
975
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
976 combobox2 = dw_combobox_new( "joe", 0 ); /* no point in specifying an initial value */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
977 dw_box_pack_start( combox, combobox2, 200, 20, TRUE, FALSE, 0);
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
978 /*
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
979 dw_window_set_text( combobox, "initial value");
602
489a684af1bb Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 600
diff changeset
980 */
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
981 dw_signal_connect( combobox2, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(combobox_select_event_callback), NULL );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
982 /* add LOTS of items */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
983 fprintf(stderr,"before appending 500 items to combobox using dw_listbox_list_append()\n");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
984 text = (char **)malloc(500*sizeof(char *));
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
985 for( i = 0; i < 500; i++ )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
986 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
987 text[i] = (char *)malloc( 50 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
988 sprintf( text[i], "item %d", i);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
989 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
990 dw_listbox_list_append( combobox2, text, 500 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
991 fprintf(stderr,"after appending 500 items to combobox\n");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
992 for( i = 0; i < 500; i++ )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
993 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
994 free(text[i]);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
995 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
996 free(text);
643
9ab89d89e6b4 Add dw_listview_insert()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 637
diff changeset
997 /* now insert a couple of items */
9ab89d89e6b4 Add dw_listview_insert()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 637
diff changeset
998 dw_listbox_insert( combobox2, "inserted item 2", 2 );
9ab89d89e6b4 Add dw_listview_insert()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 637
diff changeset
999 dw_listbox_insert( combobox2, "inserted item 5", 5 );
627
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1000 /* make a spinbutton */
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1001 spinbutton = dw_spinbutton_new( "", 0 ); /* no point in specifying text */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1002 dw_box_pack_start( combox, spinbutton, 200, 20, TRUE, FALSE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1003 dw_spinbutton_set_limits( spinbutton, 100, 1 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1004 dw_spinbutton_set_pos( spinbutton, 30 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1005 dw_signal_connect( spinbutton, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(spinbutton_valuechanged_callback), NULL );
627
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1006 /* make a slider */
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1007 slider = dw_slider_new( FALSE, 10, 0 ); /* no point in specifying text */
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1008 dw_box_pack_start( combox, slider, 200, 20, TRUE, FALSE, 0);
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1009 dw_signal_connect( slider, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(slider_valuechanged_callback), NULL );
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1010 }
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1011
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1012 void create_button( int redraw)
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1013 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1014 HWND abutton1;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1015 filetoolbarbox = dw_box_new( BOXVERT, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1016 dw_box_pack_start( buttonboxperm, filetoolbarbox, 0, 0, TRUE, TRUE, 0 );
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1017
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1018 abutton1 = dw_bitmapbutton_new_from_file( "Should be under Top button", 0, "junk" );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1019 dw_box_pack_start( filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0);
634
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
1020 dw_signal_connect( abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(change_color_red_callback), NULL );
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1021 dw_box_pack_start( filetoolbarbox, 0, 25, 5, FALSE, FALSE, 0 );
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1022
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1023 abutton1 = dw_bitmapbutton_new_from_file( "Should be under Top button", 0, "junk" );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1024 dw_box_pack_start( filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0);
634
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
1025 dw_signal_connect( abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(change_color_yellow_callback), NULL );
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1026 dw_box_pack_start( filetoolbarbox, 0, 25, 5, FALSE, FALSE, 0 );
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1027
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1028 abutton1 = dw_bitmapbutton_new_from_file( "Should be under Top button", 0, "junk" );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1029 dw_box_pack_start( filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1030 dw_signal_connect( abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(redraw_button_box_callback), NULL );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1031 dw_box_pack_start( filetoolbarbox, 0, 25, 5, FALSE, FALSE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1032 if ( redraw )
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1033 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1034 dw_window_redraw( filetoolbarbox );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1035 dw_window_redraw( mainwindow );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1036 }
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1037 }
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1038
515
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1039 void mdi_add(void)
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1040 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1041 HWND mdibox, mdi, mdi1w, mdi1box, ef, mdi2w, mdi2box, bb;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1042
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1043 /* create a box to pack into the notebook page */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1044 mdibox = dw_box_new(DW_HORZ, 0);
515
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1045
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1046 dw_box_pack_start(notebookbox6, mdibox, 500, 200, TRUE, TRUE, 1);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1047
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1048 /* now a mdi under this box */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1049 mdi = dw_mdi_new(333);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1050 dw_box_pack_start(mdibox, mdi, 500, 200, TRUE, TRUE, 2);
515
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1051
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1052 mdi1w = dw_window_new(mdi, "MDI1", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1053 mdi1box = dw_box_new(DW_HORZ, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1054 dw_box_pack_start(mdi1w, mdi1box, 0, 0, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1055 ef = dw_entryfield_new("", 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1056 dw_box_pack_start(mdi1box, ef, 100, 20, FALSE, FALSE, 4);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1057 dw_window_set_size(mdi1w, 200, 100);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1058 dw_window_show(mdi1w);
515
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1059
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1060 mdi2w = dw_window_new(mdi, "MDI2", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1061 mdi2box = dw_box_new(DW_HORZ, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1062 dw_box_pack_start(mdi2w, mdi2box, 0, 0, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1063 ef = dw_entryfield_new( "", 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1064 dw_box_pack_start(mdi2box, ef, 150, 30, FALSE, FALSE, 4);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1065 bb = dw_button_new("Browse", 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1066 dw_box_pack_start(mdi2box, bb, 60, 30, FALSE, FALSE, 4);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1067 dw_window_set_size(mdi2w, 200, 200);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1068 dw_window_show(mdi2w);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1069 }
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1070
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1071 void menu_add(void)
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1072 {
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1073 HMENUI menuitem,menu;
515
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1074
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1075 mainmenubar = dw_menubar_new( mainwindow );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1076 /* add menus to the menubar */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1077 menu = dw_menu_new( 0 );
637
9fa3cb5b3290 Bring OS/2 functionality up to latest
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 636
diff changeset
1078 menuitem = dw_menu_append_item( menu, "~Quit", 1019, 0, TRUE, FALSE, 0 );
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1079 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1080 /*
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1081 * Add the "File" menu to the menubar...
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1082 */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1083 dw_menu_append_item( mainmenubar, "~File", 1010, 0, TRUE, FALSE, menu );
515
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1084
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1085 changeable_menu = dw_menu_new( 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1086 checkable_menuitem = dw_menu_append_item( changeable_menu, "~Checkable Menu Item", CHECKABLE_MENUITEMID, 0, TRUE, TRUE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1087 dw_signal_connect( checkable_menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menu_callback), (void *)"checkable");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1088 noncheckable_menuitem = dw_menu_append_item( changeable_menu, "~Non-checkable Menu Item", NONCHECKABLE_MENUITEMID, 0, TRUE, FALSE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1089 dw_signal_connect( noncheckable_menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menu_callback), (void *)"non-checkable");
621
46c261153aa4 Remove embedded XPM.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 620
diff changeset
1090 menuitem = dw_menu_append_item( changeable_menu, "~Disabled menu Item", 2003, DW_MIS_DISABLED|DW_MIS_CHECKED, TRUE, TRUE, 0 );
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1091 /* seperator */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1092 dw_menu_append_item( changeable_menu, DW_MENU_SEPARATOR, 3999, 0, TRUE, FALSE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1093 menuitem = dw_menu_append_item( changeable_menu, "~Menu Items Disabled", 2009, 0, TRUE, TRUE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1094 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menutoggle_callback), (void *)NULL);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1095 /*
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1096 * Add the "Menu" menu to the menubar...
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1097 */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1098 dw_menu_append_item( mainmenubar, "~Menu", 1020, 0, TRUE, FALSE, changeable_menu );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1099
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1100 menu = dw_menu_new( 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1101 menuitem = dw_menu_append_item( menu, "~About", 1091, 0, TRUE, FALSE, 0 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1102 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(helpabout_callback), (void *)mainwindow);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1103 /*
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1104 * Add the "Help" menu to the menubar...
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1105 */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1106 dw_menu_append_item( mainmenubar, "~Help", 1090, 0, TRUE, FALSE, menu );
515
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1107 }
c3c5d8e36aa3 Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 514
diff changeset
1108
774
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1109 int DWSIGNAL scrollbox_button_callback(HWND window, void *data)
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1110 {
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1111 int pos, range;
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1112
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1113 pos = dw_scrollbox_get_pos( scrollbox, DW_VERT );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1114 range = dw_scrollbox_get_range( scrollbox, DW_VERT );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1115 fprintf( stderr, "Pos %d Range %d\n", pos, range );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1116 return 0;
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1117 }
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1118
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1119 void scrollbox_add(void)
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1120 {
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1121 HWND tmpbox,abutton1;
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1122 char buf[100];
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1123 int i;
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1124
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1125 /* create a box to pack into the notebook page */
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1126 scrollbox = dw_scrollbox_new(DW_VERT, 0);
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1127 dw_box_pack_start(notebookbox8, scrollbox, 0, 0, TRUE, TRUE, 1);
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1128
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1129 abutton1 = dw_button_new( "Show Adjustments", 0 );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1130 dw_box_pack_start( scrollbox, abutton1, 100, 30, FALSE, FALSE, 0 );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1131 dw_signal_connect( abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(scrollbox_button_callback), NULL );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1132
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1133 for ( i = 0; i < MAX_WIDGETS; i++ )
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1134 {
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1135 tmpbox = dw_box_new( DW_HORZ, 0 );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1136 dw_box_pack_start( scrollbox, tmpbox, 0, 24, TRUE, FALSE, 2);
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1137 sprintf( buf, "Label %d", i );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1138 labelarray[i] = dw_text_new( buf , 0 );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1139 dw_box_pack_start( tmpbox, labelarray[i], 0, 20, TRUE, FALSE, 0);
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1140 sprintf( buf, "Entry %d", i );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1141 entryarray[i] = dw_entryfield_new( buf , i );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1142 dw_box_pack_start( tmpbox, entryarray[i], 0, 20, TRUE, FALSE, 0);
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1143 }
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1144 }
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1145
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
1146 /*
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
1147 * 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
1148 */
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
1149 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
1150 {
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1151 ULONG notebookpage1;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1152 ULONG notebookpage2;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1153 ULONG notebookpage3;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1154 ULONG notebookpage4;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1155 ULONG notebookpage5;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1156 ULONG notebookpage6;
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1157 ULONG notebookpage7;
774
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1158 ULONG notebookpage8;
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
1159
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1160 dw_init(TRUE, argc, argv);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1161
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1162 mainwindow = dw_window_new( HWND_DESKTOP, "dwindows test", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1163 dw_window_set_icon(mainwindow, fileicon);
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
1164
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1165 notebookbox = dw_box_new( BOXVERT, 5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1166 dw_box_pack_start( mainwindow, notebookbox, 0, 0, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1167 /* MUST pack a box into the mainwindow BEFORE adding menus */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1168 menu_add();
195
b023d363fc09 Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 193
diff changeset
1169
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1170 notebook = dw_notebook_new( 1, TRUE );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1171 dw_box_pack_start( notebookbox, notebook, 100, 100, TRUE, TRUE, 0);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1172 dw_signal_connect(notebook, DW_SIGNAL_SWITCH_PAGE, DW_SIGNAL_FUNC(switch_page_cb), NULL);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1173
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1174 notebookbox1 = dw_box_new( BOXVERT, 5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1175 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1176 dw_notebook_pack( notebook, notebookpage1, notebookbox1 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1177 dw_notebook_page_set_text( notebook, notebookpage1, "buttons and entry");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1178 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
1179
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1180 notebookbox2 = dw_box_new( BOXVERT, 5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1181 notebookpage2 = dw_notebook_page_new( notebook, 1, FALSE );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1182 dw_notebook_pack( notebook, notebookpage2, notebookbox2 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1183 dw_notebook_page_set_text( notebook, notebookpage2, "render");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1184 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
1185
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1186 notebookbox3 = dw_box_new( BOXVERT, 5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1187 notebookpage3 = dw_notebook_page_new( notebook, 1, FALSE );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1188 dw_notebook_pack( notebook, notebookpage3, notebookbox3 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1189 dw_notebook_page_set_text( notebook, notebookpage3, "tree");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1190 tree_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
1191
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1192 notebookbox4 = dw_box_new( BOXVERT, 5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1193 notebookpage4 = dw_notebook_page_new( notebook, 1, FALSE );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1194 dw_notebook_pack( notebook, notebookpage4, notebookbox4 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1195 dw_notebook_page_set_text( notebook, notebookpage4, "container");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1196 container_add();
254
42332e598d55 Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 253
diff changeset
1197
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1198 notebookbox5 = dw_box_new( BOXVERT, 5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1199 notebookpage5 = dw_notebook_page_new( notebook, 1, FALSE );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1200 dw_notebook_pack( notebook, notebookpage5, notebookbox5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1201 dw_notebook_page_set_text( notebook, notebookpage5, "buttons");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1202 buttons_add();
304
c28c0a804442 Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 300
diff changeset
1203
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1204 notebookbox6 = dw_box_new( BOXVERT, 5 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1205 notebookpage6 = dw_notebook_page_new( notebook, 1, FALSE );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1206 dw_notebook_pack( notebook, notebookpage6, notebookbox6 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1207 dw_notebook_page_set_text( notebook, notebookpage6, "mdi");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1208 mdi_add();
503
f3ed8dda02f8 Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 487
diff changeset
1209
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1210 notebookbox7 = dw_box_new( BOXVERT, 6 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1211 notebookpage7 = dw_notebook_page_new( notebook, 1, FALSE );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1212 dw_notebook_pack( notebook, notebookpage7, notebookbox7 );
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1213 dw_notebook_page_set_text( notebook, notebookpage7, "html");
627
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1214
636
f6f887d2c5aa Add _dw_log() internal logging function
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 634
diff changeset
1215 #if 1
627
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1216 rawhtml = dw_html_new(1001);
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1217 dw_box_pack_start( notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0);
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1218 dw_html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>");
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1219 html = dw_html_new(1002);
77cc62375fee Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 621
diff changeset
1220 dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1221 /*
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1222 * This originally had:
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1223 dw_html_url(html, "http://dwindows.netlabs.org");
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1224 * but as the base file is XML, the Windows browser instance can't display it.
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1225 * Instead a pure HTML based web page is displayed. MHES 5/4/2008
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1226 */
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1227 dw_html_url(html, "http://www.rexx.org");
636
f6f887d2c5aa Add _dw_log() internal logging function
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 634
diff changeset
1228 #endif
774
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1229
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1230 notebookbox8 = dw_box_new( BOXVERT, 7 );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1231 notebookpage8 = dw_notebook_page_new( notebook, 1, FALSE );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1232 dw_notebook_pack( notebook, notebookpage8, notebookbox8 );
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1233 dw_notebook_page_set_text( notebook, notebookpage8, "scrollbox");
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1234 scrollbox_add();
bf3e9892146f Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 746
diff changeset
1235
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1236 dw_signal_connect(mainwindow, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow);
634
c6a216c8174f Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 629
diff changeset
1237 timerid = dw_timer_connect(2000, DW_SIGNAL_FUNC(timer_callback), 0);
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1238 dw_window_set_size(mainwindow, 640, 520);
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1239 dw_window_show(mainwindow);
584
420c6c94abc7 Added dw_html_* functionality for embedding HTML pages in Dynamic Windows
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 567
diff changeset
1240
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1241 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
1242
620
9876b75d7115 Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents: 606
diff changeset
1243 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
1244 }