]> git.saurik.com Git - wxWidgets.git/commitdiff
1. more warnings fixed
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Oct 2000 21:34:35 +0000 (21:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Oct 2000 21:34:35 +0000 (21:34 +0000)
2. fixed wxProgressDialog to work as wxDialog now does

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/progdlgg.h
src/generic/progdlgg.cpp
src/generic/treectlg.cpp

index b02ba1ef28bdf472bcee51e433a5652734abf48f..3c6de052883849c1a9e8a912dcac7dab6636e831 100644 (file)
@@ -63,12 +63,20 @@ public:
    */
    void Resume() { m_state = Continue; }
 
    */
    void Resume() { m_state = Continue; }
 
-   // implementation from now on
-       // callback for optional abort button
+protected:
+   // callback for optional abort button
    void OnCancel(wxCommandEvent& event);
    void OnCancel(wxCommandEvent& event);
-       // callback to disable "hard" window closing
+
+   // callback to disable "hard" window closing
    void OnClose(wxCloseEvent& event);
 
    void OnClose(wxCloseEvent& event);
 
+   // callback to detect when the dialog is closed
+   void OnShow(wxShowEvent& event);
+
+   // must be called to reenable the other windows temporarily disabled while
+   // the dialog was shown
+   void ReenableOtherWindows();
+
 private:
    // create the label with given text and another one to show the time nearby
    // under the lastWindow and modify it to be the same as the control created
 private:
    // create the label with given text and another one to show the time nearby
    // under the lastWindow and modify it to be the same as the control created
index 90436f9340ec64dfc248832fe9ac37522f30f0b8..e9c031ab2ae6b072af620906377ef080a5b4a5d8 100644 (file)
@@ -65,8 +65,11 @@ static void SetTimeLabel(unsigned long val, wxStaticText *label);
 // ----------------------------------------------------------------------------
 
 BEGIN_EVENT_TABLE(wxProgressDialog, wxDialog)
 // ----------------------------------------------------------------------------
 
 BEGIN_EVENT_TABLE(wxProgressDialog, wxDialog)
-   EVT_BUTTON(wxID_CANCEL, wxProgressDialog::OnCancel)
-   EVT_CLOSE(wxProgressDialog::OnClose)
+    EVT_BUTTON(wxID_CANCEL, wxProgressDialog::OnCancel)
+
+    EVT_SHOW(wxProgressDialog::OnShow)
+
+    EVT_CLOSE(wxProgressDialog::OnClose)
 END_EVENT_TABLE()
 
 IMPLEMENT_CLASS(wxProgressDialog, wxDialog)
 END_EVENT_TABLE()
 
 IMPLEMENT_CLASS(wxProgressDialog, wxDialog)
@@ -377,15 +380,32 @@ void wxProgressDialog::OnClose(wxCloseEvent& event)
     }
 }
 
     }
 }
 
+void wxProgressDialog::OnShow(wxShowEvent& event)
+{
+    // if the dialog is being hidden, it was closed, so reenable other windows
+    // now
+    if ( event.GetShow() )
+    {
+        ReenableOtherWindows();
+    }
+}
+
 // ----------------------------------------------------------------------------
 // destruction
 // ----------------------------------------------------------------------------
 
 wxProgressDialog::~wxProgressDialog()
 // ----------------------------------------------------------------------------
 // destruction
 // ----------------------------------------------------------------------------
 
 wxProgressDialog::~wxProgressDialog()
+{
+    // normally this should have been already done, but just in case
+    ReenableOtherWindows();
+}
+
+void wxProgressDialog::ReenableOtherWindows()
 {
     if ( GetWindowStyle() & wxPD_APP_MODAL )
     {
         delete m_winDisabler;
 {
     if ( GetWindowStyle() & wxPD_APP_MODAL )
     {
         delete m_winDisabler;
+        m_winDisabler = (wxWindowDisabler *)NULL;
     }
     else
     {
     }
     else
     {
index e45f6f08f74d9b5bf0955331a65788c8d3034c09..01072caca3c3c063db6b535915f1014d6a950aa7 100644 (file)
@@ -178,10 +178,10 @@ public:
 
     // status inquiries
     bool HasChildren() const { return !m_children.IsEmpty(); }
 
     // status inquiries
     bool HasChildren() const { return !m_children.IsEmpty(); }
-    bool IsSelected()  const { return m_hasHilight; }
+    bool IsSelected()  const { return m_hasHilight != 0; }
     bool IsExpanded()  const { return !m_isCollapsed; }
     bool HasPlus()     const { return m_hasPlus || HasChildren(); }
     bool IsExpanded()  const { return !m_isCollapsed; }
     bool HasPlus()     const { return m_hasPlus || HasChildren(); }
-    bool IsBold()      const { return m_isBold; }
+    bool IsBold()      const { return m_isBold != 0; }
 
     // attributes
         // get them - may be NULL
 
     // attributes
         // get them - may be NULL