wxWidgets/utils/serialize/serext.cpp
Guilhem Lavaux 123a7fddb8 * Added source file info in utils/serialize/*
* Added Windows support in dynlib.cpp (not tested)
* Added some operator in wxStream
* Added a mutex in thread sample (more later)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1998-08-05 17:12:43 +00:00

72 lines
2.2 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: serext.cpp
// Purpose: Serialization: Other classes
// Author: Guilhem Lavaux
// Modified by:
// Created: July 1998
// RCS-ID: $Id$
// Copyright: (c) 1998 Guilhem Lavaux
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "serext.h"
#endif
#include <wx/splitter.h>
#include <wx/objstrm.h>
#include <wx/datstrm.h>
#include "serext.h"
IMPLEMENT_SERIAL_CLASS(wxSplitterWindow, wxWindow)
void WXSERIAL(wxSplitterWindow)::StoreObject(wxObjectOutputStream& s)
{
wxSplitterWindow *splitter = (wxSplitterWindow *)Object();
WXSERIAL(wxWindow)::StoreObject(s);
if (s.FirstStage()) {
s.AddChild( splitter->GetWindow1() );
s.AddChild( splitter->GetWindow2() );
return;
}
wxDataOutputStream data_s(s);
data_s.Write8( splitter->GetSplitMode() );
data_s.Write32( splitter->GetSashSize() );
data_s.Write8( splitter->GetBorderSize() );
data_s.Write32( splitter->GetSashPosition() );
data_s.Write32( splitter->GetMinimumPaneSize() );
}
void WXSERIAL(wxSplitterWindow)::LoadObject(wxObjectInputStream& s)
{
wxSplitterWindow *splitter = (wxSplitterWindow *)Object();
WXSERIAL(wxWindow)::LoadObject(s);
wxDataInputStream data_s(s);
int split_mode, sash_size, border_size, sash_position, min_pane_size;
split_mode = data_s.Read8();
sash_size = data_s.Read32();
border_size = data_s.Read8();
sash_position = data_s.Read32();
min_pane_size = data_s.Read32();
splitter->Create(m_parent, m_id, wxPoint(m_x, m_y), wxSize(m_w, m_h), m_style,
m_name);
if (s.GetChild(1)) {
if (data_s.Read8() == wxSPLIT_VERTICAL)
splitter->SplitVertically((wxWindow *)s.GetChild(0),
(wxWindow *)s.GetChild(1), sash_position);
else
splitter->SplitHorizontally((wxWindow *)s.GetChild(0),
(wxWindow *)s.GetChild(1), sash_position);
}
splitter->SetSashSize(sash_size);
splitter->SetBorderSize(border_size);
splitter->SetMinimumPaneSize(min_pane_size);
}