changeset 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 d11be1f40f8c
children 053211e0698b
files win/dw.c
diffstat 1 files changed, 35 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Fri Oct 10 09:26:07 2003 +0000
+++ b/win/dw.c	Fri Oct 10 10:01:51 2003 +0000
@@ -94,7 +94,7 @@
 static int in_checkbox_handler = 0;
 
 /* List of signals and their equivilent Win32 message */
-#define SIGNALMAX 15
+#define SIGNALMAX 16
 
 SignalList SignalTranslate[SIGNALMAX] = {
 	{ WM_SIZE,        DW_SIGNAL_CONFIGURE },
@@ -111,7 +111,8 @@
 	{ TVN_SELCHANGED, DW_SIGNAL_ITEM_SELECT },
 	{ WM_SETFOCUS,    DW_SIGNAL_SET_FOCUS },
 	{ WM_VSCROLL,     DW_SIGNAL_VALUE_CHANGED },
-	{ TCN_SELCHANGE,  DW_SIGNAL_SWITCH_PAGE }
+	{ TCN_SELCHANGE,  DW_SIGNAL_SWITCH_PAGE },
+	{ LVN_COLUMNCLICK,DW_SIGNAL_COLUMN_CLICK }
 };
 
 #ifdef BUILD_DLL
@@ -1695,6 +1696,16 @@
 								tmp = NULL;
 							}
 						}
+						else if(tmp->message == LVN_COLUMNCLICK)
+						{
+							NMLISTVIEW FAR *tem=(NMLISTVIEW FAR *)mp2;
+							if(tmp->window == tem->hdr.hwndFrom && tem->hdr.code == tmp->message)
+							{
+								int (*columnclickfunc)(HWND, int, void *) = tmp->signalfunction;
+								result = columnclickfunc(tem->hdr.hwndFrom, tem->iSubItem, tmp->data);
+								tmp = NULL;
+							}
+						}
 					}
 					break;
 				case WM_COMMAND:
@@ -5034,15 +5045,28 @@
 	wp.length = sizeof(WINDOWPLACEMENT);
 
 	GetWindowPlacement(handle, &wp);
-	if(x)
-		*x = wp.rcNormalPosition.left;
-	if(y)
-		*y = wp.rcNormalPosition.top;
-	if(width)
-		*width = wp.rcNormalPosition.right - wp.rcNormalPosition.left;
-	if(height)
-		*height = wp.rcNormalPosition.bottom - wp.rcNormalPosition.top;
-
+	if( wp.showCmd == SW_SHOWMAXIMIZED)
+	{
+		if(x)
+			*x=0;
+		if(y)
+			*y=0;
+		if(width)
+			*width=dw_screen_width();
+		if(height)
+			*height=dw_screen_height();
+	}
+else
+	{
+		if(x)
+			*x = wp.rcNormalPosition.left;
+		if(y)
+			*y = wp.rcNormalPosition.top;
+		if(width)
+			*width = wp.rcNormalPosition.right - wp.rcNormalPosition.left;
+		if(height)
+			*height = wp.rcNormalPosition.bottom - wp.rcNormalPosition.top;
+	}
 }
 
 /*