comparison win/dw.c @ 307:324587c06cea

Use the signal #defines internally so all that is required to change the signal strings is a header file change.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 31 Mar 2003 08:21:55 +0000
parents 464b5e46b313
children 49047a8787cb
comparison
equal deleted inserted replaced
306:9d13efce2894 307:324587c06cea
86 } SignalList; 86 } SignalList;
87 87
88 static int in_checkbox_handler = 0; 88 static int in_checkbox_handler = 0;
89 89
90 /* List of signals and their equivilent Win32 message */ 90 /* List of signals and their equivilent Win32 message */
91 #define SIGNALMAX 15 91 #define SIGNALMAX 14
92 92
93 SignalList SignalTranslate[SIGNALMAX] = { 93 SignalList SignalTranslate[SIGNALMAX] = {
94 { WM_SIZE, "configure_event" }, 94 { WM_SIZE, DW_SIGNAL_CONFIGURE },
95 { WM_CHAR, "key_press_event" }, 95 { WM_CHAR, DW_SIGNAL_KEY_PRESS },
96 { WM_LBUTTONDOWN, "button_press_event" }, 96 { WM_LBUTTONDOWN, DW_SIGNAL_BUTTON_PRESS },
97 { WM_LBUTTONUP, "button_release_event" }, 97 { WM_LBUTTONUP, DW_SIGNAL_BUTTON_PRESS },
98 { WM_MOUSEMOVE, "motion_notify_event" }, 98 { WM_MOUSEMOVE, DW_SIGNAL_MOTION_NOTIFY },
99 { WM_CLOSE, "delete_event" }, 99 { WM_CLOSE, DW_SIGNAL_DELETE },
100 { WM_PAINT, "expose_event" }, 100 { WM_PAINT, DW_SIGNAL_EXPOSE },
101 { WM_COMMAND, "clicked" }, 101 { WM_COMMAND, DW_SIGNAL_CLICKED },
102 { NM_DBLCLK, "container-select" }, 102 { NM_DBLCLK, DW_SIGNAL_ITEM_ENTER },
103 { NM_RCLICK, "container-context" }, 103 { NM_RCLICK, DW_SIGNAL_ITEM_CONTEXT },
104 { LBN_SELCHANGE, "item-select" }, 104 { LBN_SELCHANGE, DW_SIGNAL_LIST_SELECT },
105 { TVN_SELCHANGED, "tree-select" }, 105 { TVN_SELCHANGED, DW_SIGNAL_ITEM_SELECT },
106 { WM_SETFOCUS, "set-focus" }, 106 { WM_SETFOCUS, DW_SIGNAL_SET_FOCUS },
107 { WM_USER+1, "lose-focus" }, 107 { WM_VSCROLL, DW_SIGNAL_VALUE_CHANGE }
108 { WM_VSCROLL, "value_changed" }
109 }; 108 };
110 109
111 #ifdef BUILD_DLL 110 #ifdef BUILD_DLL
112 void Win32_Set_Instance(HINSTANCE hInstance) 111 void Win32_Set_Instance(HINSTANCE hInstance)
113 { 112 {
7863 { 7862 {
7864 ULONG message = 0L; 7863 ULONG message = 0L;
7865 7864
7866 if(window && signame && sigfunc) 7865 if(window && signame && sigfunc)
7867 { 7866 {
7868 if(stricmp(signame, "set-focus") == 0) 7867 if(stricmp(signame, DW_SIGNAL_SET_FOCUS) == 0)
7869 window = _normalize_handle(window); 7868 window = _normalize_handle(window);
7870 7869
7871 if((message = _findsigmessage(signame)) != 0) 7870 if((message = _findsigmessage(signame)) != 0)
7872 _new_signal(message, window, 0, sigfunc, data); 7871 _new_signal(message, window, 0, sigfunc, data);
7873 } 7872 }