Mercurial > dwindows
comparison os2/dw.c @ 346:81fae15885d7
Implemented switch-page on OS/2, and changed the signal prototype to
unsigned long instead of int. Also dw_notebook_page_query should
return unsigned long as well.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 11 Apr 2003 13:35:50 +0000 |
parents | 4029240b5e63 |
children | 0137c30f485e |
comparison
equal
deleted
inserted
replaced
345:599644ca9064 | 346:81fae15885d7 |
---|---|
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 14 | 97 #define SIGNALMAX 15 |
98 | 98 |
99 SignalList SignalTranslate[SIGNALMAX] = { | 99 SignalList SignalTranslate[SIGNALMAX] = { |
100 { WM_SIZE, DW_SIGNAL_CONFIGURE }, | 100 { WM_SIZE, DW_SIGNAL_CONFIGURE }, |
101 { WM_CHAR, DW_SIGNAL_KEY_PRESS }, | 101 { WM_CHAR, DW_SIGNAL_KEY_PRESS }, |
102 { WM_BUTTON1DOWN, DW_SIGNAL_BUTTON_PRESS }, | 102 { WM_BUTTON1DOWN, DW_SIGNAL_BUTTON_PRESS }, |
108 { CN_ENTER, DW_SIGNAL_ITEM_ENTER }, | 108 { CN_ENTER, DW_SIGNAL_ITEM_ENTER }, |
109 { CN_CONTEXTMENU, DW_SIGNAL_ITEM_CONTEXT }, | 109 { CN_CONTEXTMENU, DW_SIGNAL_ITEM_CONTEXT }, |
110 { LN_SELECT, DW_SIGNAL_LIST_SELECT }, | 110 { LN_SELECT, DW_SIGNAL_LIST_SELECT }, |
111 { CN_EMPHASIS, DW_SIGNAL_ITEM_SELECT }, | 111 { CN_EMPHASIS, DW_SIGNAL_ITEM_SELECT }, |
112 { WM_SETFOCUS, DW_SIGNAL_SET_FOCUS }, | 112 { WM_SETFOCUS, DW_SIGNAL_SET_FOCUS }, |
113 { SLN_SLIDERTRACK, DW_SIGNAL_VALUE_CHANGED } | 113 { SLN_SLIDERTRACK, DW_SIGNAL_VALUE_CHANGED }, |
114 { BKN_PAGESELECTED,DW_SIGNAL_SWITCH_PAGE } | |
114 }; | 115 }; |
115 | 116 |
116 /* This function adds a signal handler callback into the linked list. | 117 /* This function adds a signal handler callback into the linked list. |
117 */ | 118 */ |
118 void _new_signal(ULONG message, HWND window, int id, void *signalfunction, void *data) | 119 void _new_signal(ULONG message, HWND window, int id, void *signalfunction, void *data) |
2293 result = 0; | 2294 result = 0; |
2294 tmp = NULL; | 2295 tmp = NULL; |
2295 } | 2296 } |
2296 } | 2297 } |
2297 } | 2298 } |
2298 | 2299 break; |
2300 case BKN_PAGESELECTED: | |
2301 { | |
2302 PAGESELECTNOTIFY *psn = (PAGESELECTNOTIFY *)mp2; | |
2303 | |
2304 if(psn && tmp->window == psn->hwndBook) | |
2305 { | |
2306 int (* API switchpagefunc)(HWND, unsigned long, void *) = (int (* API)(HWND, unsigned long, void *))tmp->signalfunction; | |
2307 | |
2308 result = switchpagefunc(tmp->window, psn->ulPageIdNew, tmp->data); | |
2309 tmp = NULL; | |
2310 } | |
2311 } | |
2299 break; | 2312 break; |
2300 } | 2313 } |
2301 } | 2314 } |
2302 break; | 2315 break; |
2303 } | 2316 } |
5034 /* | 5047 /* |
5035 * Queries the currently visible page ID. | 5048 * Queries the currently visible page ID. |
5036 * Parameters: | 5049 * Parameters: |
5037 * handle: Handle to the notebook widget. | 5050 * handle: Handle to the notebook widget. |
5038 */ | 5051 */ |
5039 unsigned int API dw_notebook_page_query(HWND handle) | 5052 unsigned long API dw_notebook_page_query(HWND handle) |
5040 { | 5053 { |
5041 return (int)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR)); | 5054 return (unsigned long)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR)); |
5042 } | 5055 } |
5043 | 5056 |
5044 /* | 5057 /* |
5045 * Sets the currently visibale page ID. | 5058 * Sets the currently visibale page ID. |
5046 * Parameters: | 5059 * Parameters: |