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:
@@ -3077,31 +3077,31 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||||
|
|
||||||
#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -100,8 +100,8 @@ BEGIN_EVENT_TABLE (Edit, wxStyledTextCtrl)
|
|||||||
EVT_MENU (myID_CONVERTCRLF, Edit::OnConvertEOL)
|
EVT_MENU (myID_CONVERTCRLF, Edit::OnConvertEOL)
|
||||||
EVT_MENU (myID_CONVERTLF, Edit::OnConvertEOL)
|
EVT_MENU (myID_CONVERTLF, Edit::OnConvertEOL)
|
||||||
// stc
|
// stc
|
||||||
EVT_STC_MARGINCLICK (-1, Edit::OnMarginClick)
|
EVT_STC_MARGINCLICK (wxID_ANY, Edit::OnMarginClick)
|
||||||
EVT_STC_CHARADDED (-1, Edit::OnCharAdded)
|
EVT_STC_CHARADDED (wxID_ANY, Edit::OnCharAdded)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
Edit::Edit (wxWindow *parent, wxWindowID id,
|
Edit::Edit (wxWindow *parent, wxWindowID id,
|
||||||
@@ -595,7 +595,7 @@ bool Edit::Modified () {
|
|||||||
|
|
||||||
EditProperties::EditProperties (Edit *edit,
|
EditProperties::EditProperties (Edit *edit,
|
||||||
long style)
|
long style)
|
||||||
: wxDialog (edit, -1, wxEmptyString,
|
: wxDialog (edit, wxID_ANY, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
||||||
|
|
||||||
@@ -606,24 +606,24 @@ EditProperties::EditProperties (Edit *edit,
|
|||||||
// fullname
|
// fullname
|
||||||
wxBoxSizer *fullname = new wxBoxSizer (wxHORIZONTAL);
|
wxBoxSizer *fullname = new wxBoxSizer (wxHORIZONTAL);
|
||||||
fullname->Add (10, 0);
|
fullname->Add (10, 0);
|
||||||
fullname->Add (new wxStaticText (this, -1, _("Full filename"),
|
fullname->Add (new wxStaticText (this, wxID_ANY, _("Full filename"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
|
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);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
// text info
|
// text info
|
||||||
wxGridSizer *textinfo = new wxGridSizer (4, 0, 2);
|
wxGridSizer *textinfo = new wxGridSizer (4, 0, 2);
|
||||||
textinfo->Add (new wxStaticText (this, -1, _("Language"),
|
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Language"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
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);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
textinfo->Add (new wxStaticText (this, -1, _("Lexer-ID: "),
|
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetLexer());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
wxString EOLtype = _T("");
|
wxString EOLtype = _T("");
|
||||||
switch (edit->GetEOLMode()) {
|
switch (edit->GetEOLMode()) {
|
||||||
@@ -631,49 +631,49 @@ EditProperties::EditProperties (Edit *edit,
|
|||||||
case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; }
|
case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; }
|
||||||
case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; }
|
case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; }
|
||||||
}
|
}
|
||||||
textinfo->Add (new wxStaticText (this, -1, _("Line endings"),
|
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
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);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
|
|
||||||
// text info box
|
// text info box
|
||||||
wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
|
wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
|
||||||
new wxStaticBox (this, -1, _("Informations")),
|
new wxStaticBox (this, wxID_ANY, _("Informations")),
|
||||||
wxVERTICAL);
|
wxVERTICAL);
|
||||||
textinfos->Add (textinfo, 0, wxEXPAND);
|
textinfos->Add (textinfo, 0, wxEXPAND);
|
||||||
textinfos->Add (0, 6);
|
textinfos->Add (0, 6);
|
||||||
|
|
||||||
// statistic
|
// statistic
|
||||||
wxGridSizer *statistic = new wxGridSizer (4, 0, 2);
|
wxGridSizer *statistic = new wxGridSizer (4, 0, 2);
|
||||||
statistic->Add (new wxStaticText (this, -1, _("Total lines"),
|
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetLineCount());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
statistic->Add (new wxStaticText (this, -1, _("Total chars"),
|
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetTextLength());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
statistic->Add (new wxStaticText (this, -1, _("Current line"),
|
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetCurrentLine());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
statistic->Add (new wxStaticText (this, -1, _("Current pos"),
|
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetCurrentPos());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
|
|
||||||
// char/line statistics
|
// char/line statistics
|
||||||
wxStaticBoxSizer *statistics = new wxStaticBoxSizer (
|
wxStaticBoxSizer *statistics = new wxStaticBoxSizer (
|
||||||
new wxStaticBox (this, -1, _("Statistics")),
|
new wxStaticBox (this, wxID_ANY, _("Statistics")),
|
||||||
wxVERTICAL);
|
wxVERTICAL);
|
||||||
statistics->Add (statistic, 0, wxEXPAND);
|
statistics->Add (statistic, 0, wxEXPAND);
|
||||||
statistics->Add (0, 6);
|
statistics->Add (0, 6);
|
||||||
|
@@ -45,7 +45,7 @@ class Edit: public wxStyledTextCtrl {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! constructor
|
//! constructor
|
||||||
Edit (wxWindow *parent, wxWindowID id = -1,
|
Edit (wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint &pos = wxDefaultPosition,
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
const wxSize &size = wxDefaultSize,
|
const wxSize &size = wxDefaultSize,
|
||||||
long style = wxSUNKEN_BORDER|wxVSCROLL
|
long style = wxSUNKEN_BORDER|wxVSCROLL
|
||||||
|
@@ -289,7 +289,7 @@ BEGIN_EVENT_TABLE (AppFrame, wxFrame)
|
|||||||
END_EVENT_TABLE ()
|
END_EVENT_TABLE ()
|
||||||
|
|
||||||
AppFrame::AppFrame (const wxString &title)
|
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) {
|
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) {
|
||||||
|
|
||||||
// intitialize important variables
|
// intitialize important variables
|
||||||
@@ -308,7 +308,7 @@ AppFrame::AppFrame (const wxString &title)
|
|||||||
CreateMenu ();
|
CreateMenu ();
|
||||||
|
|
||||||
// open first page
|
// open first page
|
||||||
m_edit = new Edit (this, -1);
|
m_edit = new Edit (this, wxID_ANY);
|
||||||
m_edit->SetFocus();
|
m_edit->SetFocus();
|
||||||
|
|
||||||
FileOpen (_T("stctest.cpp"));
|
FileOpen (_T("stctest.cpp"));
|
||||||
@@ -586,7 +586,7 @@ END_EVENT_TABLE ()
|
|||||||
AppAbout::AppAbout (wxWindow *parent,
|
AppAbout::AppAbout (wxWindow *parent,
|
||||||
int milliseconds,
|
int milliseconds,
|
||||||
long style)
|
long style)
|
||||||
: wxDialog (parent, -1, wxEmptyString,
|
: wxDialog (parent, wxID_ANY, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
||||||
|
|
||||||
@@ -602,27 +602,27 @@ AppAbout::AppAbout (wxWindow *parent,
|
|||||||
|
|
||||||
// about info
|
// about info
|
||||||
wxGridSizer *aboutinfo = new wxGridSizer (2, 0, 2);
|
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);
|
0, wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, APP_MAINT),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_MAINT),
|
||||||
1, wxEXPAND | wxALIGN_LEFT);
|
1, wxEXPAND | wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, _("Version: ")),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Version: ")),
|
||||||
0, wxALIGN_LEFT);
|
0, wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, APP_VERSION),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_VERSION),
|
||||||
1, wxEXPAND | wxALIGN_LEFT);
|
1, wxEXPAND | wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, _("Licence type: ")),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Licence type: ")),
|
||||||
0, wxALIGN_LEFT);
|
0, wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, APP_LICENCE),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_LICENCE),
|
||||||
1, wxEXPAND | wxALIGN_LEFT);
|
1, wxEXPAND | wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, _("Copyright: ")),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Copyright: ")),
|
||||||
0, wxALIGN_LEFT);
|
0, wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, APP_COPYRIGTH),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_COPYRIGTH),
|
||||||
1, wxEXPAND | wxALIGN_LEFT);
|
1, wxEXPAND | wxALIGN_LEFT);
|
||||||
|
|
||||||
// about icontitle//info
|
// about icontitle//info
|
||||||
wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
|
wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
|
||||||
wxBitmap bitmap = wxBitmap(wxICON (mondrian));
|
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);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 20);
|
||||||
aboutpane->Add (aboutinfo, 1, wxEXPAND);
|
aboutpane->Add (aboutinfo, 1, wxEXPAND);
|
||||||
aboutpane->Add (60, 0);
|
aboutpane->Add (60, 0);
|
||||||
@@ -630,12 +630,12 @@ AppAbout::AppAbout (wxWindow *parent,
|
|||||||
// about complete
|
// about complete
|
||||||
wxBoxSizer *totalpane = new wxBoxSizer (wxVERTICAL);
|
wxBoxSizer *totalpane = new wxBoxSizer (wxVERTICAL);
|
||||||
totalpane->Add (0, 20);
|
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));
|
appname->SetFont (wxFont (24, wxDEFAULT, wxNORMAL, wxBOLD));
|
||||||
totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
|
totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
|
||||||
totalpane->Add (0, 10);
|
totalpane->Add (0, 10);
|
||||||
totalpane->Add (aboutpane, 0, wxEXPAND | wxALL, 4);
|
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);
|
0, wxALIGN_CENTER | wxALL, 10);
|
||||||
wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
|
wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
|
||||||
okButton->SetDefault();
|
okButton->SetDefault();
|
||||||
|
@@ -574,7 +574,7 @@ Window::~Window() {
|
|||||||
|
|
||||||
void Window::Destroy() {
|
void Window::Destroy() {
|
||||||
if (id) {
|
if (id) {
|
||||||
Show(FALSE);
|
Show(false);
|
||||||
GETWIN(id)->Destroy();
|
GETWIN(id)->Destroy();
|
||||||
}
|
}
|
||||||
id = 0;
|
id = 0;
|
||||||
@@ -767,7 +767,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
if ( !wxPendingDelete.Member(this) )
|
if ( !wxPendingDelete.Member(this) )
|
||||||
wxPendingDelete.Append(this);
|
wxPendingDelete.Append(this);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -818,7 +818,7 @@ private:
|
|||||||
BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxWindow)
|
BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxWindow)
|
||||||
EVT_SET_FOCUS ( wxSTCListBoxWin::OnFocus)
|
EVT_SET_FOCUS ( wxSTCListBoxWin::OnFocus)
|
||||||
EVT_SIZE ( wxSTCListBoxWin::OnSize)
|
EVT_SIZE ( wxSTCListBoxWin::OnSize)
|
||||||
EVT_LIST_ITEM_ACTIVATED(-1, wxSTCListBoxWin::OnActivate)
|
EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSTCListBoxWin::OnActivate)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@@ -981,10 +981,10 @@ int ListBoxImpl::Length() {
|
|||||||
|
|
||||||
|
|
||||||
void ListBoxImpl::Select(int n) {
|
void ListBoxImpl::Select(int n) {
|
||||||
bool select = TRUE;
|
bool select = true;
|
||||||
if (n == -1) {
|
if (n == -1) {
|
||||||
n = 0;
|
n = 0;
|
||||||
select = FALSE;
|
select = false;
|
||||||
}
|
}
|
||||||
GETLB(id)->Focus(n);
|
GETLB(id)->Focus(n);
|
||||||
GETLB(id)->Select(n, select);
|
GETLB(id)->Select(n, select);
|
||||||
@@ -998,7 +998,7 @@ int ListBoxImpl::GetSelection() {
|
|||||||
|
|
||||||
int ListBoxImpl::Find(const char *WXUNUSED(prefix)) {
|
int ListBoxImpl::Find(const char *WXUNUSED(prefix)) {
|
||||||
// No longer used
|
// No longer used
|
||||||
return -1;
|
return wxNOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1019,7 +1019,7 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) {
|
|||||||
|
|
||||||
if (! imgList) {
|
if (! imgList) {
|
||||||
// assumes all images are the same size
|
// assumes all images are the same size
|
||||||
imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), TRUE);
|
imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), true);
|
||||||
imgTypeMap = new wxArrayInt;
|
imgTypeMap = new wxArrayInt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1121,7 +1121,7 @@ unsigned int Platform::DoubleClickTime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Platform::MouseButtonBounce() {
|
bool Platform::MouseButtonBounce() {
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
void Platform::DebugDisplay(const char *s) {
|
void Platform::DebugDisplay(const char *s) {
|
||||||
wxLogDebug(stc2wx(s));
|
wxLogDebug(stc2wx(s));
|
||||||
|
@@ -73,7 +73,7 @@ class wxSTCCallTip : public wxSTCCallTipBase {
|
|||||||
public:
|
public:
|
||||||
wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx)
|
wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx)
|
||||||
: wxSTCCallTipBase(parent, param2),
|
: wxSTCCallTipBase(parent, param2),
|
||||||
m_ct(ct), m_swx(swx), m_cx(-1), m_cy(-1)
|
m_ct(ct), m_swx(swx), m_cx(wxDefaultCoord), m_cy(wxDefaultCoord)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AcceptsFocus() const { return FALSE; }
|
bool AcceptsFocus() const { return false; }
|
||||||
|
|
||||||
void OnPaint(wxPaintEvent& WXUNUSED(evt)) {
|
void OnPaint(wxPaintEvent& WXUNUSED(evt)) {
|
||||||
wxBufferedPaintDC dc(this);
|
wxBufferedPaintDC dc(this);
|
||||||
@@ -113,11 +113,11 @@ public:
|
|||||||
virtual void DoSetSize(int x, int y,
|
virtual void DoSetSize(int x, int y,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
int sizeFlags = wxSIZE_AUTO) {
|
int sizeFlags = wxSIZE_AUTO) {
|
||||||
if (x != -1) {
|
if (x != wxDefaultCoord) {
|
||||||
m_cx = x;
|
m_cx = x;
|
||||||
GetParent()->ClientToScreen(&x, NULL);
|
GetParent()->ClientToScreen(&x, NULL);
|
||||||
}
|
}
|
||||||
if (y != -1) {
|
if (y != wxDefaultCoord) {
|
||||||
m_cy = y;
|
m_cy = y;
|
||||||
GetParent()->ClientToScreen(NULL, &y);
|
GetParent()->ClientToScreen(NULL, &y);
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ void ScintillaWX::StartDrag() {
|
|||||||
wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
|
wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
|
||||||
evt.SetEventObject(stc);
|
evt.SetEventObject(stc);
|
||||||
evt.SetDragText(dragText);
|
evt.SetDragText(dragText);
|
||||||
evt.SetDragAllowMove(TRUE);
|
evt.SetDragAllowMove(true);
|
||||||
evt.SetPosition(wxMin(stc->GetSelectionStart(),
|
evt.SetPosition(wxMin(stc->GetSelectionStart(),
|
||||||
stc->GetSelectionEnd()));
|
stc->GetSelectionEnd()));
|
||||||
stc->GetEventHandler()->ProcessEvent(evt);
|
stc->GetEventHandler()->ProcessEvent(evt);
|
||||||
@@ -234,11 +234,11 @@ void ScintillaWX::StartDrag() {
|
|||||||
wxDragResult result;
|
wxDragResult result;
|
||||||
|
|
||||||
source.SetData(data);
|
source.SetData(data);
|
||||||
dropWentOutside = TRUE;
|
dropWentOutside = true;
|
||||||
result = source.DoDragDrop(evt.GetDragAllowMove());
|
result = source.DoDragDrop(evt.GetDragAllowMove());
|
||||||
if (result == wxDragMove && dropWentOutside)
|
if (result == wxDragMove && dropWentOutside)
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
inDragDrop = FALSE;
|
inDragDrop = false;
|
||||||
SetDragPosition(invalidPosition);
|
SetDragPosition(invalidPosition);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -249,10 +249,10 @@ bool ScintillaWX::SetIdle(bool on) {
|
|||||||
if (idler.state != on) {
|
if (idler.state != on) {
|
||||||
// connect or disconnect the EVT_IDLE handler
|
// connect or disconnect the EVT_IDLE handler
|
||||||
if (on)
|
if (on)
|
||||||
stc->Connect(-1, wxEVT_IDLE,
|
stc->Connect(wxID_ANY, wxEVT_IDLE,
|
||||||
(wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
|
(wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
|
||||||
else
|
else
|
||||||
stc->Disconnect(-1, wxEVT_IDLE,
|
stc->Disconnect(wxID_ANY, wxEVT_IDLE,
|
||||||
(wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
|
(wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
|
||||||
idler.state = on;
|
idler.state = on;
|
||||||
}
|
}
|
||||||
@@ -425,10 +425,10 @@ void ScintillaWX::Paste() {
|
|||||||
ClearSelection();
|
ClearSelection();
|
||||||
|
|
||||||
wxTextDataObject data;
|
wxTextDataObject data;
|
||||||
bool gotData = FALSE;
|
bool gotData = false;
|
||||||
|
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
gotData = wxTheClipboard->GetData(data);
|
gotData = wxTheClipboard->GetData(data);
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
@@ -449,7 +449,7 @@ void ScintillaWX::Paste() {
|
|||||||
|
|
||||||
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len));
|
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len));
|
||||||
wxTheClipboard->SetData(new wxTextDataObject(text));
|
wxTheClipboard->SetData(new wxTextDataObject(text));
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
@@ -458,7 +458,7 @@ void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
|||||||
|
|
||||||
|
|
||||||
bool ScintillaWX::CanPaste() {
|
bool ScintillaWX::CanPaste() {
|
||||||
bool canPaste = FALSE;
|
bool canPaste = false;
|
||||||
bool didOpen;
|
bool didOpen;
|
||||||
|
|
||||||
if (Editor::CanPaste()) {
|
if (Editor::CanPaste()) {
|
||||||
@@ -467,7 +467,7 @@ bool ScintillaWX::CanPaste() {
|
|||||||
wxTheClipboard->Open();
|
wxTheClipboard->Open();
|
||||||
|
|
||||||
if (wxTheClipboard->IsOpened()) {
|
if (wxTheClipboard->IsOpened()) {
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
|
canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
|
||||||
if (didOpen)
|
if (didOpen)
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
@@ -508,10 +508,10 @@ void ScintillaWX::ClaimSelection() {
|
|||||||
SelectionText st;
|
SelectionText st;
|
||||||
CopySelectionRange(&st);
|
CopySelectionRange(&st);
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(TRUE);
|
wxTheClipboard->UsePrimarySelection(true);
|
||||||
wxString text = stc2wx(st.s, st.len);
|
wxString text = stc2wx(st.s, st.len);
|
||||||
wxTheClipboard->SetData(new wxTextDataObject(text));
|
wxTheClipboard->SetData(new wxTextDataObject(text));
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -679,9 +679,6 @@ void ScintillaWX::DoMouseWheel(int rotation, int delta,
|
|||||||
|
|
||||||
|
|
||||||
void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) {
|
void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) {
|
||||||
// PRectangle rcClient(0,0,width,height);
|
|
||||||
// SetScrollBarsTo(rcClient);
|
|
||||||
// DropGraphics();
|
|
||||||
ChangeSize();
|
ChangeSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,11 +719,11 @@ void ScintillaWX::DoMiddleButtonUp(Point pt) {
|
|||||||
|
|
||||||
pdoc->BeginUndoAction();
|
pdoc->BeginUndoAction();
|
||||||
wxTextDataObject data;
|
wxTextDataObject data;
|
||||||
bool gotData = FALSE;
|
bool gotData = false;
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(TRUE);
|
wxTheClipboard->UsePrimarySelection(true);
|
||||||
gotData = wxTheClipboard->GetData(data);
|
gotData = wxTheClipboard->GetData(data);
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
if (gotData) {
|
if (gotData) {
|
||||||
@@ -876,10 +873,10 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
|||||||
DropAt(evt.GetPosition(),
|
DropAt(evt.GetPosition(),
|
||||||
wx2stc(evt.GetDragText()),
|
wx2stc(evt.GetDragText()),
|
||||||
dragResult == wxDragMove,
|
dragResult == wxDragMove,
|
||||||
FALSE); // TODO: rectangular?
|
false); // TODO: rectangular?
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
|||||||
EVT_SYS_COLOUR_CHANGED (wxStyledTextCtrl::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED (wxStyledTextCtrl::OnSysColourChanged)
|
||||||
EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground)
|
EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground)
|
||||||
EVT_MENU_RANGE (10, 16, wxStyledTextCtrl::OnMenu)
|
EVT_MENU_RANGE (10, 16, wxStyledTextCtrl::OnMenu)
|
||||||
EVT_LISTBOX_DCLICK (-1, wxStyledTextCtrl::OnListBox)
|
EVT_LISTBOX_DCLICK (wxID_ANY, wxStyledTextCtrl::OnListBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent,
|
|||||||
#endif
|
#endif
|
||||||
m_swx = new ScintillaWX(this);
|
m_swx = new ScintillaWX(this);
|
||||||
m_stopWatch.Start();
|
m_stopWatch.Start();
|
||||||
m_lastKeyDownConsumed = FALSE;
|
m_lastKeyDownConsumed = false;
|
||||||
m_vScrollBar = NULL;
|
m_vScrollBar = NULL;
|
||||||
m_hScrollBar = NULL;
|
m_hScrollBar = NULL;
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
@@ -2566,7 +2566,7 @@ bool wxStyledTextCtrl::SaveFile(const wxString& filename)
|
|||||||
wxFile file(filename, wxFile::write);
|
wxFile file(filename, wxFile::write);
|
||||||
|
|
||||||
if (!file.IsOpened())
|
if (!file.IsOpened())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
bool success = file.Write(GetText(), *wxConvCurrent);
|
bool success = file.Write(GetText(), *wxConvCurrent);
|
||||||
|
|
||||||
@@ -2584,7 +2584,7 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
if (file.IsOpened())
|
if (file.IsOpened())
|
||||||
{
|
{
|
||||||
wxString contents;
|
wxString contents;
|
||||||
off_t len = file.Length();
|
size_t len = file.Length();
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
@@ -2982,7 +2982,7 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
|||||||
m_listType = 0;
|
m_listType = 0;
|
||||||
m_x = 0;
|
m_x = 0;
|
||||||
m_y = 0;
|
m_y = 0;
|
||||||
m_dragAllowMove = FALSE;
|
m_dragAllowMove = false;
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
m_dragResult = wxDragNone;
|
m_dragResult = wxDragNone;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -3077,31 +3077,31 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
||||||
|
|
||||||
#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -100,8 +100,8 @@ BEGIN_EVENT_TABLE (Edit, wxStyledTextCtrl)
|
|||||||
EVT_MENU (myID_CONVERTCRLF, Edit::OnConvertEOL)
|
EVT_MENU (myID_CONVERTCRLF, Edit::OnConvertEOL)
|
||||||
EVT_MENU (myID_CONVERTLF, Edit::OnConvertEOL)
|
EVT_MENU (myID_CONVERTLF, Edit::OnConvertEOL)
|
||||||
// stc
|
// stc
|
||||||
EVT_STC_MARGINCLICK (-1, Edit::OnMarginClick)
|
EVT_STC_MARGINCLICK (wxID_ANY, Edit::OnMarginClick)
|
||||||
EVT_STC_CHARADDED (-1, Edit::OnCharAdded)
|
EVT_STC_CHARADDED (wxID_ANY, Edit::OnCharAdded)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
Edit::Edit (wxWindow *parent, wxWindowID id,
|
Edit::Edit (wxWindow *parent, wxWindowID id,
|
||||||
@@ -595,7 +595,7 @@ bool Edit::Modified () {
|
|||||||
|
|
||||||
EditProperties::EditProperties (Edit *edit,
|
EditProperties::EditProperties (Edit *edit,
|
||||||
long style)
|
long style)
|
||||||
: wxDialog (edit, -1, wxEmptyString,
|
: wxDialog (edit, wxID_ANY, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
||||||
|
|
||||||
@@ -606,24 +606,24 @@ EditProperties::EditProperties (Edit *edit,
|
|||||||
// fullname
|
// fullname
|
||||||
wxBoxSizer *fullname = new wxBoxSizer (wxHORIZONTAL);
|
wxBoxSizer *fullname = new wxBoxSizer (wxHORIZONTAL);
|
||||||
fullname->Add (10, 0);
|
fullname->Add (10, 0);
|
||||||
fullname->Add (new wxStaticText (this, -1, _("Full filename"),
|
fullname->Add (new wxStaticText (this, wxID_ANY, _("Full filename"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
|
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);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
|
||||||
|
|
||||||
// text info
|
// text info
|
||||||
wxGridSizer *textinfo = new wxGridSizer (4, 0, 2);
|
wxGridSizer *textinfo = new wxGridSizer (4, 0, 2);
|
||||||
textinfo->Add (new wxStaticText (this, -1, _("Language"),
|
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Language"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
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);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
textinfo->Add (new wxStaticText (this, -1, _("Lexer-ID: "),
|
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetLexer());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
wxString EOLtype = _T("");
|
wxString EOLtype = _T("");
|
||||||
switch (edit->GetEOLMode()) {
|
switch (edit->GetEOLMode()) {
|
||||||
@@ -631,49 +631,49 @@ EditProperties::EditProperties (Edit *edit,
|
|||||||
case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; }
|
case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; }
|
||||||
case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; }
|
case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; }
|
||||||
}
|
}
|
||||||
textinfo->Add (new wxStaticText (this, -1, _("Line endings"),
|
textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
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);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
|
|
||||||
// text info box
|
// text info box
|
||||||
wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
|
wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
|
||||||
new wxStaticBox (this, -1, _("Informations")),
|
new wxStaticBox (this, wxID_ANY, _("Informations")),
|
||||||
wxVERTICAL);
|
wxVERTICAL);
|
||||||
textinfos->Add (textinfo, 0, wxEXPAND);
|
textinfos->Add (textinfo, 0, wxEXPAND);
|
||||||
textinfos->Add (0, 6);
|
textinfos->Add (0, 6);
|
||||||
|
|
||||||
// statistic
|
// statistic
|
||||||
wxGridSizer *statistic = new wxGridSizer (4, 0, 2);
|
wxGridSizer *statistic = new wxGridSizer (4, 0, 2);
|
||||||
statistic->Add (new wxStaticText (this, -1, _("Total lines"),
|
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetLineCount());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
statistic->Add (new wxStaticText (this, -1, _("Total chars"),
|
statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetTextLength());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
statistic->Add (new wxStaticText (this, -1, _("Current line"),
|
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetCurrentLine());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
statistic->Add (new wxStaticText (this, -1, _("Current pos"),
|
statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"),
|
||||||
wxDefaultPosition, wxSize(80, -1)),
|
wxDefaultPosition, wxSize(80, wxDefaultCoord)),
|
||||||
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
|
||||||
text = wxString::Format (_T("%d"), edit->GetCurrentPos());
|
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);
|
0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
|
||||||
|
|
||||||
// char/line statistics
|
// char/line statistics
|
||||||
wxStaticBoxSizer *statistics = new wxStaticBoxSizer (
|
wxStaticBoxSizer *statistics = new wxStaticBoxSizer (
|
||||||
new wxStaticBox (this, -1, _("Statistics")),
|
new wxStaticBox (this, wxID_ANY, _("Statistics")),
|
||||||
wxVERTICAL);
|
wxVERTICAL);
|
||||||
statistics->Add (statistic, 0, wxEXPAND);
|
statistics->Add (statistic, 0, wxEXPAND);
|
||||||
statistics->Add (0, 6);
|
statistics->Add (0, 6);
|
||||||
|
@@ -45,7 +45,7 @@ class Edit: public wxStyledTextCtrl {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! constructor
|
//! constructor
|
||||||
Edit (wxWindow *parent, wxWindowID id = -1,
|
Edit (wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||||
const wxPoint &pos = wxDefaultPosition,
|
const wxPoint &pos = wxDefaultPosition,
|
||||||
const wxSize &size = wxDefaultSize,
|
const wxSize &size = wxDefaultSize,
|
||||||
long style = wxSUNKEN_BORDER|wxVSCROLL
|
long style = wxSUNKEN_BORDER|wxVSCROLL
|
||||||
|
@@ -289,7 +289,7 @@ BEGIN_EVENT_TABLE (AppFrame, wxFrame)
|
|||||||
END_EVENT_TABLE ()
|
END_EVENT_TABLE ()
|
||||||
|
|
||||||
AppFrame::AppFrame (const wxString &title)
|
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) {
|
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) {
|
||||||
|
|
||||||
// intitialize important variables
|
// intitialize important variables
|
||||||
@@ -308,7 +308,7 @@ AppFrame::AppFrame (const wxString &title)
|
|||||||
CreateMenu ();
|
CreateMenu ();
|
||||||
|
|
||||||
// open first page
|
// open first page
|
||||||
m_edit = new Edit (this, -1);
|
m_edit = new Edit (this, wxID_ANY);
|
||||||
m_edit->SetFocus();
|
m_edit->SetFocus();
|
||||||
|
|
||||||
FileOpen (_T("stctest.cpp"));
|
FileOpen (_T("stctest.cpp"));
|
||||||
@@ -586,7 +586,7 @@ END_EVENT_TABLE ()
|
|||||||
AppAbout::AppAbout (wxWindow *parent,
|
AppAbout::AppAbout (wxWindow *parent,
|
||||||
int milliseconds,
|
int milliseconds,
|
||||||
long style)
|
long style)
|
||||||
: wxDialog (parent, -1, wxEmptyString,
|
: wxDialog (parent, wxID_ANY, wxEmptyString,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
|
||||||
|
|
||||||
@@ -602,27 +602,27 @@ AppAbout::AppAbout (wxWindow *parent,
|
|||||||
|
|
||||||
// about info
|
// about info
|
||||||
wxGridSizer *aboutinfo = new wxGridSizer (2, 0, 2);
|
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);
|
0, wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, APP_MAINT),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_MAINT),
|
||||||
1, wxEXPAND | wxALIGN_LEFT);
|
1, wxEXPAND | wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, _("Version: ")),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Version: ")),
|
||||||
0, wxALIGN_LEFT);
|
0, wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, APP_VERSION),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_VERSION),
|
||||||
1, wxEXPAND | wxALIGN_LEFT);
|
1, wxEXPAND | wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, _("Licence type: ")),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Licence type: ")),
|
||||||
0, wxALIGN_LEFT);
|
0, wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, APP_LICENCE),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_LICENCE),
|
||||||
1, wxEXPAND | wxALIGN_LEFT);
|
1, wxEXPAND | wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, _("Copyright: ")),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Copyright: ")),
|
||||||
0, wxALIGN_LEFT);
|
0, wxALIGN_LEFT);
|
||||||
aboutinfo->Add (new wxStaticText(this, -1, APP_COPYRIGTH),
|
aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_COPYRIGTH),
|
||||||
1, wxEXPAND | wxALIGN_LEFT);
|
1, wxEXPAND | wxALIGN_LEFT);
|
||||||
|
|
||||||
// about icontitle//info
|
// about icontitle//info
|
||||||
wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
|
wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
|
||||||
wxBitmap bitmap = wxBitmap(wxICON (mondrian));
|
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);
|
0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 20);
|
||||||
aboutpane->Add (aboutinfo, 1, wxEXPAND);
|
aboutpane->Add (aboutinfo, 1, wxEXPAND);
|
||||||
aboutpane->Add (60, 0);
|
aboutpane->Add (60, 0);
|
||||||
@@ -630,12 +630,12 @@ AppAbout::AppAbout (wxWindow *parent,
|
|||||||
// about complete
|
// about complete
|
||||||
wxBoxSizer *totalpane = new wxBoxSizer (wxVERTICAL);
|
wxBoxSizer *totalpane = new wxBoxSizer (wxVERTICAL);
|
||||||
totalpane->Add (0, 20);
|
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));
|
appname->SetFont (wxFont (24, wxDEFAULT, wxNORMAL, wxBOLD));
|
||||||
totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
|
totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
|
||||||
totalpane->Add (0, 10);
|
totalpane->Add (0, 10);
|
||||||
totalpane->Add (aboutpane, 0, wxEXPAND | wxALL, 4);
|
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);
|
0, wxALIGN_CENTER | wxALL, 10);
|
||||||
wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
|
wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
|
||||||
okButton->SetDefault();
|
okButton->SetDefault();
|
||||||
|
@@ -574,7 +574,7 @@ Window::~Window() {
|
|||||||
|
|
||||||
void Window::Destroy() {
|
void Window::Destroy() {
|
||||||
if (id) {
|
if (id) {
|
||||||
Show(FALSE);
|
Show(false);
|
||||||
GETWIN(id)->Destroy();
|
GETWIN(id)->Destroy();
|
||||||
}
|
}
|
||||||
id = 0;
|
id = 0;
|
||||||
@@ -767,7 +767,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
if ( !wxPendingDelete.Member(this) )
|
if ( !wxPendingDelete.Member(this) )
|
||||||
wxPendingDelete.Append(this);
|
wxPendingDelete.Append(this);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -818,7 +818,7 @@ private:
|
|||||||
BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxWindow)
|
BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxWindow)
|
||||||
EVT_SET_FOCUS ( wxSTCListBoxWin::OnFocus)
|
EVT_SET_FOCUS ( wxSTCListBoxWin::OnFocus)
|
||||||
EVT_SIZE ( wxSTCListBoxWin::OnSize)
|
EVT_SIZE ( wxSTCListBoxWin::OnSize)
|
||||||
EVT_LIST_ITEM_ACTIVATED(-1, wxSTCListBoxWin::OnActivate)
|
EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSTCListBoxWin::OnActivate)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@@ -981,10 +981,10 @@ int ListBoxImpl::Length() {
|
|||||||
|
|
||||||
|
|
||||||
void ListBoxImpl::Select(int n) {
|
void ListBoxImpl::Select(int n) {
|
||||||
bool select = TRUE;
|
bool select = true;
|
||||||
if (n == -1) {
|
if (n == -1) {
|
||||||
n = 0;
|
n = 0;
|
||||||
select = FALSE;
|
select = false;
|
||||||
}
|
}
|
||||||
GETLB(id)->Focus(n);
|
GETLB(id)->Focus(n);
|
||||||
GETLB(id)->Select(n, select);
|
GETLB(id)->Select(n, select);
|
||||||
@@ -998,7 +998,7 @@ int ListBoxImpl::GetSelection() {
|
|||||||
|
|
||||||
int ListBoxImpl::Find(const char *WXUNUSED(prefix)) {
|
int ListBoxImpl::Find(const char *WXUNUSED(prefix)) {
|
||||||
// No longer used
|
// No longer used
|
||||||
return -1;
|
return wxNOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1019,7 +1019,7 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) {
|
|||||||
|
|
||||||
if (! imgList) {
|
if (! imgList) {
|
||||||
// assumes all images are the same size
|
// assumes all images are the same size
|
||||||
imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), TRUE);
|
imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), true);
|
||||||
imgTypeMap = new wxArrayInt;
|
imgTypeMap = new wxArrayInt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1121,7 +1121,7 @@ unsigned int Platform::DoubleClickTime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Platform::MouseButtonBounce() {
|
bool Platform::MouseButtonBounce() {
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
void Platform::DebugDisplay(const char *s) {
|
void Platform::DebugDisplay(const char *s) {
|
||||||
wxLogDebug(stc2wx(s));
|
wxLogDebug(stc2wx(s));
|
||||||
|
@@ -73,7 +73,7 @@ class wxSTCCallTip : public wxSTCCallTipBase {
|
|||||||
public:
|
public:
|
||||||
wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx)
|
wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx)
|
||||||
: wxSTCCallTipBase(parent, param2),
|
: wxSTCCallTipBase(parent, param2),
|
||||||
m_ct(ct), m_swx(swx), m_cx(-1), m_cy(-1)
|
m_ct(ct), m_swx(swx), m_cx(wxDefaultCoord), m_cy(wxDefaultCoord)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AcceptsFocus() const { return FALSE; }
|
bool AcceptsFocus() const { return false; }
|
||||||
|
|
||||||
void OnPaint(wxPaintEvent& WXUNUSED(evt)) {
|
void OnPaint(wxPaintEvent& WXUNUSED(evt)) {
|
||||||
wxBufferedPaintDC dc(this);
|
wxBufferedPaintDC dc(this);
|
||||||
@@ -113,11 +113,11 @@ public:
|
|||||||
virtual void DoSetSize(int x, int y,
|
virtual void DoSetSize(int x, int y,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
int sizeFlags = wxSIZE_AUTO) {
|
int sizeFlags = wxSIZE_AUTO) {
|
||||||
if (x != -1) {
|
if (x != wxDefaultCoord) {
|
||||||
m_cx = x;
|
m_cx = x;
|
||||||
GetParent()->ClientToScreen(&x, NULL);
|
GetParent()->ClientToScreen(&x, NULL);
|
||||||
}
|
}
|
||||||
if (y != -1) {
|
if (y != wxDefaultCoord) {
|
||||||
m_cy = y;
|
m_cy = y;
|
||||||
GetParent()->ClientToScreen(NULL, &y);
|
GetParent()->ClientToScreen(NULL, &y);
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ void ScintillaWX::StartDrag() {
|
|||||||
wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
|
wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
|
||||||
evt.SetEventObject(stc);
|
evt.SetEventObject(stc);
|
||||||
evt.SetDragText(dragText);
|
evt.SetDragText(dragText);
|
||||||
evt.SetDragAllowMove(TRUE);
|
evt.SetDragAllowMove(true);
|
||||||
evt.SetPosition(wxMin(stc->GetSelectionStart(),
|
evt.SetPosition(wxMin(stc->GetSelectionStart(),
|
||||||
stc->GetSelectionEnd()));
|
stc->GetSelectionEnd()));
|
||||||
stc->GetEventHandler()->ProcessEvent(evt);
|
stc->GetEventHandler()->ProcessEvent(evt);
|
||||||
@@ -234,11 +234,11 @@ void ScintillaWX::StartDrag() {
|
|||||||
wxDragResult result;
|
wxDragResult result;
|
||||||
|
|
||||||
source.SetData(data);
|
source.SetData(data);
|
||||||
dropWentOutside = TRUE;
|
dropWentOutside = true;
|
||||||
result = source.DoDragDrop(evt.GetDragAllowMove());
|
result = source.DoDragDrop(evt.GetDragAllowMove());
|
||||||
if (result == wxDragMove && dropWentOutside)
|
if (result == wxDragMove && dropWentOutside)
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
inDragDrop = FALSE;
|
inDragDrop = false;
|
||||||
SetDragPosition(invalidPosition);
|
SetDragPosition(invalidPosition);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -249,10 +249,10 @@ bool ScintillaWX::SetIdle(bool on) {
|
|||||||
if (idler.state != on) {
|
if (idler.state != on) {
|
||||||
// connect or disconnect the EVT_IDLE handler
|
// connect or disconnect the EVT_IDLE handler
|
||||||
if (on)
|
if (on)
|
||||||
stc->Connect(-1, wxEVT_IDLE,
|
stc->Connect(wxID_ANY, wxEVT_IDLE,
|
||||||
(wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
|
(wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
|
||||||
else
|
else
|
||||||
stc->Disconnect(-1, wxEVT_IDLE,
|
stc->Disconnect(wxID_ANY, wxEVT_IDLE,
|
||||||
(wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
|
(wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
|
||||||
idler.state = on;
|
idler.state = on;
|
||||||
}
|
}
|
||||||
@@ -425,10 +425,10 @@ void ScintillaWX::Paste() {
|
|||||||
ClearSelection();
|
ClearSelection();
|
||||||
|
|
||||||
wxTextDataObject data;
|
wxTextDataObject data;
|
||||||
bool gotData = FALSE;
|
bool gotData = false;
|
||||||
|
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
gotData = wxTheClipboard->GetData(data);
|
gotData = wxTheClipboard->GetData(data);
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
@@ -449,7 +449,7 @@ void ScintillaWX::Paste() {
|
|||||||
|
|
||||||
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len));
|
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len));
|
||||||
wxTheClipboard->SetData(new wxTextDataObject(text));
|
wxTheClipboard->SetData(new wxTextDataObject(text));
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
@@ -458,7 +458,7 @@ void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
|||||||
|
|
||||||
|
|
||||||
bool ScintillaWX::CanPaste() {
|
bool ScintillaWX::CanPaste() {
|
||||||
bool canPaste = FALSE;
|
bool canPaste = false;
|
||||||
bool didOpen;
|
bool didOpen;
|
||||||
|
|
||||||
if (Editor::CanPaste()) {
|
if (Editor::CanPaste()) {
|
||||||
@@ -467,7 +467,7 @@ bool ScintillaWX::CanPaste() {
|
|||||||
wxTheClipboard->Open();
|
wxTheClipboard->Open();
|
||||||
|
|
||||||
if (wxTheClipboard->IsOpened()) {
|
if (wxTheClipboard->IsOpened()) {
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
|
canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
|
||||||
if (didOpen)
|
if (didOpen)
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
@@ -508,10 +508,10 @@ void ScintillaWX::ClaimSelection() {
|
|||||||
SelectionText st;
|
SelectionText st;
|
||||||
CopySelectionRange(&st);
|
CopySelectionRange(&st);
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(TRUE);
|
wxTheClipboard->UsePrimarySelection(true);
|
||||||
wxString text = stc2wx(st.s, st.len);
|
wxString text = stc2wx(st.s, st.len);
|
||||||
wxTheClipboard->SetData(new wxTextDataObject(text));
|
wxTheClipboard->SetData(new wxTextDataObject(text));
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -679,9 +679,6 @@ void ScintillaWX::DoMouseWheel(int rotation, int delta,
|
|||||||
|
|
||||||
|
|
||||||
void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) {
|
void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) {
|
||||||
// PRectangle rcClient(0,0,width,height);
|
|
||||||
// SetScrollBarsTo(rcClient);
|
|
||||||
// DropGraphics();
|
|
||||||
ChangeSize();
|
ChangeSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,11 +719,11 @@ void ScintillaWX::DoMiddleButtonUp(Point pt) {
|
|||||||
|
|
||||||
pdoc->BeginUndoAction();
|
pdoc->BeginUndoAction();
|
||||||
wxTextDataObject data;
|
wxTextDataObject data;
|
||||||
bool gotData = FALSE;
|
bool gotData = false;
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxTheClipboard->UsePrimarySelection(TRUE);
|
wxTheClipboard->UsePrimarySelection(true);
|
||||||
gotData = wxTheClipboard->GetData(data);
|
gotData = wxTheClipboard->GetData(data);
|
||||||
wxTheClipboard->UsePrimarySelection(FALSE);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
if (gotData) {
|
if (gotData) {
|
||||||
@@ -876,10 +873,10 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
|||||||
DropAt(evt.GetPosition(),
|
DropAt(evt.GetPosition(),
|
||||||
wx2stc(evt.GetDragText()),
|
wx2stc(evt.GetDragText()),
|
||||||
dragResult == wxDragMove,
|
dragResult == wxDragMove,
|
||||||
FALSE); // TODO: rectangular?
|
false); // TODO: rectangular?
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -120,7 +120,7 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
|||||||
EVT_SYS_COLOUR_CHANGED (wxStyledTextCtrl::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED (wxStyledTextCtrl::OnSysColourChanged)
|
||||||
EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground)
|
EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground)
|
||||||
EVT_MENU_RANGE (10, 16, wxStyledTextCtrl::OnMenu)
|
EVT_MENU_RANGE (10, 16, wxStyledTextCtrl::OnMenu)
|
||||||
EVT_LISTBOX_DCLICK (-1, wxStyledTextCtrl::OnListBox)
|
EVT_LISTBOX_DCLICK (wxID_ANY, wxStyledTextCtrl::OnListBox)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent,
|
|||||||
#endif
|
#endif
|
||||||
m_swx = new ScintillaWX(this);
|
m_swx = new ScintillaWX(this);
|
||||||
m_stopWatch.Start();
|
m_stopWatch.Start();
|
||||||
m_lastKeyDownConsumed = FALSE;
|
m_lastKeyDownConsumed = false;
|
||||||
m_vScrollBar = NULL;
|
m_vScrollBar = NULL;
|
||||||
m_hScrollBar = NULL;
|
m_hScrollBar = NULL;
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
@@ -2566,7 +2566,7 @@ bool wxStyledTextCtrl::SaveFile(const wxString& filename)
|
|||||||
wxFile file(filename, wxFile::write);
|
wxFile file(filename, wxFile::write);
|
||||||
|
|
||||||
if (!file.IsOpened())
|
if (!file.IsOpened())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
bool success = file.Write(GetText(), *wxConvCurrent);
|
bool success = file.Write(GetText(), *wxConvCurrent);
|
||||||
|
|
||||||
@@ -2584,7 +2584,7 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
if (file.IsOpened())
|
if (file.IsOpened())
|
||||||
{
|
{
|
||||||
wxString contents;
|
wxString contents;
|
||||||
off_t len = file.Length();
|
size_t len = file.Length();
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
@@ -2982,7 +2982,7 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
|
|||||||
m_listType = 0;
|
m_listType = 0;
|
||||||
m_x = 0;
|
m_x = 0;
|
||||||
m_y = 0;
|
m_y = 0;
|
||||||
m_dragAllowMove = FALSE;
|
m_dragAllowMove = false;
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
m_dragResult = wxDragNone;
|
m_dragResult = wxDragNone;
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user