Index: TortoiseProc/RenameDlg.cpp
===================================================================
--- TortoiseProc/RenameDlg.cpp (revision 19235)
+++ TortoiseProc/RenameDlg.cpp (working copy)
@@ -22,6 +22,7 @@
#include "TSVNPath.h"
#include "RenameDlg.h"
#include ".\renamedlg.h"
+#include "ControlsBridge.h"
IMPLEMENT_DYNAMIC(CRenameDlg, CResizableStandAloneDialog)
@@ -65,6 +66,8 @@
AddAnchor(IDC_DWM, TOP_LEFT);
AddAnchor(IDOK, BOTTOM_RIGHT);
AddAnchor(IDCANCEL, BOTTOM_RIGHT);
+
+ CControlsBridge::AlignHorizontally(this, IDC_LABEL, IDC_NAME);
if (hWndExplorer)
CenterWindow(CWnd::FromHandle(hWndExplorer));
EnableSaveRestore(_T("RenameDlg"));
Index: TortoiseProc/TortoiseProc.vcproj
===================================================================
--- TortoiseProc/TortoiseProc.vcproj (revision 19235)
+++ TortoiseProc/TortoiseProc.vcproj (working copy)
@@ -790,6 +790,10 @@
>
+
+
Index: TortoiseProc/URLDlg.cpp
===================================================================
--- TortoiseProc/URLDlg.cpp (revision 19235)
+++ TortoiseProc/URLDlg.cpp (working copy)
@@ -21,6 +21,7 @@
#include "TortoiseProc.h"
#include "URLDlg.h"
#include ".\urldlg.h"
+#include "ControlsBridge.h"
IMPLEMENT_DYNAMIC(CURLDlg, CResizableStandAloneDialog)
CURLDlg::CURLDlg(CWnd* pParent /*=NULL*/)
@@ -61,6 +62,7 @@
AddAnchor(IDC_URLCOMBO, TOP_LEFT, TOP_RIGHT);
AddAnchor(IDOK, BOTTOM_RIGHT);
AddAnchor(IDCANCEL, BOTTOM_RIGHT);
+ CControlsBridge::AlignHorizontally(this, IDC_LABEL, IDC_URLCOMBO);
EnableSaveRestore(_T("URLDlg"));
// Now, after the combo size might have changed, select the proper string and
Index: Utils/MiscUI/ControlsBridge.h
===================================================================
--- Utils/MiscUI/ControlsBridge.h (revision 0)
+++ Utils/MiscUI/ControlsBridge.h (revision 0)
@@ -0,0 +1,33 @@
+#pragma once
+#include "afxwin.h"
+
+class CControlsBridge {
+public:
+ static void AlignHorizontally(CWnd* parent, int labelId, int controlId);
+
+private:
+ CControlsBridge();
+ ~CControlsBridge();
+};
+
+inline void CControlsBridge::AlignHorizontally(CWnd* parent, int labelId, int controlId)
+{
+ CString labelText;
+ parent->GetDlgItemText(labelId, labelText);
+
+ CDC dc;
+ dc.SelectObject(parent->GetDlgItem(labelId )->GetFont());
+ CSize textSize(dc.GetTextExtent( labelText ));
+
+ CRect labelRect;
+ parent->GetDlgItem(labelId )->GetWindowRect(labelRect);
+ parent->ScreenToClient(labelRect);
+ labelRect.right = labelRect.left + textSize.cx;
+ parent->GetDlgItem(labelId)->MoveWindow(labelRect);
+
+ CRect controlRect;
+ parent->GetDlgItem(controlId)->GetWindowRect(controlRect);
+ parent->ScreenToClient(controlRect);
+ controlRect.left = labelRect.right;
+ parent->GetDlgItem(controlId)->MoveWindow(controlRect);
+}
Property changes on: Utils\MiscUI\ControlsBridge.h
___________________________________________________________________
Added: svn:eol-style
+ native