Mercurial > dwindows
comparison dwtest.c @ 2229:abbda3db3a3c
Win: Fix dw_mle_set_word_wrap() on Windows when -DRICHEDIT is enabled for MLEs.
Add a Word Wrap checkbox to dwtest for testing changing word wrap on the fly.
Rich Edit is not fully tested so this will probably land as default in 3.2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 03 Jan 2021 03:49:20 +0000 |
parents | 0132afc8c955 |
children | 7575eefcf881 |
comparison
equal
deleted
inserted
replaced
2228:2407c8b46143 | 2229:abbda3db3a3c |
---|---|
1192 title = dw_tree_get_title(tree, t1); | 1192 title = dw_tree_get_title(tree, t1); |
1193 dw_debug("t1 title \"%s\" data %d t2 data %d\n", title, DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t1)), DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t2))); | 1193 dw_debug("t1 title \"%s\" data %d t2 data %d\n", title, DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t1)), DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t2))); |
1194 dw_free(title); | 1194 dw_free(title); |
1195 } | 1195 } |
1196 | 1196 |
1197 int DWSIGNAL word_wrap_click_cb(HWND wordwrap, void *data) | |
1198 { | |
1199 HWND container_mle = (HWND)data; | |
1200 | |
1201 dw_mle_set_word_wrap(container_mle, dw_checkbox_get(wordwrap)); | |
1202 } | |
1203 | |
1197 void container_add(void) | 1204 void container_add(void) |
1198 { | 1205 { |
1199 char *titles[4]; | 1206 char *titles[4]; |
1200 char buffer[100]; | 1207 char buffer[100]; |
1201 unsigned long flags[4] = { DW_CFA_BITMAPORICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, | 1208 unsigned long flags[4] = { DW_CFA_BITMAPORICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
1205 int z; | 1212 int z; |
1206 CTIME time; | 1213 CTIME time; |
1207 CDATE date; | 1214 CDATE date; |
1208 unsigned long size, newpoint; | 1215 unsigned long size, newpoint; |
1209 HICN thisicon; | 1216 HICN thisicon; |
1217 HWND checkbox; | |
1210 | 1218 |
1211 /* create a box to pack into the notebook page */ | 1219 /* create a box to pack into the notebook page */ |
1212 containerbox = dw_box_new(DW_HORZ, 2); | 1220 containerbox = dw_box_new(DW_HORZ, 2); |
1213 dw_box_pack_start( notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0); | 1221 dw_box_pack_start( notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0); |
1222 | |
1223 /* Add a word wrap checkbox */ | |
1224 checkbox = dw_checkbox_new("Word wrap", 0); | |
1225 dw_box_pack_start( notebookbox4, checkbox, 100, -1, TRUE, FALSE, 1); | |
1226 dw_checkbox_set(checkbox, TRUE); | |
1214 | 1227 |
1215 /* now a container area under this box */ | 1228 /* now a container area under this box */ |
1216 container = dw_container_new(100, TRUE); | 1229 container = dw_container_new(100, TRUE); |
1217 dw_box_pack_start( notebookbox4, container, 500, 200, TRUE, FALSE, 1); | 1230 dw_box_pack_start( notebookbox4, container, 500, 200, TRUE, FALSE, 1); |
1218 | 1231 |
1291 /* connect our event trappers... */ | 1304 /* connect our event trappers... */ |
1292 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), DW_POINTER(container_status)); | 1305 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), DW_POINTER(container_status)); |
1293 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), DW_POINTER(container_status)); | 1306 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), DW_POINTER(container_status)); |
1294 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(container_select_cb), DW_POINTER(container_status)); | 1307 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(container_select_cb), DW_POINTER(container_status)); |
1295 dw_signal_connect(container, DW_SIGNAL_COLUMN_CLICK, DW_SIGNAL_FUNC(column_click_cb), DW_POINTER(container_status)); | 1308 dw_signal_connect(container, DW_SIGNAL_COLUMN_CLICK, DW_SIGNAL_FUNC(column_click_cb), DW_POINTER(container_status)); |
1309 dw_signal_connect(checkbox, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(word_wrap_click_cb), DW_POINTER(container_mle)); | |
1296 } | 1310 } |
1297 | 1311 |
1298 /* Beep every second */ | 1312 /* Beep every second */ |
1299 int DWSIGNAL timer_callback(void *data) | 1313 int DWSIGNAL timer_callback(void *data) |
1300 { | 1314 { |