comparison os2/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 9d13efce2894
children 77105fe19c1f
comparison
equal deleted inserted replaced
306:9d13efce2894 307:324587c06cea
92 char name[30]; 92 char name[30];
93 93
94 } SignalList; 94 } SignalList;
95 95
96 /* List of signals and their equivilent OS/2 message */ 96 /* List of signals and their equivilent OS/2 message */
97 #define SIGNALMAX 15 97 #define SIGNALMAX 14
98 98
99 SignalList SignalTranslate[SIGNALMAX] = { 99 SignalList SignalTranslate[SIGNALMAX] = {
100 { WM_SIZE, "configure_event" }, 100 { WM_SIZE, DW_SIGNAL_CONFIGURE },
101 { WM_CHAR, "key_press_event" }, 101 { WM_CHAR, DW_SIGNAL_KEY_PRESS },
102 { WM_BUTTON1DOWN, "button_press_event" }, 102 { WM_BUTTON1DOWN, DW_SIGNAL_BUTTON_PRESS },
103 { WM_BUTTON1UP, "button_release_event"}, 103 { WM_BUTTON1UP, DW_SIGNAL_BUTTON_RELEASE },
104 { WM_MOUSEMOVE, "motion_notify_event" }, 104 { WM_MOUSEMOVE, DW_SIGNAL_MOTION_NOTIFY },
105 { WM_CLOSE, "delete_event" }, 105 { WM_CLOSE, DW_SIGNAL_DELETE },
106 { WM_PAINT, "expose_event" }, 106 { WM_PAINT, DW_SIGNAL_EXPOSE },
107 { WM_COMMAND, "clicked" }, 107 { WM_COMMAND, DW_SIGNAL_CLICKED },
108 { CN_ENTER, "container-select" }, 108 { CN_ENTER, DW_SIGNAL_ITEM_ENTER },
109 { CN_CONTEXTMENU, "container-context" }, 109 { CN_CONTEXTMENU, DW_SIGNAL_ITEM_CONTEXT },
110 { LN_SELECT, "item-select" }, 110 { LN_SELECT, DW_SIGNAL_LIST_SELECT },
111 { CN_EMPHASIS, "tree-select" }, 111 { CN_EMPHASIS, DW_SIGNAL_ITEM_SELECT },
112 { WM_SETFOCUS, "set-focus" }, 112 { WM_SETFOCUS, DW_SIGNAL_SET_FOCUS },
113 { WM_USER+1, "lose-focus" }, 113 { SLN_SLIDERTRACK, DW_SIGNAL_VALUE_CHANGED }
114 { SLN_SLIDERTRACK, "value_changed" }
115 }; 114 };
116 115
117 /* This function adds a signal handler callback into the linked list. 116 /* This function adds a signal handler callback into the linked list.
118 */ 117 */
119 void _new_signal(ULONG message, HWND window, int id, void *signalfunction, void *data) 118 void _new_signal(ULONG message, HWND window, int id, void *signalfunction, void *data)
4706 case 10: 4705 case 10:
4707 case 32: 4706 case 32:
4708 case 7: 4707 case 7:
4709 hwnd = _find_entryfield(handle); 4708 hwnd = _find_entryfield(handle);
4710 _dw_window_set_color(hwnd ? hwnd : handle, DW_CLR_BLACK, DW_CLR_PALEGRAY); 4709 _dw_window_set_color(hwnd ? hwnd : handle, DW_CLR_BLACK, DW_CLR_PALEGRAY);
4711 dw_signal_connect(hwnd ? hwnd : handle, "key_press_event", DW_SIGNAL_FUNC(_null_key), (void *)100); 4710 dw_signal_connect(hwnd ? hwnd : handle, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
4712 if(val == 2) 4711 if(val == 2)
4713 dw_signal_connect(handle, "button_press_event", DW_SIGNAL_FUNC(_null_key), (void *)100); 4712 dw_signal_connect(handle, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
4714 if(hwnd) 4713 if(hwnd)
4715 dw_window_set_data(hwnd, "_dw_disabled", (void *)1); 4714 dw_window_set_data(hwnd, "_dw_disabled", (void *)1);
4716 return; 4715 return;
4717 case 3: 4716 case 3:
4718 _dw_window_set_color(handle, DW_CLR_DARKGRAY, DW_CLR_PALEGRAY); 4717 _dw_window_set_color(handle, DW_CLR_DARKGRAY, DW_CLR_PALEGRAY);
4719 dw_signal_connect(handle, "key_press_event", DW_SIGNAL_FUNC(_null_key), (void *)100); 4718 dw_signal_connect(handle, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
4720 dw_signal_connect(handle, "button_press_event", DW_SIGNAL_FUNC(_null_key), (void *)100); 4719 dw_signal_connect(handle, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
4721 return; 4720 return;
4722 } 4721 }
4723 } 4722 }
4724 WinEnableWindow(handle, FALSE); 4723 WinEnableWindow(handle, FALSE);
4725 } 4724 }