diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-06-26 13:55:35 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-06-26 13:55:35 (GMT) |
commit | 78cc9b21e097a5c1205b1f5bb486ac3acb58dbaf (patch) | |
tree | 02dd39830506c23f44633318b6da9566fdae1392 /Source/MFCDialog | |
parent | d2c2cf3296eaaa746134f20655be6770232c79c3 (diff) | |
download | CMake-78cc9b21e097a5c1205b1f5bb486ac3acb58dbaf.zip CMake-78cc9b21e097a5c1205b1f5bb486ac3acb58dbaf.tar.gz CMake-78cc9b21e097a5c1205b1f5bb486ac3acb58dbaf.tar.bz2 |
better GUI resize and combo box fixes
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r-- | Source/MFCDialog/CMakeSetup.rc | 10 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.cpp | 65 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.h | 4 |
3 files changed, 63 insertions, 16 deletions
diff --git a/Source/MFCDialog/CMakeSetup.rc b/Source/MFCDialog/CMakeSetup.rc index b25782d..35e5347 100644 --- a/Source/MFCDialog/CMakeSetup.rc +++ b/Source/MFCDialog/CMakeSetup.rc @@ -98,8 +98,8 @@ BEGIN COMBOBOX IDC_WhereBuild,148,26,133,68,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Browse...",IDC_BUTTON3,286,25,43,13 - DEFPUSHBUTTON "Build Project Files",IDC_BuildProjects,95,205,67,15 - PUSHBUTTON "Close",IDOK,219,205,50,14 + DEFPUSHBUTTON "Build Project Files",IDC_BuildProjects,112,206,67,15 + PUSHBUTTON "Close",IDOK,190,206,67,15 LISTBOX IDC_LIST2,15,55,344,122,LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL @@ -107,9 +107,9 @@ BEGIN RTEXT "Where do you want to build the binaries:",IDC_STATIC,10, 27,128,9 GROUPBOX "Cache Values",IDC_FRAME,9,43,356,141 - LTEXT "Right click on cache entries for additional options", - IDC_MouseHelpCaption,106,190,156,8 - LTEXT "Static",IDC_CMAKE_VERSION,3,211,70,13,SS_CENTERIMAGE + CTEXT "Right click on cache entries for additional options", + IDC_MouseHelpCaption,106,189,156,8 + LTEXT "Static",IDC_CMAKE_VERSION,3,211,58,13,SS_CENTERIMAGE END diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index d6e7790..bf250fa 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -81,6 +81,9 @@ CMakeSetupDialog::CMakeSetupDialog(CWnd* pParent /*=NULL*/) m_PathToExecutable = cmSystemTools::GetProgramPath(fname).c_str(); // add the cmake.exe to the path m_PathToExecutable += "/cmake.exe"; + + m_oldCX = -1; + m_deltaXRemainder = 0; } void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX) @@ -95,8 +98,8 @@ void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_WhereSource, m_WhereSourceControl); DDX_Control(pDX, IDC_WhereBuild, m_WhereBuildControl); DDX_Control(pDX, IDC_LIST2, m_CacheEntriesList); - DDX_CBString(pDX, IDC_WhereBuild, m_WhereBuild); - DDX_CBString(pDX, IDC_WhereSource, m_WhereSource); + DDX_CBStringExact(pDX, IDC_WhereBuild, m_WhereBuild); + DDX_CBStringExact(pDX, IDC_WhereSource, m_WhereSource); //}}AFX_DATA_MAP } @@ -451,6 +454,7 @@ void CMakeSetupDialog::OnSelendokWhereBuild() { m_WhereBuildControl.GetLBText(m_WhereBuildControl.GetCurSel(), m_WhereBuild); + m_WhereBuildControl.SetWindowText( m_WhereBuild); this->UpdateData(FALSE); this->OnChangeWhereBuild(); } @@ -582,23 +586,62 @@ void CMakeSetupDialog::SaveCacheFromGUI() void CMakeSetupDialog::OnSize(UINT nType, int cx, int cy) { + if (m_oldCX == -1) + { + m_oldCX = cx; + m_oldCY = cy; + } + int deltax = cx - m_oldCX; + int deltay = cy - m_oldCY; + + m_oldCX = cx; + m_oldCY = cy; + CDialog::OnSize(nType, cx, cy); + + if (deltax == 0 && deltay == 0) + { + return; + } if(m_CacheEntriesList.m_hWnd) { - m_ListFrame.SetWindowPos(&wndTop, 0, 0, cx-28, cy-137, + // get the original sizes/positions + CRect cRect; + m_ListFrame.GetWindowRect(&cRect); + m_ListFrame.SetWindowPos(&wndTop, cRect.left, cRect.top, + cRect.Width() + deltax, + cRect.Height() + deltay, SWP_NOMOVE | SWP_NOZORDER); - m_CacheEntriesList.SetWindowPos(&wndTop, 0, 0, cx-48, cy-168, - SWP_NOMOVE | SWP_NOZORDER); - m_BuildProjects.SetWindowPos(&wndTop, 143, cy-33, 0, 0, - SWP_NOSIZE | SWP_NOZORDER); - m_MouseHelp.SetWindowPos(&wndTop, 159, cy-57, + m_CacheEntriesList.GetWindowRect(&cRect); + m_CacheEntriesList.SetWindowPos(&wndTop, cRect.left, cRect.top, + cRect.Width() + deltax, + cRect.Height() + deltay, + SWP_NOMOVE | SWP_NOZORDER); + m_VersionDisplay.SetWindowPos(&wndTop, 5, cy-23, 0, 0, + SWP_NOSIZE | SWP_NOZORDER); + + deltax = deltax + m_deltaXRemainder; + m_deltaXRemainder = deltax%2; + m_MouseHelp.GetWindowRect(&cRect); + this->ScreenToClient(&cRect); + m_MouseHelp.SetWindowPos(&wndTop, cRect.left + deltax/2, + cRect.top + deltay, 0, 0, SWP_NOSIZE | SWP_NOZORDER); - m_CancelButton.SetWindowPos(&wndTop, 329, cy-33, 0, 0, + + m_BuildProjects.GetWindowRect(&cRect); + this->ScreenToClient(&cRect); + m_BuildProjects.SetWindowPos(&wndTop, cRect.left + deltax/2, + cRect.top + deltay, + 0, 0, SWP_NOSIZE | SWP_NOZORDER); - m_VersionDisplay.SetWindowPos(&wndTop, 5, cy-23, 0, 0, - SWP_NOSIZE | SWP_NOZORDER); + m_CancelButton.GetWindowRect(&cRect); + this->ScreenToClient(&cRect); + m_CancelButton.SetWindowPos(&wndTop, cRect.left + deltax/2, + cRect.top + deltay, + 0, 0, + SWP_NOSIZE | SWP_NOZORDER); } } diff --git a/Source/MFCDialog/CMakeSetupDialog.h b/Source/MFCDialog/CMakeSetupDialog.h index 7e0942d..0a474b9 100644 --- a/Source/MFCDialog/CMakeSetupDialog.h +++ b/Source/MFCDialog/CMakeSetupDialog.h @@ -81,6 +81,10 @@ protected: afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI ); //}}AFX_MSG DECLARE_MESSAGE_MAP() + + int m_oldCX; + int m_oldCY; + float m_deltaXRemainder; }; //{{AFX_INSERT_LOCATION}} |