* Some new feature in wxObject*Stream (objects aren't duplicated)

* Added SetBackgroundBrush in wxGridCell
* New classes/fixes in wxSerial


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Guilhem Lavaux
1998-08-19 18:33:19 +00:00
parent 4c444f19cf
commit 8d43638db1
13 changed files with 262 additions and 43 deletions

View File

@@ -23,7 +23,9 @@
#include <wx/listbox.h>
#include <wx/notebook.h>
#include <wx/radiobox.h>
#include <wx/radiobut.h>
#include <wx/stattext.h>
#include <wx/statbox.h>
#include <wx/combobox.h>
#include <wx/imaglist.h>
#include <wx/objstrm.h>
@@ -41,10 +43,12 @@ IMPLEMENT_SERIAL_CLASS(wxGauge, wxControl)
IMPLEMENT_SERIAL_CLASS(wxListBox, wxControl)
IMPLEMENT_SERIAL_CLASS(wxNotebook, wxControl)
IMPLEMENT_SERIAL_CLASS(wxRadioBox, wxControl)
IMPLEMENT_SERIAL_CLASS(wxRadioButton, wxControl)
IMPLEMENT_SERIAL_CLASS(wxButton, wxControl)
IMPLEMENT_SERIAL_CLASS(wxStaticText, wxControl)
//-----------------------------------------------------------------------------
void WXSERIAL(wxButton)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
@@ -61,6 +65,8 @@ void WXSERIAL(wxButton)::LoadObject(wxObjectInputStream& s)
m_style, *m_validator, m_name);
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxCheckBox)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
@@ -85,6 +91,8 @@ void WXSERIAL(wxCheckBox)::LoadObject(wxObjectInputStream& s)
chkbox->SetValue(data_s.Read8());
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxSlider)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
@@ -130,6 +138,8 @@ void WXSERIAL(wxSlider)::LoadObject(wxObjectInputStream& s)
slider->SetThumbLength( data_s.Read32() );
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxGauge)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
@@ -163,6 +173,8 @@ void WXSERIAL(wxGauge)::LoadObject(wxObjectInputStream& s)
gauge->SetValue( data_s.Read32() );
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxChoice)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
@@ -194,6 +206,8 @@ void WXSERIAL(wxChoice)::LoadObject(wxObjectInputStream& s)
choice->Append( data_s.ReadString() );
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxListBox)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
@@ -222,6 +236,8 @@ void WXSERIAL(wxListBox)::LoadObject(wxObjectInputStream& s)
listbox->Append( data_s.ReadString() );
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxNotebook)::StoreObject(wxObjectOutputStream& s)
{
wxNotebook *notebook = (wxNotebook *)Object();
@@ -250,8 +266,7 @@ void WXSERIAL(wxNotebook)::LoadObject(wxObjectInputStream& s)
int i, pcount;
wxImageList *imaglist;
imaglist = (wxImageList *)s.GetChild(0);
s.RemoveChildren(1);
imaglist = (wxImageList *)s.GetChild();
WXSERIAL(wxControl)::LoadObject(s);
@@ -265,6 +280,8 @@ void WXSERIAL(wxNotebook)::LoadObject(wxObjectInputStream& s)
notebook->SetPageText(i, data_s.ReadString() );
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxRadioBox)::StoreObject(wxObjectOutputStream& s)
{
wxRadioBox *box = (wxRadioBox *)Object();
@@ -304,6 +321,29 @@ void WXSERIAL(wxRadioBox)::LoadObject(wxObjectInputStream& s)
n_items, items, 0, m_style, *m_validator, m_name);
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxRadioButton)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
if (s.FirstStage())
return;
wxDataOutputStream data_s(s);
data_s.Write8( (char) ((wxRadioButton *)Object())->GetValue() );
}
void WXSERIAL(wxRadioButton)::LoadObject(wxObjectInputStream& s)
{
wxDataInputStream data_s(s);
WXSERIAL(wxControl)::LoadObject(s);
((wxRadioButton *)Object())->SetValue( (bool)data_s.Read8() );
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxComboBox)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
@@ -346,6 +386,8 @@ void WXSERIAL(wxComboBox)::LoadObject(wxObjectInputStream& s)
box->SetValue( data_s.ReadString() );
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxStaticText)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
@@ -358,3 +400,18 @@ void WXSERIAL(wxStaticText)::LoadObject(wxObjectInputStream& s)
((wxStaticText *)Object())->Create(m_parent, m_id, m_label, wxPoint(m_x, m_y),
wxSize(m_w, m_h), m_style, m_name);
}
//-----------------------------------------------------------------------------
void WXSERIAL(wxStaticBox)::StoreObject(wxObjectOutputStream& s)
{
WXSERIAL(wxControl)::StoreObject(s);
}
void WXSERIAL(wxStaticBox)::LoadObject(wxObjectInputStream& s)
{
WXSERIAL(wxControl)::LoadObject(s);
((wxStaticBox *)Object())->Create(m_parent, m_id, m_label, wxPoint(m_x, m_y),
wxSize(m_w, m_h), m_style, m_name);
}