# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1050068150 0 # Node ID 81fae15885d713304ff22bd2d3e1aa285e0f6ec6 # Parent 599644ca90640acdabf85103b17e3a16f5737b5a 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. diff -r 599644ca9064 -r 81fae15885d7 dw.h --- a/dw.h Fri Apr 11 12:26:54 2003 +0000 +++ b/dw.h Fri Apr 11 13:35:50 2003 +0000 @@ -875,7 +875,7 @@ void API dw_notebook_page_set_text(HWND handle, unsigned long pageid, char *text); void API dw_notebook_page_set_status_text(HWND handle, unsigned long pageid, char *text); void API dw_notebook_page_set(HWND handle, unsigned int pageid); -unsigned int API dw_notebook_page_query(HWND handle); +unsigned long API dw_notebook_page_query(HWND handle); void API dw_notebook_pack(HWND handle, unsigned long pageid, HWND page); HWND API dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id); void API dw_splitbar_set(HWND handle, float percent); diff -r 599644ca9064 -r 81fae15885d7 dwtest.c --- a/dwtest.c Fri Apr 11 12:26:54 2003 +0000 +++ b/dwtest.c Fri Apr 11 13:35:50 2003 +0000 @@ -386,11 +386,11 @@ return 0; } -int DWSIGNAL switch_page_cb( HWND window, int page_num, void *itemdata ) +int DWSIGNAL switch_page_cb( HWND window, unsigned long page_num, void *itemdata ) { -FILE *fp=fopen("log","a"); - fprintf(fp,"DW_SIGNAL_SWITCH_PAGE: Window: %x PageNum: %d Itemdata: %x\n", (unsigned int)window, (unsigned int)page_num, (unsigned int)itemdata ); -fclose(fp); + FILE *fp=fopen("log","a"); + fprintf(fp,"DW_SIGNAL_SWITCH_PAGE: Window: %x PageNum: %u Itemdata: %x\n", (unsigned int)window, (unsigned int)page_num, (unsigned int)itemdata ); + fclose(fp); return 0; } diff -r 599644ca9064 -r 81fae15885d7 gtk/dw.c --- a/gtk/dw.c Fri Apr 11 12:26:54 2003 +0000 +++ b/gtk/dw.c Fri Apr 11 13:35:50 2003 +0000 @@ -575,7 +575,7 @@ if(work) { - int (*switchpagefunc)(HWND, int, void *) = work->func; + int (*switchpagefunc)(HWND, unsigned long, void *) = work->func; retval = switchpagefunc(work->window, _get_logical_page(GTK_WIDGET(notebook), page_num), work->data); } return retval; @@ -6355,7 +6355,7 @@ * Parameters: * handle: Handle to the notebook widget. */ -unsigned int dw_notebook_page_query(HWND handle) +unsigned long dw_notebook_page_query(HWND handle) { int retval, phys; int _locked_by_me = FALSE; diff -r 599644ca9064 -r 81fae15885d7 os2/dw.c --- a/os2/dw.c Fri Apr 11 12:26:54 2003 +0000 +++ b/os2/dw.c Fri Apr 11 13:35:50 2003 +0000 @@ -94,7 +94,7 @@ } SignalList; /* List of signals and their equivilent OS/2 message */ -#define SIGNALMAX 14 +#define SIGNALMAX 15 SignalList SignalTranslate[SIGNALMAX] = { { WM_SIZE, DW_SIGNAL_CONFIGURE }, @@ -110,7 +110,8 @@ { LN_SELECT, DW_SIGNAL_LIST_SELECT }, { CN_EMPHASIS, DW_SIGNAL_ITEM_SELECT }, { WM_SETFOCUS, DW_SIGNAL_SET_FOCUS }, - { SLN_SLIDERTRACK, DW_SIGNAL_VALUE_CHANGED } + { SLN_SLIDERTRACK, DW_SIGNAL_VALUE_CHANGED }, + { BKN_PAGESELECTED,DW_SIGNAL_SWITCH_PAGE } }; /* This function adds a signal handler callback into the linked list. @@ -2295,7 +2296,19 @@ } } } - + break; + case BKN_PAGESELECTED: + { + PAGESELECTNOTIFY *psn = (PAGESELECTNOTIFY *)mp2; + + if(psn && tmp->window == psn->hwndBook) + { + int (* API switchpagefunc)(HWND, unsigned long, void *) = (int (* API)(HWND, unsigned long, void *))tmp->signalfunction; + + result = switchpagefunc(tmp->window, psn->ulPageIdNew, tmp->data); + tmp = NULL; + } + } break; } } @@ -5036,9 +5049,9 @@ * Parameters: * handle: Handle to the notebook widget. */ -unsigned int API dw_notebook_page_query(HWND handle) -{ - return (int)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR)); +unsigned long API dw_notebook_page_query(HWND handle) +{ + return (unsigned long)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR)); } /* diff -r 599644ca9064 -r 81fae15885d7 win/dw.c --- a/win/dw.c Fri Apr 11 12:26:54 2003 +0000 +++ b/win/dw.c Fri Apr 11 13:35:50 2003 +0000 @@ -1581,9 +1581,10 @@ NMHDR FAR *tem=(NMHDR FAR *)mp2; if(tmp->window == tem->hwndFrom && tem->code == tmp->message) { - int (*switchpagefunc)(HWND, int, void *) = tmp->signalfunction; - int num=dw_notebook_page_query(tem->hwndFrom); + int (*switchpagefunc)(HWND, unsigned long, void *) = tmp->signalfunction; + unsigned long num=dw_notebook_page_query(tem->hwndFrom); result = switchpagefunc(tem->hwndFrom, num, tmp->data); + tmp = NULL; } } } @@ -5055,7 +5056,7 @@ * Parameters: * handle: Handle to the notebook widget. */ -unsigned int API dw_notebook_page_query(HWND handle) +unsigned long API dw_notebook_page_query(HWND handle) { NotebookPage **array = (NotebookPage **)dw_window_get_data(handle, "_dw_array"); int physid = TabCtrl_GetCurSel(handle);