diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-11-14 23:18:49 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-11-14 23:18:49 (GMT) |
commit | c91ca248f6b0cb9a1eebf47dce9a56e51e40b1db (patch) | |
tree | 20962dedb748112e81a87b80fd97967b07b0ad7a /Source/WXDialog | |
parent | 9f6e61361c2672d98c80014da693fb2beebfe9a9 (diff) | |
download | CMake-c91ca248f6b0cb9a1eebf47dce9a56e51e40b1db.zip CMake-c91ca248f6b0cb9a1eebf47dce9a56e51e40b1db.tar.gz CMake-c91ca248f6b0cb9a1eebf47dce9a56e51e40b1db.tar.bz2 |
Add progress reporting
Diffstat (limited to 'Source/WXDialog')
-rw-r--r-- | Source/WXDialog/cmWXMainFrame.cxx | 25 | ||||
-rw-r--r-- | Source/WXDialog/cmWXMainFrame.h | 10 | ||||
-rw-r--r-- | Source/WXDialog/wxCMakeSetup.cxx | 3 |
3 files changed, 36 insertions, 2 deletions
diff --git a/Source/WXDialog/cmWXMainFrame.cxx b/Source/WXDialog/cmWXMainFrame.cxx index 605433f..3a7f482 100644 --- a/Source/WXDialog/cmWXMainFrame.cxx +++ b/Source/WXDialog/cmWXMainFrame.cxx @@ -239,6 +239,7 @@ cmMainFrame::cmMainFrame(const wxString& title, const wxSize& size) this->Connect(cmCacheProperty::Menu_Popup_Help, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) &cmMainFrame::OnPopupMenuHelp); + this->m_CMakeInstance->SetProgressCallback(&cmMainFrame::ProgressCallback, this); } cmMainFrame::~cmMainFrame() @@ -279,6 +280,27 @@ void cmMainFrame::MessageCallback(const char* m, const char* title, bool& nomore } +void cmMainFrame::ProgressCallback(const char* m, float prog, + void* clientData) +{ + + if ( clientData ) + { + cmMainFrame* self = static_cast<cmMainFrame*>( clientData ); + char tmp[1024]; + if (prog >= 0) + { + sprintf(tmp,"%s %i%%",m,(int)(100*prog)); + } + else + { + sprintf(tmp,"%s",m); + } + self->SetStatusText(tmp); + wxYield(); + } +} + void cmMainFrame::DisplayMessage(const char* m, const char* title, bool& nomore) { this->CursorNormal(false); @@ -829,6 +851,7 @@ void cmMainFrame::RunCMake(bool generateProjectFiles) cmSystemTools::Error( "Error in configuration process, project files may be invalid"); } + // update the GUI with any new values in the caused by the // generation process this->LoadCacheFromDiskToGUI(); @@ -1438,6 +1461,7 @@ void cmMainFrame::CursorBusy(bool s) { this->m_CursorChanged = true; } + wxYield(); } void cmMainFrame::CursorNormal(bool s) @@ -1447,6 +1471,7 @@ void cmMainFrame::CursorNormal(bool s) { this->m_CursorChanged = false; } + wxYield(); } void cmMainFrame::OnSourceUpdated(wxCommandEvent& event) diff --git a/Source/WXDialog/cmWXMainFrame.h b/Source/WXDialog/cmWXMainFrame.h index a192e8b..8f97fd0 100644 --- a/Source/WXDialog/cmWXMainFrame.h +++ b/Source/WXDialog/cmWXMainFrame.h @@ -33,6 +33,7 @@ class wxScrolledWindow; class wxSizer; class wxStaticBox; class wxStaticText; +class wxApp; /** \class cmMainFrame * \brief GUI for CMake with wxWindows toolkit @@ -82,11 +83,16 @@ public: void ConnectEventTo(wxWindow*, wxEventType, wxObjectEventFunction); //! Callback for the error message. - static void MessageCallback(const char* m, const char* title, bool& nomore, void* cd); + static void MessageCallback(const char* m, const char* title, + bool& nomore, void* cd); + static void ProgressCallback(const char* m, float prog, void* clientData); void DisplayMessage(const char* m, const char* title, bool& nomore); //! Retrieve the current build directory. const std::string& GetBuildDir() { return this->m_WhereBuild; } + + //! Set the application for progress + void SetApplication(wxApp* app) { m_Application = app; } private: //! Load cache file from m_WhereBuild and display in GUI editor @@ -221,6 +227,8 @@ private: cmake* m_CMakeInstance; wxTimer* m_ExitTimer; + wxApp* m_Application; + enum Events { ID_MainFrame, ID_Resize, diff --git a/Source/WXDialog/wxCMakeSetup.cxx b/Source/WXDialog/wxCMakeSetup.cxx index 6a11ccd..2db6f9e 100644 --- a/Source/WXDialog/wxCMakeSetup.cxx +++ b/Source/WXDialog/wxCMakeSetup.cxx @@ -146,10 +146,11 @@ bool wxCMakeSetup::OnInit() cm.SetValidArguments("ABGHQ"); cm.ParseCommandLine(wxApp::argc, wxApp::argv); - this->SetVendorName("Andy"); + this->SetVendorName("Kitware"); this->SetAppName("CMakeSetup"); cmMainFrame *frame = new cmMainFrame("CMake", wxSize(200, 100)); + frame->SetApplication(this); frame->Initialize(&cm); //wxFrame *frame = new testFrame("CMake", wxSize(200, 100)); //wxFrame *frame = new testFrame1("Frame", wxSize(200, 100)); |