]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/serialize/serctrl.cpp
minimal now works in Unicode mode
[wxWidgets.git] / utils / serialize / serctrl.cpp
index 13e54517215e922b721b85f4ba313b9df68adcb0..e9e0d56af475dd468931da98b3305c193fda53d9 100644 (file)
 #include "serctrl.h"
 
 IMPLEMENT_ALIAS_SERIAL_CLASS(wxControl, wxWindow)
+#ifdef __WINDOWS__
+IMPLEMENT_SERIAL_CLASS(wxSlider95, wxControl)
+IMPLEMENT_SERIAL_CLASS(wxGauge95, wxControl)
+#else
 IMPLEMENT_SERIAL_CLASS(wxSlider, wxControl)
+IMPLEMENT_SERIAL_CLASS(wxGauge, wxControl)
+#endif
 IMPLEMENT_SERIAL_CLASS(wxCheckBox, wxControl)
 IMPLEMENT_SERIAL_CLASS(wxChoice, wxControl)
 IMPLEMENT_SERIAL_CLASS(wxComboBox, wxControl)
-IMPLEMENT_SERIAL_CLASS(wxGauge, wxControl)
 IMPLEMENT_SERIAL_CLASS(wxListBox, wxControl)
 IMPLEMENT_SERIAL_CLASS(wxNotebook, wxControl)
 IMPLEMENT_SERIAL_CLASS(wxRadioBox, wxControl)
@@ -59,6 +64,9 @@ void WXSERIAL(wxButton)::LoadObject(wxObjectInputStream& s)
 {
   WXSERIAL(wxControl)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   wxButton *button = (wxButton *)Object();
 
   printf("label = %s\n", WXSTRINGCAST m_label);
@@ -83,6 +91,9 @@ void WXSERIAL(wxCheckBox)::LoadObject(wxObjectInputStream& s)
 {
   WXSERIAL(wxControl)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   wxDataInputStream data_s(s);
   wxCheckBox *chkbox = (wxCheckBox *)Object();
 
@@ -94,7 +105,11 @@ void WXSERIAL(wxCheckBox)::LoadObject(wxObjectInputStream& s)
 
 //-----------------------------------------------------------------------------
 
+#ifdef __WXMSW__
+void WXSERIAL(wxSlider95)::StoreObject(wxObjectOutputStream& s)
+#else
 void WXSERIAL(wxSlider)::StoreObject(wxObjectOutputStream& s)
+#endif
 {
   WXSERIAL(wxControl)::StoreObject(s);
 
@@ -115,10 +130,17 @@ void WXSERIAL(wxSlider)::StoreObject(wxObjectOutputStream& s)
   data_s.Write32( slider->GetThumbLength() );
 }
 
+#ifdef __WXMSW__
+void WXSERIAL(wxSlider95)::LoadObject(wxObjectInputStream& s)
+#else
 void WXSERIAL(wxSlider)::LoadObject(wxObjectInputStream& s)
+#endif
 {
   WXSERIAL(wxControl)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   wxDataInputStream data_s(s);
   wxSlider *slider = (wxSlider *)Object();
   int value, min, max;
@@ -141,7 +163,11 @@ void WXSERIAL(wxSlider)::LoadObject(wxObjectInputStream& s)
 
 //-----------------------------------------------------------------------------
 
+#ifdef __WXMSW__
+void WXSERIAL(wxGauge95)::StoreObject(wxObjectOutputStream& s)
+#else
 void WXSERIAL(wxGauge)::StoreObject(wxObjectOutputStream& s)
+#endif
 {
   WXSERIAL(wxControl)::StoreObject(s);
 
@@ -157,10 +183,17 @@ void WXSERIAL(wxGauge)::StoreObject(wxObjectOutputStream& s)
   data_s.Write32( gauge->GetValue() );
 }
 
+#ifdef __WXMSW__
+void WXSERIAL(wxGauge95)::LoadObject(wxObjectInputStream& s)
+#else
 void WXSERIAL(wxGauge)::LoadObject(wxObjectInputStream& s)
+#endif
 {
   WXSERIAL(wxControl)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   wxDataInputStream data_s(s);
   wxGauge *gauge = (wxGauge *)Object();
   int range;
@@ -196,6 +229,9 @@ void WXSERIAL(wxChoice)::LoadObject(wxObjectInputStream& s)
 {
   WXSERIAL(wxControl)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   wxDataInputStream data_s(s);
   wxChoice *choice = (wxChoice *)Object();
   int i,num = data_s.Read32();
@@ -229,6 +265,9 @@ void WXSERIAL(wxListBox)::LoadObject(wxObjectInputStream& s)
 {
   WXSERIAL(wxListBox)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   wxDataInputStream data_s(s);
   wxListBox *listbox = (wxListBox *)Object();
   int i, num = data_s.Read32();
@@ -265,14 +304,14 @@ void WXSERIAL(wxNotebook)::LoadObject(wxObjectInputStream& s)
   int i;
   wxImageList *imaglist;
 
+  WXSERIAL(wxControl)::LoadObject(s);
+
   if (s.SecondCall()) {
     for (i=0;i<m_pcount;i++)
       notebook->AddPage( (wxWindow *)s.GetChild(), m_stringlist[i] );
     return;
   }
 
-  WXSERIAL(wxControl)::LoadObject(s);
-
   imaglist = (wxImageList *)s.GetChild();
 
   notebook->Create(m_parent, m_id, wxPoint(m_x, m_y), wxSize(m_w, m_h),
@@ -312,6 +351,9 @@ void WXSERIAL(wxRadioBox)::LoadObject(wxObjectInputStream& s)
 
   WXSERIAL(wxControl)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   wxDataInputStream data_s(s);
   int i, n_rows_cols, n_items;
   wxString *items;
@@ -345,6 +387,10 @@ void WXSERIAL(wxRadioButton)::LoadObject(wxObjectInputStream& s)
   wxDataInputStream data_s(s);
 
   WXSERIAL(wxControl)::LoadObject(s);
+
+  if (s.SecondCall())
+    return;
+
   ((wxRadioButton *)Object())->SetValue( (bool)data_s.Read8() );
 }
 
@@ -375,6 +421,9 @@ void WXSERIAL(wxComboBox)::LoadObject(wxObjectInputStream& s)
 {
   WXSERIAL(wxControl)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   wxDataInputStream data_s(s);
   wxComboBox *box = (wxComboBox *)Object();
   int i, num, selection;
@@ -403,6 +452,9 @@ void WXSERIAL(wxStaticText)::LoadObject(wxObjectInputStream& s)
 {
   WXSERIAL(wxControl)::LoadObject(s);
 
+  if (s.SecondCall())
+    return;
+
   ((wxStaticText *)Object())->Create(m_parent, m_id, m_label, wxPoint(m_x, m_y),
                                      wxSize(m_w, m_h), m_style, m_name);
 }
@@ -417,6 +469,9 @@ void WXSERIAL(wxStaticBox)::StoreObject(wxObjectOutputStream& s)
 void WXSERIAL(wxStaticBox)::LoadObject(wxObjectInputStream& s)
 {
   WXSERIAL(wxControl)::LoadObject(s);
+  if (s.SecondCall())
+    return;
 
   ((wxStaticBox *)Object())->Create(m_parent, m_id, m_label, wxPoint(m_x, m_y),
                                     wxSize(m_w, m_h), m_style, m_name);