comparison dwtest.c @ 391:2059f18e9c20

Add extra button to test mouse cursor change.
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 09 May 2003 02:32:51 +0000
parents 761e5fddffca
children 255a31a3a1f5
comparison
equal deleted inserted replaced
390:2dbed2673df0 391:2059f18e9c20
27 unsigned long flStyle = DW_FCF_SYSMENU | DW_FCF_TITLEBAR | 27 unsigned long flStyle = DW_FCF_SYSMENU | DW_FCF_TITLEBAR |
28 DW_FCF_SHELLPOSITION | DW_FCF_TASKLIST | DW_FCF_DLGBORDER; 28 DW_FCF_SHELLPOSITION | DW_FCF_TASKLIST | DW_FCF_DLGBORDER;
29 29
30 HWND mainwindow, 30 HWND mainwindow,
31 entryfield, 31 entryfield,
32 cursortogglebutton,
32 okbutton, 33 okbutton,
33 cancelbutton, 34 cancelbutton,
34 lbbox, 35 lbbox,
35 notebookbox, 36 notebookbox,
36 notebookbox1, 37 notebookbox1,
63 char *current_file = NULL; 64 char *current_file = NULL;
64 int timerid; 65 int timerid;
65 int num_lines=0; 66 int num_lines=0;
66 int max_linewidth=0; 67 int max_linewidth=0;
67 int current_row=0,current_col=0; 68 int current_row=0,current_col=0;
69 int cursor_arrow = 1;
68 70
69 FILE *fp=NULL; 71 FILE *fp=NULL;
70 char **lp; 72 char **lp;
71 73
72 char *resolve_keyname( int vk ) 74 char *resolve_keyname( int vk )
249 text_expose( textbox1, NULL, NULL); 251 text_expose( textbox1, NULL, NULL);
250 text_expose( textbox2, NULL, NULL); 252 text_expose( textbox2, NULL, NULL);
251 } 253 }
252 } 254 }
253 255
256 int DWSIGNAL cursortoggle_callback(HWND window, void *data)
257 {
258 if(cursor_arrow)
259 {
260 dw_window_set_text((HWND)cursortogglebutton,"Set Cursor pointer - ARROW");
261 dw_window_pointer((HWND)data,DW_POINTER_CLOCK);
262 cursor_arrow = 0;
263 }
264 else
265 {
266 dw_window_set_text((HWND)cursortogglebutton,"Set Cursor pointer - CLOCK");
267 dw_window_pointer((HWND)data,DW_POINTER_ARROW);
268 cursor_arrow = 1;
269 }
270 dw_window_show(mainwindow);
271 return FALSE;
272 }
273
254 int DWSIGNAL beep_callback(HWND window, void *data) 274 int DWSIGNAL beep_callback(HWND window, void *data)
255 { 275 {
256 dw_timer_disconnect( timerid ); 276 dw_timer_disconnect( timerid );
257 return TRUE; 277 return TRUE;
258 } 278 }
454 /* Buttons */ 474 /* Buttons */
455 buttonbox = dw_box_new(BOXHORZ, 10); 475 buttonbox = dw_box_new(BOXHORZ, 10);
456 476
457 dw_box_pack_start(lbbox, buttonbox, 0, 0, TRUE, TRUE, 0); 477 dw_box_pack_start(lbbox, buttonbox, 0, 0, TRUE, TRUE, 0);
458 478
479 cursortogglebutton = dw_button_new("Set Cursor pointer - CLOCK", 1003L);
480
481 dw_box_pack_start(buttonbox, cursortogglebutton, 130, 30, TRUE, TRUE, 2);
482
459 okbutton = dw_button_new("Turn Off Annoying Beep!", 1001L); 483 okbutton = dw_button_new("Turn Off Annoying Beep!", 1001L);
460 484
461 dw_box_pack_start(buttonbox, okbutton, 130, 30, TRUE, TRUE, 2); 485 dw_box_pack_start(buttonbox, okbutton, 130, 30, TRUE, TRUE, 2);
462 486
463 cancelbutton = dw_button_new("Exit", 1002L); 487 cancelbutton = dw_button_new("Exit", 1002L);
470 dw_window_set_color(okbutton, DW_CLR_PALEGRAY, DW_CLR_DARKCYAN); 494 dw_window_set_color(okbutton, DW_CLR_PALEGRAY, DW_CLR_DARKCYAN);
471 495
472 dw_signal_connect(browsebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_callback), (void *)notebookbox1); 496 dw_signal_connect(browsebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_callback), (void *)notebookbox1);
473 dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(beep_callback), (void *)notebookbox1); 497 dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(beep_callback), (void *)notebookbox1);
474 dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow); 498 dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow);
499 dw_signal_connect(cursortogglebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(cursortoggle_callback), (void *)mainwindow);
475 } 500 }
476 501
477 502
478 void text_add(void) 503 void text_add(void)
479 { 504 {