diff options
author | Ken Martin <ken.martin@kitware.com> | 2002-09-26 19:14:20 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2002-09-26 19:14:20 (GMT) |
commit | c751d2ebff5b95b0f00c09ef6203d70f323c8144 (patch) | |
tree | d52b04bd774d9d6d4ba27ec633249f52c7253f52 /Source/MFCDialog | |
parent | 85896b3460f3e1276dec6ad67d63df26e65d16e2 (diff) | |
download | CMake-c751d2ebff5b95b0f00c09ef6203d70f323c8144.zip CMake-c751d2ebff5b95b0f00c09ef6203d70f323c8144.tar.gz CMake-c751d2ebff5b95b0f00c09ef6203d70f323c8144.tar.bz2 |
added progress
Diffstat (limited to 'Source/MFCDialog')
-rw-r--r-- | Source/MFCDialog/CMakeSetup.rc | 48 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.cpp | 17 | ||||
-rw-r--r-- | Source/MFCDialog/resource.h | 5 |
3 files changed, 42 insertions, 28 deletions
diff --git a/Source/MFCDialog/CMakeSetup.rc b/Source/MFCDialog/CMakeSetup.rc index d950240..5f0cff0 100644 --- a/Source/MFCDialog/CMakeSetup.rc +++ b/Source/MFCDialog/CMakeSetup.rc @@ -1,4 +1,4 @@ -//Microsoft Developer Studio generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE DISCARDABLE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE DISCARDABLE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE DISCARDABLE +3 TEXTINCLUDE BEGIN "#define _AFX_NO_SPLITTER_RESOURCES\r\n" "#define _AFX_NO_OLE_RESOURCES\r\n" @@ -66,15 +66,15 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDR_MAINFRAME ICON DISCARDABLE "res\\CMakeSetupDialog.ico" +IDR_MAINFRAME ICON "res\\CMakeSetupDialog.ico" ///////////////////////////////////////////////////////////////////////////// // // Dialog // -IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_ABOUTBOX DIALOG 0, 0, 235, 55 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About CMakeSetup" FONT 8, "MS Sans Serif" BEGIN @@ -86,11 +86,11 @@ BEGIN END IDD_CMakeSetupDialog_DIALOG DIALOGEX 0, 0, 446, 241 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_SYSMENU | WS_THICKFRAME +STYLE DS_SETFONT | 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" +FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN COMBOBOX IDC_WhereSource,96,6,169,66,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP @@ -116,10 +116,11 @@ BEGIN PUSHBUTTON "Help",IDC_HELP_BUTTON,278,223,51,15 CONTROL "Show Advanced Values",IDC_AdvancedValues,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,305,28,98,9 + RTEXT "Static",IDC_PROGRESS,341,226,100,12,SS_CENTERIMAGE END -IDD_CMAKE_HELP_DIALOG DIALOG DISCARDABLE 0, 0, 365, 183 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +IDD_CMAKE_HELP_DIALOG DIALOG 0, 0, 365, 183 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "CMake Help" FONT 8, "MS Sans Serif" BEGIN @@ -129,7 +130,6 @@ BEGIN END -#ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version @@ -152,15 +152,13 @@ BEGIN BEGIN BLOCK "040904B0" BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "CMakeSetup MFC Application\0" - VALUE "FileVersion", "1, 0, 0, 1\0" - VALUE "InternalName", "CMakeSetup\0" - VALUE "LegalCopyright", "Copyright (C) 2000\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "CMakeSetup.EXE\0" - VALUE "ProductName", "CMakeSetup Application\0" - VALUE "ProductVersion", "1, 0, 0, 1\0" + VALUE "FileDescription", "CMakeSetup MFC Application" + VALUE "FileVersion", "1, 0, 0, 1" + VALUE "InternalName", "CMakeSetup" + VALUE "LegalCopyright", "Copyright (C) 2000" + VALUE "OriginalFilename", "CMakeSetup.EXE" + VALUE "ProductName", "CMakeSetup Application" + VALUE "ProductVersion", "1, 0, 0, 1" END END BLOCK "VarFileInfo" @@ -169,8 +167,6 @@ BEGIN END END -#endif // !_MAC - ///////////////////////////////////////////////////////////////////////////// // @@ -178,7 +174,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE +GUIDELINES DESIGNINFO BEGIN IDD_ABOUTBOX, DIALOG BEGIN @@ -210,7 +206,7 @@ END // String Table // -STRINGTABLE DISCARDABLE +STRINGTABLE BEGIN IDS_ABOUTBOX "&About CMakeSetup..." IDS_CREATESHORTCUT "&Create shortcut" diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index 11324c8..fc8ccd6 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -103,6 +103,20 @@ void MFCMessageCallback(const char* m, const char* title, bool& nomore, void*) ///////////////////////////////////////////////////////////////////////////// // CMakeSetupDialog dialog +void updateProgress(const char *msg, float prog, void *cd) +{ + char tmp[1024]; + if (prog >= 0) + { + sprintf(tmp,"%s %i%%",msg,(int)(100*prog)); + } + else + { + sprintf(tmp,"%s",msg); + } + CMakeSetupDialog *self = (CMakeSetupDialog *)cd; + self->SetDlgItemText(IDC_PROGRESS, tmp); +} CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo, CWnd* pParent /*=NULL*/) @@ -147,6 +161,8 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo, m_oldCX = -1; m_deltaXRemainder = 0; m_CMakeInstance = new cmake; + m_CMakeInstance->SetProgressCallback(updateProgress, (void *)this); + } void CMakeSetupDialog::DoDataExchange(CDataExchange* pDX) @@ -268,6 +284,7 @@ BOOL CMakeSetupDialog::OnInitDialog() sprintf(tmp,"Version %d.%d - %s", cmake::GetMajorVersion(), cmake::GetMinorVersion(), cmake::GetReleaseVersion()); SetDlgItemText(IDC_CMAKE_VERSION, tmp); + SetDlgItemText(IDC_PROGRESS, ""); this->UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control } diff --git a/Source/MFCDialog/resource.h b/Source/MFCDialog/resource.h index d581f29..efa4060 100644 --- a/Source/MFCDialog/resource.h +++ b/Source/MFCDialog/resource.h @@ -1,5 +1,5 @@ //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. +// Microsoft Visual C++ generated include file. // Used by CMakeSetup.rc // #define IDM_ABOUTBOX 0x0010 @@ -26,6 +26,7 @@ #define IDC_HELP_BUTTON 1021 #define IDC_EDIT1 1025 #define IDC_AdvancedValues 1027 +#define IDC_PROGRESS 1028 // Next default values for new objects // @@ -33,7 +34,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 134 #define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1028 +#define _APS_NEXT_CONTROL_VALUE 1029 #define _APS_NEXT_SYMED_VALUE 102 #endif #endif |