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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user