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:
@@ -1457,7 +1457,7 @@ public:
|
|||||||
const wxSize& size = wxDefaultSize, long style = 0,
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
const wxString& name = wxPySTCNameStr);
|
const wxString& name = wxPySTCNameStr);
|
||||||
%name(PreStyledTextCtrl) wxStyledTextCtrl();
|
%name(PreStyledTextCtrl) wxStyledTextCtrl();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
|
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
@@ -1465,7 +1465,7 @@ public:
|
|||||||
const wxString& name = wxSTCNameStr);
|
const wxString& name = wxSTCNameStr);
|
||||||
wxStyledTextCtrl() { m_swx = NULL; }
|
wxStyledTextCtrl() { m_swx = NULL; }
|
||||||
~wxStyledTextCtrl();
|
~wxStyledTextCtrl();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Create(wxWindow *parent, wxWindowID id=wxID_ANY,
|
void Create(wxWindow *parent, wxWindowID id=wxID_ANY,
|
||||||
@@ -1969,7 +1969,7 @@ public:
|
|||||||
int startPos,
|
int startPos,
|
||||||
int endPos,
|
int endPos,
|
||||||
wxDC* draw,
|
wxDC* draw,
|
||||||
wxDC* target,
|
wxDC* target,
|
||||||
wxRect renderRect,
|
wxRect renderRect,
|
||||||
wxRect pageRect);
|
wxRect pageRect);
|
||||||
|
|
||||||
@@ -2850,7 +2850,7 @@ public:
|
|||||||
|
|
||||||
#ifdef STC_USE_DND
|
#ifdef STC_USE_DND
|
||||||
// Allow for simulating a DnD DragOver
|
// Allow for simulating a DnD DragOver
|
||||||
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
|
|
||||||
// Allow for simulating a DnD DropText
|
// Allow for simulating a DnD DropText
|
||||||
bool DoDropText(long x, long y, const wxString& data);
|
bool DoDropText(long x, long y, const wxString& data);
|
||||||
@@ -2863,7 +2863,7 @@ public:
|
|||||||
|
|
||||||
// Returns the current UseAntiAliasing setting.
|
// Returns the current UseAntiAliasing setting.
|
||||||
bool GetUseAntiAliasing();
|
bool GetUseAntiAliasing();
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -2891,7 +2891,7 @@ private:
|
|||||||
void OnMenu(wxCommandEvent& evt);
|
void OnMenu(wxCommandEvent& evt);
|
||||||
void OnListBox(wxCommandEvent& evt);
|
void OnListBox(wxCommandEvent& evt);
|
||||||
void OnIdle(wxIdleEvent& evt);
|
void OnIdle(wxIdleEvent& evt);
|
||||||
|
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
// Turn notifications from Scintilla into events
|
// Turn notifications from Scintilla into events
|
||||||
@@ -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,
|
||||||
@@ -532,9 +532,9 @@ bool Edit::LoadFile (const wxString &filename) {
|
|||||||
// InsertText (0, buf);
|
// InsertText (0, buf);
|
||||||
// }
|
// }
|
||||||
// file.Close();
|
// file.Close();
|
||||||
|
|
||||||
wxStyledTextCtrl::LoadFile(m_filename);
|
wxStyledTextCtrl::LoadFile(m_filename);
|
||||||
|
|
||||||
EmptyUndoBuffer();
|
EmptyUndoBuffer();
|
||||||
|
|
||||||
// determine lexer language
|
// determine lexer language
|
||||||
@@ -580,7 +580,7 @@ bool Edit::SaveFile (const wxString &filename) {
|
|||||||
// return true;
|
// return true;
|
||||||
|
|
||||||
return wxStyledTextCtrl::SaveFile(filename);
|
return wxStyledTextCtrl::SaveFile(filename);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Edit::Modified () {
|
bool Edit::Modified () {
|
||||||
@@ -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;
|
||||||
@@ -684,7 +684,7 @@ public:
|
|||||||
: wxListView(parent, id, pos, size, style)
|
: wxListView(parent, id, pos, size, style)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void OnFocus(wxFocusEvent& event) {
|
void OnFocus(wxFocusEvent& event) {
|
||||||
GetParent()->SetFocus();
|
GetParent()->SetFocus();
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@@ -693,7 +693,7 @@ public:
|
|||||||
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
|
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
|
||||||
// Do nothing. Prevents base class from resetting the colors...
|
// Do nothing. Prevents base class from resetting the colors...
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// For some reason I don't understand yet the focus doesn't really leave
|
// For some reason I don't understand yet the focus doesn't really leave
|
||||||
// the listbox like it should, so if we get any events feed them back to
|
// the listbox like it should, so if we get any events feed them back to
|
||||||
@@ -708,9 +708,9 @@ public:
|
|||||||
// And we need to force the focus back when being destroyed
|
// And we need to force the focus back when being destroyed
|
||||||
~wxSTCListBox() {
|
~wxSTCListBox() {
|
||||||
GetGrandParent()->SetFocus();
|
GetGrandParent()->SetFocus();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -751,7 +751,7 @@ public:
|
|||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// On OSX and (possibly others) there can still be pending
|
// On OSX and (possibly others) there can still be pending
|
||||||
// messages/events for the list control when Scintilla wants to
|
// messages/events for the list control when Scintilla wants to
|
||||||
// close it, so do a pending delete of it instead of destroying
|
// close it, so do a pending delete of it instead of destroying
|
||||||
@@ -767,10 +767,10 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
if ( !wxPendingDelete.Member(this) )
|
if ( !wxPendingDelete.Member(this) )
|
||||||
wxPendingDelete.Append(this);
|
wxPendingDelete.Append(this);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int IconWidth() {
|
int IconWidth() {
|
||||||
wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL);
|
wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL);
|
||||||
if (il != NULL) {
|
if (il != NULL) {
|
||||||
@@ -816,9 +816,9 @@ 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));
|
||||||
@@ -1183,31 +1183,31 @@ void Platform::DebugPrintf(const char *format, ...) {
|
|||||||
static bool assertionPopUps = true;
|
static bool assertionPopUps = true;
|
||||||
|
|
||||||
bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
|
bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
|
||||||
bool ret = assertionPopUps;
|
bool ret = assertionPopUps;
|
||||||
assertionPopUps = assertionPopUps_;
|
assertionPopUps = assertionPopUps_;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform::Assert(const char *c, const char *file, int line) {
|
void Platform::Assert(const char *c, const char *file, int line) {
|
||||||
char buffer[2000];
|
char buffer[2000];
|
||||||
sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
|
sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
|
||||||
if (assertionPopUps) {
|
if (assertionPopUps) {
|
||||||
/*int idButton = */
|
/*int idButton = */
|
||||||
wxMessageBox(stc2wx(buffer),
|
wxMessageBox(stc2wx(buffer),
|
||||||
wxT("Assertion failure"),
|
wxT("Assertion failure"),
|
||||||
wxICON_HAND | wxOK);
|
wxICON_HAND | wxOK);
|
||||||
// if (idButton == IDRETRY) {
|
// if (idButton == IDRETRY) {
|
||||||
// ::DebugBreak();
|
// ::DebugBreak();
|
||||||
// } else if (idButton == IDIGNORE) {
|
// } else if (idButton == IDIGNORE) {
|
||||||
// // all OK
|
// // all OK
|
||||||
// } else {
|
// } else {
|
||||||
// abort();
|
// abort();
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
strcat(buffer, "\r\n");
|
strcat(buffer, "\r\n");
|
||||||
Platform::DebugDisplay(buffer);
|
Platform::DebugDisplay(buffer);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ public:
|
|||||||
wxPoint GetMyPosition() {
|
wxPoint GetMyPosition() {
|
||||||
return wxPoint(m_cx, m_cy);
|
return wxPoint(m_cx, m_cy);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CallTip* m_ct;
|
CallTip* m_ct;
|
||||||
ScintillaWX* m_swx;
|
ScintillaWX* m_swx;
|
||||||
@@ -148,27 +148,27 @@ END_EVENT_TABLE()
|
|||||||
static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
||||||
{
|
{
|
||||||
wxTextFileType type;
|
wxTextFileType type;
|
||||||
|
|
||||||
switch (scintillaMode) {
|
switch (scintillaMode) {
|
||||||
case wxSTC_EOL_CRLF:
|
case wxSTC_EOL_CRLF:
|
||||||
type = wxTextFileType_Dos;
|
type = wxTextFileType_Dos;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxSTC_EOL_CR:
|
case wxSTC_EOL_CR:
|
||||||
type = wxTextFileType_Mac;
|
type = wxTextFileType_Mac;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxSTC_EOL_LF:
|
case wxSTC_EOL_LF:
|
||||||
type = wxTextFileType_Unix;
|
type = wxTextFileType_Unix;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
type = wxTextBuffer::typeDefault;
|
type = wxTextBuffer::typeDefault;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Constructor/Destructor
|
// Constructor/Destructor
|
||||||
@@ -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
|
||||||
@@ -248,18 +248,18 @@ void ScintillaWX::StartDrag() {
|
|||||||
bool ScintillaWX::SetIdle(bool on) {
|
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;
|
||||||
}
|
}
|
||||||
return idler.state;
|
return idler.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScintillaWX::SetTicking(bool on) {
|
void ScintillaWX::SetTicking(bool on) {
|
||||||
wxSTCTimer* steTimer;
|
wxSTCTimer* steTimer;
|
||||||
if (timer.ticking != on) {
|
if (timer.ticking != 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -561,7 +561,7 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SCI_LEXER
|
#ifdef SCI_LEXER
|
||||||
case SCI_LOADLEXERLIBRARY:
|
case SCI_LOADLEXERLIBRARY:
|
||||||
LexerManager::GetInstance()->Load((const char*)lParam);
|
LexerManager::GetInstance()->Load((const char*)lParam);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@@ -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) {
|
||||||
@@ -819,7 +816,7 @@ int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool WXUNU
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int rv = KeyDown(key, shift, ctrl, alt, consumed);
|
int rv = KeyDown(key, shift, ctrl, alt, consumed);
|
||||||
|
|
||||||
if (key)
|
if (key)
|
||||||
@@ -843,7 +840,7 @@ void ScintillaWX::DoOnListBox() {
|
|||||||
AutoCompleteCompleted();
|
AutoCompleteCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
|
void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
|
||||||
|
|
||||||
if ( Idle() )
|
if ( Idle() )
|
||||||
@@ -851,7 +848,7 @@ void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
|
|||||||
else
|
else
|
||||||
SetIdle(false);
|
SetIdle(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
@@ -860,7 +857,7 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
|||||||
|
|
||||||
wxString text = wxTextBuffer::Translate(data,
|
wxString text = wxTextBuffer::Translate(data,
|
||||||
wxConvertEOLMode(pdoc->eolMode));
|
wxConvertEOLMode(pdoc->eolMode));
|
||||||
|
|
||||||
// Send an event to allow the drag details to be changed
|
// Send an event to allow the drag details to be changed
|
||||||
wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
|
wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
|
||||||
evt.SetEventObject(stc);
|
evt.SetEventObject(stc);
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -960,6 +957,6 @@ void ScintillaWX::SetUseAntiAliasing(bool useAA) {
|
|||||||
bool ScintillaWX::GetUseAntiAliasing() {
|
bool ScintillaWX::GetUseAntiAliasing() {
|
||||||
return vs.extraFontFlag;
|
return vs.extraFontFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@@ -144,7 +144,7 @@ public:
|
|||||||
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool meta, bool* consumed);
|
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool meta, bool* consumed);
|
||||||
void DoTick() { Tick(); }
|
void DoTick() { Tick(); }
|
||||||
void DoOnIdle(wxIdleEvent& evt);
|
void DoOnIdle(wxIdleEvent& evt);
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool DoDropText(long x, long y, const wxString& data);
|
bool DoDropText(long x, long y, const wxString& data);
|
||||||
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
|
@@ -54,7 +54,7 @@ static wxColour wxColourFromLong(long c) {
|
|||||||
static wxColour wxColourFromSpec(const wxString& spec) {
|
static wxColour wxColourFromSpec(const wxString& spec) {
|
||||||
// spec should be a colour name or "#RRGGBB"
|
// spec should be a colour name or "#RRGGBB"
|
||||||
if (spec.GetChar(0) == wxT('#')) {
|
if (spec.GetChar(0) == wxT('#')) {
|
||||||
|
|
||||||
long red, green, blue;
|
long red, green, blue;
|
||||||
red = green = blue = 0;
|
red = green = blue = 0;
|
||||||
spec.Mid(1,2).ToLong(&red, 16);
|
spec.Mid(1,2).ToLong(&red, 16);
|
||||||
@@ -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
|
||||||
@@ -497,7 +497,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2049, markerNumber, (long)buff);
|
SendMsg(2049, markerNumber, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a margin to be either numeric or symbolic.
|
// Set a margin to be either numeric or symbolic.
|
||||||
@@ -881,7 +881,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2405, type, (long)buff);
|
SendMsg(2405, type, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all the registered images.
|
// Clear all the registered images.
|
||||||
@@ -1056,7 +1056,7 @@ int wxStyledTextCtrl::FindText(int minPos, int maxPos,
|
|||||||
int startPos,
|
int startPos,
|
||||||
int endPos,
|
int endPos,
|
||||||
wxDC* draw,
|
wxDC* draw,
|
||||||
wxDC* target,
|
wxDC* target,
|
||||||
wxRect renderRect,
|
wxRect renderRect,
|
||||||
wxRect pageRect) {
|
wxRect pageRect) {
|
||||||
RangeToFormat fr;
|
RangeToFormat fr;
|
||||||
@@ -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,13 +2584,13 @@ 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
|
||||||
wxMemoryBuffer buffer(len+1);
|
wxMemoryBuffer buffer(len+1);
|
||||||
success = (file.Read(buffer.GetData(), len) == len);
|
success = (file.Read(buffer.GetData(), len) == len);
|
||||||
if (success) {
|
if (success) {
|
||||||
((char*)buffer.GetData())[len] = 0;
|
((char*)buffer.GetData())[len] = 0;
|
||||||
contents = wxString(buffer, *wxConvCurrent, len);
|
contents = wxString(buffer, *wxConvCurrent, len);
|
||||||
}
|
}
|
||||||
@@ -2601,7 +2601,7 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
success = true; // empty file is ok
|
success = true; // empty file is ok
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
@@ -2616,12 +2616,12 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
|
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
||||||
return m_swx->DoDragOver(x, y, def);
|
return m_swx->DoDragOver(x, y, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) {
|
bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) {
|
||||||
return m_swx->DoDropText(x, y, data);
|
return m_swx->DoDropText(x, y, data);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -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
|
||||||
|
@@ -1457,7 +1457,7 @@ public:
|
|||||||
const wxSize& size = wxDefaultSize, long style = 0,
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
const wxString& name = wxPySTCNameStr);
|
const wxString& name = wxPySTCNameStr);
|
||||||
%name(PreStyledTextCtrl) wxStyledTextCtrl();
|
%name(PreStyledTextCtrl) wxStyledTextCtrl();
|
||||||
|
|
||||||
#else
|
#else
|
||||||
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
|
wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
@@ -1465,7 +1465,7 @@ public:
|
|||||||
const wxString& name = wxSTCNameStr);
|
const wxString& name = wxSTCNameStr);
|
||||||
wxStyledTextCtrl() { m_swx = NULL; }
|
wxStyledTextCtrl() { m_swx = NULL; }
|
||||||
~wxStyledTextCtrl();
|
~wxStyledTextCtrl();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Create(wxWindow *parent, wxWindowID id=wxID_ANY,
|
void Create(wxWindow *parent, wxWindowID id=wxID_ANY,
|
||||||
@@ -1969,7 +1969,7 @@ public:
|
|||||||
int startPos,
|
int startPos,
|
||||||
int endPos,
|
int endPos,
|
||||||
wxDC* draw,
|
wxDC* draw,
|
||||||
wxDC* target,
|
wxDC* target,
|
||||||
wxRect renderRect,
|
wxRect renderRect,
|
||||||
wxRect pageRect);
|
wxRect pageRect);
|
||||||
|
|
||||||
@@ -2850,7 +2850,7 @@ public:
|
|||||||
|
|
||||||
#ifdef STC_USE_DND
|
#ifdef STC_USE_DND
|
||||||
// Allow for simulating a DnD DragOver
|
// Allow for simulating a DnD DragOver
|
||||||
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult DoDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
|
|
||||||
// Allow for simulating a DnD DropText
|
// Allow for simulating a DnD DropText
|
||||||
bool DoDropText(long x, long y, const wxString& data);
|
bool DoDropText(long x, long y, const wxString& data);
|
||||||
@@ -2863,7 +2863,7 @@ public:
|
|||||||
|
|
||||||
// Returns the current UseAntiAliasing setting.
|
// Returns the current UseAntiAliasing setting.
|
||||||
bool GetUseAntiAliasing();
|
bool GetUseAntiAliasing();
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -2891,7 +2891,7 @@ private:
|
|||||||
void OnMenu(wxCommandEvent& evt);
|
void OnMenu(wxCommandEvent& evt);
|
||||||
void OnListBox(wxCommandEvent& evt);
|
void OnListBox(wxCommandEvent& evt);
|
||||||
void OnIdle(wxIdleEvent& evt);
|
void OnIdle(wxIdleEvent& evt);
|
||||||
|
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
// Turn notifications from Scintilla into events
|
// Turn notifications from Scintilla into events
|
||||||
@@ -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,
|
||||||
@@ -532,9 +532,9 @@ bool Edit::LoadFile (const wxString &filename) {
|
|||||||
// InsertText (0, buf);
|
// InsertText (0, buf);
|
||||||
// }
|
// }
|
||||||
// file.Close();
|
// file.Close();
|
||||||
|
|
||||||
wxStyledTextCtrl::LoadFile(m_filename);
|
wxStyledTextCtrl::LoadFile(m_filename);
|
||||||
|
|
||||||
EmptyUndoBuffer();
|
EmptyUndoBuffer();
|
||||||
|
|
||||||
// determine lexer language
|
// determine lexer language
|
||||||
@@ -580,7 +580,7 @@ bool Edit::SaveFile (const wxString &filename) {
|
|||||||
// return true;
|
// return true;
|
||||||
|
|
||||||
return wxStyledTextCtrl::SaveFile(filename);
|
return wxStyledTextCtrl::SaveFile(filename);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Edit::Modified () {
|
bool Edit::Modified () {
|
||||||
@@ -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;
|
||||||
@@ -684,7 +684,7 @@ public:
|
|||||||
: wxListView(parent, id, pos, size, style)
|
: wxListView(parent, id, pos, size, style)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void OnFocus(wxFocusEvent& event) {
|
void OnFocus(wxFocusEvent& event) {
|
||||||
GetParent()->SetFocus();
|
GetParent()->SetFocus();
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@@ -693,7 +693,7 @@ public:
|
|||||||
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
|
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
|
||||||
// Do nothing. Prevents base class from resetting the colors...
|
// Do nothing. Prevents base class from resetting the colors...
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// For some reason I don't understand yet the focus doesn't really leave
|
// For some reason I don't understand yet the focus doesn't really leave
|
||||||
// the listbox like it should, so if we get any events feed them back to
|
// the listbox like it should, so if we get any events feed them back to
|
||||||
@@ -708,9 +708,9 @@ public:
|
|||||||
// And we need to force the focus back when being destroyed
|
// And we need to force the focus back when being destroyed
|
||||||
~wxSTCListBox() {
|
~wxSTCListBox() {
|
||||||
GetGrandParent()->SetFocus();
|
GetGrandParent()->SetFocus();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -751,7 +751,7 @@ public:
|
|||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// On OSX and (possibly others) there can still be pending
|
// On OSX and (possibly others) there can still be pending
|
||||||
// messages/events for the list control when Scintilla wants to
|
// messages/events for the list control when Scintilla wants to
|
||||||
// close it, so do a pending delete of it instead of destroying
|
// close it, so do a pending delete of it instead of destroying
|
||||||
@@ -767,10 +767,10 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
if ( !wxPendingDelete.Member(this) )
|
if ( !wxPendingDelete.Member(this) )
|
||||||
wxPendingDelete.Append(this);
|
wxPendingDelete.Append(this);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int IconWidth() {
|
int IconWidth() {
|
||||||
wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL);
|
wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL);
|
||||||
if (il != NULL) {
|
if (il != NULL) {
|
||||||
@@ -816,9 +816,9 @@ 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));
|
||||||
@@ -1183,31 +1183,31 @@ void Platform::DebugPrintf(const char *format, ...) {
|
|||||||
static bool assertionPopUps = true;
|
static bool assertionPopUps = true;
|
||||||
|
|
||||||
bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
|
bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
|
||||||
bool ret = assertionPopUps;
|
bool ret = assertionPopUps;
|
||||||
assertionPopUps = assertionPopUps_;
|
assertionPopUps = assertionPopUps_;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform::Assert(const char *c, const char *file, int line) {
|
void Platform::Assert(const char *c, const char *file, int line) {
|
||||||
char buffer[2000];
|
char buffer[2000];
|
||||||
sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
|
sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
|
||||||
if (assertionPopUps) {
|
if (assertionPopUps) {
|
||||||
/*int idButton = */
|
/*int idButton = */
|
||||||
wxMessageBox(stc2wx(buffer),
|
wxMessageBox(stc2wx(buffer),
|
||||||
wxT("Assertion failure"),
|
wxT("Assertion failure"),
|
||||||
wxICON_HAND | wxOK);
|
wxICON_HAND | wxOK);
|
||||||
// if (idButton == IDRETRY) {
|
// if (idButton == IDRETRY) {
|
||||||
// ::DebugBreak();
|
// ::DebugBreak();
|
||||||
// } else if (idButton == IDIGNORE) {
|
// } else if (idButton == IDIGNORE) {
|
||||||
// // all OK
|
// // all OK
|
||||||
// } else {
|
// } else {
|
||||||
// abort();
|
// abort();
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
strcat(buffer, "\r\n");
|
strcat(buffer, "\r\n");
|
||||||
Platform::DebugDisplay(buffer);
|
Platform::DebugDisplay(buffer);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ public:
|
|||||||
wxPoint GetMyPosition() {
|
wxPoint GetMyPosition() {
|
||||||
return wxPoint(m_cx, m_cy);
|
return wxPoint(m_cx, m_cy);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CallTip* m_ct;
|
CallTip* m_ct;
|
||||||
ScintillaWX* m_swx;
|
ScintillaWX* m_swx;
|
||||||
@@ -148,27 +148,27 @@ END_EVENT_TABLE()
|
|||||||
static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
static wxTextFileType wxConvertEOLMode(int scintillaMode)
|
||||||
{
|
{
|
||||||
wxTextFileType type;
|
wxTextFileType type;
|
||||||
|
|
||||||
switch (scintillaMode) {
|
switch (scintillaMode) {
|
||||||
case wxSTC_EOL_CRLF:
|
case wxSTC_EOL_CRLF:
|
||||||
type = wxTextFileType_Dos;
|
type = wxTextFileType_Dos;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxSTC_EOL_CR:
|
case wxSTC_EOL_CR:
|
||||||
type = wxTextFileType_Mac;
|
type = wxTextFileType_Mac;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxSTC_EOL_LF:
|
case wxSTC_EOL_LF:
|
||||||
type = wxTextFileType_Unix;
|
type = wxTextFileType_Unix;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
type = wxTextBuffer::typeDefault;
|
type = wxTextBuffer::typeDefault;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// Constructor/Destructor
|
// Constructor/Destructor
|
||||||
@@ -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
|
||||||
@@ -248,18 +248,18 @@ void ScintillaWX::StartDrag() {
|
|||||||
bool ScintillaWX::SetIdle(bool on) {
|
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;
|
||||||
}
|
}
|
||||||
return idler.state;
|
return idler.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScintillaWX::SetTicking(bool on) {
|
void ScintillaWX::SetTicking(bool on) {
|
||||||
wxSTCTimer* steTimer;
|
wxSTCTimer* steTimer;
|
||||||
if (timer.ticking != on) {
|
if (timer.ticking != 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -561,7 +561,7 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SCI_LEXER
|
#ifdef SCI_LEXER
|
||||||
case SCI_LOADLEXERLIBRARY:
|
case SCI_LOADLEXERLIBRARY:
|
||||||
LexerManager::GetInstance()->Load((const char*)lParam);
|
LexerManager::GetInstance()->Load((const char*)lParam);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@@ -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) {
|
||||||
@@ -819,7 +816,7 @@ int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool WXUNU
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int rv = KeyDown(key, shift, ctrl, alt, consumed);
|
int rv = KeyDown(key, shift, ctrl, alt, consumed);
|
||||||
|
|
||||||
if (key)
|
if (key)
|
||||||
@@ -843,7 +840,7 @@ void ScintillaWX::DoOnListBox() {
|
|||||||
AutoCompleteCompleted();
|
AutoCompleteCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
|
void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
|
||||||
|
|
||||||
if ( Idle() )
|
if ( Idle() )
|
||||||
@@ -851,7 +848,7 @@ void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
|
|||||||
else
|
else
|
||||||
SetIdle(false);
|
SetIdle(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
@@ -860,7 +857,7 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
|
|||||||
|
|
||||||
wxString text = wxTextBuffer::Translate(data,
|
wxString text = wxTextBuffer::Translate(data,
|
||||||
wxConvertEOLMode(pdoc->eolMode));
|
wxConvertEOLMode(pdoc->eolMode));
|
||||||
|
|
||||||
// Send an event to allow the drag details to be changed
|
// Send an event to allow the drag details to be changed
|
||||||
wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
|
wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
|
||||||
evt.SetEventObject(stc);
|
evt.SetEventObject(stc);
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -960,6 +957,6 @@ void ScintillaWX::SetUseAntiAliasing(bool useAA) {
|
|||||||
bool ScintillaWX::GetUseAntiAliasing() {
|
bool ScintillaWX::GetUseAntiAliasing() {
|
||||||
return vs.extraFontFlag;
|
return vs.extraFontFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@@ -144,7 +144,7 @@ public:
|
|||||||
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool meta, bool* consumed);
|
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool meta, bool* consumed);
|
||||||
void DoTick() { Tick(); }
|
void DoTick() { Tick(); }
|
||||||
void DoOnIdle(wxIdleEvent& evt);
|
void DoOnIdle(wxIdleEvent& evt);
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
bool DoDropText(long x, long y, const wxString& data);
|
bool DoDropText(long x, long y, const wxString& data);
|
||||||
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
|
wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
|
||||||
|
@@ -54,7 +54,7 @@ static wxColour wxColourFromLong(long c) {
|
|||||||
static wxColour wxColourFromSpec(const wxString& spec) {
|
static wxColour wxColourFromSpec(const wxString& spec) {
|
||||||
// spec should be a colour name or "#RRGGBB"
|
// spec should be a colour name or "#RRGGBB"
|
||||||
if (spec.GetChar(0) == wxT('#')) {
|
if (spec.GetChar(0) == wxT('#')) {
|
||||||
|
|
||||||
long red, green, blue;
|
long red, green, blue;
|
||||||
red = green = blue = 0;
|
red = green = blue = 0;
|
||||||
spec.Mid(1,2).ToLong(&red, 16);
|
spec.Mid(1,2).ToLong(&red, 16);
|
||||||
@@ -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
|
||||||
@@ -497,7 +497,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2049, markerNumber, (long)buff);
|
SendMsg(2049, markerNumber, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a margin to be either numeric or symbolic.
|
// Set a margin to be either numeric or symbolic.
|
||||||
@@ -881,7 +881,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
|
|||||||
buff[len] = 0;
|
buff[len] = 0;
|
||||||
SendMsg(2405, type, (long)buff);
|
SendMsg(2405, type, (long)buff);
|
||||||
delete [] buff;
|
delete [] buff;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all the registered images.
|
// Clear all the registered images.
|
||||||
@@ -1056,7 +1056,7 @@ int wxStyledTextCtrl::FindText(int minPos, int maxPos,
|
|||||||
int startPos,
|
int startPos,
|
||||||
int endPos,
|
int endPos,
|
||||||
wxDC* draw,
|
wxDC* draw,
|
||||||
wxDC* target,
|
wxDC* target,
|
||||||
wxRect renderRect,
|
wxRect renderRect,
|
||||||
wxRect pageRect) {
|
wxRect pageRect) {
|
||||||
RangeToFormat fr;
|
RangeToFormat fr;
|
||||||
@@ -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,13 +2584,13 @@ 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
|
||||||
wxMemoryBuffer buffer(len+1);
|
wxMemoryBuffer buffer(len+1);
|
||||||
success = (file.Read(buffer.GetData(), len) == len);
|
success = (file.Read(buffer.GetData(), len) == len);
|
||||||
if (success) {
|
if (success) {
|
||||||
((char*)buffer.GetData())[len] = 0;
|
((char*)buffer.GetData())[len] = 0;
|
||||||
contents = wxString(buffer, *wxConvCurrent, len);
|
contents = wxString(buffer, *wxConvCurrent, len);
|
||||||
}
|
}
|
||||||
@@ -2601,7 +2601,7 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
success = true; // empty file is ok
|
success = true; // empty file is ok
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
@@ -2616,12 +2616,12 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
|
|||||||
|
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
||||||
return m_swx->DoDragOver(x, y, def);
|
return m_swx->DoDragOver(x, y, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) {
|
bool wxStyledTextCtrl::DoDropText(long x, long y, const wxString& data) {
|
||||||
return m_swx->DoDropText(x, y, data);
|
return m_swx->DoDropText(x, y, data);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -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