soc.2009.vulture: ea8a9188: Move controls around as necessary in joi...

gdick at soc.pidgin.im gdick at soc.pidgin.im
Sat Jul 4 16:05:58 EDT 2009


-----------------------------------------------------------------
Revision: ea8a918807216b8b4dd03584245dd650d7368634
Ancestor: e14f13801e6b8fe54885c2b86063a475dd0e53e1
Author: gdick at soc.pidgin.im
Date: 2009-07-04T10:07:29
Branch: im.pidgin.soc.2009.vulture
URL: http://d.pidgin.im/viewmtn/revision/info/ea8a918807216b8b4dd03584245dd650d7368634

Modified files:
        vulture/resource.h vulture/vulture-res.rc
        vulture/vulturedlg.c

ChangeLog: 

Move controls around as necessary in join-chat dialogue.

-------------- next part --------------
============================================================
--- vulture/resource.h	2fddd9a771474dcdc36212d68b1ba76dc1396054
+++ vulture/resource.h	b0e6ad885e4d16ff0f82307b3623e9eb2d19a46f
@@ -12,8 +12,9 @@
 #define IDD_IM                                  115
 #define IDD_CHAT                                117
 #define IDD_JOINCHAT                            119
-#define IDC_COMBO1                              1000
+#define IDC_CBEX_ACCOUNTS                       1000
 #define IDC_LIST_NAMES                          1001
+#define IDC_STATIC_DETAILS                      1001
 #define IDC_TAB_CONVERSATIONS                   1001
 #define IDC_BUDDY_ICON                          1002
 #define IDC_LIST_ACCOUNTS                       1003
============================================================
--- vulture/vulture-res.rc	72957cbc45d13645e2e052b8ed974f4ac596fc21
+++ vulture/vulture-res.rc	242f1d6eceec7a8031eb4d6230059c0b9fdce03e
@@ -104,8 +104,8 @@ FONT 8, "Ms Shell Dlg 2"
     PUSHBUTTON      "Cancel", IDCANCEL, 150, 105, 50, 14, BS_PUSHBUTTON
     LTEXT           "Please choose an account, and then enter the details of the chat that you wish to join.", IDC_STATIC, 5, 5, 195, 20, SS_LEFT
     LTEXT           "Account:", IDC_STATIC, 5, 32, 35, 10, SS_LEFT
-    COMBOBOX        IDC_COMBO1, 45, 30, 155, 12, CBS_DROPDOWN | CBS_HASSTRINGS
-    GROUPBOX        "Static", IDC_STATIC, 5, 50, 195, 50
+    CONTROL         "", IDC_CBEX_ACCOUNTS, "ComboBoxEx32", 0x50000003, 45, 30, 155, 90
+    GROUPBOX        "Details", IDC_STATIC_DETAILS, 5, 50, 195, 50
 }
 
 
============================================================
--- vulture/vulturedlg.c	f2752c6e89c3bbe831e23d80e344cfc689943657
+++ vulture/vulturedlg.c	6b7bd27db19a0ca52c93abbf12d7c8ecdd527206
@@ -59,9 +59,22 @@ static INT_PTR CALLBACK JoinChatDlgProc(
  */
 static INT_PTR CALLBACK JoinChatDlgProc(HWND hwndDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
 {
+	static int s_cyNonGroup = 0, s_cyButtonMargin = 0;
+
 	switch(uiMsg)
 	{
 	case WM_INITDIALOG:
+		{
+			RECT rcGroup, rcDlg, rcButton;
+
+			GetClientRect(hwndDlg, &rcDlg);
+			GetClientRect(GetDlgItem(hwndDlg, IDC_STATIC_DETAILS), &rcGroup);
+			GetClientRect(GetDlgItem(hwndDlg, IDOK), &rcButton);
+
+			s_cyNonGroup = rcDlg.bottom - rcGroup.bottom + rcGroup.top;
+			s_cyButtonMargin = rcDlg.bottom - rcButton.top;
+		}
+
 		/* Let the system set the focus. */
 		return TRUE;
 
@@ -79,6 +92,30 @@ static INT_PTR CALLBACK JoinChatDlgProc(
 		}
 
 		break;
+
+	case WM_SIZE:
+		{
+			RECT rcGroup, rcOK, rcCancel;
+			HDWP hdwp;
+			HWND hwndGroup = GetDlgItem(hwndDlg, IDC_STATIC_DETAILS);
+			HWND hwndOK = GetDlgItem(hwndDlg, IDOK);
+			HWND hwndCancel = GetDlgItem(hwndDlg, IDCANCEL);
+
+			GetClientRect(hwndGroup, &rcGroup);
+			GetClientRect(hwndOK, &rcOK);
+			GetClientRect(hwndCancel, &rcCancel);
+
+			/* Adjust group and buttons so that they fill the
+			 * dialogue.
+			 */
+			hdwp = BeginDeferWindowPos(3);
+			hdwp = DeferWindowPos(hdwp, hwndGroup, NULL, 0, 0, rcGroup.right - rcGroup.left, HIWORD(lParam) - s_cyNonGroup, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
+			hdwp = DeferWindowPos(hdwp, hwndOK, NULL, rcOK.left, HIWORD(lParam) - s_cyButtonMargin, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+			hdwp = DeferWindowPos(hdwp, hwndCancel, NULL, rcCancel.left, HIWORD(lParam) - s_cyButtonMargin, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+			EndDeferWindowPos(hdwp);
+		}
+
+		return TRUE;
 	}
 
 	return FALSE;


More information about the Commits mailing list