Code cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
922bcaff46
commit
4219b5e7c7
@ -94,7 +94,7 @@ static char * icon2_xpm[] = {
|
|||||||
// resources
|
// resources
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// the application icon
|
// the application icon
|
||||||
#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
#ifndef __WXMSW__
|
||||||
#include "mondrian.xpm"
|
#include "mondrian.xpm"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
|||||||
SetIcon(wxICON(mondrian));
|
SetIcon(wxICON(mondrian));
|
||||||
|
|
||||||
// create a menu bar
|
// create a menu bar
|
||||||
wxMenu *menuFile = new wxMenu(wxT(""), wxMENU_TEAROFF);
|
wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF);
|
||||||
|
|
||||||
// the "About" item should be in the help menu
|
// the "About" item should be in the help menu
|
||||||
wxMenu *helpMenu = new wxMenu;
|
wxMenu *helpMenu = new wxMenu;
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
#include "doc.h"
|
#include "doc.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
#ifndef __WXMSW__
|
||||||
#include "ogl.xpm"
|
#include "ogl.xpm"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// A macro needed for some compilers (AIX) that need 'main' to be defined
|
// A macro needed for some compilers (AIX) that need 'main' to be defined
|
||||||
@ -208,4 +208,3 @@ MyFrame *GetMainFrame(void)
|
|||||||
{
|
{
|
||||||
return wxGetApp().frame;
|
return wxGetApp().frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "cspalette.h"
|
#include "cspalette.h"
|
||||||
#include "symbols.h"
|
#include "symbols.h"
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
#ifndef __WXMSW__
|
||||||
#include "bitmaps/arrow.xpm"
|
#include "bitmaps/arrow.xpm"
|
||||||
#include "bitmaps/texttool.xpm"
|
#include "bitmaps/texttool.xpm"
|
||||||
#endif
|
#endif
|
||||||
@ -118,7 +118,7 @@ bool csApp::CreatePalette(wxFrame *parent)
|
|||||||
wxBitmap PaletteArrow(_T("arrowtool"));
|
wxBitmap PaletteArrow(_T("arrowtool"));
|
||||||
wxBitmap TextTool(_T("texttool"));
|
wxBitmap TextTool(_T("texttool"));
|
||||||
wxSize toolBitmapSize(32, 32);
|
wxSize toolBitmapSize(32, 32);
|
||||||
#elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__)
|
#else // !__WXMSW__
|
||||||
wxBitmap PaletteArrow(arrow_xpm);
|
wxBitmap PaletteArrow(arrow_xpm);
|
||||||
wxBitmap TextTool(texttool_xpm);
|
wxBitmap TextTool(texttool_xpm);
|
||||||
wxSize toolBitmapSize(22, 22);
|
wxSize toolBitmapSize(22, 22);
|
||||||
@ -141,7 +141,7 @@ bool csApp::CreatePalette(wxFrame *parent)
|
|||||||
|
|
||||||
symbols[noSymbols] = _T("Thin Rectangle");
|
symbols[noSymbols] = _T("Thin Rectangle");
|
||||||
noSymbols ++;
|
noSymbols ++;
|
||||||
|
|
||||||
symbols[noSymbols] = _T("Triangle");
|
symbols[noSymbols] = _T("Triangle");
|
||||||
noSymbols ++;
|
noSymbols ++;
|
||||||
|
|
||||||
@ -200,4 +200,3 @@ bool csApp::CreatePalette(wxFrame *parent)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +178,7 @@ MyFrame::MyFrame(wxWindow *parent,
|
|||||||
InitToolBar(GetToolBar());
|
InitToolBar(GetToolBar());
|
||||||
#endif // wxUSE_TOOLBAR
|
#endif // wxUSE_TOOLBAR
|
||||||
|
|
||||||
|
#if wxUSE_ACCEL
|
||||||
// Accelerators
|
// Accelerators
|
||||||
wxAcceleratorEntry entries[3];
|
wxAcceleratorEntry entries[3];
|
||||||
entries[0].Set(wxACCEL_CTRL, (int) 'N', MDI_NEW_WINDOW);
|
entries[0].Set(wxACCEL_CTRL, (int) 'N', MDI_NEW_WINDOW);
|
||||||
@ -185,6 +186,7 @@ MyFrame::MyFrame(wxWindow *parent,
|
|||||||
entries[2].Set(wxACCEL_CTRL, (int) 'A', MDI_ABOUT);
|
entries[2].Set(wxACCEL_CTRL, (int) 'A', MDI_ABOUT);
|
||||||
wxAcceleratorTable accel(3, entries);
|
wxAcceleratorTable accel(3, entries);
|
||||||
SetAcceleratorTable(accel);
|
SetAcceleratorTable(accel);
|
||||||
|
#endif // wxUSE_ACCEL
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnClose(wxCloseEvent& event)
|
void MyFrame::OnClose(wxCloseEvent& event)
|
||||||
@ -280,7 +282,7 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) )
|
|||||||
subframe->Show(true);
|
subframe->Show(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnSize(wxSizeEvent&
|
void MyFrame::OnSize(wxSizeEvent&
|
||||||
#ifdef __WXUNIVERSAL__
|
#ifdef __WXUNIVERSAL__
|
||||||
event
|
event
|
||||||
#else
|
#else
|
||||||
@ -297,7 +299,7 @@ void MyFrame::OnSize(wxSizeEvent&
|
|||||||
// FIXME: On wxX11, we need the MDI frame to process this
|
// FIXME: On wxX11, we need the MDI frame to process this
|
||||||
// event, but on other platforms this should not
|
// event, but on other platforms this should not
|
||||||
// be done.
|
// be done.
|
||||||
#ifdef __WXUNIVERSAL__
|
#ifdef __WXUNIVERSAL__
|
||||||
event.Skip();
|
event.Skip();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -519,5 +521,3 @@ void MyChild::OnClose(wxCloseEvent& event)
|
|||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ bool ctConfigToolDoc::Save()
|
|||||||
{
|
{
|
||||||
if (!IsModified() && m_savedYet) return true;
|
if (!IsModified() && m_savedYet) return true;
|
||||||
|
|
||||||
bool ret = (m_documentFile == wxT("") || !m_savedYet) ?
|
bool ret = (m_documentFile.empty() || !m_savedYet) ?
|
||||||
SaveAs() :
|
SaveAs() :
|
||||||
OnSaveDocument(m_documentFile);
|
OnSaveDocument(m_documentFile);
|
||||||
if ( ret )
|
if ( ret )
|
||||||
@ -124,9 +124,9 @@ bool ctConfigToolDoc::OnCreate(const wxString& path, long flags)
|
|||||||
//rootItem->InitProperties();
|
//rootItem->InitProperties();
|
||||||
rootItem->GetProperties().AddProperty(
|
rootItem->GetProperties().AddProperty(
|
||||||
new ctProperty(
|
new ctProperty(
|
||||||
wxT("The item description."),
|
wxT("The item description."),
|
||||||
wxVariant(wxT(""), wxT("description")),
|
wxVariant(wxEmptyString, wxT("description")),
|
||||||
wxT("multiline")));
|
wxT("multiline")));
|
||||||
|
|
||||||
rootItem->SetPropertyString(_T("description"),
|
rootItem->SetPropertyString(_T("description"),
|
||||||
_T("<B>This is the top-level configuration item.</B>"));
|
_T("<B>This is the top-level configuration item.</B>"));
|
||||||
@ -501,7 +501,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent)
|
|||||||
wxString type(wxT("string"));
|
wxString type(wxT("string"));
|
||||||
wxString choices;
|
wxString choices;
|
||||||
wxString editorType(wxT("string"));
|
wxString editorType(wxT("string"));
|
||||||
wxString description(wxT(""));
|
wxString description;
|
||||||
childTag->GetAttributeValue(type, wxT("type"));
|
childTag->GetAttributeValue(type, wxT("type"));
|
||||||
childTag->GetAttributeValue(type, wxT("editor-type"));
|
childTag->GetAttributeValue(type, wxT("editor-type"));
|
||||||
childTag->GetAttributeValue(type, wxT("choices"));
|
childTag->GetAttributeValue(type, wxT("choices"));
|
||||||
@ -514,7 +514,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent)
|
|||||||
else if (type == wxT("long"))
|
else if (type == wxT("long"))
|
||||||
prop->GetVariant() = wxVariant((long) 0, name);
|
prop->GetVariant() = wxVariant((long) 0, name);
|
||||||
else
|
else
|
||||||
prop->GetVariant() = wxVariant(wxT(""), name);
|
prop->GetVariant() = wxVariant(wxEmptyString, name);
|
||||||
prop->SetDescription(description);
|
prop->SetDescription(description);
|
||||||
prop->SetCustom(true);
|
prop->SetCustom(true);
|
||||||
prop->SetEditorType(editorType);
|
prop->SetEditorType(editorType);
|
||||||
@ -797,6 +797,8 @@ wxString ctConfigToolDoc::GetFrameworkDir(bool makeUnix)
|
|||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
if (makeUnix)
|
if (makeUnix)
|
||||||
path.Replace(wxT("\\"), wxT("/"));
|
path.Replace(wxT("\\"), wxT("/"));
|
||||||
|
#else
|
||||||
|
wxUnusedVar(makeUnix);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
|
Loading…
Reference in New Issue
Block a user