]> git.saurik.com Git - wxWidgets.git/commitdiff
Also the radiobox was unitialised.
authorKarsten Ballüder <ballueder@usa.net>
Sat, 3 Apr 1999 16:59:38 +0000 (16:59 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Sat, 3 Apr 1999 16:59:38 +0000 (16:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/prntdlgg.cpp

index 3602295dab0920b5fc367ace7b93141531a50701..4a77b717690b30b4e97b9b978695bf80e985acaf 100644 (file)
@@ -137,7 +137,8 @@ void wxGenericPrintDialog::Init(wxWindow *parent)
 
     m_fromText = (wxTextCtrl*)NULL;
     m_toText = (wxTextCtrl*)NULL;
-
+    m_rangeRadioBox = (wxRadioBox *)NULL;
+    
     if (m_printDialogData.GetFromPage() != 0)
     {
         m_rangeRadioBox = new wxRadioBox(this, wxPRINTID_RANGE, _("Print Range"),
@@ -287,17 +288,21 @@ bool wxGenericPrintDialog::TransferDataToWindow()
              m_fromText->SetValue(buf);
              sprintf(buf, "%d", m_printDialogData.GetToPage());
              m_toText->SetValue(buf);
-             if (m_printDialogData.GetAllPages())
-                m_rangeRadioBox->SetSelection(0);
-             else
-                m_rangeRadioBox->SetSelection(1);
+             if(m_rangeRadioBox)
+                if (m_printDialogData.GetAllPages())
+                   m_rangeRadioBox->SetSelection(0);
+                else
+                   m_rangeRadioBox->SetSelection(1);
           }
           else
           {
              m_fromText->Enable(FALSE);
              m_toText->Enable(FALSE);
-             m_rangeRadioBox->SetSelection(0);
-             m_rangeRadioBox->wxRadioBox::Enable(1, FALSE);
+             if(m_rangeRadioBox)
+             {
+                m_rangeRadioBox->SetSelection(0);
+                m_rangeRadioBox->wxRadioBox::Enable(1, FALSE);
+             }
           }
        }
     }
@@ -318,10 +323,13 @@ bool wxGenericPrintDialog::TransferDataFromWindow()
            if(m_fromText) m_printDialogData.SetFromPage(atoi(m_fromText->GetValue()));
            if(m_toText)   m_printDialogData.SetToPage(atoi(m_toText->GetValue()));
         }
-        if (m_rangeRadioBox->GetSelection() == 0)
-            m_printDialogData.SetAllPages(TRUE);
-        else
-            m_printDialogData.SetAllPages(FALSE);
+        if(m_rangeRadioBox)
+        {
+           if (m_rangeRadioBox->GetSelection() == 0)
+              m_printDialogData.SetAllPages(TRUE);
+           else
+              m_printDialogData.SetAllPages(FALSE);
+        }
     }
     else
     { // continuous printing