Remove all trailing spaces

No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
This commit is contained in:
Vadim Zeitlin
2019-01-30 17:28:08 +01:00
parent ae94f4da9c
commit 8fbca5cb70
320 changed files with 1611 additions and 1611 deletions

View File

@@ -458,7 +458,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_BUTTON( ID_SHOW_ATTRIBUTES, MyFrame::OnShowAttributes)
EVT_CHECKBOX( ID_MULTIPLE_SORT, MyFrame::OnMultipleSort)
EVT_CHECKBOX( ID_SORT_BY_FIRST_COLUMN, MyFrame::OnSortByFirstColumn)
// Fourth page.
EVT_BUTTON( ID_DELETE_TREE_ITEM, MyFrame::OnDeleteTreeItem )
EVT_BUTTON( ID_DELETE_ALL_TREE_ITEMS, MyFrame::OnDeleteAllTreeItems )

View File

@@ -2,7 +2,7 @@
<makefile>
<include file="../../build/bakefiles/config.bkl"/>
<template id="sub">
<dir>$(id)</dir>
<dependency-of>all</dependency-of>

View File

@@ -9,7 +9,7 @@
<wx-lib>base</wx-lib>
<win32-res>ownerdrw.rc</win32-res>
</exe>
<wx-data id="data">
<files>sound.png nosound.png</files>
</wx-data>

View File

@@ -22,5 +22,5 @@
<wx-lib>core</wx-lib>
<wx-lib>base</wx-lib>
</wx-gui-plugin>
</makefile>

View File

@@ -299,8 +299,8 @@ MyFrame::MyFrame()
{
wxRibbonPage* home = new wxRibbonPage(m_ribbon, wxID_ANY, "Examples", ribbon_xpm);
wxRibbonPanel *toolbar_panel = new wxRibbonPanel(home, wxID_ANY, "Toolbar",
wxNullBitmap, wxDefaultPosition, wxDefaultSize,
wxRibbonPanel *toolbar_panel = new wxRibbonPanel(home, wxID_ANY, "Toolbar",
wxNullBitmap, wxDefaultPosition, wxDefaultSize,
wxRIBBON_PANEL_NO_AUTO_MINIMISE |
wxRIBBON_PANEL_EXT_BUTTON);
wxRibbonToolBar *toolbar = new wxRibbonToolBar(toolbar_panel, ID_MAIN_TOOLBAR);
@@ -322,9 +322,9 @@ MyFrame::MyFrame()
toolbar->AddTool(wxID_ANY, wxArtProvider::GetBitmap(wxART_REPORT_VIEW, wxART_OTHER, wxSize(16, 15)));
toolbar->AddTool(wxID_ANY, wxArtProvider::GetBitmap(wxART_LIST_VIEW, wxART_OTHER, wxSize(16, 15)));
toolbar->AddSeparator();
toolbar->AddHybridTool(ID_POSITION_LEFT, position_left_xpm,
toolbar->AddHybridTool(ID_POSITION_LEFT, position_left_xpm,
"Align ribbonbar vertically\non the left\nfor demonstration purposes");
toolbar->AddHybridTool(ID_POSITION_TOP, position_top_xpm,
toolbar->AddHybridTool(ID_POSITION_TOP, position_top_xpm,
"Align the ribbonbar horizontally\nat the top\nfor demonstration purposes");
toolbar->AddSeparator();
toolbar->AddHybridTool(wxID_PRINT, wxArtProvider::GetBitmap(wxART_PRINT, wxART_OTHER, wxSize(16, 15)),
@@ -340,7 +340,7 @@ MyFrame::MyFrame()
wxRibbonPanel *shapes_panel = new wxRibbonPanel(home, wxID_ANY, "Shapes", wxBitmap(circle_small_xpm));
wxRibbonButtonBar *shapes = new wxRibbonButtonBar(shapes_panel);
shapes->AddButton(ID_CIRCLE, "Circle", wxBitmap(circle_xpm), wxBitmap(circle_small_xpm),
shapes->AddButton(ID_CIRCLE, "Circle", wxBitmap(circle_xpm), wxBitmap(circle_small_xpm),
wxNullBitmap, wxNullBitmap, wxRIBBON_BUTTON_NORMAL,
"This is a tooltip for the circle button\ndemonstrating another tooltip");
shapes->AddButton(ID_CROSS, "Cross", wxBitmap(cross_xpm), wxEmptyString);
@@ -348,21 +348,21 @@ MyFrame::MyFrame()
shapes->AddButton(ID_SQUARE, "Square", wxBitmap(square_xpm), wxEmptyString);
shapes->AddDropdownButton(ID_POLYGON, "Other Polygon", wxBitmap(hexagon_xpm), wxEmptyString);
wxRibbonPanel *sizer_panel = new wxRibbonPanel(home, wxID_ANY, "Panel with Sizer",
wxNullBitmap, wxDefaultPosition, wxDefaultSize,
wxRibbonPanel *sizer_panel = new wxRibbonPanel(home, wxID_ANY, "Panel with Sizer",
wxNullBitmap, wxDefaultPosition, wxDefaultSize,
wxRIBBON_PANEL_DEFAULT_STYLE);
wxArrayString as;
as.Add("Item 1 using a box sizer now");
as.Add("Item 2 using a box sizer now");
wxComboBox* sizer_panelcombo = new wxComboBox(sizer_panel, wxID_ANY,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxComboBox* sizer_panelcombo = new wxComboBox(sizer_panel, wxID_ANY,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
as, wxCB_READONLY);
wxComboBox* sizer_panelcombo2 = new wxComboBox(sizer_panel, wxID_ANY,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxComboBox* sizer_panelcombo2 = new wxComboBox(sizer_panel, wxID_ANY,
wxEmptyString,
wxDefaultPosition, wxDefaultSize,
as, wxCB_READONLY);
sizer_panelcombo->Select(0);

View File

@@ -14,5 +14,5 @@
<wx-lib>base</wx-lib>
<win32-res>../sample.rc</win32-res>
</exe>
</makefile>

View File

@@ -763,7 +763,7 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
#ifdef __WXMAC__
SetWindowVariant(wxWINDOW_VARIANT_SMALL);
#endif
// set the frame icon
SetIcon(wxICON(sample));
@@ -1247,14 +1247,14 @@ void MyFrame::WriteInitialText()
r.WriteText(msg);
}
}
// Demonstrate colspan and rowspan
wxRichTextCell* cell = table->GetCell(1, 0);
cell->SetColSpan(2);
r.SetFocusObject(cell);
cell->Clear();
r.WriteText("This cell spans 2 columns");
cell = table->GetCell(1, 3);
cell->SetRowSpan(2);
r.SetFocusObject(cell);
@@ -2010,7 +2010,7 @@ void MyFrame::OnTableDeleteColumn(wxCommandEvent& WXUNUSED(event))
{
col = table->GetColumnCount() - 1;
}
table->DeleteColumns(col, 1);
}
}
@@ -2025,7 +2025,7 @@ void MyFrame::OnTableDeleteRow(wxCommandEvent& WXUNUSED(event))
{
row = table->GetRowCount() - 1;
}
table->DeleteRows(row, 1);
}
}

View File

@@ -259,7 +259,7 @@ wxMenu *MyTaskBarIcon::CreatePopupMenu()
submenu->Append(PU_SUB2, "Another submenu");
menu->Append(PU_SUBMAIN, "Submenu", submenu);
/* OSX has built-in quit menu for the dock menu, but not for the status item */
#ifdef __WXOSX__
#ifdef __WXOSX__
if ( OSXIsStatusItem() )
#endif
{

View File

@@ -37,7 +37,7 @@
<object class="wxStaticBitmap" name="my_bitmap">
<bitmap stock_id="wxART_INFORMATION" stock_client="wxART_MESSAGE_BOX">derivdlg.xpm</bitmap>
</object>
</object>
</object>
<object class="sizeritem">
<flag>wxALIGN_CENTRE|wxALL</flag>
<border>5</border>

View File

@@ -29,7 +29,7 @@
<label>_Non-Derived Dialog Example</label>
<bitmap>basicdlg.xpm</bitmap>
<help>The basic instance of wxDialog loaded via XRC</help>
</object>
</object>
<object class="wxMenuItem" name="derived_tool_or_menuitem">
<label>_Derived Dialog Example</label>
<bitmap>derivdlg.xpm</bitmap>
@@ -39,13 +39,13 @@
<label>_Controls Example</label>
<bitmap>controls.xpm</bitmap>
<help>A notebook displaying all the wxWidgets controls</help>
</object>
</object>
<object class="wxMenuItem" name="uncentered_tool_or_menuitem">
<label>_Uncentered Example</label>
<bitmap>uncenter.xpm</bitmap>
<help>Disable autocentering of a dialog on its parent</help>
</object>
</object>
</object>
</object>
<object class="wxMenu" name="advanced_demos_menu">
<label>_Advanced</label>
<help>Advanced techniques with XRC</help>
@@ -63,7 +63,7 @@
<label>_Custom Class Example</label>
<bitmap>custclas.xpm</bitmap>
<help>Embed your own custom classes into an XRC</help>
</object>
</object>
<object class="wxMenuItem" name="platform_property_tool_or_menuitem">
<label>_Platform Specific Example</label>
<bitmap>platform.xpm</bitmap>
@@ -78,7 +78,7 @@
<label>_Variable Expansion Example</label>
<bitmap>variable.xpm</bitmap>
<help>Replace variables in the XRC file at runtime</help>
</object>
</object>
<object class="wxMenuItem" name="variants">
<label>_Variants</label>
<bitmap>variants.xpm</bitmap>
@@ -88,7 +88,7 @@
<label>_Recursive Load</label>
<help>Show how an individual control can be loaded</help>
</object>
</object>
</object>
<object class="wxMenu" name="help_menu">
<label>_Help</label>

View File

@@ -109,27 +109,27 @@
<object class="wxStaticText" name="download_mac_statictext">
<label>Get latest update at www.mycompany.com/download/mac</label>
</object>
</object>
<object platform="win" class="sizeritem">
</object>
<object platform="win" class="sizeritem">
<flag>wxALIGN_CENTRE|wxALL</flag>
<border>5</border>
<object class="wxStaticText" name="download_win_statictext">
<label>Get latest update at www.mycompany.com/download/win</label>
</object>
</object>
</object>
<object platform="unix" class="sizeritem">
<flag>wxALIGN_CENTRE|wxALL</flag>
<border>5</border>
<object class="wxStaticText" name="download_unix_statictext">
<label>Get latest update at www.mycompany.com/download/unix</label>
</object>
</object>
</object>
<object platform="os2" class="sizeritem">
<flag>wxALIGN_CENTRE|wxALL</flag>
<border>5</border>
<object class="wxStaticText" name="download_os2_statictext">
<label>Get latest update at www.mycompany.com/download/os2</label>
</object>
</object>
</object>
<object class="sizeritem">
<flag>wxALIGN_CENTRE|wxALL</flag>

View File

@@ -19,12 +19,12 @@
<tooltip>Controls Example</tooltip>
<bitmap>controls.xpm</bitmap>
<longhelp>A notebook displaying all the wxWidgets controls</longhelp>
</object>
</object>
<object class="tool" name="uncentered_tool_or_menuitem">
<tooltip>Uncentered Example</tooltip>
<bitmap>uncenter.xpm</bitmap>
<longhelp>Disable autocentering of a dialog on its parent</longhelp>
</object>
</object>
<object class="separator"/>
<object class="tool" name="aui_demo_tool_or_menuitem">
<bitmap>aui.xpm</bitmap>
@@ -40,7 +40,7 @@
<tooltip>Custom Class Example</tooltip>
<bitmap>custclas.xpm</bitmap>
<longhelp>Embed your own custom classes into an XRC</longhelp>
</object>
</object>
<object class="tool" name="platform_property_tool_or_menuitem">
<tooltip>Platform Specific Example</tooltip>
<bitmap>platform.xpm</bitmap>
@@ -55,7 +55,7 @@
<tooltip>Variable Expansion Example</tooltip>
<bitmap>variable.xpm</bitmap>
<longhelp>Replace variables in the XRC file at runtime</longhelp>
</object>
</object>
</object>
</resource>

View File

@@ -2,7 +2,7 @@
// Name: classlist.cpp
// Purpose: ClassListDialog implementation
// Author: Francesco Montorsi
// Modified by:
// Modified by:
// Created: 03/06/2007 14:49:55
// Copyright: (c) 2007 Francesco Montorsi
// Licence: wxWindows licence
@@ -12,7 +12,7 @@
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
@@ -53,15 +53,15 @@ ClassListDialog::ClassListDialog()
Init();
}
ClassListDialog::ClassListDialog( wxWindow* parent, wxWindowID id,
const wxString& caption, const wxPoint& pos,
ClassListDialog::ClassListDialog( wxWindow* parent, wxWindowID id,
const wxString& caption, const wxPoint& pos,
const wxSize& size, long style )
{
Init();
Create(parent, id, caption, pos, size, style);
}
bool ClassListDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption,
bool ClassListDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption,
const wxPoint& pos, const wxSize& size, long style )
{
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
@@ -101,14 +101,14 @@ void ClassListDialog::CreateControls()
// filters
wxBoxSizer* filters = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(filters, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
filters->Add(new wxCheckBox(this, ID_SHOW_ONLY_XTI,
filters->Add(new wxCheckBox(this, ID_SHOW_ONLY_XTI,
"Show only classes with eXtended infos"));
filters->AddSpacer(10);
filters->Add(new wxCheckBox(this, ID_SHOW_PROPERTIES_RECURSIVELY,
"Show properties of parent classes"));
// show how many have we filtered out
m_pClassCountText = new wxStaticText( this, wxID_STATIC,
m_pClassCountText = new wxStaticText( this, wxID_STATIC,
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
wxDefaultPosition, wxDefaultSize, 0 );
m_pClassCountText->SetFont(wxFontInfo(8).Family(wxFONTFAMILY_SWISS).Bold());
@@ -182,7 +182,7 @@ int ClassListDialog::AddClassesWithParent(const wxClassInfo *parent, const wxTre
wxString(ci->GetBaseClassName2()) == parent->GetClassName())
{
wxTreeItemId child = m_pParentTreeCtrl->AppendItem(id, ci->GetClassName());
// update the name of this child with the count of the children classes
int ret = AddClassesWithParent(ci, child);
m_pParentTreeCtrl->SetItemText(child,
@@ -190,7 +190,7 @@ int ClassListDialog::AddClassesWithParent(const wxClassInfo *parent, const wxTre
wxString::Format(" [%d]", ret));
count += ret+1;
}
ci = ci->GetNext();
}
@@ -281,7 +281,7 @@ void ClassListDialog::UpdateFilterText()
// how many are we showing
m_pClassCountText->SetLabel(
wxString::Format(
"Showing %d classes on a total of %d registered classes in wxXTI.",
"Showing %d classes on a total of %d registered classes in wxXTI.",
m_nCount, m_nTotalCount));
}
@@ -386,7 +386,7 @@ wxString DumpPropertyAccessor(const wxPropertyAccessor *acc, int indent)
if (!acc)
return ind + "no property accessors";
if (acc->HasSetter())
infostr << ind << "setter name: " << acc->GetSetterName();
if (acc->HasCollectionGetter())
@@ -442,7 +442,7 @@ wxString DumpHandlerInfo(const wxHandlerInfo *phdlr, int indent)
if (!phdlr)
return ind + "none";
infostr << ind << "event class: " <<
infostr << ind << "event class: " <<
(phdlr->GetEventClassInfo() ? phdlr->GetEventClassInfo()->GetClassName() : "none");
return infostr;

View File

@@ -2,7 +2,7 @@
// Name: classlist.h
// Purpose: ClassListDialog definition
// Author: Francesco Montorsi
// Modified by:
// Modified by:
// Created: 03/06/2007 14:49:55
// Copyright: (c) 2007 Francesco Montorsi
// Licence: wxWindows licence
@@ -42,7 +42,7 @@
// ----------------------------------------------------------------------------
class ClassListDialog: public wxDialog
{
{
// we explicitly don't want to use the following macro:
// wxDECLARE_DYNAMIC_CLASS( ClassListDialog );
// as otherwise the ClassListDialog class would appear in the list
@@ -52,17 +52,17 @@ class ClassListDialog: public wxDialog
public:
// Constructors
ClassListDialog();
ClassListDialog( wxWindow* parent, wxWindowID id = SYMBOL_CLASSLISTDIALOG_IDNAME,
const wxString& caption = SYMBOL_CLASSLISTDIALOG_TITLE,
const wxPoint& pos = SYMBOL_CLASSLISTDIALOG_POSITION,
const wxSize& size = SYMBOL_CLASSLISTDIALOG_SIZE,
ClassListDialog( wxWindow* parent, wxWindowID id = SYMBOL_CLASSLISTDIALOG_IDNAME,
const wxString& caption = SYMBOL_CLASSLISTDIALOG_TITLE,
const wxPoint& pos = SYMBOL_CLASSLISTDIALOG_POSITION,
const wxSize& size = SYMBOL_CLASSLISTDIALOG_SIZE,
long style = SYMBOL_CLASSLISTDIALOG_STYLE );
// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CLASSLISTDIALOG_IDNAME,
const wxString& caption = SYMBOL_CLASSLISTDIALOG_TITLE,
const wxPoint& pos = SYMBOL_CLASSLISTDIALOG_POSITION,
const wxSize& size = SYMBOL_CLASSLISTDIALOG_SIZE,
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CLASSLISTDIALOG_IDNAME,
const wxString& caption = SYMBOL_CLASSLISTDIALOG_TITLE,
const wxPoint& pos = SYMBOL_CLASSLISTDIALOG_POSITION,
const wxSize& size = SYMBOL_CLASSLISTDIALOG_SIZE,
long style = SYMBOL_CLASSLISTDIALOG_STYLE );
// Destructor

View File

@@ -113,7 +113,7 @@ class WXDLLIMPEXP_BASE wxObjectConstructorWriter: public wxObjectWriterFunctor
{
public:
wxObjectConstructorWriter(const wxClassTypeInfo* cti,
wxObjectCodeReaderCallback* writer) :
wxObjectCodeReaderCallback* writer) :
m_cti(cti),m_writer(writer)
{}
@@ -194,20 +194,20 @@ void wxObjectCodeReaderCallback::CreateObject(int objectID,
)
{
int i;
m_source += ( wxString::Format( "\t%s->Create(",
m_source += ( wxString::Format( "\t%s->Create(",
m_data->GetObjectName(objectID) ) );
for (i = 0; i < paramCount; i++)
{
if ( objectIDValues[i] != wxInvalidObjectID )
{
wxString str =
wxString::Format( "%s",
wxString str =
wxString::Format( "%s",
m_data->GetObjectName( objectIDValues[i] ) );
m_source += ( str );
}
else
{
m_source += (
m_source += (
wxString::Format( "%s", ValueAsCode(params[i]) ) );
}
if (i < paramCount - 1)
@@ -236,11 +236,11 @@ void wxObjectCodeReaderCallback::ConstructObject(int objectID,
for (i = 0; i < paramCount; i++)
{
if ( objectIDValues[i] != wxInvalidObjectID )
m_source += ( wxString::Format( "%s",
m_source += ( wxString::Format( "%s",
m_data->GetObjectName( objectIDValues[i] ) ) );
else
{
m_source += (
m_source += (
wxString::Format( "%s", ValueAsCode(params[i]) ) );
}
if (i < paramCount - 1)
@@ -308,7 +308,7 @@ void wxObjectCodeReaderCallback::SetConnect(int eventSourceObjectID,
wxString ehsource = m_data->GetObjectName( eventSourceObjectID );
wxString ehsink = m_data->GetObjectName(eventSinkObjectID);
wxString ehsinkClass = eventSinkClassInfo->GetClassName();
const wxEventSourceTypeInfo *delegateTypeInfo =
const wxEventSourceTypeInfo *delegateTypeInfo =
wx_dynamic_cast(const wxEventSourceTypeInfo*, delegateInfo->GetTypeInfo());
if ( delegateTypeInfo )
{
@@ -316,7 +316,7 @@ void wxObjectCodeReaderCallback::SetConnect(int eventSourceObjectID,
wxString handlerName = handlerInfo->GetName();
wxString code =
wxString::Format(
wxString::Format(
"\t%s->Connect( %s->GetId(), %d, "
"(wxObjectEventFunction)(wxEventFunction) & %s::%s, NULL, %s );",
ehsource, ehsource, eventType, ehsinkClass,

View File

@@ -39,8 +39,8 @@ public:
virtual void AllocateObject(int objectID, wxClassInfo *classInfo,
wxStringToAnyHashMap &metadata);
// initialize the already allocated object having the ID objectID
// with the Create method creation parameters which are objects are
// initialize the already allocated object having the ID objectID
// with the Create method creation parameters which are objects are
// having their Ids passed in objectIDValues having objectId <> wxInvalidObjectID
virtual void CreateObject(int objectID,
@@ -52,9 +52,9 @@ public:
wxStringToAnyHashMap &metadata
);
// construct the new object on the heap, that object will have the
// passed in ID (for objects that don't support allocate-create type
// of creation) creation parameters which are objects are having their
// construct the new object on the heap, that object will have the
// passed in ID (for objects that don't support allocate-create type
// of creation) creation parameters which are objects are having their
// Ids passed in objectIDValues having objectId <> wxInvalidObjectID
virtual void ConstructObject(int objectID,
@@ -65,8 +65,8 @@ public:
const wxClassInfo **objectClassInfos,
wxStringToAnyHashMap &metadata);
// destroy the heap-allocated object having the ID objectID, this may
// be used if an object is embedded in another object and set via value
// destroy the heap-allocated object having the ID objectID, this may
// be used if an object is embedded in another object and set via value
// semantics, so the intermediate object can be destroyed after safely
virtual void DestroyObject(int objectID, wxClassInfo *classInfo);

View File

@@ -6,7 +6,7 @@
<exe id="xti" template="wx_sample" template_append="wx_append">
<sources>xti.cpp classlist.cpp codereadercallback.cpp</sources>
<wx-lib>core</wx-lib>
<wx-lib>xml</wx-lib>
<wx-lib>base</wx-lib>

View File

@@ -170,14 +170,14 @@ MyFrame::MyFrame(const wxString& title)
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(Minimal_About, "&About\tF1", "Show about dialog");
fileMenu->Append(Minimal_Persist, "Persist a wxFrame to XML...",
fileMenu->Append(Minimal_Persist, "Persist a wxFrame to XML...",
"Creates a wxFrame using wxXTI and saves its description as XML");
fileMenu->Append(Minimal_Depersist, "Depersist XML file...",
fileMenu->Append(Minimal_Depersist, "Depersist XML file...",
"Loads the description of wxFrame from XML");
fileMenu->Append(Minimal_GenerateCode, "Generate code for a wxFrame saved to XML...",
fileMenu->Append(Minimal_GenerateCode, "Generate code for a wxFrame saved to XML...",
"Generates the C++ code which belong to a persisted wxFrame");
fileMenu->AppendSeparator();
fileMenu->Append(Minimal_DumpClasses, "Dump registered classes...",
fileMenu->Append(Minimal_DumpClasses, "Dump registered classes...",
"Dumps the description of all wxWidgets classes registered in XTI");
fileMenu->AppendSeparator();
fileMenu->Append(Minimal_Quit, "E&xit\tAlt-X", "Quit this program");
@@ -204,8 +204,8 @@ MyFrame::MyFrame(const wxString& title)
// XTI sample code
// ----------------------------------------------------------------------------
// this is the kind of source code that would end up being generated by a
// designer corresponding to the information we are setting up via RTTI
// this is the kind of source code that would end up being generated by a
// designer corresponding to the information we are setting up via RTTI
// in the CreateFrameRTTI function:
//
// class MyXTIFrame : public wxFrame
@@ -271,17 +271,17 @@ public:
}
virtual bool BeforeWriteDelegate( wxObjectWriter *WXUNUSED(writer),
const wxObject *object,
const wxClassInfo* WXUNUSED(classInfo),
const wxPropertyInfo *propInfo,
const wxObject *&eventSink,
const wxHandlerInfo* &handlerInfo )
const wxObject *object,
const wxClassInfo* WXUNUSED(classInfo),
const wxPropertyInfo *propInfo,
const wxObject *&eventSink,
const wxHandlerInfo* &handlerInfo )
{
// this approach would be used if the handler would not
// be connected really in the designer, so we have to supply
// this approach would be used if the handler would not
// be connected really in the designer, so we have to supply
// the information
const wxObject* but = wxAnyGetAsObjectPtr( m_frame->GetProperty("Button") );
if ( object == but &&
if ( object == but &&
propInfo == wxCLASSINFO( wxButton )->FindPropertyInfo("OnClick") )
{
eventSink = m_frame;
@@ -296,7 +296,7 @@ private:
wxDynamicObject *m_frame;
};
// sometimes linkers (at least MSVC and GCC ones) optimize the final EXE
// sometimes linkers (at least MSVC and GCC ones) optimize the final EXE
// even in debug mode pruning the object files which he "thinks" are useless;
// thus the classes defined in those files won't be available in the XTI
// table and the program will fail to allocate them.
@@ -314,17 +314,17 @@ void RegisterFrameRTTI()
{
// set up the RTTI info for a class (MyXTIFrame) which
// is not defined anywhere in this program
wxDynamicClassInfo *dyninfo =
wxDynamicClassInfo *dyninfo =
wx_dynamic_cast( wxDynamicClassInfo *, wxClassInfo::FindClass("MyXTIFrame"));
if ( dyninfo == NULL )
{
dyninfo = new wxDynamicClassInfo("myxtiframe.h",
"MyXTIFrame",
"MyXTIFrame",
CLASSINFO(wxFrame) );
// this class has a property named "Button" and the relative handler:
dyninfo->AddProperty("Button", wxGetTypeInfo((wxButton**) NULL));
dyninfo->AddHandler("ButtonClickHandler",
dyninfo->AddHandler("ButtonClickHandler",
NULL /* no instance of the handler method */, CLASSINFO( wxEvent ) );
}
}
@@ -339,7 +339,7 @@ wxDynamicObject* CreateFrameRTTI()
wxFrame* frame;
wxClassInfo *info = wxClassInfo::FindClass("MyXTIFrame");
wxASSERT( info );
wxDynamicObject* frameWrapper =
wxDynamicObject* frameWrapper =
wx_dynamic_cast(wxDynamicObject*, info->CreateObject() );
Params[0] = wxAny((wxWindow*)(NULL));
Params[1] = wxAny(wxWindowID(baseID++));
@@ -532,7 +532,7 @@ bool SaveFrameRTTI(const wxString &testFileName, wxDynamicObject *frame)
{
// setup the XML document
wxXmlDocument xml;
wxXmlNode *root = new wxXmlNode(wxXML_ELEMENT_NODE,
wxXmlNode *root = new wxXmlNode(wxXML_ELEMENT_NODE,
"TestXTI", "This is the content");
xml.SetRoot(root);
@@ -542,7 +542,7 @@ bool SaveFrameRTTI(const wxString &testFileName, wxDynamicObject *frame)
// write the given wxObject into the XML document
wxStringToAnyHashMap empty;
writer.WriteObject( frame, frame->GetClassInfo(), &persister,
writer.WriteObject( frame, frame->GetClassInfo(), &persister,
wxString("myTestFrame"), empty );
return xml.Save(testFileName);
@@ -568,8 +568,8 @@ wxDynamicObject* LoadFrameRTTI(const wxString &fileName)
bool GenerateFrameRTTICode(const wxString &inFileName, const wxString &outFileName)
{
// is loading the streamed out component from xml and writing code that
// will create the same component
// is loading the streamed out component from xml and writing code that
// will create the same component
wxFFileOutputStream fos( outFileName );
wxTextOutputStream tos( fos );
@@ -585,7 +585,7 @@ bool GenerateFrameRTTICode(const wxString &inFileName, const wxString &outFileNa
return false;
// read the XML file using the wxObjectCodeReaderCallback
wxString headerincludes;
wxString sourcecode;
wxObjectCodeReaderCallback Callbacks(headerincludes,sourcecode);
@@ -595,7 +595,7 @@ bool GenerateFrameRTTICode(const wxString &inFileName, const wxString &outFileNa
Reader.ReadObject( wxString("myTestFrame"), &Callbacks );
// header preamble
tos <<
tos <<
"#include \"wx/wxprec.h\" \n#ifdef __BORLANDC__\n#pragma hdrstop\n#endif\n#ifndef WX_PRECOMP\n#include \"wx/wx.h\" \n#endif\n\n";
// add object includes
tos.WriteString( headerincludes );
@@ -629,7 +629,7 @@ void MyFrame::OnPersist(wxCommandEvent& WXUNUSED(event))
// ask the user where to save it
wxFileDialog dlg(this, "Where should the frame be saved?",
wxEmptyString, "test.xml", "XML files (*.xml)|*.xml",
wxEmptyString, "test.xml", "XML files (*.xml)|*.xml",
wxFD_SAVE);
if (dlg.ShowModal() == wxID_CANCEL)
return;
@@ -649,7 +649,7 @@ void MyFrame::OnDepersist(wxCommandEvent& WXUNUSED(event))
{
// ask the user which file to load
wxFileDialog dlg(this, "Which file contains the frame to depersist?",
wxEmptyString, "test.xml", "XML files (*.xml)|*.xml",
wxEmptyString, "test.xml", "XML files (*.xml)|*.xml",
wxFD_OPEN);
if (dlg.ShowModal() == wxID_CANCEL)
return;
@@ -679,14 +679,14 @@ void MyFrame::OnGenerateCode(wxCommandEvent& WXUNUSED(event))
{
// ask the user which file to load
wxFileDialog dlg(this, "Which file contains the frame to work on?",
wxEmptyString, "test.xml", "XML files (*.xml)|*.xml",
wxEmptyString, "test.xml", "XML files (*.xml)|*.xml",
wxFD_OPEN);
if (dlg.ShowModal() == wxID_CANCEL)
return;
// ask the user which file to load
wxFileDialog dlg2(this, "Where should the C++ code be saved?",
wxEmptyString, "test.cpp", "Source files (*.cpp)|*.cpp",
wxEmptyString, "test.cpp", "Source files (*.cpp)|*.cpp",
wxFD_SAVE);
if (dlg2.ShowModal() == wxID_CANCEL)
return;
@@ -704,13 +704,13 @@ void MyFrame::OnGenerateCode(wxCommandEvent& WXUNUSED(event))
wxStringOutputStream str;
f.Read(str);
wxDialog dlg(this, wxID_ANY, "Generated code",
wxDialog dlg(this, wxID_ANY, "Generated code",
wxDefaultPosition, wxDefaultSize,
wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE);
wxPanel *panel = new wxPanel(&dlg);
wxSizer *sz = new wxBoxSizer(wxVERTICAL);
sz->Add(new wxTextCtrl(panel, wxID_ANY, str.GetString(),
wxDefaultPosition, wxDefaultSize,
sz->Add(new wxTextCtrl(panel, wxID_ANY, str.GetString(),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE|wxTE_READONLY|wxTE_DONTWRAP),
1, wxGROW|wxALL, 5);
sz->Add(new wxButton(panel, wxID_OK), 0, wxALIGN_RIGHT|wxALL, 5);