comparison win/dw.c @ 473:fc0341624711

Add support for column-click signal. Allow window to be created minimized or maximized (no code change)
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 10 Oct 2003 10:01:51 +0000
parents 7952b9c1dc07
children 97c2c560f829
comparison
equal deleted inserted replaced
472:d11be1f40f8c 473:fc0341624711
92 } SignalList; 92 } SignalList;
93 93
94 static int in_checkbox_handler = 0; 94 static int in_checkbox_handler = 0;
95 95
96 /* List of signals and their equivilent Win32 message */ 96 /* List of signals and their equivilent Win32 message */
97 #define SIGNALMAX 15 97 #define SIGNALMAX 16
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_LBUTTONDOWN, DW_SIGNAL_BUTTON_PRESS }, 102 { WM_LBUTTONDOWN, DW_SIGNAL_BUTTON_PRESS },
109 { NM_RCLICK, DW_SIGNAL_ITEM_CONTEXT }, 109 { NM_RCLICK, DW_SIGNAL_ITEM_CONTEXT },
110 { LBN_SELCHANGE, DW_SIGNAL_LIST_SELECT }, 110 { LBN_SELCHANGE, DW_SIGNAL_LIST_SELECT },
111 { TVN_SELCHANGED, DW_SIGNAL_ITEM_SELECT }, 111 { TVN_SELCHANGED, DW_SIGNAL_ITEM_SELECT },
112 { WM_SETFOCUS, DW_SIGNAL_SET_FOCUS }, 112 { WM_SETFOCUS, DW_SIGNAL_SET_FOCUS },
113 { WM_VSCROLL, DW_SIGNAL_VALUE_CHANGED }, 113 { WM_VSCROLL, DW_SIGNAL_VALUE_CHANGED },
114 { TCN_SELCHANGE, DW_SIGNAL_SWITCH_PAGE } 114 { TCN_SELCHANGE, DW_SIGNAL_SWITCH_PAGE },
115 { LVN_COLUMNCLICK,DW_SIGNAL_COLUMN_CLICK }
115 }; 116 };
116 117
117 #ifdef BUILD_DLL 118 #ifdef BUILD_DLL
118 void Win32_Set_Instance(HINSTANCE hInstance) 119 void Win32_Set_Instance(HINSTANCE hInstance)
119 { 120 {
1690 if(tmp->window == tem->hwndFrom && tem->code == tmp->message) 1691 if(tmp->window == tem->hwndFrom && tem->code == tmp->message)
1691 { 1692 {
1692 int (*switchpagefunc)(HWND, unsigned long, void *) = tmp->signalfunction; 1693 int (*switchpagefunc)(HWND, unsigned long, void *) = tmp->signalfunction;
1693 unsigned long num=dw_notebook_page_query(tem->hwndFrom); 1694 unsigned long num=dw_notebook_page_query(tem->hwndFrom);
1694 result = switchpagefunc(tem->hwndFrom, num, tmp->data); 1695 result = switchpagefunc(tem->hwndFrom, num, tmp->data);
1696 tmp = NULL;
1697 }
1698 }
1699 else if(tmp->message == LVN_COLUMNCLICK)
1700 {
1701 NMLISTVIEW FAR *tem=(NMLISTVIEW FAR *)mp2;
1702 if(tmp->window == tem->hdr.hwndFrom && tem->hdr.code == tmp->message)
1703 {
1704 int (*columnclickfunc)(HWND, int, void *) = tmp->signalfunction;
1705 result = columnclickfunc(tem->hdr.hwndFrom, tem->iSubItem, tmp->data);
1695 tmp = NULL; 1706 tmp = NULL;
1696 } 1707 }
1697 } 1708 }
1698 } 1709 }
1699 break; 1710 break;
5032 WINDOWPLACEMENT wp; 5043 WINDOWPLACEMENT wp;
5033 5044
5034 wp.length = sizeof(WINDOWPLACEMENT); 5045 wp.length = sizeof(WINDOWPLACEMENT);
5035 5046
5036 GetWindowPlacement(handle, &wp); 5047 GetWindowPlacement(handle, &wp);
5037 if(x) 5048 if( wp.showCmd == SW_SHOWMAXIMIZED)
5038 *x = wp.rcNormalPosition.left; 5049 {
5039 if(y) 5050 if(x)
5040 *y = wp.rcNormalPosition.top; 5051 *x=0;
5041 if(width) 5052 if(y)
5042 *width = wp.rcNormalPosition.right - wp.rcNormalPosition.left; 5053 *y=0;
5043 if(height) 5054 if(width)
5044 *height = wp.rcNormalPosition.bottom - wp.rcNormalPosition.top; 5055 *width=dw_screen_width();
5045 5056 if(height)
5057 *height=dw_screen_height();
5058 }
5059 else
5060 {
5061 if(x)
5062 *x = wp.rcNormalPosition.left;
5063 if(y)
5064 *y = wp.rcNormalPosition.top;
5065 if(width)
5066 *width = wp.rcNormalPosition.right - wp.rcNormalPosition.left;
5067 if(height)
5068 *height = wp.rcNormalPosition.bottom - wp.rcNormalPosition.top;
5069 }
5046 } 5070 }
5047 5071
5048 /* 5072 /*
5049 * Sets the style of a given window (widget). 5073 * Sets the style of a given window (widget).
5050 * Parameters: 5074 * Parameters: