]>
git.saurik.com Git - wxWidgets.git/blob - utils/serialize/serext.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Serialization: Other classes
4 // Author: Guilhem Lavaux
8 // Copyright: (c) 1998 Guilhem Lavaux
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "serext.h"
16 #include <wx/splitter.h>
17 #include <wx/objstrm.h>
18 #include <wx/datstrm.h>
21 IMPLEMENT_SERIAL_CLASS(wxSplitterWindow
, wxWindow
)
23 void WXSERIAL(wxSplitterWindow
)::StoreObject(wxObjectOutputStream
& s
)
25 wxSplitterWindow
*splitter
= (wxSplitterWindow
*)Object();
26 WXSERIAL(wxWindow
)::StoreObject(s
);
29 s
.AddChild( splitter
->GetWindow1() );
30 s
.AddChild( splitter
->GetWindow2() );
34 wxDataOutputStream
data_s(s
);
35 data_s
.Write8( splitter
->GetSplitMode() );
36 data_s
.Write32( splitter
->GetSashSize() );
37 data_s
.Write8( splitter
->GetBorderSize() );
38 data_s
.Write32( splitter
->GetSashPosition() );
39 data_s
.Write32( splitter
->GetMinimumPaneSize() );
42 void WXSERIAL(wxSplitterWindow
)::LoadObject(wxObjectInputStream
& s
)
44 wxSplitterWindow
*splitter
= (wxSplitterWindow
*)Object();
45 WXSERIAL(wxWindow
)::LoadObject(s
);
47 wxDataInputStream
data_s(s
);
48 int split_mode
, sash_size
, border_size
, sash_position
, min_pane_size
;
50 split_mode
= data_s
.Read8();
51 sash_size
= data_s
.Read32();
52 border_size
= data_s
.Read8();
53 sash_position
= data_s
.Read32();
54 min_pane_size
= data_s
.Read32();
56 splitter
->Create(m_parent
, m_id
, wxPoint(m_x
, m_y
), wxSize(m_w
, m_h
), m_style
,
60 if (data_s
.Read8() == wxSPLIT_VERTICAL
)
61 splitter
->SplitVertically((wxWindow
*)s
.GetChild(0),
62 (wxWindow
*)s
.GetChild(1), sash_position
);
64 splitter
->SplitHorizontally((wxWindow
*)s
.GetChild(0),
65 (wxWindow
*)s
.GetChild(1), sash_position
);
68 splitter
->SetSashSize(sash_size
);
69 splitter
->SetBorderSize(border_size
);
70 splitter
->SetMinimumPaneSize(min_pane_size
);