Source cleaning: whitespaces, tabs, TRUE/true, FALSE/false, -1/wxID_ANY/wxDefaultCoord/wxNOT_FOUND.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -100,8 +100,8 @@ BEGIN_EVENT_TABLE (Edit, wxStyledTextCtrl)
|
||||
EVT_MENU (myID_CONVERTCRLF, Edit::OnConvertEOL)
|
||||
EVT_MENU (myID_CONVERTLF, Edit::OnConvertEOL)
|
||||
// stc
|
||||
EVT_STC_MARGINCLICK (-1, Edit::OnMarginClick)
|
||||
EVT_STC_CHARADDED (-1, Edit::OnCharAdded)
|
||||
EVT_STC_MARGINCLICK (wxID_ANY, Edit::OnMarginClick)
|
||||
EVT_STC_CHARADDED (wxID_ANY, Edit::OnCharAdded)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
Edit::Edit (wxWindow *parent, wxWindowID id,
|
||||
@@ -532,9 +532,9 @@ bool Edit::LoadFile (const wxString &filename) {
|
||||
// InsertText (0, buf);
|
||||
// }
|
||||
// file.Close();
|
||||
|
||||
|
||||
wxStyledTextCtrl::LoadFile(m_filename);
|
||||
|
||||
|
||||
EmptyUndoBuffer();
|
||||
|
||||
// determine lexer language
|
||||
@@ -580,7 +580,7 @@ bool Edit::SaveFile (const wxString &filename) {
|
||||
// return true;
|
||||
|
||||
return wxStyledTextCtrl::SaveFile(filename);
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool Edit::Modified () {
|
||||
@@ -595,7 +595,7 @@ bool Edit::Modified () {
|
||||
|
||||
EditProperties::EditProperties (Edit *edit,
|
||||
long style)
|
||||
: wxDialog (edit, -1, wxEmptyString,
|
||||
: wxDialog (edit, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
||||
|
||||
@@ -606,24 +606,24 @@ EditProperties::EditProperties (Edit *edit,
|
||||
// fullname
|
||||
wxBoxSizer *fullname = new wxBoxSizer (wxHORIZONTAL);
|
||||
fullname->Add (10, 0);
|
||||
fullname->Add (new wxStaticText (this, -1, _("Full filename"),
|
||||
wxDefaultPosition, wxSize(80, -1)),
|
||||
fullname->Add (new wxStaticText (this, wxID_ANY, _("Full filename"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
|
||||
fullname->Add (new wxStaticText (this, -1, edit->GetFilename()),
|
||||
fullname->Add (new wxStaticText (this, wxID_ANY, edit->GetFilename()),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
// text info
|
||||
wxGridSizer *textinfo = new wxGridSizer (4, 0, 2);
|
||||
textinfo->Add (new wxStaticText (this, -1, _("Language"),
|
||||
wxDefaultPosition, wxSize(80, -1)),
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Language"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
textinfo->Add (new wxStaticText (this, -1, edit->m_language->name),
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, edit->m_language->name),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
textinfo->Add (new wxStaticText (this, -1, _("Lexer-ID: "),
|
||||
wxDefaultPosition, wxSize(80, -1)),
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (_T("%d"), edit->GetLexer());
|
||||
textinfo->Add (new wxStaticText (this, -1, text),
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
wxString EOLtype = _T("");
|
||||
switch (edit->GetEOLMode()) {
|
||||
@@ -631,49 +631,49 @@ EditProperties::EditProperties (Edit *edit,
|
||||
case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; }
|
||||
case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; }
|
||||
}
|
||||
textinfo->Add (new wxStaticText (this, -1, _("Line endings"),
|
||||
wxDefaultPosition, wxSize(80, -1)),
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
textinfo->Add (new wxStaticText (this, -1, EOLtype),
|
||||
textinfo->Add (new wxStaticText (this, wxID_ANY, EOLtype),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
|
||||
// text info box
|
||||
wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
|
||||
new wxStaticBox (this, -1, _("Informations")),
|
||||
new wxStaticBox (this, wxID_ANY, _("Informations")),
|
||||
wxVERTICAL);
|
||||
textinfos->Add (textinfo, 0, wxEXPAND);
|
||||
textinfos->Add (0, 6);
|
||||
|
||||
// statistic
|
||||
wxGridSizer *statistic = new wxGridSizer (4, 0, 2);
|
||||
statistic->Add (new wxStaticText (this, -1, _("Total lines"),
|
||||
wxDefaultPosition, wxSize(80, -1)),
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (_T("%d"), edit->GetLineCount());
|
||||
statistic->Add (new wxStaticText (this, -1, text),
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, -1, _("Total chars"),
|
||||
wxDefaultPosition, wxSize(80, -1)),
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (_T("%d"), edit->GetTextLength());
|
||||
statistic->Add (new wxStaticText (this, -1, text),
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, -1, _("Current line"),
|
||||
wxDefaultPosition, wxSize(80, -1)),
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (_T("%d"), edit->GetCurrentLine());
|
||||
statistic->Add (new wxStaticText (this, -1, text),
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
statistic->Add (new wxStaticText (this, -1, _("Current pos"),
|
||||
wxDefaultPosition, wxSize(80, -1)),
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"),
|
||||
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||
text = wxString::Format (_T("%d"), edit->GetCurrentPos());
|
||||
statistic->Add (new wxStaticText (this, -1, text),
|
||||
statistic->Add (new wxStaticText (this, wxID_ANY, text),
|
||||
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||
|
||||
// char/line statistics
|
||||
wxStaticBoxSizer *statistics = new wxStaticBoxSizer (
|
||||
new wxStaticBox (this, -1, _("Statistics")),
|
||||
new wxStaticBox (this, wxID_ANY, _("Statistics")),
|
||||
wxVERTICAL);
|
||||
statistics->Add (statistic, 0, wxEXPAND);
|
||||
statistics->Add (0, 6);
|
||||
|
@@ -45,7 +45,7 @@ class Edit: public wxStyledTextCtrl {
|
||||
|
||||
public:
|
||||
//! constructor
|
||||
Edit (wxWindow *parent, wxWindowID id = -1,
|
||||
Edit (wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxSUNKEN_BORDER|wxVSCROLL
|
||||
|
@@ -289,7 +289,7 @@ BEGIN_EVENT_TABLE (AppFrame, wxFrame)
|
||||
END_EVENT_TABLE ()
|
||||
|
||||
AppFrame::AppFrame (const wxString &title)
|
||||
: wxFrame ((wxFrame *)NULL, -1, title, wxDefaultPosition, wxSize(750,550),
|
||||
: wxFrame ((wxFrame *)NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750,550),
|
||||
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) {
|
||||
|
||||
// intitialize important variables
|
||||
@@ -308,7 +308,7 @@ AppFrame::AppFrame (const wxString &title)
|
||||
CreateMenu ();
|
||||
|
||||
// open first page
|
||||
m_edit = new Edit (this, -1);
|
||||
m_edit = new Edit (this, wxID_ANY);
|
||||
m_edit->SetFocus();
|
||||
|
||||
FileOpen (_T("stctest.cpp"));
|
||||
@@ -586,7 +586,7 @@ END_EVENT_TABLE ()
|
||||
AppAbout::AppAbout (wxWindow *parent,
|
||||
int milliseconds,
|
||||
long style)
|
||||
: wxDialog (parent, -1, wxEmptyString,
|
||||
: wxDialog (parent, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
||||
|
||||
@@ -602,27 +602,27 @@ AppAbout::AppAbout (wxWindow *parent,
|
||||
|
||||
// about info
|
||||
wxGridSizer *aboutinfo = new wxGridSizer (2, 0, 2);
|
||||
aboutinfo->Add (new wxStaticText(this, -1, _("Written by: ")),
|
||||
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Written by: ")),
|
||||
0, wxALIGN_LEFT);
|
||||
aboutinfo->Add (new wxStaticText(this, -1, APP_MAINT),
|
||||
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_MAINT),
|
||||
1, wxEXPAND | wxALIGN_LEFT);
|
||||
aboutinfo->Add (new wxStaticText(this, -1, _("Version: ")),
|
||||
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Version: ")),
|
||||
0, wxALIGN_LEFT);
|
||||
aboutinfo->Add (new wxStaticText(this, -1, APP_VERSION),
|
||||
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_VERSION),
|
||||
1, wxEXPAND | wxALIGN_LEFT);
|
||||
aboutinfo->Add (new wxStaticText(this, -1, _("Licence type: ")),
|
||||
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Licence type: ")),
|
||||
0, wxALIGN_LEFT);
|
||||
aboutinfo->Add (new wxStaticText(this, -1, APP_LICENCE),
|
||||
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_LICENCE),
|
||||
1, wxEXPAND | wxALIGN_LEFT);
|
||||
aboutinfo->Add (new wxStaticText(this, -1, _("Copyright: ")),
|
||||
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Copyright: ")),
|
||||
0, wxALIGN_LEFT);
|
||||
aboutinfo->Add (new wxStaticText(this, -1, APP_COPYRIGTH),
|
||||
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_COPYRIGTH),
|
||||
1, wxEXPAND | wxALIGN_LEFT);
|
||||
|
||||
// about icontitle//info
|
||||
wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
|
||||
wxBitmap bitmap = wxBitmap(wxICON (mondrian));
|
||||
aboutpane->Add (new wxStaticBitmap (this, -1, bitmap),
|
||||
aboutpane->Add (new wxStaticBitmap (this, wxID_ANY, bitmap),
|
||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 20);
|
||||
aboutpane->Add (aboutinfo, 1, wxEXPAND);
|
||||
aboutpane->Add (60, 0);
|
||||
@@ -630,12 +630,12 @@ AppAbout::AppAbout (wxWindow *parent,
|
||||
// about complete
|
||||
wxBoxSizer *totalpane = new wxBoxSizer (wxVERTICAL);
|
||||
totalpane->Add (0, 20);
|
||||
wxStaticText *appname = new wxStaticText(this, -1, *g_appname);
|
||||
wxStaticText *appname = new wxStaticText(this, wxID_ANY, *g_appname);
|
||||
appname->SetFont (wxFont (24, wxDEFAULT, wxNORMAL, wxBOLD));
|
||||
totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
|
||||
totalpane->Add (0, 10);
|
||||
totalpane->Add (aboutpane, 0, wxEXPAND | wxALL, 4);
|
||||
totalpane->Add (new wxStaticText(this, -1, APP_DESCR),
|
||||
totalpane->Add (new wxStaticText(this, wxID_ANY, APP_DESCR),
|
||||
0, wxALIGN_CENTER | wxALL, 10);
|
||||
wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
|
||||
okButton->SetDefault();
|
||||
|
Reference in New Issue
Block a user