Mercurial > dwindows
annotate dwtest.c @ 3005:522ef24b0aba default tip
GTK4: Fix even more deprecation warnings in GTK 4.10 and later.
Migrate to GtkAlertDialog for 4.10 from GtkMessageDialog.
Still need to center the dialog or something.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 20 Dec 2023 05:17:54 +0000 |
parents | 392f0b3dd502 |
children |
rev | line source |
---|---|
1560
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1 /* |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2 * An example Dynamic Windows application and |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
3 * testing ground for Dynamic Windows features. |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
4 * By: Brian Smith and Mark Hessling |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
5 */ |
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
|
6 #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
|
7 #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
|
8 #include <stdio.h> |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
9 #include <errno.h> |
2800
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
10 #ifdef __ANDROID__ |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
11 #include <fcntl.h> |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
12 #include <unistd.h> |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
13 #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
|
14 #include "dw.h" |
2026
a9809db1ddbf
Last change also allows removing Windows specific #ifdef.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2025
diff
changeset
|
15 /* For snprintf, strdup etc on old Windows SDK */ |
2354
dfb52d2bddaa
Only include dwcompat.h in dwtest on OS/2 and Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2284
diff
changeset
|
16 #if defined(__WIN32__) || defined(__OS2__) |
2025
211330337f2d
Include "dwcompat.h" in the test program for the system macros.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2010
diff
changeset
|
17 #include "dwcompat.h" |
2354
dfb52d2bddaa
Only include dwcompat.h in dwtest on OS/2 and Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2284
diff
changeset
|
18 #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
|
19 |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
20 /* Select a fixed width font for our platform */ |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
21 #ifdef __OS2__ |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
22 #define FIXEDFONT "5.System VIO" |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
23 #define PLATFORMFOLDER "os2\\" |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
24 #elif defined(__WIN32__) |
1242
8e37ebb3fab7
Changed FIXEDFONT to "Lucinda Console" on Windows. Terminal looks better to me...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1230
diff
changeset
|
25 #define FIXEDFONT "10.Lucida Console" |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
26 #define PLATFORMFOLDER "win\\" |
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
|
27 #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
|
28 #define FIXEDFONT "9.Monaco" |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
29 #define PLATFORMFOLDER "mac/" |
2446
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
30 #elif defined(__IOS__) |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
31 #define FIXEDFONT "9.Monaco" |
2547
dbd15c13f5bb
Android: Implement most of the font functions and control/widget color.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2542
diff
changeset
|
32 #elif defined(__ANDROID__) |
dbd15c13f5bb
Android: Implement most of the font functions and control/widget color.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2542
diff
changeset
|
33 #define FIXEDFONT "10.Monospace" |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
34 #elif GTK_MAJOR_VERSION > 1 |
1002
0802d6122ec7
Changes to the test program to use new font style for GTK2+.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
992
diff
changeset
|
35 #define FIXEDFONT "10.monospace" |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
36 #define PLATFORMFOLDER "gtk/" |
219
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
37 #else |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
38 #define FIXEDFONT "fixed" |
79968cf0f3b3
Choose a nice font. ;)
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
218
diff
changeset
|
39 #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
|
40 |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
41 char fileiconpath[1025] = "file"; |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
42 char foldericonpath[1025] = "folder"; |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
43 |
774
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
44 #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
|
45 |
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
|
46 unsigned long flStyle = DW_FCF_SYSMENU | DW_FCF_TITLEBAR | |
1484
9b24233d7606
Remove obsolete DW_FCF_SHELLPOSITION from the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1465
diff
changeset
|
47 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
|
48 |
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
|
49 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
|
50 |
602
489a684af1bb
Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
600
diff
changeset
|
51 int iteration = 0; |
774
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
52 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
|
53 |
1090
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
54 static char folder_ico[1718] = { |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
55 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x01, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x05, 0x00, 0x00, 0x4E, 0x01, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
56 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x30, 0x03, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3B, 0x37, 0x77, 0x77, 0x77, 0x77, 0xB7, 0x33, 0x3B, 0x37, 0x77, 0x77, 0x77, 0x77, 0xB7, 0x33, 0x3B, 0x37, 0x77, 0x77, 0x77, 0x77, 0xB7, 0x33, 0x3B, 0x37, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
57 0x77, 0x77, 0x77, 0x77, 0xB7, 0x33, 0x37, 0x37, 0x77, 0x77, 0x77, 0x77, 0xB7, 0x33, 0x37, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x33, 0x37, 0x73, 0x33, 0x33, 0x33, 0x33, 0x33, 0x30, 0x37, 0x77, 0x77, 0x7F, 0xFF, 0xFF, 0x30, 0x00, 0x3F, 0x77, 0x77, 0xF3, 0x33, 0x33, 0x30, 0x00, 0x03, 0xFF, 0xFF, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
58 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x81, 0xFF, 0x00, 0x00, 0xC3, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x80, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
59 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xDC, 0xC0, 0x00, 0xF0, 0xCA, 0xA6, 0x00, 0x04, 0x04, 0x04, 0x00, 0x08, 0x08, 0x08, 0x00, 0x0C, 0x0C, 0x0C, 0x00, 0x11, 0x11, 0x11, 0x00, 0x16, 0x16, 0x16, 0x00, 0x1C, 0x1C, 0x1C, 0x00, 0x22, 0x22, 0x22, 0x00, 0x29, 0x29, 0x29, 0x00, 0x55, 0x55, 0x55, 0x00, 0x4D, 0x4D, 0x4D, 0x00, 0x42, 0x42, 0x42, 0x00, 0x39, 0x39, 0x39, 0x00, 0x80, 0x7C, 0xFF, 0x00, 0x50, 0x50, 0xFF, 0x00, 0x93, 0x00, 0xD6, 0x00, 0xFF, 0xEC, 0xCC, 0x00, 0xC6, 0xD6, 0xEF, 0x00, 0xD6, 0xE7, 0xE7, 0x00, 0x90, 0xA9, 0xAD, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
60 0x99, 0x00, 0x00, 0x00, 0xCC, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, 0x33, 0x66, 0x00, 0x00, 0x33, 0x99, 0x00, 0x00, 0x33, 0xCC, 0x00, 0x00, 0x33, 0xFF, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x66, 0x33, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x99, 0x00, 0x00, 0x66, 0xCC, 0x00, 0x00, 0x66, 0xFF, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x99, 0x33, 0x00, 0x00, 0x99, 0x66, 0x00, 0x00, 0x99, 0x99, 0x00, 0x00, 0x99, 0xCC, 0x00, 0x00, 0x99, 0xFF, 0x00, 0x00, 0xCC, 0x00, 0x00, 0x00, 0xCC, 0x33, 0x00, 0x00, 0xCC, 0x66, 0x00, 0x00, 0xCC, 0x99, 0x00, 0x00, 0xCC, 0xCC, 0x00, 0x00, 0xCC, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
61 0xFF, 0x00, 0x00, 0xFF, 0x66, 0x00, 0x00, 0xFF, 0x99, 0x00, 0x00, 0xFF, 0xCC, 0x00, 0x33, 0x00, 0x00, 0x00, 0x33, 0x00, 0x33, 0x00, 0x33, 0x00, 0x66, 0x00, 0x33, 0x00, 0x99, 0x00, 0x33, 0x00, 0xCC, 0x00, 0x33, 0x00, 0xFF, 0x00, 0x33, 0x33, 0x00, 0x00, 0x33, 0x33, 0x33, 0x00, 0x33, 0x33, 0x66, 0x00, 0x33, 0x33, 0x99, 0x00, 0x33, 0x33, 0xCC, 0x00, 0x33, 0x33, 0xFF, 0x00, 0x33, 0x66, 0x00, 0x00, 0x33, 0x66, 0x33, 0x00, 0x33, 0x66, 0x66, 0x00, 0x33, 0x66, 0x99, 0x00, 0x33, 0x66, 0xCC, 0x00, 0x33, 0x66, 0xFF, 0x00, 0x33, 0x99, 0x00, 0x00, 0x33, 0x99, 0x33, 0x00, 0x33, 0x99, 0x66, 0x00, 0x33, 0x99, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
62 0x99, 0x00, 0x33, 0x99, 0xCC, 0x00, 0x33, 0x99, 0xFF, 0x00, 0x33, 0xCC, 0x00, 0x00, 0x33, 0xCC, 0x33, 0x00, 0x33, 0xCC, 0x66, 0x00, 0x33, 0xCC, 0x99, 0x00, 0x33, 0xCC, 0xCC, 0x00, 0x33, 0xCC, 0xFF, 0x00, 0x33, 0xFF, 0x33, 0x00, 0x33, 0xFF, 0x66, 0x00, 0x33, 0xFF, 0x99, 0x00, 0x33, 0xFF, 0xCC, 0x00, 0x33, 0xFF, 0xFF, 0x00, 0x66, 0x00, 0x00, 0x00, 0x66, 0x00, 0x33, 0x00, 0x66, 0x00, 0x66, 0x00, 0x66, 0x00, 0x99, 0x00, 0x66, 0x00, 0xCC, 0x00, 0x66, 0x00, 0xFF, 0x00, 0x66, 0x33, 0x00, 0x00, 0x66, 0x33, 0x33, 0x00, 0x66, 0x33, 0x66, 0x00, 0x66, 0x33, 0x99, 0x00, 0x66, 0x33, 0xCC, 0x00, 0x66, 0x33, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
63 0xFF, 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x33, 0x00, 0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x99, 0x00, 0x66, 0x66, 0xCC, 0x00, 0x66, 0x99, 0x00, 0x00, 0x66, 0x99, 0x33, 0x00, 0x66, 0x99, 0x66, 0x00, 0x66, 0x99, 0x99, 0x00, 0x66, 0x99, 0xCC, 0x00, 0x66, 0x99, 0xFF, 0x00, 0x66, 0xCC, 0x00, 0x00, 0x66, 0xCC, 0x33, 0x00, 0x66, 0xCC, 0x99, 0x00, 0x66, 0xCC, 0xCC, 0x00, 0x66, 0xCC, 0xFF, 0x00, 0x66, 0xFF, 0x00, 0x00, 0x66, 0xFF, 0x33, 0x00, 0x66, 0xFF, 0x99, 0x00, 0x66, 0xFF, 0xCC, 0x00, 0xCC, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xCC, 0x00, 0x99, 0x99, 0x00, 0x00, 0x99, 0x33, 0x99, 0x00, 0x99, 0x00, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
64 0x99, 0x00, 0x99, 0x00, 0xCC, 0x00, 0x99, 0x00, 0x00, 0x00, 0x99, 0x33, 0x33, 0x00, 0x99, 0x00, 0x66, 0x00, 0x99, 0x33, 0xCC, 0x00, 0x99, 0x00, 0xFF, 0x00, 0x99, 0x66, 0x00, 0x00, 0x99, 0x66, 0x33, 0x00, 0x99, 0x33, 0x66, 0x00, 0x99, 0x66, 0x99, 0x00, 0x99, 0x66, 0xCC, 0x00, 0x99, 0x33, 0xFF, 0x00, 0x99, 0x99, 0x33, 0x00, 0x99, 0x99, 0x66, 0x00, 0x99, 0x99, 0x99, 0x00, 0x99, 0x99, 0xCC, 0x00, 0x99, 0x99, 0xFF, 0x00, 0x99, 0xCC, 0x00, 0x00, 0x99, 0xCC, 0x33, 0x00, 0x66, 0xCC, 0x66, 0x00, 0x99, 0xCC, 0x99, 0x00, 0x99, 0xCC, 0xCC, 0x00, 0x99, 0xCC, 0xFF, 0x00, 0x99, 0xFF, 0x00, 0x00, 0x99, 0xFF, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
65 0x33, 0x00, 0x99, 0xCC, 0x66, 0x00, 0x99, 0xFF, 0x99, 0x00, 0x99, 0xFF, 0xCC, 0x00, 0x99, 0xFF, 0xFF, 0x00, 0xCC, 0x00, 0x00, 0x00, 0x99, 0x00, 0x33, 0x00, 0xCC, 0x00, 0x66, 0x00, 0xCC, 0x00, 0x99, 0x00, 0xCC, 0x00, 0xCC, 0x00, 0x99, 0x33, 0x00, 0x00, 0xCC, 0x33, 0x33, 0x00, 0xCC, 0x33, 0x66, 0x00, 0xCC, 0x33, 0x99, 0x00, 0xCC, 0x33, 0xCC, 0x00, 0xCC, 0x33, 0xFF, 0x00, 0xCC, 0x66, 0x00, 0x00, 0xCC, 0x66, 0x33, 0x00, 0x99, 0x66, 0x66, 0x00, 0xCC, 0x66, 0x99, 0x00, 0xCC, 0x66, 0xCC, 0x00, 0x99, 0x66, 0xFF, 0x00, 0xCC, 0x99, 0x00, 0x00, 0xCC, 0x99, 0x33, 0x00, 0xCC, 0x99, 0x66, 0x00, 0xCC, 0x99, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
66 0x99, 0x00, 0xCC, 0x99, 0xCC, 0x00, 0xCC, 0x99, 0xFF, 0x00, 0xCC, 0xCC, 0x00, 0x00, 0xCC, 0xCC, 0x33, 0x00, 0xCC, 0xCC, 0x66, 0x00, 0xCC, 0xCC, 0x99, 0x00, 0xCC, 0xCC, 0xCC, 0x00, 0xCC, 0xCC, 0xFF, 0x00, 0xCC, 0xFF, 0x00, 0x00, 0xCC, 0xFF, 0x33, 0x00, 0x99, 0xFF, 0x66, 0x00, 0xCC, 0xFF, 0x99, 0x00, 0xCC, 0xFF, 0xCC, 0x00, 0xCC, 0xFF, 0xFF, 0x00, 0xCC, 0x00, 0x33, 0x00, 0xFF, 0x00, 0x66, 0x00, 0xFF, 0x00, 0x99, 0x00, 0xCC, 0x33, 0x00, 0x00, 0xFF, 0x33, 0x33, 0x00, 0xFF, 0x33, 0x66, 0x00, 0xFF, 0x33, 0x99, 0x00, 0xFF, 0x33, 0xCC, 0x00, 0xFF, 0x33, 0xFF, 0x00, 0xFF, 0x66, 0x00, 0x00, 0xFF, 0x66, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
67 0x33, 0x00, 0xCC, 0x66, 0x66, 0x00, 0xFF, 0x66, 0x99, 0x00, 0xFF, 0x66, 0xCC, 0x00, 0xCC, 0x66, 0xFF, 0x00, 0xFF, 0x99, 0x00, 0x00, 0xFF, 0x99, 0x33, 0x00, 0xFF, 0x99, 0x66, 0x00, 0xFF, 0x99, 0x99, 0x00, 0xFF, 0x99, 0xCC, 0x00, 0xFF, 0x99, 0xFF, 0x00, 0xFF, 0xCC, 0x00, 0x00, 0xFF, 0xCC, 0x33, 0x00, 0xFF, 0xCC, 0x66, 0x00, 0xFF, 0xCC, 0x99, 0x00, 0xFF, 0xCC, 0xCC, 0x00, 0xFF, 0xCC, 0xFF, 0x00, 0xFF, 0xFF, 0x33, 0x00, 0xCC, 0xFF, 0x66, 0x00, 0xFF, 0xFF, 0x99, 0x00, 0xFF, 0xFF, 0xCC, 0x00, 0x66, 0x66, 0xFF, 0x00, 0x66, 0xFF, 0x66, 0x00, 0x66, 0xFF, 0xFF, 0x00, 0xFF, 0x66, 0x66, 0x00, 0xFF, 0x66, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
68 0xFF, 0x00, 0xFF, 0xFF, 0x66, 0x00, 0x21, 0x00, 0xA5, 0x00, 0x5F, 0x5F, 0x5F, 0x00, 0x77, 0x77, 0x77, 0x00, 0x86, 0x86, 0x86, 0x00, 0x96, 0x96, 0x96, 0x00, 0xCB, 0xCB, 0xCB, 0x00, 0xB2, 0xB2, 0xB2, 0x00, 0xD7, 0xD7, 0xD7, 0x00, 0xDD, 0xDD, 0xDD, 0x00, 0xE3, 0xE3, 0xE3, 0x00, 0xEA, 0xEA, 0xEA, 0x00, 0xF1, 0xF1, 0xF1, 0x00, 0xF8, 0xF8, 0xF8, 0x00, 0xF0, 0xFB, 0xFF, 0x00, 0xA4, 0xA0, 0xA0, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x0A, 0x0A, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
69 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x0A, 0x0A, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x4B, 0x52, 0x7A, 0x52, 0xA0, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x58, 0xA0, 0x52, 0x4B, 0x52, 0x7A, 0x52, 0xA0, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x58, 0xA0, 0x52, 0x4B, 0x52, 0x7A, 0x52, 0xA0, 0x9A, 0x9A, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
70 0x9A, 0x9A, 0x9A, 0x9A, 0x9A, 0xA0, 0x58, 0xA0, 0x52, 0x4B, 0x52, 0x7A, 0x52, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0x79, 0xA0, 0x52, 0x4B, 0x52, 0x7A, 0x52, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0x7A, 0xA0, 0x52, 0x4B, 0x52, 0x7A, 0x52, 0xFF, 0xF6, 0xF6, 0xF6, 0xF6, 0xF6, 0xFF, 0xFF, 0xFF, 0x9A, 0xF6, 0x52, 0x4B, 0x52, 0xA0, 0x9A, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x52, 0x0A, 0x52, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2A, 0x0A, 0x0A, 0x0A, 0x52, 0xFF, 0xA0, 0xA0, 0xA0, 0xA0, 0xFF, 0x52, 0x52, 0x52, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
71 0x52, 0x52, 0x2A, 0x0A, 0x0A, 0x0A, 0x0A, 0x52, 0xFF, 0xFF, 0xFF, 0xF6, 0x52, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x52, 0x52, 0x52, 0x52, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
72 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x81, 0xFF, 0x00, 0x00, 0xC3, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
73 }; |
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
74 |
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
|
75 HWND mainwindow, |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
76 copypastefield, |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
77 entryfield, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
78 checkable_menuitem, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
79 noncheckable_menuitem, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
80 cursortogglebutton, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
81 colorchoosebutton, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
82 okbutton, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
83 cancelbutton, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
84 lbbox, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
85 combox, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
86 combobox1, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
87 combobox2, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
88 spinbutton, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
89 slider, |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
90 percent, |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
91 notebookbox, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
92 notebookbox1, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
93 notebookbox2, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
94 notebookbox3, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
95 notebookbox4, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
96 notebookbox5, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
97 notebookbox6, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
98 notebookbox7, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
99 notebookbox8, |
1200
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
100 notebookbox9, |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
101 html, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
102 rawhtml, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
103 notebook, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
104 vscrollbar, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
105 hscrollbar, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
106 status1, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
107 status2, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
108 rendcombo, |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
109 imagexspin, |
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
110 imageyspin, |
1243
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
111 imagestretchcheck, |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
112 container_status, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
113 tree_status, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
114 stext, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
115 tree, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
116 container, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
117 container_mle, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
118 pagebox, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
119 containerbox, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
120 textbox1, textbox2, textboxA, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
121 buttonbox, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
122 buttonsbox, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
123 buttonboxperm, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
124 cal, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
125 scrollbox, |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
126 labelarray[MAX_WIDGETS], |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
127 entryarray[MAX_WIDGETS], |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
128 filetoolbarbox; |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
129 |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
130 HMENUI mainmenubar,changeable_menu; |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
131 #define CHECKABLE_MENUITEMID 2001 |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
132 #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
|
133 |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
134 #define SHAPES_DOUBLE_BUFFERED 0 |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
135 #define SHAPES_DIRECT 1 |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
136 #define DRAW_FILE 2 |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
137 |
503
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
138 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
|
139 |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
140 int menu_enabled = 1; |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
141 |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
142 HPIXMAP text1pm,text2pm,image; |
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
|
143 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
|
144 int mle_point=-1; |
1243
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
145 int image_x = 20, image_y = 20, image_stretch = 0; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
146 |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
147 int font_width = 8; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
148 int font_height=12; |
1002
0802d6122ec7
Changes to the test program to use new font style for GTK2+.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
992
diff
changeset
|
149 int rows=10,width1=6,cols=80; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
150 char *current_file = NULL; |
2584
2acc7ba5dea0
Add HTIMER type and change dw_timer_() functions to use it.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2560
diff
changeset
|
151 HTIMER timerid; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
152 int num_lines=0; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
153 int max_linewidth=0; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
154 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
|
155 int cursor_arrow = 1; |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
156 int render_type = SHAPES_DOUBLE_BUFFERED; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
157 |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
158 FILE *fp=NULL; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
159 char **lp; |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
160 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
161 char *resolve_keyname(int vk) |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
162 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
163 char *keyname; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
164 switch(vk) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
165 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
166 case VK_LBUTTON : keyname = "VK_LBUTTON"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
167 case VK_RBUTTON : keyname = "VK_RBUTTON"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
168 case VK_CANCEL : keyname = "VK_CANCEL"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
169 case VK_MBUTTON : keyname = "VK_MBUTTON"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
170 case VK_TAB : keyname = "VK_TAB"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
171 case VK_CLEAR : keyname = "VK_CLEAR"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
172 case VK_RETURN : keyname = "VK_RETURN"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
173 case VK_PAUSE : keyname = "VK_PAUSE"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
174 case VK_CAPITAL : keyname = "VK_CAPITAL"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
175 case VK_ESCAPE : keyname = "VK_ESCAPE"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
176 case VK_SPACE : keyname = "VK_SPACE"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
177 case VK_PRIOR : keyname = "VK_PRIOR"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
178 case VK_NEXT : keyname = "VK_NEXT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
179 case VK_END : keyname = "VK_END"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
180 case VK_HOME : keyname = "VK_HOME"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
181 case VK_LEFT : keyname = "VK_LEFT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
182 case VK_UP : keyname = "VK_UP"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
183 case VK_RIGHT : keyname = "VK_RIGHT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
184 case VK_DOWN : keyname = "VK_DOWN"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
185 case VK_SELECT : keyname = "VK_SELECT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
186 case VK_PRINT : keyname = "VK_PRINT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
187 case VK_EXECUTE : keyname = "VK_EXECUTE"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
188 case VK_SNAPSHOT: keyname = "VK_SNAPSHOT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
189 case VK_INSERT : keyname = "VK_INSERT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
190 case VK_DELETE : keyname = "VK_DELETE"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
191 case VK_HELP : keyname = "VK_HELP"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
192 case VK_LWIN : keyname = "VK_LWIN"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
193 case VK_RWIN : keyname = "VK_RWIN"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
194 case VK_NUMPAD0 : keyname = "VK_NUMPAD0"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
195 case VK_NUMPAD1 : keyname = "VK_NUMPAD1"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
196 case VK_NUMPAD2 : keyname = "VK_NUMPAD2"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
197 case VK_NUMPAD3 : keyname = "VK_NUMPAD3"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
198 case VK_NUMPAD4 : keyname = "VK_NUMPAD4"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
199 case VK_NUMPAD5 : keyname = "VK_NUMPAD5"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
200 case VK_NUMPAD6 : keyname = "VK_NUMPAD6"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
201 case VK_NUMPAD7 : keyname = "VK_NUMPAD7"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
202 case VK_NUMPAD8 : keyname = "VK_NUMPAD8"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
203 case VK_NUMPAD9 : keyname = "VK_NUMPAD9"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
204 case VK_MULTIPLY: keyname = "VK_MULTIPLY"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
205 case VK_ADD : keyname = "VK_ADD"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
206 case VK_SEPARATOR: keyname = "VK_SEPARATOR"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
207 case VK_SUBTRACT: keyname = "VK_SUBTRACT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
208 case VK_DECIMAL : keyname = "VK_DECIMAL"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
209 case VK_DIVIDE : keyname = "VK_DIVIDE"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
210 case VK_F1 : keyname = "VK_F1"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
211 case VK_F2 : keyname = "VK_F2"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
212 case VK_F3 : keyname = "VK_F3"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
213 case VK_F4 : keyname = "VK_F4"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
214 case VK_F5 : keyname = "VK_F5"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
215 case VK_F6 : keyname = "VK_F6"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
216 case VK_F7 : keyname = "VK_F7"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
217 case VK_F8 : keyname = "VK_F8"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
218 case VK_F9 : keyname = "VK_F9"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
219 case VK_F10 : keyname = "VK_F10"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
220 case VK_F11 : keyname = "VK_F11"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
221 case VK_F12 : keyname = "VK_F12"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
222 case VK_F13 : keyname = "VK_F13"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
223 case VK_F14 : keyname = "VK_F14"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
224 case VK_F15 : keyname = "VK_F15"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
225 case VK_F16 : keyname = "VK_F16"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
226 case VK_F17 : keyname = "VK_F17"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
227 case VK_F18 : keyname = "VK_F18"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
228 case VK_F19 : keyname = "VK_F19"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
229 case VK_F20 : keyname = "VK_F20"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
230 case VK_F21 : keyname = "VK_F21"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
231 case VK_F22 : keyname = "VK_F22"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
232 case VK_F23 : keyname = "VK_F23"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
233 case VK_F24 : keyname = "VK_F24"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
234 case VK_NUMLOCK : keyname = "VK_NUMLOCK"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
235 case VK_SCROLL : keyname = "VK_SCROLL"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
236 case VK_LSHIFT : keyname = "VK_LSHIFT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
237 case VK_RSHIFT : keyname = "VK_RSHIFT"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
238 case VK_LCONTROL: keyname = "VK_LCONTROL"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
239 case VK_RCONTROL: keyname = "VK_RCONTROL"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
240 default: keyname = "<unknown>"; break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
241 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
242 return keyname; |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
243 } |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
244 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
245 char *resolve_keymodifiers(int mask) |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
246 { |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
247 if((mask & KC_CTRL) && (mask & KC_SHIFT) && (mask & KC_ALT)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
248 return "KC_CTRL KC_SHIFT KC_ALT"; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
249 else if((mask & KC_CTRL) && (mask & KC_SHIFT)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
250 return "KC_CTRL KC_SHIFT"; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
251 else if((mask & KC_CTRL) && (mask & KC_ALT)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
252 return "KC_CTRL KC_ALT"; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
253 else if((mask & KC_SHIFT) && (mask & KC_ALT)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
254 return "KC_SHIFT KC_ALT"; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
255 else if((mask & KC_SHIFT)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
256 return "KC_SHIFT"; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
257 else if((mask & KC_CTRL)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
258 return "KC_CTRL"; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
259 else if((mask & KC_ALT)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
260 return "KC_ALT"; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
261 else return "none"; |
297
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
262 } |
5414d3d582e4
Add icons to tree items on page three.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
293
diff
changeset
|
263 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
264 void update_render(void); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
265 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
266 /* 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
|
267 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
|
268 { |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
269 if(render_type != SHAPES_DIRECT) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
270 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
271 HPIXMAP hpm; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
272 unsigned long width,height; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
273 |
2532
457c91634881
Added dw_window_compare() to check if two window handles refer to the same object.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2521
diff
changeset
|
274 if(dw_window_compare(hwnd, textbox1)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
275 hpm = text1pm; |
2532
457c91634881
Added dw_window_compare() to check if two window handles refer to the same object.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2521
diff
changeset
|
276 else if(dw_window_compare(hwnd, textbox2)) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
277 hpm = text2pm; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
278 else |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
279 return TRUE; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
280 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
281 width = (int)DW_PIXMAP_WIDTH(hpm); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
282 height = (int)DW_PIXMAP_HEIGHT(hpm); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
283 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
284 dw_pixmap_bitblt(hwnd, NULL, 0, 0, (int)width, (int)height, 0, hpm, 0, 0 ); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
285 dw_flush(); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
286 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
287 else |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
288 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
289 update_render(); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
290 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
291 return TRUE; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
292 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
293 |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
294 char *read_file(char *filename) |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
295 { |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
296 char *errors = NULL; |
2800
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
297 #ifdef __ANDROID__ |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
298 int fd = -1; |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
299 |
2800
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
300 /* Special way to open for URIs on Android */ |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
301 if(strstr(filename, "://")) |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
302 { |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
303 fd = dw_file_open(filename, O_RDONLY); |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
304 fp = fdopen(fd, "r"); |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
305 } |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
306 else |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
307 #endif |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
308 fp = fopen(filename, "r"); |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
309 if(!fp) |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
310 errors = strerror(errno); |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
311 else |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
312 { |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
313 int i,len; |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
314 |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
315 lp = (char **)calloc(1000,sizeof(char *)); |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
316 /* should test for out of memory */ |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
317 max_linewidth=0; |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
318 for(i=0; i<1000; i++) |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
319 { |
1090
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
320 lp[i] = (char *)calloc(1, 1025); |
2724
c1f8e598960d
Only expand the calendar control and box horizontally....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2717
diff
changeset
|
321 if (fgets(lp[i], 1024, fp) == NULL) |
1090
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
322 break; |
2724
c1f8e598960d
Only expand the calendar control and box horizontally....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2717
diff
changeset
|
323 len = (int)strlen(lp[i]); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
324 if (len > max_linewidth) |
1090
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
325 max_linewidth = len; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
326 if(lp[i][len - 1] == '\n') |
1090
b905fd8e7fd1
Use _tempnam() on Windows instead of tmpnam() for dw_*_from_data() functions.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1077
diff
changeset
|
327 lp[i][len - 1] = '\0'; |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
328 } |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
329 num_lines = i; |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
330 fclose(fp); |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
331 dw_scrollbar_set_range(hscrollbar, max_linewidth, cols); |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
332 dw_scrollbar_set_pos(hscrollbar, 0); |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
333 dw_scrollbar_set_range(vscrollbar, num_lines, rows); |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
334 dw_scrollbar_set_pos(vscrollbar, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
335 } |
2800
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
336 #ifdef __ANDROID__ |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
337 if(fd != -1) |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
338 close(fd); |
56eab3a84b62
Android: Add Android specific code to handle opening URIs in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2768
diff
changeset
|
339 #endif |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
340 return errors; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
341 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
342 |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
343 /* When hpma is not NULL we are printing.. so handle things differently */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
344 void draw_file(int row, int col, int nrows, int fheight, HPIXMAP hpma) |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
345 { |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
346 HPIXMAP hpm = hpma ? hpma : text2pm; |
2855
86286f528adf
Fix new safety warnings reported by the new GCC on Linux.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2854
diff
changeset
|
347 char buf[15] = {0}; |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
348 int i,y,fileline; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
349 char *pLine; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
350 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
351 if(current_file) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
352 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
353 dw_color_foreground_set(DW_CLR_WHITE); |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
354 if(!hpma) |
1684
31dd366acfc8
Fixed calculating the GDI+ ratio based on the DPI on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1667
diff
changeset
|
355 dw_draw_rect(0, text1pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, (int)DW_PIXMAP_WIDTH(text1pm), (int)DW_PIXMAP_HEIGHT(text1pm)); |
31dd366acfc8
Fixed calculating the GDI+ ratio based on the DPI on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1667
diff
changeset
|
356 dw_draw_rect(0, hpm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, (int)DW_PIXMAP_WIDTH(hpm), (int)DW_PIXMAP_HEIGHT(hpm)); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
357 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
358 for(i = 0;(i < nrows) && (i+row < num_lines); i++) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
359 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
360 fileline = i + row - 1; |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
361 y = i*fheight; |
2855
86286f528adf
Fix new safety warnings reported by the new GCC on Linux.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2854
diff
changeset
|
362 dw_color_background_set(1 + (fileline % 15)); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
363 dw_color_foreground_set(fileline < 0 ? DW_CLR_WHITE : fileline % 16); |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
364 if(!hpma) |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
365 { |
2855
86286f528adf
Fix new safety warnings reported by the new GCC on Linux.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2854
diff
changeset
|
366 snprintf(buf, 15, "%6.6d", i+row); |
86286f528adf
Fix new safety warnings reported by the new GCC on Linux.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2854
diff
changeset
|
367 dw_draw_text(0, text1pm, 0, y, buf); |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
368 } |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
369 pLine = lp[i+row]; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
370 dw_draw_text(0, hpm, 0, y, pLine+col); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
371 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
372 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
373 } |
380
fcb52d773ed2
Implement tests for setting background color on render boxes.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
378
diff
changeset
|
374 |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
375 /* When hpma is not NULL we are printing.. so handle things differently */ |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
376 void draw_shapes(int direct, HPIXMAP hpma) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
377 { |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
378 HPIXMAP hpm = hpma ? hpma : text2pm; |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
379 int width = (int)DW_PIXMAP_WIDTH(hpm), height = (int)DW_PIXMAP_HEIGHT(hpm); |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
380 HPIXMAP pixmap = direct ? NULL : hpm; |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
381 HWND window = direct ? textbox2 : 0; |
1259
2d2b945ee0bf
Added a polygon to the test code to make sure that works on all platforms.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1243
diff
changeset
|
382 int x[7] = { 20, 180, 180, 230, 180, 180, 20 }; |
2d2b945ee0bf
Added a polygon to the test code to make sure that works on all platforms.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1243
diff
changeset
|
383 int y[7] = { 50, 50, 20, 70, 120, 90, 90 }; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
384 |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
385 image_x = (int)dw_spinbutton_get_pos(imagexspin); |
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
386 image_y = (int)dw_spinbutton_get_pos(imageyspin); |
1243
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
387 image_stretch = dw_checkbox_get(imagestretchcheck); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
388 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
389 dw_color_foreground_set(DW_CLR_WHITE); |
1684
31dd366acfc8
Fixed calculating the GDI+ ratio based on the DPI on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1667
diff
changeset
|
390 dw_draw_rect(window, pixmap, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, width, height); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
391 dw_color_foreground_set(DW_CLR_DARKPINK); |
1684
31dd366acfc8
Fixed calculating the GDI+ ratio based on the DPI on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1667
diff
changeset
|
392 dw_draw_rect(window, pixmap, DW_DRAW_FILL | DW_DRAW_NOAA, 10, 10, width - 20, height - 20); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
393 dw_color_foreground_set(DW_CLR_GREEN); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
394 dw_color_background_set(DW_CLR_DARKRED); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
395 dw_draw_text(window, pixmap, 10, 10, "This should be aligned with the edges."); |
1613
fd3b7784ab53
Initial commit for GDI+ anti-aliased drawing. Code currently does not work,
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1601
diff
changeset
|
396 dw_color_foreground_set(DW_CLR_YELLOW); |
fd3b7784ab53
Initial commit for GDI+ anti-aliased drawing. Code currently does not work,
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1601
diff
changeset
|
397 dw_draw_line(window, pixmap, width - 10, 10, 10, height - 10); |
1259
2d2b945ee0bf
Added a polygon to the test code to make sure that works on all platforms.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1243
diff
changeset
|
398 dw_color_foreground_set(DW_CLR_BLUE); |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
399 dw_draw_polygon(window, pixmap, DW_DRAW_FILL, 7, x, y); |
1280
70efdb4e0ce9
Draw a rectangle behind the circle to make sure it fits inside.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1270
diff
changeset
|
400 dw_color_foreground_set(DW_CLR_BLACK); |
1684
31dd366acfc8
Fixed calculating the GDI+ ratio based on the DPI on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1667
diff
changeset
|
401 dw_draw_rect(window, pixmap, DW_DRAW_FILL | DW_DRAW_NOAA, 80, 80, 80, 40); |
1261
61d0c5f84644
Initial attempt at adding dw_draw_arc() support on all platforms.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1259
diff
changeset
|
402 dw_color_foreground_set(DW_CLR_CYAN); |
1269
9e477efbacca
Added DW_DRAW_DEFAULT, DW_DRAW_FILL and DW_DRAW_FULL drawing flags.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1266
diff
changeset
|
403 /* Bottom right corner */ |
1266
83b0ed8c8377
Fixed on GTK passing angles to cairo in degrees instead of radians.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1261
diff
changeset
|
404 dw_draw_arc(window, pixmap, 0, width - 30, height - 30, width - 10, height - 30, width - 30, height - 10); |
1269
9e477efbacca
Added DW_DRAW_DEFAULT, DW_DRAW_FILL and DW_DRAW_FULL drawing flags.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1266
diff
changeset
|
405 /* Top right corner */ |
9e477efbacca
Added DW_DRAW_DEFAULT, DW_DRAW_FILL and DW_DRAW_FULL drawing flags.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1266
diff
changeset
|
406 dw_draw_arc(window, pixmap, 0, width - 30, 30, width - 30, 10, width - 10, 30); |
9e477efbacca
Added DW_DRAW_DEFAULT, DW_DRAW_FILL and DW_DRAW_FULL drawing flags.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1266
diff
changeset
|
407 /* Bottom left corner */ |
9e477efbacca
Added DW_DRAW_DEFAULT, DW_DRAW_FILL and DW_DRAW_FULL drawing flags.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1266
diff
changeset
|
408 dw_draw_arc(window, pixmap, 0, 30, height - 30, 30, height - 10, 10, height - 30); |
9e477efbacca
Added DW_DRAW_DEFAULT, DW_DRAW_FILL and DW_DRAW_FULL drawing flags.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1266
diff
changeset
|
409 /* Full circle in the left top area */ |
1282
4f0f816f1e76
Update to draw as an ellipse and fix for circles on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1280
diff
changeset
|
410 dw_draw_arc(window, pixmap, DW_DRAW_FULL, 120, 100, 80, 80, 160, 120); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
411 if(image) |
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
412 { |
1243
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
413 if(image_stretch) |
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
414 dw_pixmap_stretch_bitblt(window, pixmap, 10, 10, width - 20, height - 20, 0, image, 0, 0, (int)DW_PIXMAP_WIDTH(image), (int)DW_PIXMAP_HEIGHT(image)); |
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
415 else |
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
416 dw_pixmap_bitblt(window, pixmap, image_x, image_y, (int)DW_PIXMAP_WIDTH(image), (int)DW_PIXMAP_HEIGHT(image), 0, image, 0, 0); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
417 } |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
418 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
419 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
420 void update_render(void) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
421 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
422 switch(render_type) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
423 { |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
424 case SHAPES_DOUBLE_BUFFERED: |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
425 draw_shapes(FALSE, NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
426 break; |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
427 case SHAPES_DIRECT: |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
428 draw_shapes(TRUE, NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
429 break; |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
430 case DRAW_FILE: |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
431 draw_file(current_row, current_col, rows, font_height, NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
432 break; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
433 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
434 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
435 |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
436 /* Request that the render widgets redraw... |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
437 * If not using direct rendering, call update_render() to |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
438 * redraw the in memory pixmaps. Then trigger the expose events. |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
439 * Expose will call update_render() to draw directly or bitblt the pixmaps. |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
440 */ |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
441 void render_draw(void) |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
442 { |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
443 /* If we are double buffered, draw to the pixmaps */ |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
444 if(render_type != SHAPES_DIRECT) |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
445 update_render(); |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
446 /* Trigger expose event */ |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
447 dw_render_redraw(textbox1); |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
448 dw_render_redraw(textbox2); |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
449 } |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
450 |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
451 int DWSIGNAL draw_page(HPRINT print, HPIXMAP pixmap, int page_num, void *data) |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
452 { |
1146
9d97610b2140
Adding dw_pixmap_set_font() which is equivalent to dw_window_set_font() except for pixmaps.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1142
diff
changeset
|
453 dw_pixmap_set_font(pixmap, FIXEDFONT); |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
454 if(page_num == 0) |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
455 { |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
456 draw_shapes(FALSE, pixmap); |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
457 } |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
458 else if(page_num == 1) |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
459 { |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
460 /* Get the font size for this printer context... */ |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
461 int fheight, fwidth; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
462 |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
463 /* If we have a file to display... */ |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
464 if(current_file) |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
465 { |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
466 int nrows; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
467 |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
468 /* Calculate new dimensions */ |
1343
d4c874f13e9b
More fixes for OS/2 gcc/gmake. Need to use := to evaluate the $(shell) variable.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1319
diff
changeset
|
469 dw_font_text_extents_get(0, pixmap, "(g", NULL, &fheight); |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
470 nrows = (int)(DW_PIXMAP_HEIGHT(pixmap) / fheight); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
471 |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
472 /* Do the actual drawing */ |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
473 draw_file(0, 0, nrows, fheight, pixmap); |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
474 } |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
475 else |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
476 { |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
477 /* We don't have a file so center an error message on the page */ |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
478 char *text = "No file currently selected!"; |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
479 int posx, posy; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
480 |
1343
d4c874f13e9b
More fixes for OS/2 gcc/gmake. Need to use := to evaluate the $(shell) variable.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1319
diff
changeset
|
481 dw_font_text_extents_get(0, pixmap, text, &fwidth, &fheight); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
482 |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
483 posx = (int)(DW_PIXMAP_WIDTH(pixmap) - fwidth)/2; |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
484 posy = (int)(DW_PIXMAP_HEIGHT(pixmap) - fheight)/2; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
485 |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
486 dw_color_foreground_set(DW_CLR_BLACK); |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
487 dw_color_background_set(DW_CLR_WHITE); |
1343
d4c874f13e9b
More fixes for OS/2 gcc/gmake. Need to use := to evaluate the $(shell) variable.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1319
diff
changeset
|
488 dw_draw_text(0, pixmap, posx, posy, text); |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
489 } |
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
490 } |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
491 return TRUE; |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
492 } |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
493 |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
494 int DWSIGNAL print_callback(HWND window, void *data) |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
495 { |
1230
75a773cdb626
Fixes to dw_font_text_extents_get() on Mac so it honors the font set with dw_pixmap_set_font().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1227
diff
changeset
|
496 HPRINT print = dw_print_new("DWTest Job", 0, 2, DW_SIGNAL_FUNC(draw_page), NULL); |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
497 dw_print_run(print, 0); |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
498 return FALSE; |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
499 } |
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
500 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
501 int DWSIGNAL refresh_callback(HWND window, void *data) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
502 { |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
503 render_draw(); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
504 return FALSE; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
505 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
506 |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
507 int DWSIGNAL render_select_event_callback(HWND window, int index) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
508 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
509 if(index != render_type) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
510 { |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
511 if(index == DRAW_FILE) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
512 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
513 dw_scrollbar_set_range(hscrollbar, max_linewidth, cols); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
514 dw_scrollbar_set_pos(hscrollbar, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
515 dw_scrollbar_set_range(vscrollbar, num_lines, rows); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
516 dw_scrollbar_set_pos(vscrollbar, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
517 current_col = current_row = 0; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
518 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
519 else |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
520 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
521 dw_scrollbar_set_range(hscrollbar, 0, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
522 dw_scrollbar_set_pos(hscrollbar, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
523 dw_scrollbar_set_range(vscrollbar, 0, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
524 dw_scrollbar_set_pos(vscrollbar, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
525 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
526 render_type = index; |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
527 render_draw(); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
528 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
529 return FALSE; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
530 } |
566
f6de197ecbe9
Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
531
diff
changeset
|
531 |
f6de197ecbe9
Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
531
diff
changeset
|
532 int DWSIGNAL colorchoose_callback(HWND window, void *data) |
f6de197ecbe9
Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
531
diff
changeset
|
533 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
534 current_color = dw_color_choose(current_color); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
535 return FALSE; |
566
f6de197ecbe9
Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
531
diff
changeset
|
536 } |
f6de197ecbe9
Add dw_color_choose()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
531
diff
changeset
|
537 |
391
2059f18e9c20
Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
385
diff
changeset
|
538 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
|
539 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
540 if(cursor_arrow) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
541 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
542 dw_window_set_text((HWND)cursortogglebutton,"Set Cursor pointer - ARROW"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
543 dw_window_set_pointer((HWND)data,DW_POINTER_CLOCK); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
544 cursor_arrow = 0; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
545 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
546 else |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
547 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
548 dw_window_set_text((HWND)cursortogglebutton,"Set Cursor pointer - CLOCK"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
549 dw_window_set_pointer((HWND)data,DW_POINTER_DEFAULT); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
550 cursor_arrow = 1; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
551 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
552 return FALSE; |
391
2059f18e9c20
Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
385
diff
changeset
|
553 } |
2059f18e9c20
Add extra button to test mouse cursor change.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
385
diff
changeset
|
554 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
555 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
|
556 { |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
557 dw_timer_disconnect(timerid); |
2597
99fdcb7f2a2a
Don't reuse timerid since on iOS and Android it is not an index to a timer
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2588
diff
changeset
|
558 timerid = 0; |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
559 return TRUE; |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
560 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
561 |
1746
76b24619f6fa
Experimental OS/2 code adding utf8 input conversion...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1745
diff
changeset
|
562 int DWSIGNAL keypress_callback(HWND window, char ch, int vk, int state, void *data, char *utf8) |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
563 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
564 char tmpbuf[100]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
565 if ( ch ) |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
566 sprintf(tmpbuf, "Key: %c(%d) Modifiers: %s(%d) utf8 %s", ch, ch, resolve_keymodifiers(state), state, utf8); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
567 else |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
568 sprintf(tmpbuf, "Key: %s(%d) Modifiers: %s(%d) utf8 %s", resolve_keyname(vk), vk, resolve_keymodifiers(state), state, utf8); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
569 dw_window_set_text(status1, tmpbuf); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
570 return 0; |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
571 } |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
572 |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
573 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
|
574 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
575 char buf[100]; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
576 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
577 sprintf(buf, "%s menu item selected", (char *)data); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
578 dw_messagebox("Menu Item Callback", DW_MB_OK | DW_MB_INFORMATION, buf); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
579 return 0; |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
580 } |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
581 |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
582 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
|
583 { |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
584 if (menu_enabled) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
585 { |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
586 dw_menu_item_set_state(changeable_menu, CHECKABLE_MENUITEMID, DW_MIS_DISABLED); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
587 dw_menu_item_set_state(changeable_menu, NONCHECKABLE_MENUITEMID, DW_MIS_DISABLED); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
588 menu_enabled = 0; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
589 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
590 else |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
591 { |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
592 dw_menu_item_set_state(changeable_menu, CHECKABLE_MENUITEMID, DW_MIS_ENABLED); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
593 dw_menu_item_set_state(changeable_menu, NONCHECKABLE_MENUITEMID, DW_MIS_ENABLED); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
594 menu_enabled = 1; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
595 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
596 return 0; |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
597 } |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
598 |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
599 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
|
600 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
601 DWEnv env; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
602 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
603 dw_environment_query(&env); |
2542
bb75e64e6138
Android: Implement dw_screen_* and dw_environment_query().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2532
diff
changeset
|
604 dw_messagebox("About dwindows", DW_MB_OK | DW_MB_INFORMATION, "dwindows test\n\nOS: %s %s %s Version: %d.%d.%d.%d\n\nHTML: %s\n\ndwindows Version: %d.%d.%d\n\nScreen: %dx%d %dbpp", |
1741
1b3b059a74b1
Unsafe use of sprintf() in dwtest may have been causing stack overruns on Win2k.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1738
diff
changeset
|
605 env.osName, env.buildDate, env.buildTime, |
1b3b059a74b1
Unsafe use of sprintf() in dwtest may have been causing stack overruns on Win2k.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1738
diff
changeset
|
606 env.MajorVersion, env.MinorVersion, env.MajorBuild, env.MinorBuild, |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
607 env.htmlEngine, |
2542
bb75e64e6138
Android: Implement dw_screen_* and dw_environment_query().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2532
diff
changeset
|
608 env.DWMajorVersion, env.DWMinorVersion, env.DWSubVersion, |
bb75e64e6138
Android: Implement dw_screen_* and dw_environment_query().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2532
diff
changeset
|
609 dw_screen_width(), dw_screen_height(), dw_color_depth_get()); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
610 return 0; |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
611 } |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
612 |
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
|
613 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
|
614 { |
1559
bc3a11fe9a46
Don't use _dw_pool_drain() in dw_exit() on Mac... that drains and recreates the pool.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1557
diff
changeset
|
615 if(dw_messagebox("dwtest", DW_MB_YESNO | DW_MB_QUESTION, "Are you sure you want to exit?")) |
bc3a11fe9a46
Don't use _dw_pool_drain() in dw_exit() on Mac... that drains and recreates the pool.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1557
diff
changeset
|
616 { |
bc3a11fe9a46
Don't use _dw_pool_drain() in dw_exit() on Mac... that drains and recreates the pool.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1557
diff
changeset
|
617 dw_main_quit(); |
bc3a11fe9a46
Don't use _dw_pool_drain() in dw_exit() on Mac... that drains and recreates the pool.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1557
diff
changeset
|
618 } |
bc3a11fe9a46
Don't use _dw_pool_drain() in dw_exit() on Mac... that drains and recreates the pool.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1557
diff
changeset
|
619 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
|
620 } |
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
|
621 |
2104
6e55c6f8d816
Added initial notification callback code to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2099
diff
changeset
|
622 int DWSIGNAL notification_clicked_callback(HWND notification, void *data) |
6e55c6f8d816
Added initial notification callback code to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2099
diff
changeset
|
623 { |
6e55c6f8d816
Added initial notification callback code to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2099
diff
changeset
|
624 dw_debug("Notification clicked\n"); |
2105
10c22853b479
Add dw_app_id_set() dwtest call to set application name and ID for sending notifications.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2104
diff
changeset
|
625 return TRUE; |
2104
6e55c6f8d816
Added initial notification callback code to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2099
diff
changeset
|
626 } |
6e55c6f8d816
Added initial notification callback code to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2099
diff
changeset
|
627 |
905
ae5d884af4ed
Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
897
diff
changeset
|
628 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
|
629 { |
2724
c1f8e598960d
Only expand the calendar control and box horizontally....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2717
diff
changeset
|
630 char *tmp = dw_file_browse("Pick a file", "dwtest.c", "c", DW_FILE_OPEN); |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
631 if(tmp) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
632 { |
2717
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
633 char *errors = read_file(tmp); |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
634 char *title = "New file load"; |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
635 char *image = "image/test.png"; |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
636 HWND notification; |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
637 |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
638 if(errors) |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
639 notification = dw_notification_new(title, image,"dwtest failed to load \"%s\" into the file browser, %s.", tmp, errors); |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
640 else |
43d630b2b37f
Add error checking to the file load handler and display an error notification
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2609
diff
changeset
|
641 notification = dw_notification_new(title, image,"dwtest loaded \"%s\" into the file browser on the Render tab, with \"File Display\" selected from the drop down list.", tmp); |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
642 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
643 if(current_file) |
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
644 dw_free(current_file); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
645 current_file = tmp; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
646 dw_window_set_text(entryfield, current_file); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
647 current_col = current_row = 0; |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
648 render_draw(); |
2104
6e55c6f8d816
Added initial notification callback code to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2099
diff
changeset
|
649 dw_signal_connect(notification, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(notification_clicked_callback), NULL); |
2066
2c2530f8cbef
Initial design for system notification support on GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2054
diff
changeset
|
650 dw_notification_send(notification); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
651 } |
1798
9fb8339ae458
Add simple test of dw_window_set_focus()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1795
diff
changeset
|
652 dw_window_set_focus(copypastefield); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
653 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
|
654 } |
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
|
655 |
905
ae5d884af4ed
Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
897
diff
changeset
|
656 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
|
657 { |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
658 char *tmp = dw_file_browse("Pick a folder", ".", "c", DW_DIRECTORY_OPEN); |
1306
dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1294
diff
changeset
|
659 dw_debug("Folder picked: %s\n", tmp ? tmp : "None"); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
660 return 0; |
905
ae5d884af4ed
Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
897
diff
changeset
|
661 } |
ae5d884af4ed
Added a Browse Folder button to test the folder browsing dialogs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
897
diff
changeset
|
662 |
503
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
663 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
|
664 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
665 unsigned int y,m,d; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
666 unsigned int idx; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
667 int len; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
668 long spvalue; |
2521
5f92284e2b08
Android: Implement bitmap buttons, implement dw_listbox_selected_multi().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2506
diff
changeset
|
669 char buf1[100] = {0}; |
5f92284e2b08
Android: Implement bitmap buttons, implement dw_listbox_selected_multi().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2506
diff
changeset
|
670 char buf2[100] = {0}; |
5f92284e2b08
Android: Implement bitmap buttons, implement dw_listbox_selected_multi().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2506
diff
changeset
|
671 char buf3[500] = {0}; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
672 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
673 idx = dw_listbox_selected(combobox1); |
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
674 dw_listbox_get_text(combobox1, idx, buf1, 99); |
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
675 idx = dw_listbox_selected(combobox2); |
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
676 dw_listbox_get_text(combobox2, idx, buf2, 99); |
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
677 dw_calendar_get_date(cal, &y, &m, &d); |
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
678 spvalue = dw_spinbutton_get_pos(spinbutton); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
679 len = sprintf(buf3, "spinbutton: %ld\ncombobox1: \"%s\"\ncombobox2: \"%s\"\ncalendar: %d-%d-%d", |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
680 spvalue, |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
681 buf1, buf2, |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
682 y, m, d); |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
683 dw_messagebox("Values", DW_MB_OK | DW_MB_INFORMATION, buf3); |
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
684 dw_clipboard_set_text(buf3, len); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
685 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
|
686 } |
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
687 |
1833
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
688 int DWSIGNAL bitmap_toggle_callback(HWND window, void *data) |
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
689 { |
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
690 static int isfoldericon = 1; |
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
691 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
692 if(isfoldericon) |
1833
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
693 { |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
694 isfoldericon = 0; |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
695 dw_window_set_bitmap(window, 0, fileiconpath); |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
696 dw_window_set_tooltip(window, "File Icon"); |
1833
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
697 } |
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
698 else |
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
699 { |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
700 isfoldericon = 1; |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
701 dw_window_set_bitmap_from_data(window, 0, folder_ico, sizeof(folder_ico)); |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
702 dw_window_set_tooltip(window, "Folder Icon"); |
1833
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
703 } |
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
704 return 0; |
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
705 } |
b35e041fc114
Fixed dw_bitmapbutton_new_from_data(); was missing the save of the bitmap image reference.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1821
diff
changeset
|
706 |
1190
76262040ed5f
Added DW_PERCENT_INDETERMINATE which can be passed to dw_percent_set_pos() to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1186
diff
changeset
|
707 int DWSIGNAL percent_button_box_callback(HWND window, void *data) |
503
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
708 { |
1190
76262040ed5f
Added DW_PERCENT_INDETERMINATE which can be passed to dw_percent_set_pos() to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1186
diff
changeset
|
709 dw_percent_set_pos(percent, DW_PERCENT_INDETERMINATE); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
710 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
|
711 } |
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
712 |
634
c6a216c8174f
Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
629
diff
changeset
|
713 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
|
714 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
715 dw_window_set_color(buttonsbox, DW_CLR_RED, DW_CLR_RED); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
716 return 0; |
634
c6a216c8174f
Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
629
diff
changeset
|
717 } |
c6a216c8174f
Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
629
diff
changeset
|
718 |
c6a216c8174f
Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
629
diff
changeset
|
719 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
|
720 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
721 dw_window_set_color(buttonsbox, DW_CLR_YELLOW, DW_CLR_YELLOW); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
722 return 0; |
634
c6a216c8174f
Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
629
diff
changeset
|
723 } |
c6a216c8174f
Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
629
diff
changeset
|
724 |
c6a216c8174f
Support for setting transparent colour for bitmaps
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
629
diff
changeset
|
725 |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
726 /* 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
|
727 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
|
728 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
729 if(data) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
730 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
731 HWND stext = (HWND)data; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
732 char tmpbuf[100]; |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
733 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
734 if(hwnd == vscrollbar) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
735 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
736 current_row = value; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
737 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
738 else |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
739 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
740 current_col = value; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
741 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
742 sprintf(tmpbuf, "Row:%d Col:%d Lines:%d Cols:%d", current_row,current_col,num_lines,max_linewidth); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
743 dw_window_set_text(stext, tmpbuf); |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
744 render_draw(); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
745 } |
217
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
746 } |
7112c817573d
Added test code from mark hessling.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
213
diff
changeset
|
747 |
602
489a684af1bb
Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
600
diff
changeset
|
748 /* 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
|
749 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
|
750 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
751 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
|
752 } |
489a684af1bb
Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
600
diff
changeset
|
753 |
627
77cc62375fee
Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
621
diff
changeset
|
754 /* 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
|
755 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
|
756 { |
1190
76262040ed5f
Added DW_PERCENT_INDETERMINATE which can be passed to dw_percent_set_pos() to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1186
diff
changeset
|
757 dw_percent_set_pos(percent, value * 10); |
627
77cc62375fee
Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
621
diff
changeset
|
758 } |
77cc62375fee
Fixed dw_html_raw() under GTK+ and added test case for it
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
621
diff
changeset
|
759 |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
760 /* 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
|
761 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
|
762 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
763 HPIXMAP old1 = text1pm, old2 = text2pm; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
764 unsigned long depth = dw_color_depth_get(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
765 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
766 rows = height / font_height; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
767 cols = width / font_width; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
768 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
769 /* Create new pixmaps with the current sizes */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
770 text1pm = dw_pixmap_new(textbox1, (unsigned long)(font_width*(width1)), (unsigned long)height, (int)depth); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
771 text2pm = dw_pixmap_new(textbox2, (unsigned long)width, (unsigned long)height, (int)depth); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
772 |
1461
09323eb9dc32
Clear the side pixmap on configure so there won't sometimes be garbage there.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1460
diff
changeset
|
773 /* Make sure the side area is cleared */ |
09323eb9dc32
Clear the side pixmap on configure so there won't sometimes be garbage there.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1460
diff
changeset
|
774 dw_color_foreground_set(DW_CLR_WHITE); |
1684
31dd366acfc8
Fixed calculating the GDI+ ratio based on the DPI on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1667
diff
changeset
|
775 dw_draw_rect(0, text1pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, (int)DW_PIXMAP_WIDTH(text1pm), (int)DW_PIXMAP_HEIGHT(text1pm)); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
776 |
1461
09323eb9dc32
Clear the side pixmap on configure so there won't sometimes be garbage there.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1460
diff
changeset
|
777 /* Destroy the old pixmaps */ |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
778 dw_pixmap_destroy(old1); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
779 dw_pixmap_destroy(old2); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
780 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
781 /* Update scrollbar ranges with new values */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
782 dw_scrollbar_set_range(hscrollbar, max_linewidth, cols); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
783 dw_scrollbar_set_range(vscrollbar, num_lines, rows); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
784 |
2360
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
785 /* Redraw the render widgets */ |
98d0873d9c05
Rewrite the render code to use the new dw_render_redraw() to trigger expose
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2354
diff
changeset
|
786 render_draw(); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
787 return TRUE; |
218
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
788 } |
fe0ab0040ba2
Not quite right yet but... handle resize and pixmap resizing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
217
diff
changeset
|
789 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
790 int DWSIGNAL item_enter_cb(HWND window, 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
|
791 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
792 char buf[200]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
793 HWND statline = (HWND)data; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
794 |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
795 sprintf(buf,"DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), text, DW_POINTER_TO_UINT(itemdata)); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
796 dw_window_set_text(statline, buf); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
797 return 0; |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
798 } |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
799 |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
800 /* Context menus */ |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
801 int DWSIGNAL context_menu_cb(HWND hwnd, void *data) |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
802 { |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
803 char buf[200]; |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
804 HWND statline = (HWND)data; |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
805 |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
806 sprintf(buf,"DW_SIGNAL_CLICKED: Menu: %x Container context menu clicked", DW_POINTER_TO_UINT(hwnd)); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
807 dw_window_set_text(statline, buf); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
808 return 0; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
809 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
810 |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
811 HMENUI item_context_menu_new(char *text, void *data) |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
812 { |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
813 HMENUI hwndMenu = dw_menu_new(0L); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
814 HMENUI hwndSubMenu = dw_menu_new(0L); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
815 HWND menuitem = dw_menu_append_item(hwndSubMenu, "File", DW_MENU_POPUP, 0L, TRUE, TRUE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
816 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
817 menuitem = dw_menu_append_item(hwndSubMenu, "Date", DW_MENU_POPUP, 0L, TRUE, TRUE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
818 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
819 menuitem = dw_menu_append_item(hwndSubMenu, "Size", DW_MENU_POPUP, 0L, TRUE, TRUE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
820 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
821 menuitem = dw_menu_append_item(hwndSubMenu, "None", DW_MENU_POPUP, 0L, TRUE, TRUE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
822 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
823 |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
824 menuitem = dw_menu_append_item(hwndMenu, "Sort", DW_MENU_POPUP, 0L, TRUE, FALSE, hwndSubMenu); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
825 |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
826 menuitem = dw_menu_append_item(hwndMenu, "Make Directory", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
827 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
828 |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
829 dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
830 menuitem = dw_menu_append_item(hwndMenu, "Rename Entry", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
831 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
832 |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
833 menuitem = dw_menu_append_item(hwndMenu, "Delete Entry", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
834 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
835 |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
836 dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
837 menuitem = dw_menu_append_item(hwndMenu, "View File", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
838 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
839 |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
840 return hwndMenu; |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
841 } |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
842 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
843 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
|
844 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
845 char buf[200]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
846 HWND statline = (HWND)data; |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
847 HMENUI popupmenu = item_context_menu_new(text, data); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
848 |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
849 sprintf(buf,"DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", DW_POINTER_TO_UINT(window), text, x, y, DW_POINTER_TO_UINT(itemdata)); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
850 dw_window_set_text(statline, buf); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
851 dw_menu_popup(&popupmenu, mainwindow, x, y); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
852 return 0; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
853 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
854 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
855 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
|
856 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
857 char buf[200]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
858 HWND statline = (HWND)data; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
859 |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
860 sprintf(buf,"DW_SIGNAL_LIST_SELECT: Window: %d Item: %d", DW_POINTER_TO_UINT(window), item); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
861 dw_window_set_text(statline, buf); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
862 return 0; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
863 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
864 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
865 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
|
866 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
867 char buf[200]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
868 HWND statline = (HWND)data; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
869 |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
870 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
871 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata)); |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
872 dw_window_set_text(statline, buf); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
873 return 0; |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
874 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
875 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
876 int DWSIGNAL container_select_cb(HWND window, HTREEITEM item, char *text, void *data, void *itemdata) |
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
|
877 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
878 char buf[200]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
879 char *str; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
880 HWND statline = (HWND)data; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
881 unsigned long size; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
882 |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
883 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
884 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
885 dw_window_set_text( statline, buf); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
886 sprintf(buf,"\r\nDW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x\r\n", DW_POINTER_TO_UINT(window), |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
887 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
888 mle_point = dw_mle_import( container_mle, buf, mle_point); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
889 str = dw_container_query_start(container, DW_CRA_SELECTED); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
890 while(str) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
891 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
892 sprintf(buf,"Selected: %s\r\n", str); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
893 mle_point = dw_mle_import( container_mle, buf, mle_point); |
1884
71780cf68aa2
More container and tree changes on all platforms regarding memory.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1883
diff
changeset
|
894 dw_free(str); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
895 str = dw_container_query_next(container, DW_CRA_SELECTED); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
896 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
897 /* Make the last inserted point the cursor location */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
898 dw_mle_set_cursor(container_mle, mle_point); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
899 /* set the details of item 0 to new data */ |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
900 dw_debug("In cb: container: %x containerinfo: %x icon: %x\n", DW_POINTER_TO_INT(container), |
1102
cfe7d2b6bc16
Added DW_INT_TO_POINTER/DW_UINT_TO_POINTER/DW_POINTER_TO_INT/DW_POINTER_TO_UINT macros.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1090
diff
changeset
|
901 DW_POINTER_TO_INT(containerinfo), DW_POINTER_TO_INT(fileicon)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
902 dw_filesystem_change_file(container, 0, "new data", fileicon); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
903 size = 999; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
904 dw_debug("In cb: container: %x containerinfo: %x icon: %x\n", DW_POINTER_TO_INT(container), |
1102
cfe7d2b6bc16
Added DW_INT_TO_POINTER/DW_UINT_TO_POINTER/DW_POINTER_TO_INT/DW_POINTER_TO_UINT macros.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1090
diff
changeset
|
905 DW_POINTER_TO_INT(containerinfo), DW_POINTER_TO_INT(fileicon)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
906 dw_filesystem_change_item(container, 1, 0, &size); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
907 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
|
908 } |
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
|
909 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
910 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
|
911 { |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
912 dw_debug("DW_SIGNAL_SWITCH_PAGE: Window: %x PageNum: %u Itemdata: %x\n", DW_POINTER_TO_UINT(window), |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
913 DW_POINTER_TO_UINT(page_num), DW_POINTER_TO_UINT(itemdata)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
914 return 0; |
333
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
915 } |
b6491cefa512
Add test for switch-page signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
328
diff
changeset
|
916 |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
917 int DWSIGNAL column_click_cb(HWND window, int column_num, void *data) |
474
053211e0698b
Add tracing code for column-click signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
459
diff
changeset
|
918 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
919 char buf[200], buf1[100]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
920 HWND statline = (HWND)data; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
921 int column_type; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
922 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
923 if(column_num == 0) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
924 strcpy(buf1,"Filename"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
925 else |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
926 { |
2448
7e1828dd4fe0
iOS: Fix scrollbox content not expanding to take the full area if smaller.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2447
diff
changeset
|
927 column_type = dw_filesystem_get_column_type(window, column_num-1); |
2560
3da35cd91ca7
Android: Implement querying containers and ENTER and CONTEXT callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2554
diff
changeset
|
928 if(column_type == DW_CFA_STRING) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
929 strcpy(buf1,"String"); |
2560
3da35cd91ca7
Android: Implement querying containers and ENTER and CONTEXT callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2554
diff
changeset
|
930 else if(column_type == DW_CFA_ULONG) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
931 strcpy(buf1,"ULong"); |
2560
3da35cd91ca7
Android: Implement querying containers and ENTER and CONTEXT callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2554
diff
changeset
|
932 else if(column_type == DW_CFA_DATE) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
933 strcpy(buf1,"Date"); |
2560
3da35cd91ca7
Android: Implement querying containers and ENTER and CONTEXT callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2554
diff
changeset
|
934 else if(column_type == DW_CFA_TIME) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
935 strcpy(buf1,"Time"); |
2560
3da35cd91ca7
Android: Implement querying containers and ENTER and CONTEXT callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2554
diff
changeset
|
936 else if(column_type == DW_CFA_BITMAPORICON) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
937 strcpy(buf1,"BitmapOrIcon"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
938 else |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
939 strcpy(buf1,"Unknown"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
940 } |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
941 sprintf(buf,"DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Type: %s Itemdata: %x", DW_POINTER_TO_UINT(window), |
1102
cfe7d2b6bc16
Added DW_INT_TO_POINTER/DW_UINT_TO_POINTER/DW_POINTER_TO_INT/DW_POINTER_TO_UINT macros.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1090
diff
changeset
|
942 column_num, buf1, DW_POINTER_TO_UINT(data) ); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
943 dw_window_set_text( statline, buf); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
944 return 0; |
474
053211e0698b
Add tracing code for column-click signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
459
diff
changeset
|
945 } |
053211e0698b
Add tracing code for column-click signal.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
459
diff
changeset
|
946 |
602
489a684af1bb
Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
600
diff
changeset
|
947 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
|
948 { |
1306
dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1294
diff
changeset
|
949 dw_debug("got combobox_select_event for index: %d, iteration: %d\n", index, iteration++); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
950 return FALSE; |
602
489a684af1bb
Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
600
diff
changeset
|
951 } |
489a684af1bb
Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
600
diff
changeset
|
952 |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
953 int DWSIGNAL copy_clicked_callback(HWND button, void *data) |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
954 { |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
955 char *test = dw_window_get_text(copypastefield); |
1798
9fb8339ae458
Add simple test of dw_window_set_focus()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1795
diff
changeset
|
956 |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
957 if(test) |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
958 { |
1765
15414cbe857f
Fix warnings with Visual C largely in debug mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1753
diff
changeset
|
959 dw_clipboard_set_text(test, (int)strlen(test)); |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
960 dw_free(test); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
961 } |
1798
9fb8339ae458
Add simple test of dw_window_set_focus()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1795
diff
changeset
|
962 dw_window_set_focus(entryfield); |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
963 return TRUE; |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
964 } |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
965 |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
966 int DWSIGNAL paste_clicked_callback(HWND button, void *data) |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
967 { |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
968 char *test = dw_clipboard_get_text(); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
969 if(test) |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
970 { |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
971 dw_window_set_text(copypastefield, test); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
972 dw_free(test); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
973 } |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
974 return TRUE; |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
975 } |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
976 |
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
|
977 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
|
978 { |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
979 HWND browsefilebutton, browsefolderbutton, copybutton, pastebutton, browsebox; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
980 |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
981 lbbox = dw_box_new(DW_VERT, 10); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
982 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
983 dw_box_pack_start(notebookbox1, lbbox, 150, 70, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
984 |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
985 /* Copy and Paste */ |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
986 browsebox = dw_box_new(DW_HORZ, 0); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
987 |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
988 dw_box_pack_start(lbbox, browsebox, 0, 0, FALSE, FALSE, 0); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
989 |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
990 copypastefield = dw_entryfield_new("", 0); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
991 |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
992 dw_entryfield_set_limit(copypastefield, 260); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
993 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
994 dw_box_pack_start(browsebox, copypastefield, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 4); |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
995 |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
996 copybutton = dw_button_new("Copy", 0); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
997 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
998 dw_box_pack_start(browsebox, copybutton, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 0); |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
999 |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
1000 pastebutton = dw_button_new("Paste", 0); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
1001 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1002 dw_box_pack_start(browsebox, pastebutton, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 0); |
1798
9fb8339ae458
Add simple test of dw_window_set_focus()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1795
diff
changeset
|
1003 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1004 /* Archive Name */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1005 stext = dw_text_new("File to browse", 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1006 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1007 dw_window_set_style(stext, DW_DT_VCENTER, DW_DT_VCENTER); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1008 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1009 dw_box_pack_start(lbbox, stext, 130, 15, TRUE, TRUE, 2); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1010 |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1011 browsebox = dw_box_new(DW_HORZ, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1012 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1013 dw_box_pack_start(lbbox, browsebox, 0, 0, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1014 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1015 entryfield = dw_entryfield_new("", 100L); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1016 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1017 dw_entryfield_set_limit(entryfield, 260); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1018 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1019 dw_box_pack_start(browsebox, entryfield, 100, 15, TRUE, TRUE, 4); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1020 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1021 browsefilebutton = dw_button_new("Browse File", 1001L); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1022 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1023 dw_box_pack_start(browsebox, browsefilebutton, 40, 15, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1024 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1025 browsefolderbutton = dw_button_new("Browse Folder", 1001L); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1026 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1027 dw_box_pack_start(browsebox, browsefolderbutton, 40, 15, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1028 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1029 dw_window_set_color(browsebox, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1030 dw_window_set_color(stext, DW_CLR_BLACK, DW_CLR_PALEGRAY); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1031 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1032 /* Buttons */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1033 buttonbox = dw_box_new(DW_HORZ, 10); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1034 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1035 dw_box_pack_start(lbbox, buttonbox, 0, 0, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1036 |
1667
9dbd2984c1e5
Initial implementation of dw_box_remove() and dw_box_remove_at_index()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1615
diff
changeset
|
1037 cancelbutton = dw_button_new("Exit", 1002L); |
9dbd2984c1e5
Initial implementation of dw_box_remove() and dw_box_remove_at_index()
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1615
diff
changeset
|
1038 dw_box_pack_start(buttonbox, cancelbutton, 130, 30, TRUE, TRUE, 2); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1039 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1040 cursortogglebutton = dw_button_new("Set Cursor pointer - CLOCK", 1003L); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1041 dw_box_pack_start(buttonbox, cursortogglebutton, 130, 30, TRUE, TRUE, 2); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1042 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1043 okbutton = dw_button_new("Turn Off Annoying Beep!", 1001L); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1044 dw_box_pack_start(buttonbox, okbutton, 130, 30, TRUE, TRUE, 2); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1045 |
1769
d81bebc5c8cc
Mark and I decided to change dw_box_remove*() to dw_box_unpack*() for consistency.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1765
diff
changeset
|
1046 dw_box_unpack(cancelbutton); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1047 dw_box_pack_start(buttonbox, cancelbutton, 130, 30, TRUE, TRUE, 2); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1048 dw_window_click_default( mainwindow, cancelbutton ); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1049 |
1077
34f1d6f5f1c3
Added function dw_box_pack_at_index() on Windows, Mac and OS/2. And an example usage in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1049
diff
changeset
|
1050 colorchoosebutton = dw_button_new("Color Chooser Dialog", 1004L); |
34f1d6f5f1c3
Added function dw_box_pack_at_index() on Windows, Mac and OS/2. And an example usage in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1049
diff
changeset
|
1051 dw_box_pack_at_index(buttonbox, colorchoosebutton, 1, 130, 30, TRUE, TRUE, 2); |
34f1d6f5f1c3
Added function dw_box_pack_at_index() on Windows, Mac and OS/2. And an example usage in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1049
diff
changeset
|
1052 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1053 /* Set some nice fonts and colors */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1054 dw_window_set_color(lbbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1055 dw_window_set_color(buttonbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1056 dw_window_set_color(okbutton, DW_CLR_PALEGRAY, DW_CLR_DARKCYAN); |
1849
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1057 #ifdef COLOR_DEBUG |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1058 dw_window_set_color(copypastefield, DW_CLR_WHITE, DW_CLR_RED); |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1059 dw_window_set_color(copybutton, DW_CLR_WHITE, DW_CLR_RED); |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1060 /* Set a color then clear it to make sure it clears correctly */ |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1061 dw_window_set_color(entryfield, DW_CLR_WHITE, DW_CLR_RED); |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1062 dw_window_set_color(entryfield, DW_CLR_DEFAULT, DW_CLR_DEFAULT); |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1063 /* Set a color then clear it to make sure it clears correctly... again */ |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1064 dw_window_set_color(pastebutton, DW_CLR_WHITE, DW_CLR_RED); |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1065 dw_window_set_color(pastebutton, DW_CLR_DEFAULT, DW_CLR_DEFAULT); |
b5e1ccc76e58
Added code to set the foreground color on Mac buttons...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1844
diff
changeset
|
1066 #endif |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1067 |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1068 dw_signal_connect(browsefilebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_file_callback), DW_POINTER(notebookbox1)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1069 dw_signal_connect(browsefolderbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_folder_callback), DW_POINTER(notebookbox1)); |
1753
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
1070 dw_signal_connect(copybutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(copy_clicked_callback), DW_POINTER(copypastefield)); |
87c215963fdc
Added some fields to the test program to test copy and paste functionality.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1746
diff
changeset
|
1071 dw_signal_connect(pastebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(paste_clicked_callback), DW_POINTER(copypastefield)); |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1072 dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(beep_callback), DW_POINTER(notebookbox1)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1073 dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1074 dw_signal_connect(cursortogglebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(cursortoggle_callback), DW_POINTER(mainwindow)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1075 dw_signal_connect(colorchoosebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(colorchoose_callback), DW_POINTER(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
|
1076 } |
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
|
1077 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1078 int API motion_notify_event(HWND window, int x, int y, int buttonmask, void *data) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1079 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1080 char buf[200]; |
2609
1ee59f231f6c
Add buttons to the status info on the render test tab.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2597
diff
changeset
|
1081 sprintf(buf, "%s: %dx%d buttons %d", data ? "motion_notify" : "button_press", x, y, buttonmask); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1082 dw_window_set_text(status2, buf); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1083 return 0; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1084 } |
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
|
1085 |
1560
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1086 int DWSIGNAL show_window_callback(HWND window, void *data) |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1087 { |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1088 HWND thiswindow = (HWND)data; |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1089 if(thiswindow) |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1090 { |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1091 dw_window_show(thiswindow); |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1092 dw_window_raise(thiswindow); |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1093 } |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1094 return TRUE; |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1095 } |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1096 |
1220
67ff39b9577c
Initial implementation of dw_taskbar_* for the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1213
diff
changeset
|
1097 int API context_menu_event(HWND window, int x, int y, int buttonmask, void *data) |
67ff39b9577c
Initial implementation of dw_taskbar_* for the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1213
diff
changeset
|
1098 { |
1221
10f5b8645975
Fixes to allow non-toplevel window handles in dw_taskbar_insert() on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1220
diff
changeset
|
1099 HMENUI hwndMenu = dw_menu_new(0L); |
1560
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1100 HWND menuitem = dw_menu_append_item(hwndMenu, "~Quit", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); |
1220
67ff39b9577c
Initial implementation of dw_taskbar_* for the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1213
diff
changeset
|
1101 long px, py; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1102 |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1103 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow)); |
1560
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1104 dw_menu_append_item(hwndMenu, DW_MENU_SEPARATOR, DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
1105 menuitem = dw_menu_append_item(hwndMenu, "~Show Window", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1106 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(show_window_callback), DW_POINTER(mainwindow)); |
1220
67ff39b9577c
Initial implementation of dw_taskbar_* for the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1213
diff
changeset
|
1107 dw_pointer_query_pos(&px, &py); |
1227
b54d37938d61
Fix for the status popup menu not functioning when a different
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1224
diff
changeset
|
1108 /* Use the toplevel window handle here.... because on the Mac.. |
b54d37938d61
Fix for the status popup menu not functioning when a different
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1224
diff
changeset
|
1109 * using the control itself, when a different tab is active |
b54d37938d61
Fix for the status popup menu not functioning when a different
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1224
diff
changeset
|
1110 * the control is removed from the window and can no longer |
b54d37938d61
Fix for the status popup menu not functioning when a different
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1224
diff
changeset
|
1111 * handle the messages. |
b54d37938d61
Fix for the status popup menu not functioning when a different
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1224
diff
changeset
|
1112 */ |
b54d37938d61
Fix for the status popup menu not functioning when a different
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1224
diff
changeset
|
1113 dw_menu_popup(&hwndMenu, mainwindow, (int)px, (int)py); |
1224
cfe8608253a8
Return code of 0 from the button press callback on OS/2 was causing
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1221
diff
changeset
|
1114 return TRUE; |
1220
67ff39b9577c
Initial implementation of dw_taskbar_* for the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1213
diff
changeset
|
1115 } |
67ff39b9577c
Initial implementation of dw_taskbar_* for the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1213
diff
changeset
|
1116 |
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
|
1117 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
|
1118 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1119 unsigned long depth = dw_color_depth_get(); |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
1120 HWND vscrollbox, hbox, button1, button2, label; |
1460
da9cd5da3440
Test dw_window_get_preferred_size by using it to get the size of the scrollbars.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1456
diff
changeset
|
1121 int vscrollbarwidth, hscrollbarheight; |
1785
c5ea64e8b436
Added UTF8/Wide conversion for GTK2/3.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1783
diff
changeset
|
1122 wchar_t widestring[100] = L"DWTest Wide"; |
c5ea64e8b436
Added UTF8/Wide conversion for GTK2/3.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1783
diff
changeset
|
1123 char *utf8string = dw_wchar_to_utf8(widestring); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1124 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1125 /* create a box to pack into the notebook page */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1126 pagebox = dw_box_new(DW_HORZ, 2); |
2560
3da35cd91ca7
Android: Implement querying containers and ENTER and CONTEXT callbacks.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2554
diff
changeset
|
1127 dw_box_pack_start(notebookbox2, pagebox, 0, 0, TRUE, TRUE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1128 /* now a status area under this box */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1129 hbox = dw_box_new(DW_HORZ, 1 ); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1130 dw_box_pack_start(notebookbox2, hbox, 100, 20, TRUE, FALSE, 1); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1131 status1 = dw_status_text_new("", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1132 dw_box_pack_start(hbox, status1, 100, DW_SIZE_AUTO, TRUE, FALSE, 1); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1133 status2 = dw_status_text_new("", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1134 dw_box_pack_start(hbox, status2, 100, DW_SIZE_AUTO, TRUE, FALSE, 1); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1135 /* a box with combobox and button */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1136 hbox = dw_box_new(DW_HORZ, 1 ); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1137 dw_box_pack_start(notebookbox2, hbox, 100, 25, TRUE, FALSE, 1); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1138 rendcombo = dw_combobox_new( "Shapes Double Buffered", 0 ); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1139 dw_box_pack_start(hbox, rendcombo, 80, 25, TRUE, TRUE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1140 dw_listbox_append(rendcombo, "Shapes Double Buffered"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1141 dw_listbox_append(rendcombo, "Shapes Direct"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1142 dw_listbox_append(rendcombo, "File Display"); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1143 label = dw_text_new("Image X:", 100); |
1142
88cc189b5e56
Some layout updates on the dwtest render page.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1137
diff
changeset
|
1144 dw_window_set_style(label, DW_DT_VCENTER | DW_DT_CENTER, DW_DT_VCENTER | DW_DT_CENTER); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1145 dw_box_pack_start(hbox, label, DW_SIZE_AUTO, 25, FALSE, TRUE, 0); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1146 imagexspin = dw_spinbutton_new("20", 1021); |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1147 dw_box_pack_start(hbox, imagexspin, 25, 25, TRUE, TRUE, 0); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1148 label = dw_text_new("Y:", 100); |
1142
88cc189b5e56
Some layout updates on the dwtest render page.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1137
diff
changeset
|
1149 dw_window_set_style(label, DW_DT_VCENTER | DW_DT_CENTER, DW_DT_VCENTER | DW_DT_CENTER); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1150 dw_box_pack_start(hbox, label, DW_SIZE_AUTO, 25, FALSE, TRUE, 0); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1151 imageyspin = dw_spinbutton_new("20", 1021); |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1152 dw_box_pack_start(hbox, imageyspin, 25, 25, TRUE, TRUE, 0); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1153 dw_spinbutton_set_limits(imagexspin, 2000, 0); |
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1154 dw_spinbutton_set_limits(imageyspin, 2000, 0); |
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1155 dw_spinbutton_set_pos(imagexspin, 20); |
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1156 dw_spinbutton_set_pos(imageyspin, 20); |
1243
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
1157 imagestretchcheck = dw_checkbox_new("Stretch", 1021); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1158 dw_box_pack_start(hbox, imagestretchcheck, DW_SIZE_AUTO, 25, FALSE, TRUE, 0); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1159 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1160 button1 = dw_button_new("Refresh", 1223L ); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1161 dw_box_pack_start(hbox, button1, DW_SIZE_AUTO, 25, FALSE, TRUE, 0); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1162 button2 = dw_button_new("Print", 1224L ); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1163 dw_box_pack_start(hbox, button2, DW_SIZE_AUTO, 25, FALSE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1164 |
1460
da9cd5da3440
Test dw_window_get_preferred_size by using it to get the size of the scrollbars.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1456
diff
changeset
|
1165 /* Pre-create the scrollbars so we can query their sizes */ |
da9cd5da3440
Test dw_window_get_preferred_size by using it to get the size of the scrollbars.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1456
diff
changeset
|
1166 vscrollbar = dw_scrollbar_new(DW_VERT, 50); |
da9cd5da3440
Test dw_window_get_preferred_size by using it to get the size of the scrollbars.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1456
diff
changeset
|
1167 hscrollbar = dw_scrollbar_new(DW_HORZ, 50); |
da9cd5da3440
Test dw_window_get_preferred_size by using it to get the size of the scrollbars.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1456
diff
changeset
|
1168 dw_window_get_preferred_size(vscrollbar, &vscrollbarwidth, NULL); |
da9cd5da3440
Test dw_window_get_preferred_size by using it to get the size of the scrollbars.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1456
diff
changeset
|
1169 dw_window_get_preferred_size(hscrollbar, NULL, &hscrollbarheight); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1170 |
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1171 /* On GTK with overlay scrollbars enabled this returns us 0... |
1525
34ce887be578
Handle special case of overlay scrollbars returning size 0.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1484
diff
changeset
|
1172 * so in that case we need to give it some real values. |
34ce887be578
Handle special case of overlay scrollbars returning size 0.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1484
diff
changeset
|
1173 */ |
34ce887be578
Handle special case of overlay scrollbars returning size 0.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1484
diff
changeset
|
1174 if(!vscrollbarwidth) |
34ce887be578
Handle special case of overlay scrollbars returning size 0.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1484
diff
changeset
|
1175 vscrollbarwidth = 8; |
34ce887be578
Handle special case of overlay scrollbars returning size 0.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1484
diff
changeset
|
1176 if(!hscrollbarheight) |
34ce887be578
Handle special case of overlay scrollbars returning size 0.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1484
diff
changeset
|
1177 hscrollbarheight = 8; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1178 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1179 /* create render box for number pixmap */ |
2542
bb75e64e6138
Android: Implement dw_screen_* and dw_environment_query().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2532
diff
changeset
|
1180 textbox1 = dw_render_new(100); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1181 dw_window_set_font(textbox1, FIXEDFONT); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1182 dw_font_text_extents_get(textbox1, NULL, "(g", &font_width, &font_height); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1183 font_width = font_width / 2; |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1184 vscrollbox = dw_box_new(DW_VERT, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1185 dw_box_pack_start(vscrollbox, textbox1, font_width*width1, font_height*rows, FALSE, TRUE, 0); |
1460
da9cd5da3440
Test dw_window_get_preferred_size by using it to get the size of the scrollbars.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1456
diff
changeset
|
1186 dw_box_pack_start(vscrollbox, 0, (font_width*(width1+1)), hscrollbarheight, FALSE, FALSE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1187 dw_box_pack_start(pagebox, vscrollbox, 0, 0, FALSE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1188 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1189 /* pack empty space 1 character wide */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1190 dw_box_pack_start(pagebox, 0, font_width, 0, FALSE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1191 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1192 /* create box for filecontents and horz scrollbar */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1193 textboxA = dw_box_new(DW_VERT,0 ); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1194 dw_box_pack_start(pagebox, textboxA, 0, 0, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1195 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1196 /* create render box for filecontents pixmap */ |
2542
bb75e64e6138
Android: Implement dw_screen_* and dw_environment_query().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2532
diff
changeset
|
1197 textbox2 = dw_render_new(101); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1198 dw_box_pack_start(textboxA, textbox2, 10, 10, TRUE, TRUE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1199 dw_window_set_font(textbox2, FIXEDFONT); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1200 /* create horizonal scrollbar */ |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1201 dw_box_pack_start(textboxA, hscrollbar, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1202 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1203 /* create vertical scrollbar */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1204 vscrollbox = dw_box_new(DW_VERT, 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1205 dw_box_pack_start(vscrollbox, vscrollbar, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, TRUE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1206 /* Pack an area of empty space 14x14 pixels */ |
1460
da9cd5da3440
Test dw_window_get_preferred_size by using it to get the size of the scrollbars.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1456
diff
changeset
|
1207 dw_box_pack_start(vscrollbox, 0, vscrollbarwidth, hscrollbarheight, FALSE, FALSE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1208 dw_box_pack_start(pagebox, vscrollbox, 0, 0, FALSE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1209 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1210 text1pm = dw_pixmap_new(textbox1, font_width*width1, font_height*rows, (int)depth); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1211 text2pm = dw_pixmap_new(textbox2, font_width*cols, font_height*rows, (int)depth); |
958 | 1212 image = dw_pixmap_new_from_file(textbox2, "image/test"); |
957
beed3e7f9d4b
Fixes to flip pixmaps when loading from file or data on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
955
diff
changeset
|
1213 if(!image) |
958 | 1214 image = dw_pixmap_new_from_file(textbox2, "~/test"); |
2446
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1215 if(!image) |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1216 { |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1217 char *appdir = dw_app_dir(); |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1218 char pathbuff[1025] = {0}; |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1219 int pos = (int)strlen(appdir); |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1220 |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1221 strncpy(pathbuff, appdir, 1024); |
2451
44b77654c406
Add DW_DIR_SEPARATOR for easy access to the separator characters.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2448
diff
changeset
|
1222 pathbuff[pos] = DW_DIR_SEPARATOR; |
2446
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1223 pos++; |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1224 strncpy(&pathbuff[pos], "test", 1024-pos); |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1225 image = dw_pixmap_new_from_file(textbox2, pathbuff); |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
1226 } |
958 | 1227 if(image) |
1228 dw_pixmap_set_transparent_color(image, DW_CLR_WHITE); | |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1229 |
1785
c5ea64e8b436
Added UTF8/Wide conversion for GTK2/3.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1783
diff
changeset
|
1230 dw_messagebox(utf8string ? utf8string : "DWTest", DW_MB_OK|DW_MB_INFORMATION, "Width: %d Height: %d\n", font_width, font_height); |
2816
4521f014bb17
Fix some memory leaks reported by Xcode's Instruments.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2800
diff
changeset
|
1231 if(utf8string) |
4521f014bb17
Fix some memory leaks reported by Xcode's Instruments.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2800
diff
changeset
|
1232 dw_free(utf8string); |
1684
31dd366acfc8
Fixed calculating the GDI+ ratio based on the DPI on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1667
diff
changeset
|
1233 dw_draw_rect(0, text1pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, font_width*width1, font_height*rows); |
31dd366acfc8
Fixed calculating the GDI+ ratio based on the DPI on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1667
diff
changeset
|
1234 dw_draw_rect(0, text2pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, font_width*cols, font_height*rows); |
1220
67ff39b9577c
Initial implementation of dw_taskbar_* for the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1213
diff
changeset
|
1235 dw_signal_connect(textbox1, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(context_menu_event), NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1236 dw_signal_connect(textbox1, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1237 dw_signal_connect(textbox2, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1238 dw_signal_connect(textbox2, DW_SIGNAL_CONFIGURE, DW_SIGNAL_FUNC(configure_event), text2pm); |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1239 dw_signal_connect(textbox2, DW_SIGNAL_MOTION_NOTIFY, DW_SIGNAL_FUNC(motion_notify_event), DW_INT_TO_POINTER(1)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1240 dw_signal_connect(textbox2, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(motion_notify_event), DW_INT_TO_POINTER(0)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1241 dw_signal_connect(hscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged_callback), DW_POINTER(status1)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1242 dw_signal_connect(vscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged_callback), DW_POINTER(status1)); |
1243
c191a562c14a
Added new dw_pixmap_stretch_bitblt() function on Windows and OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1242
diff
changeset
|
1243 dw_signal_connect(imagestretchcheck, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(refresh_callback), NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1244 dw_signal_connect(button1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(refresh_callback), NULL); |
1137
e24e5a13ff2c
Added code to test the new print functions in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1110
diff
changeset
|
1245 dw_signal_connect(button2, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(print_callback), NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1246 dw_signal_connect(rendcombo, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(render_select_event_callback), NULL ); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1247 dw_signal_connect(mainwindow, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(keypress_callback), NULL); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1248 |
1220
67ff39b9577c
Initial implementation of dw_taskbar_* for the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1213
diff
changeset
|
1249 dw_taskbar_insert(textbox1, fileicon, "DWTest"); |
254
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
1250 } |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
1251 |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
1252 void tree_add(void) |
42332e598d55
Add third notebook page - for tree example. Just starting.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
253
diff
changeset
|
1253 { |
1186
ce83df520be0
Remove the MDI notebook tab from DEPRECATED.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1152
diff
changeset
|
1254 HTREEITEM t1,t2; |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1255 HWND listbox; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1256 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1257 /* create a box to pack into the notebook page */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1258 listbox = dw_listbox_new(1024, TRUE); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1259 dw_box_pack_start(notebookbox3, listbox, 500, 200, TRUE, TRUE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1260 dw_listbox_append(listbox, "Test 1"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1261 dw_listbox_append(listbox, "Test 2"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1262 dw_listbox_append(listbox, "Test 3"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1263 dw_listbox_append(listbox, "Test 4"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1264 dw_listbox_append(listbox, "Test 5"); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1265 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1266 /* now a tree area under this box */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1267 tree = dw_tree_new(101); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1268 if(tree) |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1269 { |
2419
65ff339e9cd2
iOS: A number of fixes, notebook layout select first page if none selected.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2410
diff
changeset
|
1270 char *title; |
65ff339e9cd2
iOS: A number of fixes, notebook layout select first page if none selected.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2410
diff
changeset
|
1271 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1272 dw_box_pack_start(notebookbox3, tree, 500, 200, TRUE, TRUE, 1); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1273 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1274 /* and a status area to see whats going on */ |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1275 tree_status = dw_status_text_new("", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1276 dw_box_pack_start(notebookbox3, tree_status, 100, DW_SIZE_AUTO, TRUE, FALSE, 1); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1277 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1278 /* set up our signal trappers... */ |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1279 dw_signal_connect(tree, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), DW_POINTER(tree_status)); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1280 dw_signal_connect(tree, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(item_select_cb), DW_POINTER(tree_status)); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1281 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1282 t1 = dw_tree_insert(tree, "tree folder 1", foldericon, NULL, DW_INT_TO_POINTER(1)); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1283 t2 = dw_tree_insert(tree, "tree folder 2", foldericon, NULL, DW_INT_TO_POINTER(2)); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1284 dw_tree_insert(tree, "tree file 1", fileicon, t1, DW_INT_TO_POINTER(3)); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1285 dw_tree_insert(tree, "tree file 2", fileicon, t1, DW_INT_TO_POINTER(4)); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1286 dw_tree_insert(tree, "tree file 3", fileicon, t2, DW_INT_TO_POINTER(5)); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1287 dw_tree_insert(tree, "tree file 4", fileicon, t2, DW_INT_TO_POINTER(6)); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1288 dw_tree_item_change(tree, t1, "tree folder 1", foldericon); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1289 dw_tree_item_change(tree, t2, "tree folder 2", foldericon); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1290 dw_tree_item_set_data(tree, t2, DW_INT_TO_POINTER(100)); |
2768
b17197a2fb28
Add a dw_tree_item_expand() to the test program. This helps test another
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2742
diff
changeset
|
1291 dw_tree_item_expand(tree, t1); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1292 title = dw_tree_get_title(tree, t1); |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1293 dw_debug("t1 title \"%s\" data %d t2 data %d\n", title, DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t1)), |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1294 DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t2))); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1295 dw_free(title); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1296 } |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1297 else |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1298 { |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1299 tree = dw_text_new("Tree widget not available.", 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1300 dw_box_pack_start(notebookbox3, tree, 500, 200, TRUE, TRUE, 1); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1301 } |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
1302 } |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
1303 |
2229
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1304 int DWSIGNAL word_wrap_click_cb(HWND wordwrap, void *data) |
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1305 { |
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1306 HWND container_mle = (HWND)data; |
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1307 |
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1308 dw_mle_set_word_wrap(container_mle, dw_checkbox_get(wordwrap)); |
2230
7575eefcf881
Fix warning due to missing return in the word wrap callback.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2229
diff
changeset
|
1309 return TRUE; |
2229
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1310 } |
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1311 |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1312 HWND color_combobox(void) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1313 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1314 HWND combobox = dw_combobox_new("DW_CLR_DEFAULT", 0); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1315 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1316 dw_listbox_append(combobox, "DW_CLR_DEFAULT"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1317 dw_listbox_append(combobox, "DW_CLR_BLACK"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1318 dw_listbox_append(combobox, "DW_CLR_DARKRED"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1319 dw_listbox_append(combobox, "DW_CLR_DARKGREEN"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1320 dw_listbox_append(combobox, "DW_CLR_BROWN"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1321 dw_listbox_append(combobox, "DW_CLR_DARKBLUE"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1322 dw_listbox_append(combobox, "DW_CLR_DARKPINK"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1323 dw_listbox_append(combobox, "DW_CLR_DARKCYAN"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1324 dw_listbox_append(combobox, "DW_CLR_PALEGRAY"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1325 dw_listbox_append(combobox, "DW_CLR_DARKGRAY"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1326 dw_listbox_append(combobox, "DW_CLR_RED"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1327 dw_listbox_append(combobox, "DW_CLR_GREEN"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1328 dw_listbox_append(combobox, "DW_CLR_YELLOW"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1329 dw_listbox_append(combobox, "DW_CLR_BLUE"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1330 dw_listbox_append(combobox, "DW_CLR_PINK"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1331 dw_listbox_append(combobox, "DW_CLR_CYAN"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1332 dw_listbox_append(combobox, "DW_CLR_WHITE"); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1333 return combobox; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1334 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1335 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1336 ULONG combobox_color(char *colortext) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1337 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1338 ULONG color = DW_CLR_DEFAULT; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1339 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1340 if(strcmp(colortext, "DW_CLR_BLACK") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1341 color = DW_CLR_BLACK; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1342 else if(strcmp(colortext, "DW_CLR_DARKRED") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1343 color = DW_CLR_DARKRED; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1344 else if(strcmp(colortext, "DW_CLR_DARKGREEN") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1345 color = DW_CLR_DARKGREEN; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1346 else if(strcmp(colortext, "DW_CLR_BROWN") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1347 color = DW_CLR_BROWN; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1348 else if(strcmp(colortext, "DW_CLR_DARKBLUE") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1349 color = DW_CLR_DARKBLUE; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1350 else if(strcmp(colortext, "DW_CLR_DARKPINK") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1351 color = DW_CLR_DARKPINK; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1352 else if(strcmp(colortext, "DW_CLR_DARKCYAN") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1353 color = DW_CLR_DARKCYAN; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1354 else if(strcmp(colortext, "DW_CLR_PALEGRAY") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1355 color = DW_CLR_PALEGRAY; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1356 else if(strcmp(colortext, "DW_CLR_DARKGRAY") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1357 color = DW_CLR_DARKGRAY; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1358 else if(strcmp(colortext, "DW_CLR_RED") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1359 color = DW_CLR_RED; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1360 else if(strcmp(colortext, "DW_CLR_GREEN") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1361 color = DW_CLR_GREEN; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1362 else if(strcmp(colortext, "DW_CLR_YELLOW") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1363 color = DW_CLR_YELLOW; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1364 else if(strcmp(colortext, "DW_CLR_BLUE") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1365 color = DW_CLR_BLUE; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1366 else if(strcmp(colortext, "DW_CLR_PINK") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1367 color = DW_CLR_PINK; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1368 else if(strcmp(colortext, "DW_CLR_CYAN") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1369 color = DW_CLR_CYAN; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1370 else if(strcmp(colortext, "DW_CLR_WHITE") == 0) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1371 color = DW_CLR_WHITE; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1372 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1373 return color; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1374 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1375 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1376 int DWSIGNAL mle_color_cb(HWND hwnd, int pos, void *data) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1377 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1378 HWND hbox = (HWND)data; |
2241
6f28c68642f5
Fix a couple gcc warnings from that last commit.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2240
diff
changeset
|
1379 HWND mlefore = (HWND)dw_window_get_data(hbox, "mlefore"); |
6f28c68642f5
Fix a couple gcc warnings from that last commit.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2240
diff
changeset
|
1380 HWND mleback = (HWND)dw_window_get_data(hbox, "mleback"); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1381 char colortext[101] = {0}; |
2241
6f28c68642f5
Fix a couple gcc warnings from that last commit.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2240
diff
changeset
|
1382 ULONG fore = DW_CLR_DEFAULT, back = DW_CLR_DEFAULT; |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1383 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1384 if(hwnd == mlefore) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1385 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1386 dw_listbox_get_text(mlefore, pos, colortext, 100); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1387 fore = combobox_color(colortext); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1388 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1389 else |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1390 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1391 char *text = dw_window_get_text(mlefore); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1392 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1393 if(text) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1394 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1395 fore = combobox_color(text); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1396 dw_free(text); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1397 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1398 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1399 if(hwnd == mleback) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1400 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1401 dw_listbox_get_text(mleback, pos, colortext, 100); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1402 back = combobox_color(colortext); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1403 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1404 else |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1405 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1406 char *text = dw_window_get_text(mleback); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1407 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1408 if(text) |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1409 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1410 back = combobox_color(text); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1411 dw_free(text); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1412 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1413 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1414 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1415 dw_window_set_color(container_mle, fore, back); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1416 return 0; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1417 } |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1418 |
2247
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1419 void mle_font_set(HWND mle, int fontsize, char *fontname) |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1420 { |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1421 char font[101] = {0}; |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1422 |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1423 if(fontname) |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1424 snprintf(font, 100, "%d.%s", fontsize, fontname); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1425 dw_window_set_font(mle, fontname ? font : NULL); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1426 } |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1427 |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1428 int DWSIGNAL mle_fontname_cb(HWND hwnd, int pos, void *data) |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1429 { |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1430 HWND hbox = (HWND)data; |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1431 HWND fontsize = (HWND)dw_window_get_data(hbox, "fontsize"); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1432 HWND fontname = (HWND)dw_window_get_data(hbox, "fontname"); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1433 char font[101] = {0}; |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1434 |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1435 dw_listbox_get_text(fontname, pos, font, 100); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1436 mle_font_set(container_mle, (int)dw_spinbutton_get_pos(fontsize), strcmp(font, "Default") == 0 ? NULL : font); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1437 return 0; |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1438 } |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1439 |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1440 int mle_fontsize_cb(HWND hwnd, int size, void *data) |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1441 { |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1442 HWND hbox = (HWND)data; |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1443 HWND fontname = (HWND)dw_window_get_data(hbox, "fontname"); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1444 char *font = dw_window_get_text(fontname); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1445 |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1446 if(font) |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1447 { |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1448 mle_font_set(container_mle, size, strcmp(font, "Default") == 0 ? NULL : font); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1449 dw_free(font); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1450 } |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1451 else |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1452 mle_font_set(container_mle, size, NULL); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1453 return 0; |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1454 } |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1455 |
304
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
1456 void container_add(void) |
c28c0a804442
Added extra notebook page for a container example.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
300
diff
changeset
|
1457 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1458 char *titles[4]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1459 char buffer[100]; |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1460 unsigned long flags[4] = { DW_CFA_BITMAPORICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1461 DW_CFA_ULONG | DW_CFA_RIGHT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1462 DW_CFA_TIME | DW_CFA_CENTER | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1463 DW_CFA_DATE | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR }; |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1464 int z; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1465 CTIME time; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1466 CDATE date; |
1319
03f0bc85e7be
Code change to fix llvm-gcc optimization problem on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1306
diff
changeset
|
1467 unsigned long size, newpoint; |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1468 HICN thisicon; |
2247
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1469 HWND checkbox, mlefore, mleback, fontsize, fontname, hbox; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1470 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1471 /* create a box to pack into the notebook page */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1472 containerbox = dw_box_new(DW_HORZ, 2); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1473 dw_box_pack_start(notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1474 |
2229
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1475 /* Add a word wrap checkbox */ |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1476 { |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1477 HWND text; |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1478 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1479 hbox = dw_box_new(DW_HORZ, 0); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1480 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1481 checkbox = dw_checkbox_new("Word wrap", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1482 dw_box_pack_start(hbox, checkbox, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, TRUE, 1); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1483 text = dw_text_new("Foreground:", 0); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1484 dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1485 dw_box_pack_start(hbox, text, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, TRUE, 1); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1486 mlefore = color_combobox(); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1487 dw_box_pack_start(hbox, mlefore, 150, DW_SIZE_AUTO, TRUE, FALSE, 1); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1488 text = dw_text_new("Background:", 0); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1489 dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1490 dw_box_pack_start(hbox, text, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, TRUE, 1); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1491 mleback = color_combobox(); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1492 dw_box_pack_start(hbox, mleback, 150, DW_SIZE_AUTO, TRUE, FALSE, 1); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1493 dw_checkbox_set(checkbox, TRUE); |
2247
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1494 text = dw_text_new("Font:", 0); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1495 dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1496 dw_box_pack_start(hbox, text, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, TRUE, 1); |
2247
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1497 fontsize = dw_spinbutton_new("9", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1498 dw_box_pack_start(hbox, fontsize, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 1); |
2248
4fb54b9fcf78
GTK3: Switch to using CSS syntax for specifying fonts from Pango.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2247
diff
changeset
|
1499 dw_spinbutton_set_limits(fontsize, 100, 5); |
2256
b7467bceb2cd
Set the font point size position to 9, the default value before use.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2253
diff
changeset
|
1500 dw_spinbutton_set_pos(fontsize, 9); |
2247
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1501 fontname = dw_combobox_new("Default", 0); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1502 dw_listbox_append(fontname, "Default"); |
2253
08369a79850f
Add some more font options for various platforms to test.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2252
diff
changeset
|
1503 dw_listbox_append(fontname, "Arial"); |
08369a79850f
Add some more font options for various platforms to test.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2252
diff
changeset
|
1504 dw_listbox_append(fontname, "Geneva"); |
08369a79850f
Add some more font options for various platforms to test.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2252
diff
changeset
|
1505 dw_listbox_append(fontname, "Verdana"); |
2252
5dbe950115c1
Mac: Fix crash in dw_window_set_font() with NULL font name.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2248
diff
changeset
|
1506 dw_listbox_append(fontname, "Helvetica"); |
2253
08369a79850f
Add some more font options for various platforms to test.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2252
diff
changeset
|
1507 dw_listbox_append(fontname, "DejaVu Sans"); |
2262
fe64be23680e
Mac: Switch to using NSFontManager fontWithFamily instead of NSFont fontWithName
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2260
diff
changeset
|
1508 dw_listbox_append(fontname, "Times New Roman"); |
fe64be23680e
Mac: Switch to using NSFontManager fontWithFamily instead of NSFont fontWithName
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2260
diff
changeset
|
1509 dw_listbox_append(fontname, "Times New Roman Bold"); |
fe64be23680e
Mac: Switch to using NSFontManager fontWithFamily instead of NSFont fontWithName
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2260
diff
changeset
|
1510 dw_listbox_append(fontname, "Times New Roman Italic"); |
fe64be23680e
Mac: Switch to using NSFontManager fontWithFamily instead of NSFont fontWithName
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2260
diff
changeset
|
1511 dw_listbox_append(fontname, "Times New Roman Bold Italic"); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1512 dw_box_pack_start(hbox, fontname, 150, DW_SIZE_AUTO, TRUE, FALSE, 1); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1513 dw_box_pack_start(notebookbox4, hbox, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 1); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1514 |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1515 dw_window_set_data(hbox, "mlefore", DW_POINTER(mlefore)); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1516 dw_window_set_data(hbox, "mleback", DW_POINTER(mleback)); |
2247
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1517 dw_window_set_data(hbox, "fontsize", DW_POINTER(fontsize)); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1518 dw_window_set_data(hbox, "fontname", DW_POINTER(fontname)); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1519 } |
2229
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1520 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1521 /* now a container area under this box */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1522 container = dw_container_new(100, TRUE); |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1523 dw_box_pack_start(notebookbox4, container, 500, 200, TRUE, FALSE, 1); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1524 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1525 /* and a status area to see whats going on */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1526 container_status = dw_status_text_new("", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1527 dw_box_pack_start(notebookbox4, container_status, 100, DW_SIZE_AUTO, TRUE, FALSE, 1); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1528 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1529 titles[0] = "Type"; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1530 titles[1] = "Size"; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1531 titles[2] = "Time"; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1532 titles[3] = "Date"; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1533 |
1745
7dd1659c2693
Fixes for the new localization function on OS/2 and GTK3.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1744
diff
changeset
|
1534 dw_filesystem_set_column_title(container, "Test"); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1535 dw_filesystem_setup(container, flags, titles, 4); |
1291
b99b0b2c2826
Renamed dw_container_set_row_bg() to dw_container_set_stripe().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1282
diff
changeset
|
1536 dw_container_set_stripe(container, DW_CLR_DEFAULT, DW_CLR_DEFAULT); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1537 containerinfo = dw_container_alloc(container, 3); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1538 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1539 for(z=0;z<3;z++) |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1540 { |
1873
15d24b5300ec
Third GTK3 round of changes to split string and data
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1872
diff
changeset
|
1541 char names[100]; |
2002
a2931caa3422
Fix setting/getting dates in dw_calendar under macos. Only tested on Mojave. Sorry about the white space changes.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1920
diff
changeset
|
1542 |
1873
15d24b5300ec
Third GTK3 round of changes to split string and data
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1872
diff
changeset
|
1543 sprintf(names, "We can now allocate from the stack: Item: %d", z); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1544 size = z*100; |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1545 sprintf(buffer, "Filename %d", z+1); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1546 if (z == 0 ) thisicon = foldericon; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1547 else thisicon = fileicon; |
1306
dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1294
diff
changeset
|
1548 dw_debug("Initial: container: %x containerinfo: %x icon: %x\n", DW_POINTER_TO_INT(container), |
dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1294
diff
changeset
|
1549 DW_POINTER_TO_INT(containerinfo), DW_POINTER_TO_INT(thisicon)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1550 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1551 dw_filesystem_set_item(container, containerinfo, 0, z, &thisicon); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1552 dw_filesystem_set_item(container, containerinfo, 1, z, &size); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1553 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1554 time.seconds = z+10; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1555 time.minutes = z+10; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1556 time.hours = z+10; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1557 dw_filesystem_set_item(container, containerinfo, 2, z, &time); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1558 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1559 date.day = z+10; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1560 date.month = z+10; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1561 date.year = z+2000; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1562 dw_filesystem_set_item(container, containerinfo, 3, z, &date); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1563 |
1873
15d24b5300ec
Third GTK3 round of changes to split string and data
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1872
diff
changeset
|
1564 dw_container_set_row_title(containerinfo, z, names); |
1872
eae36372d64d
Second Windows round of changes to split the data and string
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1870
diff
changeset
|
1565 dw_container_set_row_data(containerinfo, z, DW_INT_TO_POINTER(z)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1566 } |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1567 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1568 dw_container_insert(container, containerinfo, 3); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1569 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1570 containerinfo = dw_container_alloc(container, 1); |
1880
6949c73e30fd
Fixes for building on OS/2 and removed some strdup()s in
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1875
diff
changeset
|
1571 dw_filesystem_set_file(container, containerinfo, 0, "Yikes", foldericon); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1572 size = 324; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1573 dw_filesystem_set_item(container, containerinfo, 0, 0, &foldericon); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1574 dw_filesystem_set_item(container, containerinfo, 1, 0, &size); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1575 dw_filesystem_set_item(container, containerinfo, 2, 0, &time); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1576 dw_filesystem_set_item(container, containerinfo, 3, 0, &date); |
1880
6949c73e30fd
Fixes for building on OS/2 and removed some strdup()s in
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1875
diff
changeset
|
1577 dw_container_set_row_title(containerinfo, 0, "Extra"); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1578 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1579 dw_container_insert(container, containerinfo, 1); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1580 dw_container_optimize(container); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1581 |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1582 container_mle = dw_mle_new(111); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1583 dw_box_pack_start(containerbox, container_mle, 500, 200, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1584 |
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1585 mle_point = dw_mle_import(container_mle, "", -1); |
991
64c4c40c5835
Added some MLE tests to dwtest program to make sure MLEs function the same across platforms.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
958
diff
changeset
|
1586 sprintf(buffer, "[%d]", mle_point); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1587 mle_point = dw_mle_import(container_mle, buffer, mle_point); |
991
64c4c40c5835
Added some MLE tests to dwtest program to make sure MLEs function the same across platforms.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
958
diff
changeset
|
1588 sprintf(buffer, "[%d]abczxydefijkl", mle_point); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1589 mle_point = dw_mle_import(container_mle, buffer, mle_point); |
992
2d80b4dcff9a
A few MLE fixes on the Mac... and a slightly updated dwtest for MLE testing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
991
diff
changeset
|
1590 dw_mle_delete(container_mle, 9, 3); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1591 mle_point = dw_mle_import(container_mle, "gh", 12); |
1319
03f0bc85e7be
Code change to fix llvm-gcc optimization problem on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1306
diff
changeset
|
1592 dw_mle_get_size(container_mle, &newpoint, NULL); |
03f0bc85e7be
Code change to fix llvm-gcc optimization problem on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1306
diff
changeset
|
1593 mle_point = (int)newpoint; |
992
2d80b4dcff9a
A few MLE fixes on the Mac... and a slightly updated dwtest for MLE testing.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
991
diff
changeset
|
1594 sprintf(buffer, "[%d]\r\n\r\n", mle_point); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1595 mle_point = dw_mle_import(container_mle, buffer, mle_point); |
991
64c4c40c5835
Added some MLE tests to dwtest program to make sure MLEs function the same across platforms.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
958
diff
changeset
|
1596 dw_mle_set_cursor(container_mle, mle_point); |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1597 |
1547
2fd9ff675d79
Added autosize code for the MLE on OS/2...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1525
diff
changeset
|
1598 /* connect our event trappers... */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1599 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), DW_POINTER(container_status)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1600 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), DW_POINTER(container_status)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1601 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(container_select_cb), DW_POINTER(container_status)); |
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1602 dw_signal_connect(container, DW_SIGNAL_COLUMN_CLICK, DW_SIGNAL_FUNC(column_click_cb), DW_POINTER(container_status)); |
2229
abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2213
diff
changeset
|
1603 dw_signal_connect(checkbox, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(word_wrap_click_cb), DW_POINTER(container_mle)); |
2240
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1604 dw_signal_connect(mlefore, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(mle_color_cb), DW_POINTER(hbox)); |
7f6939857cca
Win: Added dw_window_set_color() support for Rich Edit based MLE controls.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2236
diff
changeset
|
1605 dw_signal_connect(mleback, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(mle_color_cb), DW_POINTER(hbox)); |
2247
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1606 dw_signal_connect(fontname, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(mle_fontname_cb), DW_POINTER(hbox)); |
703023e1a644
Win: Implement dw_window_set_font() support for Rich Edit based MLEs.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2241
diff
changeset
|
1607 dw_signal_connect(fontsize, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(mle_fontsize_cb), DW_POINTER(hbox)); |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
1608 } |
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
|
1609 |
195
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
1610 /* Beep every second */ |
b023d363fc09
Added scrollbar and timer support on OS/2 and GTK.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
193
diff
changeset
|
1611 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
|
1612 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1613 dw_beep(200, 200); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1614 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1615 /* Return TRUE so we get called again */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1616 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
|
1617 } |
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
|
1618 |
503
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
1619 |
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
1620 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
|
1621 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1622 HWND abutton1,abutton2,calbox; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1623 int i; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1624 char **text; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1625 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1626 /* create a box to pack into the notebook page */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1627 buttonsbox = dw_box_new(DW_VERT, 2); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1628 dw_box_pack_start(notebookbox5, buttonsbox, 25, 200, TRUE, TRUE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1629 dw_window_set_color(buttonsbox, DW_CLR_RED, DW_CLR_RED); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1630 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1631 calbox = dw_box_new(DW_HORZ, 0); |
2724
c1f8e598960d
Only expand the calendar control and box horizontally....
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2717
diff
changeset
|
1632 dw_box_pack_start(notebookbox5, calbox, 0, 0, TRUE, FALSE, 1); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1633 cal = dw_calendar_new(100); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1634 dw_box_pack_start(calbox, cal, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 0); |
2002
a2931caa3422
Fix setting/getting dates in dw_calendar under macos. Only tested on Mojave. Sorry about the white space changes.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1920
diff
changeset
|
1635 |
a2931caa3422
Fix setting/getting dates in dw_calendar under macos. Only tested on Mojave. Sorry about the white space changes.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1920
diff
changeset
|
1636 dw_calendar_set_date(cal, 2019, 4, 30); |
a2931caa3422
Fix setting/getting dates in dw_calendar under macos. Only tested on Mojave. Sorry about the white space changes.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1920
diff
changeset
|
1637 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1638 /* |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1639 * Create our file toolbar boxes... |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1640 */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1641 buttonboxperm = dw_box_new(DW_VERT, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1642 dw_box_pack_start(buttonsbox, buttonboxperm, 25, 0, FALSE, TRUE, 2); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1643 dw_window_set_color(buttonboxperm, DW_CLR_WHITE, DW_CLR_WHITE); |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
1644 abutton1 = dw_bitmapbutton_new_from_file("Top Button", 0, fileiconpath); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1645 dw_box_pack_start(buttonboxperm, abutton1, 100, 30, FALSE, FALSE, 0 ); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1646 dw_signal_connect(abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(button_callback), NULL); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1647 dw_box_pack_start(buttonboxperm, 0, 25, 5, FALSE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1648 abutton2 = dw_bitmapbutton_new_from_data( "Folder Icon", 0, folder_ico, sizeof(folder_ico)); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1649 dw_box_pack_start(buttonsbox, abutton2, 25, 25, FALSE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1650 dw_signal_connect(abutton2, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(bitmap_toggle_callback), NULL); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1651 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1652 create_button(0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1653 /* make a combobox */ |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1654 combox = dw_box_new(DW_VERT, 2); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1655 dw_box_pack_start(notebookbox5, combox, 25, 200, TRUE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1656 combobox1 = dw_combobox_new("fred", 0); /* no point in specifying an initial value */ |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1657 dw_listbox_append(combobox1, "fred"); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1658 dw_box_pack_start(combox, combobox1, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1659 /* |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1660 dw_window_set_text( combobox, "initial value"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1661 */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1662 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
|
1663 #if 0 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1664 /* add LOTS of items */ |
1306
dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1294
diff
changeset
|
1665 dw_debug("before appending 100 items to combobox using dw_listbox_append()\n"); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1666 for(i = 0; i < 100; i++) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1667 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1668 sprintf( buf, "item %d", i); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1669 dw_listbox_append(combobox1, buf); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1670 } |
1306
dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1294
diff
changeset
|
1671 dw_debug("after appending 100 items to combobox\n"); |
602
489a684af1bb
Add some more test
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
600
diff
changeset
|
1672 #endif |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1673 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1674 combobox2 = dw_combobox_new("joe", 0); /* no point in specifying an initial value */ |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1675 dw_box_pack_start(combox, combobox2, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1676 /* |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1677 dw_window_set_text(combobox, "initial value"); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1678 */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1679 dw_signal_connect(combobox2, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(combobox_select_event_callback), NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1680 /* add LOTS of items */ |
1306
dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1294
diff
changeset
|
1681 dw_debug("before appending 500 items to combobox using dw_listbox_list_append()\n"); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1682 text = (char **)malloc(500*sizeof(char *)); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1683 for(i = 0; i < 500; i++) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1684 { |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1685 text[i] = (char *)malloc(50); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1686 sprintf( text[i], "item %d", i); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1687 } |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1688 dw_listbox_list_append(combobox2, text, 500); |
1306
dbd507f42947
Added dw_debug() logging function which will output a message to the debugging console.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1294
diff
changeset
|
1689 dw_debug("after appending 500 items to combobox\n"); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1690 for(i = 0; i < 500; i++) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1691 { |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1692 free(text[i]); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1693 } |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1694 free(text); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1695 /* now insert a couple of items */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1696 dw_listbox_insert(combobox2, "inserted item 2", 2); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1697 dw_listbox_insert(combobox2, "inserted item 5", 5); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1698 /* make a spinbutton */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1699 spinbutton = dw_spinbutton_new("", 0); /* no point in specifying text */ |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1700 dw_box_pack_start(combox, spinbutton, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 0); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1701 dw_spinbutton_set_limits(spinbutton, 100, 1); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1702 dw_spinbutton_set_pos(spinbutton, 30); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1703 dw_signal_connect(spinbutton, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(spinbutton_valuechanged_callback), NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1704 /* make a slider */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1705 slider = dw_slider_new(FALSE, 11, 0); /* no point in specifying text */ |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1706 dw_box_pack_start(combox, slider, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 0); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1707 dw_signal_connect(slider, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(slider_valuechanged_callback), NULL); |
1190
76262040ed5f
Added DW_PERCENT_INDETERMINATE which can be passed to dw_percent_set_pos() to
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1186
diff
changeset
|
1708 /* make a percent */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1709 percent = dw_percent_new(0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1710 dw_box_pack_start(combox, percent, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, 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
|
1711 } |
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
1712 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1713 void create_button(int redraw) |
503
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
1714 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1715 HWND abutton1; |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1716 filetoolbarbox = dw_box_new(DW_VERT, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1717 dw_box_pack_start(buttonboxperm, filetoolbarbox, 0, 0, TRUE, TRUE, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1718 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1719 abutton1 = dw_bitmapbutton_new_from_file("Empty image. Should be under Top button", 0, "junk"); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1720 dw_box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1721 dw_signal_connect(abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(change_color_red_callback), NULL); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1722 dw_box_pack_start(filetoolbarbox, 0, 25, 5, FALSE, FALSE, 0 ); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1723 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1724 abutton1 = dw_bitmapbutton_new_from_data("A borderless bitmapbitton", 0, folder_ico, 1718 ); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1725 dw_box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1726 dw_signal_connect(abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(change_color_yellow_callback), NULL); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1727 dw_box_pack_start(filetoolbarbox, 0, 25, 5, FALSE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1728 dw_window_set_style(abutton1, DW_BS_NOBORDER, DW_BS_NOBORDER); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1729 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1730 abutton1 = dw_bitmapbutton_new_from_data("A button from data", 0, folder_ico, 1718); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1731 dw_box_pack_start(filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1732 dw_signal_connect(abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(percent_button_box_callback), NULL); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1733 dw_box_pack_start(filetoolbarbox, 0, 25, 5, FALSE, FALSE, 0 ); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1734 if(redraw) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1735 { |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1736 dw_window_redraw(filetoolbarbox); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1737 dw_window_redraw(mainwindow); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1738 } |
503
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
1739 } |
f3ed8dda02f8
Added dw_filesystem_change_*() and testcase code from Mark in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
487
diff
changeset
|
1740 |
1920
31179c5a3c5a
Change DEPRECATED to DW_INCLUDE_DEPRECATED in dwtest.c so
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1884
diff
changeset
|
1741 #ifdef DW_INCLUDE_DEPRECATED |
515
c3c5d8e36aa3
Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
514
diff
changeset
|
1742 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
|
1743 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1744 HWND mdibox, mdi, mdi1w, mdi1box, ef, mdi2w, mdi2box, bb; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1745 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1746 /* create a box to pack into the notebook page */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1747 mdibox = dw_box_new(DW_HORZ, 0); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1748 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1749 dw_box_pack_start(notebookbox6, mdibox, 500, 200, TRUE, TRUE, 1); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1750 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1751 /* now a mdi under this box */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1752 mdi = dw_mdi_new(333); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1753 dw_box_pack_start(mdibox, mdi, 500, 200, TRUE, TRUE, 2); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1754 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1755 mdi1w = dw_window_new(mdi, "MDI1", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1756 mdi1box = dw_box_new(DW_HORZ, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1757 dw_box_pack_start(mdi1w, mdi1box, 0, 0, TRUE, TRUE, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1758 ef = dw_entryfield_new("", 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1759 dw_box_pack_start(mdi1box, ef, 100, 20, FALSE, FALSE, 4); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1760 dw_window_set_size(mdi1w, 200, 100); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1761 dw_window_show(mdi1w); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1762 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1763 mdi2w = dw_window_new(mdi, "MDI2", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1764 mdi2box = dw_box_new(DW_HORZ, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1765 dw_box_pack_start(mdi2w, mdi2box, 0, 0, TRUE, TRUE, 0); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1766 ef = dw_entryfield_new("", 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1767 dw_box_pack_start(mdi2box, ef, 150, 30, FALSE, FALSE, 4); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1768 bb = dw_button_new("Browse", 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1769 dw_box_pack_start(mdi2box, bb, 60, 30, FALSE, FALSE, 4); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1770 dw_window_set_size(mdi2w, 200, 200); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1771 dw_window_show(mdi2w); |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
1772 } |
1783
9de6d1cc8fb8
Put test program code into DEPRECATED #ifdef again to avoid build warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1769
diff
changeset
|
1773 #endif |
620
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
1774 |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
1775 void menu_add(void) |
9876b75d7115
Added menu tests, including checked and disabled menu items.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
606
diff
changeset
|
1776 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1777 HMENUI menuitem,menu; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1778 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1779 mainmenubar = dw_menubar_new(mainwindow); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1780 /* add menus to the menubar */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1781 menu = dw_menu_new(0); |
2889
4b075e64536c
C++: Add some simple menu code to see if things are working.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2855
diff
changeset
|
1782 menuitem = dw_menu_append_item(menu, "~Quit", 1019, 0, TRUE, FALSE, 0); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1783 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1784 /* |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1785 * Add the "File" menu to the menubar... |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1786 */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1787 dw_menu_append_item(mainmenubar, "~File", 1010, 0, TRUE, FALSE, menu); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1788 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1789 changeable_menu = dw_menu_new(0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1790 checkable_menuitem = dw_menu_append_item(changeable_menu, "~Checkable Menu Item", CHECKABLE_MENUITEMID, 0, TRUE, TRUE, 0); |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
1791 dw_signal_connect( checkable_menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menu_callback), DW_POINTER("checkable")); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1792 noncheckable_menuitem = dw_menu_append_item(changeable_menu, "~Non-checkable Menu Item", NONCHECKABLE_MENUITEMID, 0, TRUE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1793 dw_signal_connect(noncheckable_menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menu_callback), DW_POINTER("non-checkable")); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1794 dw_menu_append_item(changeable_menu, "~Disabled menu Item", 2003, DW_MIS_DISABLED|DW_MIS_CHECKED, TRUE, TRUE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1795 /* seperator */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1796 dw_menu_append_item(changeable_menu, DW_MENU_SEPARATOR, 3999, 0, TRUE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1797 menuitem = dw_menu_append_item(changeable_menu, "~Menu Items Disabled", 2009, 0, TRUE, TRUE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1798 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menutoggle_callback), NULL); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1799 /* |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1800 * Add the "Menu" menu to the menubar... |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1801 */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1802 dw_menu_append_item(mainmenubar, "~Menu", 1020, 0, TRUE, FALSE, changeable_menu); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1803 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1804 menu = dw_menu_new(0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1805 menuitem = dw_menu_append_item(menu, "~About", 1091, 0, TRUE, FALSE, 0); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1806 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(helpabout_callback), DW_POINTER(mainwindow)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1807 /* |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1808 * Add the "Help" menu to the menubar... |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1809 */ |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1810 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
|
1811 } |
c3c5d8e36aa3
Implemented MDI Window in Window code on GTK 2.x.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
514
diff
changeset
|
1812 |
774
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
1813 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
|
1814 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1815 int pos, range; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1816 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1817 pos = dw_scrollbox_get_pos(scrollbox, DW_VERT); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1818 range = dw_scrollbox_get_range(scrollbox, DW_VERT); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1819 dw_debug("Pos %d Range %d\n", pos, range); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1820 return 0; |
774
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
1821 } |
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
1822 |
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
1823 void scrollbox_add(void) |
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
1824 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1825 HWND tmpbox,abutton1; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1826 char buf[100]; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1827 int i; |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1828 |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1829 /* create a box to pack into the notebook page */ |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1830 scrollbox = dw_scrollbox_new(DW_VERT, 0); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1831 dw_box_pack_start(notebookbox8, scrollbox, 0, 0, TRUE, TRUE, 1); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1832 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1833 abutton1 = dw_button_new("Show Adjustments", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1834 dw_box_pack_start(scrollbox, abutton1, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 0); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1835 dw_signal_connect(abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(scrollbox_button_callback), NULL); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
1836 |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1837 for(i = 0; i < MAX_WIDGETS; i++) |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1838 { |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1839 tmpbox = dw_box_new(DW_HORZ, 0); |
2553
2b4f2929408e
Android: Fix issue with specifying static sizes... still some issues.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2547
diff
changeset
|
1840 dw_box_pack_start(scrollbox, tmpbox, 0, 0, TRUE, FALSE, 2); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1841 sprintf(buf, "Label %d", i); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1842 labelarray[i] = dw_text_new(buf , 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1843 dw_box_pack_start(tmpbox, labelarray[i], 0, DW_SIZE_AUTO, TRUE, FALSE, 0); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1844 sprintf(buf, "Entry %d", i); |
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1845 entryarray[i] = dw_entryfield_new(buf , i); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1846 dw_box_pack_start(tmpbox, entryarray[i], 0, DW_SIZE_AUTO, TRUE, FALSE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
1847 } |
774
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
1848 } |
bf3e9892146f
Add new notebook page to test scrollbox widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
746
diff
changeset
|
1849 |
1200
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1850 /* Section for thread/event test */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1851 HWND threadmle, startbutton; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1852 HMTX mutex; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1853 HEV workevent, controlevent; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1854 int finished = FALSE; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1855 int ready = 0; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1856 #define BUF_SIZE 1024 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1857 void DWSIGNAL run_thread(void *data); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1858 void DWSIGNAL control_thread(void *data); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1859 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1860 void update_mle(char *text, int lock) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1861 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1862 static unsigned int pos = 0; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1863 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1864 /* Protect pos from being changed by different threads */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1865 if(lock) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1866 dw_mutex_lock(mutex); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1867 pos = dw_mle_import(threadmle, text, pos); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1868 dw_mle_set_cursor(threadmle, pos); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1869 if(lock) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1870 dw_mutex_unlock(mutex); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1871 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1872 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1873 int DWSIGNAL start_threads_button_callback(HWND window, void *data) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1874 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1875 dw_window_disable(startbutton); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1876 dw_mutex_lock(mutex); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1877 controlevent = dw_event_new(); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1878 dw_event_reset(workevent); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1879 finished = FALSE; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1880 ready = 0; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1881 update_mle("Starting thread 1\r\n", FALSE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1882 dw_thread_new(DW_SIGNAL_FUNC(run_thread), DW_INT_TO_POINTER(1), 10000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1883 update_mle("Starting thread 2\r\n", FALSE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1884 dw_thread_new(DW_SIGNAL_FUNC(run_thread), DW_INT_TO_POINTER(2), 10000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1885 update_mle("Starting thread 3\r\n", FALSE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1886 dw_thread_new(DW_SIGNAL_FUNC(run_thread), DW_INT_TO_POINTER(3), 10000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1887 update_mle("Starting thread 4\r\n", FALSE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1888 dw_thread_new(DW_SIGNAL_FUNC(run_thread), DW_INT_TO_POINTER(4), 10000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1889 update_mle("Starting control thread\r\n", FALSE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1890 dw_thread_new(DW_SIGNAL_FUNC(control_thread), DW_INT_TO_POINTER(0), 10000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1891 dw_mutex_unlock(mutex); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1892 return 0; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1893 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1894 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1895 void thread_add(void) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1896 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1897 HWND tmpbox; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1898 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1899 /* create a box to pack into the notebook page */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1900 tmpbox = dw_box_new(DW_VERT, 0); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1901 dw_box_pack_start(notebookbox9, tmpbox, 0, 0, TRUE, TRUE, 1); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1902 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1903 startbutton = dw_button_new( "Start Threads", 0 ); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
1904 dw_box_pack_start(tmpbox, startbutton, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 0); |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
1905 dw_signal_connect(startbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(start_threads_button_callback), NULL); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1906 |
1200
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1907 /* Create the base threading components */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1908 threadmle = dw_mle_new(0); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1909 dw_box_pack_start(tmpbox, threadmle, 1, 1, TRUE, TRUE, 0); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1910 mutex = dw_mutex_new(); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1911 workevent = dw_event_new(); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1912 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1913 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1914 void DWSIGNAL run_thread(void *data) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1915 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1916 int threadnum = DW_POINTER_TO_INT(data); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1917 char buf[BUF_SIZE]; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1918 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1919 sprintf(buf, "Thread %d started.\r\n", threadnum); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1920 update_mle(buf, TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1921 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1922 /* Increment the ready count while protected by mutex */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1923 dw_mutex_lock(mutex); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1924 ready++; |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1925 /* If all 4 threads have incrememted the ready count... |
1200
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1926 * Post the control event semaphore so things will get started. |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1927 */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1928 if(ready == 4) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1929 dw_event_post(controlevent); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1930 dw_mutex_unlock(mutex); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1931 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1932 while(!finished) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1933 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1934 int result = dw_event_wait(workevent, 2000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1935 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1936 if(result == DW_ERROR_TIMEOUT) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1937 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1938 sprintf(buf, "Thread %d timeout waiting for event.\r\n", threadnum); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1939 update_mle(buf, TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1940 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1941 else if(result == DW_ERROR_NONE) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1942 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1943 sprintf(buf, "Thread %d doing some work.\r\n", threadnum); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1944 update_mle(buf, TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1945 /* Pretend to do some work */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1946 dw_main_sleep(1000 * threadnum); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1947 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1948 /* Increment the ready count while protected by mutex */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1949 dw_mutex_lock(mutex); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1950 ready++; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1951 sprintf(buf, "Thread %d work done. ready=%d", threadnum, ready); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
1952 /* If all 4 threads have incrememted the ready count... |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1953 * Post the control event semaphore so things will get started. |
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
1954 */ |
1200
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1955 if(ready == 4) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1956 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1957 dw_event_post(controlevent); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1958 strcat(buf, " Control posted."); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1959 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1960 dw_mutex_unlock(mutex); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1961 strcat(buf, "\r\n"); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1962 update_mle(buf, TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1963 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1964 else |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1965 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1966 sprintf(buf, "Thread %d error %d.\r\n", threadnum, result); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1967 update_mle(buf, TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1968 dw_main_sleep(10000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1969 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1970 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1971 sprintf(buf, "Thread %d finished.\r\n", threadnum); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1972 update_mle(buf, TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1973 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1974 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1975 void DWSIGNAL control_thread(void *data) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1976 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1977 int inprogress = 5; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1978 char buf[BUF_SIZE]; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1979 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1980 while(inprogress) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1981 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1982 int result = dw_event_wait(controlevent, 2000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1983 |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1984 if(result == DW_ERROR_TIMEOUT) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1985 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1986 update_mle("Control thread timeout waiting for event.\r\n", TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1987 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1988 else if(result == DW_ERROR_NONE) |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1989 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1990 /* Reset the control event */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1991 dw_event_reset(controlevent); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1992 ready = 0; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1993 sprintf(buf,"Control thread starting worker threads. Inprogress=%d\r\n", inprogress); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1994 update_mle(buf, TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1995 /* Start the work threads */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1996 dw_event_post(workevent); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1997 dw_main_sleep(100); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1998 /* Reset the work event */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
1999 dw_event_reset(workevent); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2000 inprogress--; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2001 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2002 else |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2003 { |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2004 sprintf(buf, "Control thread error %d.\r\n", result); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2005 update_mle(buf, TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2006 dw_main_sleep(10000); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2007 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2008 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2009 /* Tell the other threads we are done */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2010 finished = TRUE; |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2011 dw_event_post(workevent); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2012 /* Close the control event */ |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2013 dw_event_close(&controlevent); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2014 update_mle("Control thread finished.\r\n", TRUE); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2015 dw_window_enable(startbutton); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2016 } |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2017 |
2009
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2018 /* Handle web back navigation */ |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2019 int DWSIGNAL web_back_clicked(HWND button, void *data) |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2020 { |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2021 HWND html = (HWND)data; |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
2022 |
2009
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2023 dw_html_action(html, DW_HTML_GOBACK); |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2024 return FALSE; |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2025 } |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2026 |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2027 /* Handle web forward navigation */ |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2028 int DWSIGNAL web_forward_clicked(HWND button, void *data) |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2029 { |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2030 HWND html = (HWND)data; |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
2031 |
2009
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2032 dw_html_action(html, DW_HTML_GOFORWARD); |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2033 return FALSE; |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2034 } |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2035 |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2036 /* Handle web reload */ |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2037 int DWSIGNAL web_reload_clicked(HWND button, void *data) |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2038 { |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2039 HWND html = (HWND)data; |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
2040 |
2009
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2041 dw_html_action(html, DW_HTML_RELOAD); |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2042 return FALSE; |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2043 } |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2044 |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2045 /* Handle web run */ |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2046 int DWSIGNAL web_run_clicked(HWND button, void *data) |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2047 { |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2048 HWND html = (HWND)data; |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2049 HWND javascript = (HWND)dw_window_get_data(button, "javascript"); |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2050 char *script = dw_window_get_text(javascript); |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
2051 |
2009
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2052 dw_html_javascript_run(html, script, NULL); |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2053 dw_free(script); |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2054 return FALSE; |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2055 } |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2056 |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2057 /* Handle web javascript result */ |
2054
466cf00f409f
Fixed swapped parameters in web_html_result in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2031
diff
changeset
|
2058 int DWSIGNAL web_html_result(HWND html, int status, char *result, void *script_data, void *user_data) |
2009
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2059 { |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
2060 dw_messagebox("Javascript Result", DW_MB_OK | (status ? DW_MB_ERROR : DW_MB_INFORMATION), |
2010
617a78dc70aa
Added a number of possible javascript snippets to test.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2009
diff
changeset
|
2061 result ? result : "Javascript result is not a string value"); |
2009
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2062 return TRUE; |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2063 } |
8577d533b371
Added controls to the test HTML widget, with a field to run javascript.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2008
diff
changeset
|
2064 |
2008
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2065 /* Handle web html changed */ |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2066 int DWSIGNAL web_html_changed(HWND html, int status, char *url, void *data) |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2067 { |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2068 HWND hwndstatus = (HWND)data; |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2069 char *statusnames[] = { "none", "started", "redirect", "loading", "complete", NULL }; |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
2070 |
2008
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2071 if(hwndstatus && url && status < 5) |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2072 { |
2031
c4fc33d70a8e
Mac: Removed delayed setNeedsDisplay:YES to fix the incorrect dwtest file
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2026
diff
changeset
|
2073 int length = (int)strlen(url) + (int)strlen(statusnames[status]) + 10; |
2008
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2074 char *text = calloc(1, length+1); |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2075 |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2076 snprintf(text, length, "Status %s: %s", statusnames[status], url); |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2077 dw_window_set_text(hwndstatus, text); |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2078 free(text); |
2081
24875681eec5
Added htmlEngine to DWEnv
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2066
diff
changeset
|
2079 } |
2008
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2080 return FALSE; |
74facb490f5a
GTK: Fix html changed callbacks when using webkit1.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2002
diff
changeset
|
2081 } |
1200
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2082 |
2974
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2083 /* Handle web javascript message */ |
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2084 int DWSIGNAL web_html_message(HWND html, char *name, char *message, void *data) |
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2085 { |
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2086 dw_messagebox("Javascript Message", DW_MB_OK | DW_MB_INFORMATION, "Name: %s Message: %s", |
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2087 name, message); |
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2088 return TRUE; |
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2089 } |
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2090 |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2091 void html_add(void) |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2092 { |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2093 rawhtml = dw_html_new(1001); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2094 if(rawhtml) |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2095 { |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2096 HWND htmlstatus; |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2097 HWND hbox = dw_box_new(DW_HORZ, 0); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2098 HWND item; |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2099 HWND javascript = dw_combobox_new("", 0); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2100 |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2101 dw_listbox_append(javascript, "window.scrollTo(0,500);"); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2102 dw_listbox_append(javascript, "window.document.title;"); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2103 dw_listbox_append(javascript, "window.navigator.userAgent;"); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2104 |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
2105 dw_box_pack_start(notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0); |
2974
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2106 dw_html_javascript_add(rawhtml, "test"); |
fffb4904c90b
Mac: Initial support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2889
diff
changeset
|
2107 dw_signal_connect(rawhtml, DW_SIGNAL_HTML_MESSAGE, DW_SIGNAL_FUNC(web_html_message), DW_POINTER(javascript)); |
2988
dfab2dfa9bc1
Check DW_FEATURE_HTML_MESSAGE to decide if the raw html widget
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2975
diff
changeset
|
2108 dw_html_raw(rawhtml, dw_feature_get(DW_FEATURE_HTML_MESSAGE) == DW_FEATURE_ENABLED ? |
dfab2dfa9bc1
Check DW_FEATURE_HTML_MESSAGE to decide if the raw html widget
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2975
diff
changeset
|
2109 "<html><body><center><h1><a href=\"javascript:test('This is the message');\">dwtest</a></h1></center></body></html>" : |
dfab2dfa9bc1
Check DW_FEATURE_HTML_MESSAGE to decide if the raw html widget
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2975
diff
changeset
|
2110 "<html><body><center><h1>dwtest</h1></center></body></html>"); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2111 html = dw_html_new(1002); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2112 |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2113 dw_box_pack_start(notebookbox7, hbox, 0, 0, TRUE, FALSE, 0); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2114 |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2115 /* Add navigation buttons */ |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2116 item = dw_button_new("Back", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2117 dw_box_pack_start(hbox, item, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 0); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2118 dw_signal_connect(item, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(web_back_clicked), DW_POINTER(html)); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2119 |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2120 item = dw_button_new("Forward", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2121 dw_box_pack_start(hbox, item, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 0); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2122 dw_signal_connect(item, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(web_forward_clicked), DW_POINTER(html)); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2123 |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2124 /* Put in some extra space */ |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2125 dw_box_pack_start(hbox, 0, 5, 1, FALSE, FALSE, 0); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2126 |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2127 item = dw_button_new("Reload", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2128 dw_box_pack_start(hbox, item, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 0); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2129 dw_signal_connect(item, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(web_reload_clicked), DW_POINTER(html)); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2130 |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2131 /* Put in some extra space */ |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2132 dw_box_pack_start(hbox, 0, 5, 1, FALSE, FALSE, 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2133 dw_box_pack_start(hbox, javascript, DW_SIZE_AUTO, DW_SIZE_AUTO, TRUE, FALSE, 0); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2134 |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2135 item = dw_button_new("Run", 0); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2136 dw_window_set_data(item, "javascript", DW_POINTER(javascript)); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2137 dw_box_pack_start(hbox, item, DW_SIZE_AUTO, DW_SIZE_AUTO, FALSE, FALSE, 0); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2138 dw_signal_connect(item, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(web_run_clicked), DW_POINTER(html)); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2139 dw_window_click_default(javascript, item); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2140 |
2462
596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2451
diff
changeset
|
2141 dw_box_pack_start(notebookbox7, html, 0, 100, TRUE, TRUE, 0); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2142 dw_html_url(html, "https://dbsoft.org/dw_help.php"); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2143 htmlstatus = dw_status_text_new("HTML status loading...", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2144 dw_box_pack_start(notebookbox7, htmlstatus, 100, DW_SIZE_AUTO, TRUE, FALSE, 1); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2145 dw_signal_connect(html, DW_SIGNAL_HTML_CHANGED, DW_SIGNAL_FUNC(web_html_changed), DW_POINTER(htmlstatus)); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2146 dw_signal_connect(html, DW_SIGNAL_HTML_RESULT, DW_SIGNAL_FUNC(web_html_result), DW_POINTER(javascript)); |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2147 } |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2148 else |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2149 { |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2150 html = dw_text_new("HTML widget not available.", 0); |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2151 dw_box_pack_start(notebookbox7, html, 0, 100, TRUE, TRUE, 0); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2152 } |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2153 } |
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2154 |
2093
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2155 /* Pretty list of features corresponding to the DWFEATURE enum in dw.h */ |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2156 char *DWFeatureList[] = { |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2157 "Supports the HTML Widget", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2158 "Supports the DW_SIGNAL_HTML_RESULT callback", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2159 "Supports custom window border sizes", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2160 "Supports window frame transparency", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2161 "Supports Dark Mode user interface", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2162 "Supports auto completion in Multi-line Edit boxes", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2163 "Supports word wrapping in Multi-line Edit boxes", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2164 "Supports striped line display in container widgets", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2165 "Supports Multiple Document Interface window frame", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2166 "Supports status text area on notebook/tabbed controls", |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2167 "Supports sending system notifications", |
2127
663467f6eee4
Code cleanup: Add constants to header for dark mode, buffer sizes and Unicode support.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2115
diff
changeset
|
2168 "Supports UTF8 encoded Unicode text", |
2236
e7060d262939
Win: Switched to using Rich Edit MLE by default on Windows.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2230
diff
changeset
|
2169 "Supports Rich Edit based MLE control (Windows)", |
2284
3361ce6070ce
Add DW_FEATURE_TASK_BAR to the feature tests, for taskbar icon support.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2263
diff
changeset
|
2170 "Supports icons in the taskbar or similar system widget", |
2410
0286ac44d347
Add DW_FEATURE_TREE feature test, since iOS does not suppor tree.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2406
diff
changeset
|
2171 "Supports the Tree Widget", |
2506
fa976a5bc7bd
Add DW_FEATURE_WINDOW_PLACEMENT for platforms supporting arbitrary window placement.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2462
diff
changeset
|
2172 "Supports arbitrary window placement", |
2837
444031116159
Add DW_FEATURE_CONTAINER_MODE to the dwtest feature test list.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2831
diff
changeset
|
2173 "Supports alternate container view modes", |
2975
ae4d6856b983
iOS: Support for dw_html_javascript_add() and DW_SIGNAL_HTML_MESSAGE.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2974
diff
changeset
|
2174 "Supports the DW_SIGNAL_HTML_MESSAGE callback", |
2993
392f0b3dd502
Android: Add DW_FEATURE_RENDER_SAFE, initially just for Android.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2988
diff
changeset
|
2175 "Supports render safe drawing mode, limited to expose", |
2093
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2176 NULL }; |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2177 |
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
|
2178 /* |
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
|
2179 * 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
|
2180 */ |
2397
f181963f23d5
Switch dwtest entrypoint to be dwmain instead of main to help on iOS.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2361
diff
changeset
|
2181 int dwmain(int argc, char *argv[]) |
191
634625c3239d
Fixes for dw_color_xxxx_set() to accept OS/2 style colors, and fixed a
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff
changeset
|
2182 { |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2183 ULONG notebookpage1; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2184 ULONG notebookpage2; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2185 ULONG notebookpage3; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2186 ULONG notebookpage4; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2187 ULONG notebookpage5; |
1920
31179c5a3c5a
Change DEPRECATED to DW_INCLUDE_DEPRECATED in dwtest.c so
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1884
diff
changeset
|
2188 #ifdef DW_INCLUDE_DEPRECATED |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2189 ULONG notebookpage6; |
1783
9de6d1cc8fb8
Put test program code into DEPRECATED #ifdef again to avoid build warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1769
diff
changeset
|
2190 #endif |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2191 ULONG notebookpage7; |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2192 ULONG notebookpage8; |
1200
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2193 ULONG notebookpage9; |
2093
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2194 DWFEATURE feat; |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2195 |
2105
10c22853b479
Add dw_app_id_set() dwtest call to set application name and ID for sending notifications.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2104
diff
changeset
|
2196 /* Setup the Application ID for sending notifications */ |
10c22853b479
Add dw_app_id_set() dwtest call to set application name and ID for sending notifications.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2104
diff
changeset
|
2197 dw_app_id_set("org.dbsoft.dwindows.dwtest", "Dynamic Windows Test"); |
10c22853b479
Add dw_app_id_set() dwtest call to set application name and ID for sending notifications.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2104
diff
changeset
|
2198 |
2099
296a3872ddd9
Added a fourth dark mode option on Windows: Disabled, Basic, Full, Forced.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2095
diff
changeset
|
2199 /* Enable full dark mode on platforms that support it */ |
2213
0132afc8c955
Check for DW_DARK_MODE environment variable to enable full dark mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2127
diff
changeset
|
2200 if(getenv("DW_DARK_MODE")) |
0132afc8c955
Check for DW_DARK_MODE environment variable to enable full dark mode.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2127
diff
changeset
|
2201 dw_feature_set(DW_FEATURE_DARK_MODE, DW_DARK_MODE_FULL); |
2099
296a3872ddd9
Added a fourth dark mode option on Windows: Disabled, Basic, Full, Forced.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2095
diff
changeset
|
2202 |
2827
455d539ac555
iOS: Add initial implementation of DW_CONTAINER_MODE_EXTRA.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2816
diff
changeset
|
2203 #ifdef DW_MOBILE |
2831
adb0e4ce9347
iOS: Fix multi-line container display, had to stop using buttons for images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2827
diff
changeset
|
2204 /* Enable multi-line container display on Mobile platforms */ |
adb0e4ce9347
iOS: Fix multi-line container display, had to stop using buttons for images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2827
diff
changeset
|
2205 dw_feature_set(DW_FEATURE_CONTAINER_MODE, DW_CONTAINER_MODE_MULTI); |
2827
455d539ac555
iOS: Add initial implementation of DW_CONTAINER_MODE_EXTRA.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2816
diff
changeset
|
2206 #endif |
455d539ac555
iOS: Add initial implementation of DW_CONTAINER_MODE_EXTRA.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2816
diff
changeset
|
2207 |
2095
a3e176450077
OS/2: Fix a warning in dw_notication_new(), return 0 not NULL.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2094
diff
changeset
|
2208 /* Initialize the Dynamic Windows engine */ |
a3e176450077
OS/2: Fix a warning in dw_notication_new(), return 0 not NULL.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2094
diff
changeset
|
2209 dw_init(TRUE, argc, argv); |
a3e176450077
OS/2: Fix a warning in dw_notication_new(), return 0 not NULL.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2094
diff
changeset
|
2210 |
2093
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2211 /* Test all the features and display the results */ |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2212 for(feat=0;feat<DW_FEATURE_MAX && DWFeatureList[feat];feat++) |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2213 { |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2214 int result = dw_feature_get(feat); |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2215 char *status = "Unsupported"; |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2216 |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2217 if(result == 0) |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2218 status = "Disabled"; |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2219 else if(result > 0) |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2220 status = "Enabled"; |
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2221 |
2094
8de0a767c0e5
Add \n newline to the dw_debug() line in dwtest for cleaner display on Unix.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2093
diff
changeset
|
2222 dw_debug("%s: %s (%d)\n", DWFeatureList[feat], status, result); |
2093
0c7de37977c8
Add a display of all features in dwtest using dw_debug().
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2084
diff
changeset
|
2223 } |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2224 |
1560
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2225 /* Create our window */ |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2226 mainwindow = dw_window_new(HWND_DESKTOP, "dwindows test UTF8 中国語 (繁体) cañón", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2227 dw_window_set_icon(mainwindow, fileicon); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2228 |
1465
0f9c6f7636db
Menus don't need to be added after packing a box into a window anymore...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1463
diff
changeset
|
2229 menu_add(); |
0f9c6f7636db
Menus don't need to be added after packing a box into a window anymore...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1463
diff
changeset
|
2230 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2231 notebookbox = dw_box_new(DW_VERT, 5); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2232 dw_box_pack_start(mainwindow, notebookbox, 0, 0, TRUE, TRUE, 0); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
2233 |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2234 /* First try the current directory */ |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2235 foldericon = dw_icon_load_from_file(foldericonpath); |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2236 fileicon = dw_icon_load_from_file(fileiconpath); |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2237 |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2238 #ifdef PLATFORMFOLDER |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2239 /* In case we are running from the build directory... |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2240 * also check the appropriate platform subfolder |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2241 */ |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2242 if(!foldericon) |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2243 { |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2244 strncpy(foldericonpath, PLATFORMFOLDER "folder", 1024); |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2245 foldericon = dw_icon_load_from_file(foldericonpath); |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2246 } |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2247 if(!fileicon) |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2248 { |
2851
fdd21139c07f
Fix a copy and paste error in dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2850
diff
changeset
|
2249 strncpy(fileiconpath, PLATFORMFOLDER "file", 1024); |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2250 fileicon = dw_icon_load_from_file(fileiconpath); |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2251 } |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2252 #endif |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2253 |
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2254 /* Finally try from the platform application directory */ |
2446
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2255 if(!foldericon && !fileicon) |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2256 { |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2257 char *appdir = dw_app_dir(); |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2258 char pathbuff[1025] = {0}; |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2259 int pos = (int)strlen(appdir); |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2260 |
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2261 strncpy(pathbuff, appdir, 1024); |
2451
44b77654c406
Add DW_DIR_SEPARATOR for easy access to the separator characters.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2448
diff
changeset
|
2262 pathbuff[pos] = DW_DIR_SEPARATOR; |
2446
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2263 pos++; |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2264 strncpy(&pathbuff[pos], "folder", 1024-pos); |
2446
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2265 foldericon = dw_icon_load_from_file(pathbuff); |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2266 if(foldericon) |
2854
8a5131cbbe93
GTK2/3/4: Add return values to dw_window_set_bitmap(_from_data).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2851
diff
changeset
|
2267 strncpy(foldericonpath, pathbuff, 1025); |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2268 strncpy(&pathbuff[pos], "file", 1024-pos); |
2446
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2269 fileicon = dw_icon_load_from_file(pathbuff); |
2850
2934b2fdcd8e
Mac/iOS: Add return value to dw_window_set_bitmap(_from_data) in resource
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2837
diff
changeset
|
2270 if(fileicon) |
2854
8a5131cbbe93
GTK2/3/4: Add return values to dw_window_set_bitmap(_from_data).
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2851
diff
changeset
|
2271 strncpy(fileiconpath, pathbuff, 1025); |
2446
b9d373d1ccf5
Add support for checking the application data directory for the images.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2445
diff
changeset
|
2272 } |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
2273 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2274 notebook = dw_notebook_new(1, TRUE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2275 dw_box_pack_start(notebookbox, notebook, 100, 100, TRUE, TRUE, 0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2276 dw_signal_connect(notebook, DW_SIGNAL_SWITCH_PAGE, DW_SIGNAL_FUNC(switch_page_cb), NULL); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2277 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2278 notebookbox1 = dw_box_new(DW_VERT, 5); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2279 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2280 dw_notebook_pack( notebook, notebookpage1, notebookbox1); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2281 dw_notebook_page_set_text( notebook, notebookpage1, "buttons and entry"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2282 archive_add(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2283 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2284 notebookbox2 = dw_box_new(DW_VERT, 5); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2285 notebookpage2 = dw_notebook_page_new( notebook, 1, FALSE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2286 dw_notebook_pack( notebook, notebookpage2, notebookbox2); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2287 dw_notebook_page_set_text(notebook, notebookpage2, "render"); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2288 text_add(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2289 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2290 notebookbox3 = dw_box_new(DW_VERT, 5); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2291 notebookpage3 = dw_notebook_page_new( notebook, 1, FALSE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2292 dw_notebook_pack( notebook, notebookpage3, notebookbox3); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2293 dw_notebook_page_set_text( notebook, notebookpage3, "tree"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2294 tree_add(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2295 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2296 notebookbox4 = dw_box_new(DW_VERT, 5); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2297 notebookpage4 = dw_notebook_page_new(notebook, 1, FALSE); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2298 dw_notebook_pack( notebook, notebookpage4, notebookbox4 ); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2299 dw_notebook_page_set_text( notebook, notebookpage4, "container"); |
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2300 container_add(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2301 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2302 notebookbox5 = dw_box_new(DW_VERT, 5); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2303 notebookpage5 = dw_notebook_page_new(notebook, 1, FALSE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2304 dw_notebook_pack(notebook, notebookpage5, notebookbox5); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2305 dw_notebook_page_set_text(notebook, notebookpage5, "buttons"); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2306 buttons_add(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2307 |
1920
31179c5a3c5a
Change DEPRECATED to DW_INCLUDE_DEPRECATED in dwtest.c so
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1884
diff
changeset
|
2308 #ifdef DW_INCLUDE_DEPRECATED |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2309 notebookbox6 = dw_box_new(DW_VERT, 5); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2310 notebookpage6 = dw_notebook_page_new(notebook, 1, FALSE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2311 dw_notebook_pack(notebook, notebookpage6, notebookbox6); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2312 dw_notebook_page_set_text(notebook, notebookpage6, "mdi"); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2313 mdi_add(); |
1783
9de6d1cc8fb8
Put test program code into DEPRECATED #ifdef again to avoid build warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1769
diff
changeset
|
2314 #endif |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2315 |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2316 notebookbox7 = dw_box_new(DW_VERT, 6); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2317 notebookpage7 = dw_notebook_page_new(notebook, 1, FALSE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2318 dw_notebook_pack(notebook, notebookpage7, notebookbox7); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2319 dw_notebook_page_set_text(notebook, notebookpage7, "html"); |
2406
716f38f69073
Move HTML code into html_add() function in dwtest to allow for easier
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2397
diff
changeset
|
2320 html_add(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2321 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2322 notebookbox8 = dw_box_new(DW_VERT, 7); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2323 notebookpage8 = dw_notebook_page_new(notebook, 1, FALSE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2324 dw_notebook_pack(notebook, notebookpage8, notebookbox8); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2325 dw_notebook_page_set_text(notebook, notebookpage8, "scrollbox"); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2326 scrollbox_add(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2327 |
2742
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2328 notebookbox9 = dw_box_new(DW_VERT, 8); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2329 notebookpage9 = dw_notebook_page_new(notebook, 1, FALSE); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2330 dw_notebook_pack(notebook, notebookpage9, notebookbox9); |
06b368d2e4f9
Switch to using DW_SIZE_AUTO constant in the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2724
diff
changeset
|
2331 dw_notebook_page_set_text(notebook, notebookpage9, "thread/event"); |
1200
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2332 thread_add(); |
88b3f27542b0
Added thread/event tab to the test program.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1190
diff
changeset
|
2333 |
1795
9304241b7b33
Added new dw_window_set_focus() function and attempted to fix...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1791
diff
changeset
|
2334 /* Set the default field */ |
9304241b7b33
Added new dw_window_set_focus() function and attempted to fix...
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1791
diff
changeset
|
2335 dw_window_default(mainwindow, copypastefield); |
1798
9fb8339ae458
Add simple test of dw_window_set_focus()
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1795
diff
changeset
|
2336 |
1685
96fcc01693cf
Updated the test program removing deprecated flags and using new
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1684
diff
changeset
|
2337 dw_signal_connect(mainwindow, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow)); |
1844
1558f5e14f83
Added code and comment to the test program demonstrating trapping application quit on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1833
diff
changeset
|
2338 /* |
1558f5e14f83
Added code and comment to the test program demonstrating trapping application quit on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1833
diff
changeset
|
2339 * The following is a special case handler for the Mac and other platforms which contain |
2031
c4fc33d70a8e
Mac: Removed delayed setNeedsDisplay:YES to fix the incorrect dwtest file
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
2026
diff
changeset
|
2340 * an application object which can be closed. It functions identically to a window delete/close |
1844
1558f5e14f83
Added code and comment to the test program demonstrating trapping application quit on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1833
diff
changeset
|
2341 * request except it applies to the entire application not an individual window. If it is not |
1558f5e14f83
Added code and comment to the test program demonstrating trapping application quit on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1833
diff
changeset
|
2342 * handled or you allow the default handler to take place the entire application will close. |
1558f5e14f83
Added code and comment to the test program demonstrating trapping application quit on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1833
diff
changeset
|
2343 * On platforms which do not have an application object this line will be ignored. |
1558f5e14f83
Added code and comment to the test program demonstrating trapping application quit on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1833
diff
changeset
|
2344 */ |
1558f5e14f83
Added code and comment to the test program demonstrating trapping application quit on Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1833
diff
changeset
|
2345 dw_signal_connect(DW_DESKTOP, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow)); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2346 timerid = dw_timer_connect(2000, DW_SIGNAL_FUNC(timer_callback), 0); |
1735
1a7b9b96d9d7
Minor layout changes to the test program so all buttons are
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1685
diff
changeset
|
2347 dw_window_set_size(mainwindow, 640, 550); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2348 dw_window_show(mainwindow); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2349 |
1560
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2350 /* Now that the window is created and shown... |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2351 * run the main loop until we get dw_main_quit() |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2352 */ |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2353 dw_main(); |
1049
b3674ea2909f
Put http://dwindows.netlabs.org back in as test site for HTML widget
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1038
diff
changeset
|
2354 |
1560
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2355 /* Now that the loop is done we can cleanup */ |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2356 dw_taskbar_delete(textbox1, fileicon); |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2357 dw_window_destroy(mainwindow); |
1738
d93e860c38d1
Add code to show borderless bitmapbutton.
mhessling@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1735
diff
changeset
|
2358 |
1560
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2359 dw_debug("dwtest exiting...\n"); |
ee47bda26916
Added some comments and a couple more tests to dwtest.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1559
diff
changeset
|
2360 /* Call dw_exit() to shutdown the Dynamic Windows engine */ |
1559
bc3a11fe9a46
Don't use _dw_pool_drain() in dw_exit() on Mac... that drains and recreates the pool.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
1557
diff
changeset
|
2361 dw_exit(0); |
954
cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
905
diff
changeset
|
2362 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
|
2363 } |