ENH: add resize ability to dialog and fix tab stop orders

This commit is contained in:
Bill Hoffman 2001-06-19 14:32:37 -04:00
parent 873c9e7840
commit f991ddd4ba
5 changed files with 80 additions and 29 deletions

View File

@ -27,6 +27,11 @@ protected:
// Dialog Data
//{{AFX_DATA(CMakeSetupDialog)
enum { IDD = IDD_CMakeSetupDialog_DIALOG };
CButton m_CancelButton;
CStatic m_MouseHelp;
CStatic m_VersionDisplay;
CButton m_BuildProjects;
CButton m_ListFrame;
CComboBox m_WhereSourceControl;
CComboBox m_WhereBuildControl;
CListBox m_CacheEntriesList;
@ -52,19 +57,12 @@ protected:
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnBrowse();
virtual void OnOK();
afx_msg void OnButton3();
afx_msg void OnBuildProjects();
afx_msg void OnChangeWhereBuild();
afx_msg void OnChangeWhereSource();
afx_msg void OnEditchangeWhereBuild();
afx_msg void OnEditchangeWhereSource();
afx_msg void OnSelchangeWhereSource();
afx_msg void OnSelchangeWhereBuild();
afx_msg void OnEditupdateWhereBuild();
afx_msg void OnCloseupWhereBuild();
afx_msg void OnSelendokWhereBuild();
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

View File

@ -85,29 +85,30 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 375, 226
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 376, 225
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION "CMakeSetupDialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Close",IDOK,219,206,50,14
PUSHBUTTON "Browse...",IDC_BUTTON2,286,5,43,13
RTEXT "Where is the source code:",IDC_STATIC,52,6,86,9
PUSHBUTTON "Browse...",IDC_BUTTON3,286,25,43,13
RTEXT "Where do you want to build the binaries:",IDC_STATIC,10,
27,128,9
PUSHBUTTON "Build Project Files",IDC_BuildProjects,95,205,67,15
GROUPBOX "Cache Values",IDC_STATIC,9,43,356,141
LISTBOX IDC_LIST2,15,55,344,122,LBS_OWNERDRAWVARIABLE |
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
WS_HSCROLL | WS_TABSTOP
CTEXT "Right click on cache entries for additional options",
IDC_STATIC,19,190,333,11
COMBOBOX IDC_WhereBuild,148,26,133,68,CBS_DROPDOWN |
CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_WhereSource,147,6,135,66,CBS_DROPDOWN |
CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Browse...",IDC_BUTTON2,286,5,43,13
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
LISTBOX IDC_LIST2,15,55,344,122,LBS_OWNERDRAWVARIABLE |
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
WS_HSCROLL
RTEXT "Where is the source code:",IDC_STATIC,52,6,86,9
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
END
@ -170,6 +171,11 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_CMakeSetupDialog_DIALOG, DIALOG
BEGIN
RIGHTMARGIN, 375
END
END
#endif // APSTUDIO_INVOKED

View File

@ -87,6 +87,11 @@ void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMakeSetupDialog)
DDX_Control(pDX, IDOK, m_CancelButton);
DDX_Control(pDX, IDC_MouseHelpCaption, m_MouseHelp);
DDX_Control(pDX, IDC_CMAKE_VERSION, m_VersionDisplay);
DDX_Control(pDX, IDC_BuildProjects, m_BuildProjects);
DDX_Control(pDX, IDC_FRAME, m_ListFrame);
DDX_Control(pDX, IDC_WhereSource, m_WhereSourceControl);
DDX_Control(pDX, IDC_WhereBuild, m_WhereBuildControl);
DDX_Control(pDX, IDC_LIST2, m_CacheEntriesList);
@ -101,12 +106,14 @@ BEGIN_MESSAGE_MAP(CMakeSetupDialog, CDialog)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BuildProjects, OnBuildProjects)
ON_CBN_EDITCHANGE(IDC_WhereBuild, OnChangeWhereBuild)
ON_CBN_EDITCHANGE(IDC_WhereSource, OnChangeWhereSource)
ON_CBN_SELCHANGE(IDC_WhereBuild, OnSelendokWhereBuild)
ON_BN_CLICKED(IDC_BUTTON2, OnBrowseWhereSource)
ON_BN_CLICKED(IDC_BUTTON3, OnBrowseWhereBuild)
ON_CBN_EDITCHANGE(IDC_WhereBuild, OnChangeWhereBuild)
ON_CBN_SELCHANGE(IDC_WhereBuild, OnSelendokWhereBuild)
ON_CBN_SELENDOK(IDC_WhereSource, OnSelendokWhereSource)
ON_CBN_EDITCHANGE(IDC_WhereSource, OnChangeWhereSource)
ON_WM_SIZE()
ON_WM_GETMINMAXINFO()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@ -572,3 +579,34 @@ void CMakeSetupDialog::SaveCacheFromGUI()
}
void CMakeSetupDialog::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(m_CacheEntriesList.m_hWnd)
{
m_ListFrame.SetWindowPos(&wndTop, 0, 0, cx-28, cy-137,
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,
0, 0,
SWP_NOSIZE | SWP_NOZORDER);
m_CancelButton.SetWindowPos(&wndTop, 329, cy-33, 0, 0,
SWP_NOSIZE | SWP_NOZORDER);
m_VersionDisplay.SetWindowPos(&wndTop, 5, cy-23, 0, 0,
SWP_NOSIZE | SWP_NOZORDER);
}
}
void CMakeSetupDialog::OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI )
{
lpMMI->ptMinTrackSize.x = 550;
lpMMI->ptMinTrackSize.y = 272;
}

View File

@ -35,10 +35,15 @@ protected:
enum { IDD = IDD_CMakeSetupDialog_DIALOG };
CString m_WhereSource;
CString m_WhereBuild;
CButton m_ListFrame;
bool m_BuildPathChanged;
CComboBox m_WhereSourceControl;
CComboBox m_WhereBuildControl;
CPropertyList m_CacheEntriesList;
CStatic m_MouseHelp;
CStatic m_VersionDisplay;
CButton m_BuildProjects;
CButton m_CancelButton;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
@ -72,6 +77,8 @@ protected:
afx_msg void OnSelendokWhereBuild();
afx_msg void OnChangeWhereSource();
afx_msg void OnSelendokWhereSource();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI );
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

View File

@ -15,6 +15,8 @@
#define IDC_LIST2 1007
#define IDC_LIST3 1010
#define IDC_CMAKE_VERSION 1014
#define IDC_FRAME 1015
#define IDC_MouseHelpCaption 1016
// Next default values for new objects
//
@ -22,7 +24,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1015
#define _APS_NEXT_CONTROL_VALUE 1017
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif