]> git.saurik.com Git - wxWidgets.git/commitdiff
Source cleaning: whitespaces, tabs, TRUE/true, FALSE/false, -1/wxID_ANY/wxDefaultCoor...
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 28 Sep 2004 15:13:27 +0000 (15:13 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 28 Sep 2004 15:13:27 +0000 (15:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

16 files changed:
contrib/include/wx/stc/stc.h
contrib/samples/stc/edit.cpp
contrib/samples/stc/edit.h
contrib/samples/stc/stctest.cpp
contrib/src/stc/PlatWX.cpp
contrib/src/stc/ScintillaWX.cpp
contrib/src/stc/ScintillaWX.h
contrib/src/stc/stc.cpp
include/wx/stc/stc.h
samples/stc/edit.cpp
samples/stc/edit.h
samples/stc/stctest.cpp
src/stc/PlatWX.cpp
src/stc/ScintillaWX.cpp
src/stc/ScintillaWX.h
src/stc/stc.cpp

index e8f6a9cbbfe137d8abcfb24cbb3dd857ec7290e2..fd5ce0637a974a2d846cc3386ec76eac9527c6e7 100644 (file)
@@ -1457,7 +1457,7 @@ public:
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxPySTCNameStr);
     %name(PreStyledTextCtrl) wxStyledTextCtrl();
-    
+
 #else
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
                      const wxPoint& pos = wxDefaultPosition,
@@ -1465,7 +1465,7 @@ public:
                      const wxString& name = wxSTCNameStr);
     wxStyledTextCtrl() { m_swx = NULL; }
     ~wxStyledTextCtrl();
-    
+
 #endif
 
     void Create(wxWindow *parent, wxWindowID id=wxID_ANY,
@@ -1969,7 +1969,7 @@ public:
                int    startPos,
                int    endPos,
                wxDC*  draw,
-               wxDC*  target, 
+               wxDC*  target,
                wxRect renderRect,
                wxRect pageRect);
 
@@ -2850,7 +2850,7 @@ public:
 
 #ifdef STC_USE_DND
     // 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
     bool DoDropText(long x, long y, const wxString& data);
@@ -2863,7 +2863,7 @@ public:
 
     // Returns the current UseAntiAliasing setting.
     bool GetUseAntiAliasing();
-    
+
 
 //----------------------------------------------------------------------
 
@@ -2891,7 +2891,7 @@ private:
     void OnMenu(wxCommandEvent& evt);
     void OnListBox(wxCommandEvent& evt);
     void OnIdle(wxIdleEvent& evt);
-    
+
     virtual wxSize DoGetBestSize() const;
 
     // Turn notifications from Scintilla into events
@@ -3077,31 +3077,31 @@ END_DECLARE_EVENT_TYPES()
 #ifndef SWIG
 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_STYLENEEDED(id, fn)        DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED,           id, -1, (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_SAVEPOINTREACHED(id, fn)   DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED,      id, -1, (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_ROMODIFYATTEMPT(id, fn)    DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT,       id, -1, (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_DOUBLECLICK(id, fn)        DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK,           id, -1, (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_MODIFIED(id, fn)           DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED,              id, -1, (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_MARGINCLICK(id, fn)        DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK,           id, -1, (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_PAINTED(id, fn)            DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED,               id, -1, (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_URIDROPPED(id, fn)         DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED,            id, -1, (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_DWELLEND(id, fn)           DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND,              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, -1, (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_DO_DROP(id, fn)            DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP,               id, -1, (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_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_DCLICK(id, fn)     DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK,        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, -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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, 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, 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, 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, wxID_ANY, (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, 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, 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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction)  wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
 
 #endif
 
index 5a233bf158afe09db556ee27a603a224fb011f16..c9f53d0d843efea96a8bf5beebcc0ab20ee9396d 100644 (file)
@@ -100,8 +100,8 @@ BEGIN_EVENT_TABLE (Edit, wxStyledTextCtrl)
     EVT_MENU (myID_CONVERTCRLF,        Edit::OnConvertEOL)
     EVT_MENU (myID_CONVERTLF,          Edit::OnConvertEOL)
     // stc
-    EVT_STC_MARGINCLICK (-1,           Edit::OnMarginClick)
-    EVT_STC_CHARADDED (-1,             Edit::OnCharAdded)
+    EVT_STC_MARGINCLICK (wxID_ANY,     Edit::OnMarginClick)
+    EVT_STC_CHARADDED (wxID_ANY,       Edit::OnCharAdded)
 END_EVENT_TABLE()
 
 Edit::Edit (wxWindow *parent, wxWindowID id,
@@ -532,9 +532,9 @@ bool Edit::LoadFile (const wxString &filename) {
 //         InsertText (0, buf);
 //     }
 //     file.Close();
-    
+
     wxStyledTextCtrl::LoadFile(m_filename);
-    
+
     EmptyUndoBuffer();
 
     // determine lexer language
@@ -580,7 +580,7 @@ bool Edit::SaveFile (const wxString &filename) {
 //     return true;
 
     return wxStyledTextCtrl::SaveFile(filename);
-    
+
 }
 
 bool Edit::Modified () {
@@ -595,7 +595,7 @@ bool Edit::Modified () {
 
 EditProperties::EditProperties (Edit *edit,
                                 long style)
-        : wxDialog (edit, -1, wxEmptyString,
+        : wxDialog (edit, wxID_ANY, wxEmptyString,
                     wxDefaultPosition, wxDefaultSize,
                     style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
 
@@ -606,24 +606,24 @@ EditProperties::EditProperties (Edit *edit,
     // fullname
     wxBoxSizer *fullname = new wxBoxSizer (wxHORIZONTAL);
     fullname->Add (10, 0);
-    fullname->Add (new wxStaticText (this, -1, _("Full filename"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    fullname->Add (new wxStaticText (this, wxID_ANY, _("Full filename"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
-    fullname->Add (new wxStaticText (this, -1, edit->GetFilename()),
+    fullname->Add (new wxStaticText (this, wxID_ANY, edit->GetFilename()),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
 
     // text info
     wxGridSizer *textinfo = new wxGridSizer (4, 0, 2);
-    textinfo->Add (new wxStaticText (this, -1, _("Language"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, _("Language"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
-    textinfo->Add (new wxStaticText (this, -1, edit->m_language->name),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, edit->m_language->name),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
-    textinfo->Add (new wxStaticText (this, -1, _("Lexer-ID: "),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetLexer());
-    textinfo->Add (new wxStaticText (this, -1, text),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, text),
                    0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
     wxString EOLtype = _T("");
     switch (edit->GetEOLMode()) {
@@ -631,49 +631,49 @@ EditProperties::EditProperties (Edit *edit,
         case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; }
         case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; }
     }
-    textinfo->Add (new wxStaticText (this, -1, _("Line endings"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
-    textinfo->Add (new wxStaticText (this, -1, EOLtype),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, EOLtype),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
 
     // text info box
     wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
-                     new wxStaticBox (this, -1, _("Informations")),
+                     new wxStaticBox (this, wxID_ANY, _("Informations")),
                      wxVERTICAL);
     textinfos->Add (textinfo, 0, wxEXPAND);
     textinfos->Add (0, 6);
 
     // statistic
     wxGridSizer *statistic = new wxGridSizer (4, 0, 2);
-    statistic->Add (new wxStaticText (this, -1, _("Total lines"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetLineCount());
-    statistic->Add (new wxStaticText (this, -1, text),
+    statistic->Add (new wxStaticText (this, wxID_ANY, text),
                     0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
-    statistic->Add (new wxStaticText (this, -1, _("Total chars"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetTextLength());
-    statistic->Add (new wxStaticText (this, -1, text),
+    statistic->Add (new wxStaticText (this, wxID_ANY, text),
                     0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
-    statistic->Add (new wxStaticText (this, -1, _("Current line"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetCurrentLine());
-    statistic->Add (new wxStaticText (this, -1, text),
+    statistic->Add (new wxStaticText (this, wxID_ANY, text),
                     0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
-    statistic->Add (new wxStaticText (this, -1, _("Current pos"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetCurrentPos());
-    statistic->Add (new wxStaticText (this, -1, text),
+    statistic->Add (new wxStaticText (this, wxID_ANY, text),
                     0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
 
     // char/line statistics
     wxStaticBoxSizer *statistics = new wxStaticBoxSizer (
-                     new wxStaticBox (this, -1, _("Statistics")),
+                     new wxStaticBox (this, wxID_ANY, _("Statistics")),
                      wxVERTICAL);
     statistics->Add (statistic, 0, wxEXPAND);
     statistics->Add (0, 6);
index 22d5c8cac37f5ebf0b369440bf54df0a4556797e..54034003ae9115571d4f0afdf61c4d7437a33150 100644 (file)
@@ -45,7 +45,7 @@ class Edit: public wxStyledTextCtrl {
 
 public:
     //! constructor
-    Edit (wxWindow *parent, wxWindowID id = -1,
+    Edit (wxWindow *parent, wxWindowID id = wxID_ANY,
           const wxPoint &pos = wxDefaultPosition,
           const wxSize &size = wxDefaultSize,
           long style = wxSUNKEN_BORDER|wxVSCROLL
index 636934d79ced5cbf5d77039ac7a473a3ebab8ae9..93711b1d1c0789585e9b13e20c10b7f70c906c0e 100644 (file)
@@ -289,7 +289,7 @@ BEGIN_EVENT_TABLE (AppFrame, wxFrame)
 END_EVENT_TABLE ()
 
 AppFrame::AppFrame (const wxString &title)
-        : wxFrame ((wxFrame *)NULL, -1, title, wxDefaultPosition, wxSize(750,550),
+        : wxFrame ((wxFrame *)NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750,550),
                     wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) {
 
     // intitialize important variables
@@ -308,7 +308,7 @@ AppFrame::AppFrame (const wxString &title)
     CreateMenu ();
 
     // open first page
-    m_edit = new Edit (this, -1);
+    m_edit = new Edit (this, wxID_ANY);
     m_edit->SetFocus();
 
     FileOpen (_T("stctest.cpp"));
@@ -586,7 +586,7 @@ END_EVENT_TABLE ()
 AppAbout::AppAbout (wxWindow *parent,
                     int milliseconds,
                     long style)
-        : wxDialog (parent, -1, wxEmptyString,
+        : wxDialog (parent, wxID_ANY, wxEmptyString,
                     wxDefaultPosition, wxDefaultSize,
                     style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
 
@@ -602,27 +602,27 @@ AppAbout::AppAbout (wxWindow *parent,
 
     // about info
     wxGridSizer *aboutinfo = new wxGridSizer (2, 0, 2);
-    aboutinfo->Add (new wxStaticText(this, -1, _("Written by: ")),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Written by: ")),
                     0, wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, APP_MAINT),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_MAINT),
                     1, wxEXPAND | wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, _("Version: ")),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Version: ")),
                     0, wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, APP_VERSION),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_VERSION),
                     1, wxEXPAND | wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, _("Licence type: ")),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Licence type: ")),
                     0, wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, APP_LICENCE),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_LICENCE),
                     1, wxEXPAND | wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, _("Copyright: ")),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Copyright: ")),
                     0, wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, APP_COPYRIGTH),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_COPYRIGTH),
                     1, wxEXPAND | wxALIGN_LEFT);
 
     // about icontitle//info
     wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
     wxBitmap bitmap = wxBitmap(wxICON (mondrian));
-    aboutpane->Add (new wxStaticBitmap (this, -1, bitmap),
+    aboutpane->Add (new wxStaticBitmap (this, wxID_ANY, bitmap),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 20);
     aboutpane->Add (aboutinfo, 1, wxEXPAND);
     aboutpane->Add (60, 0);
@@ -630,12 +630,12 @@ AppAbout::AppAbout (wxWindow *parent,
     // about complete
     wxBoxSizer *totalpane = new wxBoxSizer (wxVERTICAL);
     totalpane->Add (0, 20);
-    wxStaticText *appname = new wxStaticText(this, -1, *g_appname);
+    wxStaticText *appname = new wxStaticText(this, wxID_ANY, *g_appname);
     appname->SetFont (wxFont (24, wxDEFAULT, wxNORMAL, wxBOLD));
     totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
     totalpane->Add (0, 10);
     totalpane->Add (aboutpane, 0, wxEXPAND | wxALL, 4);
-    totalpane->Add (new wxStaticText(this, -1, APP_DESCR),
+    totalpane->Add (new wxStaticText(this, wxID_ANY, APP_DESCR),
                     0, wxALIGN_CENTER | wxALL, 10);
     wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
     okButton->SetDefault();
index b20f68fa34ca18f7c1315d2b886a0b18d5ae91f6..4b983f1cd6f27ca3fa90793f15680203f6ba68be 100644 (file)
@@ -574,7 +574,7 @@ Window::~Window() {
 
 void Window::Destroy() {
     if (id) {
-        Show(FALSE);
+        Show(false);
         GETWIN(id)->Destroy();
     }
     id = 0;
@@ -684,7 +684,7 @@ public:
         : wxListView(parent, id, pos, size, style)
     {}
 
-    
+
     void OnFocus(wxFocusEvent& event) {
         GetParent()->SetFocus();
         event.Skip();
@@ -693,7 +693,7 @@ public:
     void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
         // Do nothing.  Prevents base class from resetting the colors...
     }
-    
+
 #ifdef __WXMAC__
     // 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
@@ -708,9 +708,9 @@ public:
     // And we need to force the focus back when being destroyed
     ~wxSTCListBox() {
         GetGrandParent()->SetFocus();
-    }    
-#endif    
-    
+    }
+#endif
+
 private:
     DECLARE_EVENT_TABLE()
 };
@@ -751,7 +751,7 @@ public:
         Hide();
     }
 
-            
+
     // On OSX and (possibly others) there can still be pending
     // messages/events for the list control when Scintilla wants to
     // close it, so do a pending delete of it instead of destroying
@@ -767,10 +767,10 @@ public:
 #endif
         if ( !wxPendingDelete.Member(this) )
             wxPendingDelete.Append(this);
-        return TRUE;
+        return true;
     }
 
-    
+
     int IconWidth() {
         wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL);
         if (il != NULL) {
@@ -816,9 +816,9 @@ private:
 
 
 BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxWindow)
-    EVT_SET_FOCUS          (    wxSTCListBoxWin::OnFocus)
-    EVT_SIZE               (    wxSTCListBoxWin::OnSize)
-    EVT_LIST_ITEM_ACTIVATED(-1, wxSTCListBoxWin::OnActivate)
+    EVT_SET_FOCUS          (          wxSTCListBoxWin::OnFocus)
+    EVT_SIZE               (          wxSTCListBoxWin::OnSize)
+    EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSTCListBoxWin::OnActivate)
 END_EVENT_TABLE()
 
 
@@ -981,10 +981,10 @@ int ListBoxImpl::Length() {
 
 
 void ListBoxImpl::Select(int n) {
-    bool select = TRUE;
+    bool select = true;
     if (n == -1) {
         n = 0;
-        select = FALSE;
+        select = false;
     }
     GETLB(id)->Focus(n);
     GETLB(id)->Select(n, select);
@@ -998,7 +998,7 @@ int ListBoxImpl::GetSelection() {
 
 int ListBoxImpl::Find(const char *WXUNUSED(prefix)) {
     // No longer used
-    return -1;
+    return wxNOT_FOUND;
 }
 
 
@@ -1019,7 +1019,7 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) {
 
     if (! imgList) {
         // 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;
     }
 
@@ -1121,7 +1121,7 @@ unsigned int Platform::DoubleClickTime() {
 }
 
 bool Platform::MouseButtonBounce() {
-       return FALSE;
+    return false;
 }
 void Platform::DebugDisplay(const char *s) {
     wxLogDebug(stc2wx(s));
@@ -1183,31 +1183,31 @@ void Platform::DebugPrintf(const char *format, ...) {
 static bool assertionPopUps = true;
 
 bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
-       bool ret = assertionPopUps;
-       assertionPopUps = assertionPopUps_;
-       return ret;
+    bool ret = assertionPopUps;
+    assertionPopUps = assertionPopUps_;
+    return ret;
 }
 
 void Platform::Assert(const char *c, const char *file, int line) {
-       char buffer[2000];
-       sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
-       if (assertionPopUps) {
-            /*int idButton = */
-            wxMessageBox(stc2wx(buffer),
-                         wxT("Assertion failure"),
-                         wxICON_HAND | wxOK);
-//             if (idButton == IDRETRY) {
-//                     ::DebugBreak();
-//             } else if (idButton == IDIGNORE) {
-//                     // all OK
-//             } else {
-//                     abort();
-//             }
-       } else {
-               strcat(buffer, "\r\n");
-               Platform::DebugDisplay(buffer);
-               abort();
-       }
+    char buffer[2000];
+    sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
+    if (assertionPopUps) {
+        /*int idButton = */
+        wxMessageBox(stc2wx(buffer),
+                     wxT("Assertion failure"),
+                     wxICON_HAND | wxOK);
+//      if (idButton == IDRETRY) {
+//          ::DebugBreak();
+//      } else if (idButton == IDIGNORE) {
+//          // all OK
+//      } else {
+//          abort();
+//      }
+    } else {
+        strcat(buffer, "\r\n");
+        Platform::DebugDisplay(buffer);
+        abort();
+    }
 }
 
 
index 0e6d4c6874cb2195e13fac6fc3a7568e27a99a20..c12d3ff2691a4da890f9bc9885dd521d313b2add 100644 (file)
@@ -73,7 +73,7 @@ class wxSTCCallTip : public wxSTCCallTipBase {
 public:
     wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx)
         : 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
     }
 
-    bool AcceptsFocus() const { return FALSE; }
+    bool AcceptsFocus() const { return false; }
 
     void OnPaint(wxPaintEvent& WXUNUSED(evt)) {
         wxBufferedPaintDC dc(this);
@@ -113,11 +113,11 @@ public:
     virtual void DoSetSize(int x, int y,
                            int width, int height,
                            int sizeFlags = wxSIZE_AUTO) {
-        if (x != -1) {
+        if (x != wxDefaultCoord) {
             m_cx = x;
             GetParent()->ClientToScreen(&x, NULL);
         }
-        if (y != -1) {
+        if (y != wxDefaultCoord) {
             m_cy = y;
             GetParent()->ClientToScreen(NULL, &y);
         }
@@ -128,7 +128,7 @@ public:
     wxPoint GetMyPosition() {
         return wxPoint(m_cx, m_cy);
     }
-    
+
 private:
     CallTip*      m_ct;
     ScintillaWX*  m_swx;
@@ -148,27 +148,27 @@ END_EVENT_TABLE()
 static wxTextFileType wxConvertEOLMode(int scintillaMode)
 {
     wxTextFileType type;
-    
+
     switch (scintillaMode) {
         case wxSTC_EOL_CRLF:
             type = wxTextFileType_Dos;
             break;
-            
+
         case wxSTC_EOL_CR:
             type = wxTextFileType_Mac;
             break;
-                
+
         case wxSTC_EOL_LF:
             type = wxTextFileType_Unix;
             break;
-            
+
         default:
             type = wxTextBuffer::typeDefault;
             break;
     }
     return type;
 }
-    
+
 
 //----------------------------------------------------------------------
 // Constructor/Destructor
@@ -222,7 +222,7 @@ void ScintillaWX::StartDrag() {
     wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
     evt.SetEventObject(stc);
     evt.SetDragText(dragText);
-    evt.SetDragAllowMove(TRUE);
+    evt.SetDragAllowMove(true);
     evt.SetPosition(wxMin(stc->GetSelectionStart(),
                           stc->GetSelectionEnd()));
     stc->GetEventHandler()->ProcessEvent(evt);
@@ -234,11 +234,11 @@ void ScintillaWX::StartDrag() {
         wxDragResult        result;
 
         source.SetData(data);
-        dropWentOutside = TRUE;
+        dropWentOutside = true;
         result = source.DoDragDrop(evt.GetDragAllowMove());
         if (result == wxDragMove && dropWentOutside)
             ClearSelection();
-        inDragDrop = FALSE;
+        inDragDrop = false;
         SetDragPosition(invalidPosition);
     }
 #endif
@@ -248,18 +248,18 @@ void ScintillaWX::StartDrag() {
 bool ScintillaWX::SetIdle(bool on) {
     if (idler.state != on) {
         // connect or disconnect the EVT_IDLE handler
-        if (on) 
-            stc->Connect(-1, wxEVT_IDLE,
+        if (on)
+            stc->Connect(wxID_ANY, wxEVT_IDLE,
                          (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
         else
-            stc->Disconnect(-1, wxEVT_IDLE,
+            stc->Disconnect(wxID_ANY, wxEVT_IDLE,
                             (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
         idler.state = on;
     }
     return idler.state;
 }
 
-    
+
 void ScintillaWX::SetTicking(bool on) {
     wxSTCTimer* steTimer;
     if (timer.ticking != on) {
@@ -425,10 +425,10 @@ void ScintillaWX::Paste() {
     ClearSelection();
 
     wxTextDataObject data;
-    bool gotData = FALSE;
+    bool gotData = false;
 
     if (wxTheClipboard->Open()) {
-        wxTheClipboard->UsePrimarySelection(FALSE);
+        wxTheClipboard->UsePrimarySelection(false);
         gotData = wxTheClipboard->GetData(data);
         wxTheClipboard->Close();
     }
@@ -449,7 +449,7 @@ void ScintillaWX::Paste() {
 
 void ScintillaWX::CopyToClipboard(const SelectionText& st) {
     if (wxTheClipboard->Open()) {
-        wxTheClipboard->UsePrimarySelection(FALSE);
+        wxTheClipboard->UsePrimarySelection(false);
         wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len));
         wxTheClipboard->SetData(new wxTextDataObject(text));
         wxTheClipboard->Close();
@@ -458,7 +458,7 @@ void ScintillaWX::CopyToClipboard(const SelectionText& st) {
 
 
 bool ScintillaWX::CanPaste() {
-    bool canPaste = FALSE;
+    bool canPaste = false;
     bool didOpen;
 
     if (Editor::CanPaste()) {
@@ -467,7 +467,7 @@ bool ScintillaWX::CanPaste() {
             wxTheClipboard->Open();
 
         if (wxTheClipboard->IsOpened()) {
-            wxTheClipboard->UsePrimarySelection(FALSE);
+            wxTheClipboard->UsePrimarySelection(false);
             canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
             if (didOpen)
                 wxTheClipboard->Close();
@@ -508,10 +508,10 @@ void ScintillaWX::ClaimSelection() {
         SelectionText st;
         CopySelectionRange(&st);
         if (wxTheClipboard->Open()) {
-            wxTheClipboard->UsePrimarySelection(TRUE);
+            wxTheClipboard->UsePrimarySelection(true);
             wxString text = stc2wx(st.s, st.len);
             wxTheClipboard->SetData(new wxTextDataObject(text));
-            wxTheClipboard->UsePrimarySelection(FALSE);
+            wxTheClipboard->UsePrimarySelection(false);
             wxTheClipboard->Close();
         }
     }
@@ -561,7 +561,7 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar
       }
 
 #ifdef SCI_LEXER
-       case SCI_LOADLEXERLIBRARY:
+      case SCI_LOADLEXERLIBRARY:
             LexerManager::GetInstance()->Load((const char*)lParam);
             break;
 #endif
@@ -679,9 +679,6 @@ void ScintillaWX::DoMouseWheel(int rotation, int delta,
 
 
 void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) {
-//      PRectangle rcClient(0,0,width,height);
-//      SetScrollBarsTo(rcClient);
-//      DropGraphics();
     ChangeSize();
 }
 
@@ -722,11 +719,11 @@ void ScintillaWX::DoMiddleButtonUp(Point pt) {
 
     pdoc->BeginUndoAction();
     wxTextDataObject data;
-    bool gotData = FALSE;
+    bool gotData = false;
     if (wxTheClipboard->Open()) {
-        wxTheClipboard->UsePrimarySelection(TRUE);
+        wxTheClipboard->UsePrimarySelection(true);
         gotData = wxTheClipboard->GetData(data);
-        wxTheClipboard->UsePrimarySelection(FALSE);
+        wxTheClipboard->UsePrimarySelection(false);
         wxTheClipboard->Close();
     }
     if (gotData) {
@@ -819,7 +816,7 @@ int  ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool WXUNU
         }
     }
 #endif
-    
+
     int rv = KeyDown(key, shift, ctrl, alt, consumed);
 
     if (key)
@@ -843,7 +840,7 @@ void ScintillaWX::DoOnListBox() {
     AutoCompleteCompleted();
 }
 
+
 void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
 
     if ( Idle() )
@@ -851,7 +848,7 @@ void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
     else
         SetIdle(false);
 }
+
 //----------------------------------------------------------------------
 
 #if wxUSE_DRAG_AND_DROP
@@ -860,7 +857,7 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
 
     wxString text = wxTextBuffer::Translate(data,
                                             wxConvertEOLMode(pdoc->eolMode));
-    
+
     // Send an event to allow the drag details to be changed
     wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
     evt.SetEventObject(stc);
@@ -876,10 +873,10 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
         DropAt(evt.GetPosition(),
                wx2stc(evt.GetDragText()),
                dragResult == wxDragMove,
-               FALSE); // TODO: rectangular?
-        return TRUE;
+               false); // TODO: rectangular?
+        return true;
     }
-    return FALSE;
+    return false;
 }
 
 
@@ -960,6 +957,6 @@ void ScintillaWX::SetUseAntiAliasing(bool useAA) {
 bool ScintillaWX::GetUseAntiAliasing() {
     return vs.extraFontFlag;
 }
+
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
index d5a0127b7c87f39708fa9b1b32d92773dd82d8a6..a902db5ed64ffcd317152ec79bf71feea6ae4410 100644 (file)
@@ -144,7 +144,7 @@ public:
     int  DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool meta, bool* consumed);
     void DoTick() { Tick(); }
     void DoOnIdle(wxIdleEvent& evt);
-    
+
 #if wxUSE_DRAG_AND_DROP
     bool DoDropText(long x, long y, const wxString& data);
     wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
index 57ba993f8f47f8e570387233bb4ce5b77dce8ece..e0e4260914bb4a6edd3876cf4c63acc31e0fa4dd 100644 (file)
@@ -54,7 +54,7 @@ static wxColour wxColourFromLong(long c) {
 static wxColour wxColourFromSpec(const wxString& spec) {
     // spec should be a colour name or "#RRGGBB"
     if (spec.GetChar(0) == wxT('#')) {
-        
+
         long red, green, blue;
         red = green = blue = 0;
         spec.Mid(1,2).ToLong(&red,   16);
@@ -120,7 +120,7 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
     EVT_SYS_COLOUR_CHANGED      (wxStyledTextCtrl::OnSysColourChanged)
     EVT_ERASE_BACKGROUND        (wxStyledTextCtrl::OnEraseBackground)
     EVT_MENU_RANGE              (10, 16, wxStyledTextCtrl::OnMenu)
-    EVT_LISTBOX_DCLICK          (-1, wxStyledTextCtrl::OnListBox)
+    EVT_LISTBOX_DCLICK          (wxID_ANY, wxStyledTextCtrl::OnListBox)
 END_EVENT_TABLE()
 
 
@@ -166,7 +166,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent,
 #endif
     m_swx = new ScintillaWX(this);
     m_stopWatch.Start();
-    m_lastKeyDownConsumed = FALSE;
+    m_lastKeyDownConsumed = false;
     m_vScrollBar = NULL;
     m_hScrollBar = NULL;
 #if wxUSE_UNICODE
@@ -497,7 +497,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
         buff[len] = 0;
         SendMsg(2049, markerNumber, (long)buff);
         delete [] buff;
-        
+
 }
 
 // Set a margin to be either numeric or symbolic.
@@ -881,7 +881,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
         buff[len] = 0;
         SendMsg(2405, type, (long)buff);
         delete [] buff;
-     
+
 }
 
 // Clear all the registered images.
@@ -1056,7 +1056,7 @@ int wxStyledTextCtrl::FindText(int minPos, int maxPos,
                 int    startPos,
                 int    endPos,
                 wxDC*  draw,
-                wxDC*  target, 
+                wxDC*  target,
                 wxRect renderRect,
                 wxRect pageRect) {
              RangeToFormat fr;
@@ -2566,7 +2566,7 @@ bool wxStyledTextCtrl::SaveFile(const wxString& filename)
     wxFile file(filename, wxFile::write);
 
     if (!file.IsOpened())
-        return FALSE;
+        return false;
 
     bool success = file.Write(GetText(), *wxConvCurrent);
 
@@ -2584,13 +2584,13 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
     if (file.IsOpened())
     {
         wxString contents;
-        off_t len = file.Length();
+        size_t len = file.Length();
         if (len > 0)
         {
 #if wxUSE_UNICODE
             wxMemoryBuffer buffer(len+1);
             success = (file.Read(buffer.GetData(), len) == len);
-           if (success) {
+            if (success) {
                 ((char*)buffer.GetData())[len] = 0;
                 contents = wxString(buffer, *wxConvCurrent, len);
             }
@@ -2601,7 +2601,7 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
 #endif
         }
         else
-            success = true;            // empty file is ok
+            success = true; // empty file is ok
 
         if (success)
         {
@@ -2616,12 +2616,12 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
 
 
 #if wxUSE_DRAG_AND_DROP
-wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { 
-        return m_swx->DoDragOver(x, y, def); 
-} 
+wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult 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);
 }
 #endif
@@ -2982,7 +2982,7 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
     m_listType = 0;
     m_x = 0;
     m_y = 0;
-    m_dragAllowMove = FALSE;
+    m_dragAllowMove = false;
 #if wxUSE_DRAG_AND_DROP
     m_dragResult = wxDragNone;
 #endif
index e8f6a9cbbfe137d8abcfb24cbb3dd857ec7290e2..fd5ce0637a974a2d846cc3386ec76eac9527c6e7 100644 (file)
@@ -1457,7 +1457,7 @@ public:
                      const wxSize& size = wxDefaultSize, long style = 0,
                      const wxString& name = wxPySTCNameStr);
     %name(PreStyledTextCtrl) wxStyledTextCtrl();
-    
+
 #else
     wxStyledTextCtrl(wxWindow *parent, wxWindowID id=wxID_ANY,
                      const wxPoint& pos = wxDefaultPosition,
@@ -1465,7 +1465,7 @@ public:
                      const wxString& name = wxSTCNameStr);
     wxStyledTextCtrl() { m_swx = NULL; }
     ~wxStyledTextCtrl();
-    
+
 #endif
 
     void Create(wxWindow *parent, wxWindowID id=wxID_ANY,
@@ -1969,7 +1969,7 @@ public:
                int    startPos,
                int    endPos,
                wxDC*  draw,
-               wxDC*  target, 
+               wxDC*  target,
                wxRect renderRect,
                wxRect pageRect);
 
@@ -2850,7 +2850,7 @@ public:
 
 #ifdef STC_USE_DND
     // 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
     bool DoDropText(long x, long y, const wxString& data);
@@ -2863,7 +2863,7 @@ public:
 
     // Returns the current UseAntiAliasing setting.
     bool GetUseAntiAliasing();
-    
+
 
 //----------------------------------------------------------------------
 
@@ -2891,7 +2891,7 @@ private:
     void OnMenu(wxCommandEvent& evt);
     void OnListBox(wxCommandEvent& evt);
     void OnIdle(wxIdleEvent& evt);
-    
+
     virtual wxSize DoGetBestSize() const;
 
     // Turn notifications from Scintilla into events
@@ -3077,31 +3077,31 @@ END_DECLARE_EVENT_TYPES()
 #ifndef SWIG
 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_STYLENEEDED(id, fn)        DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED,           id, -1, (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_SAVEPOINTREACHED(id, fn)   DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED,      id, -1, (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_ROMODIFYATTEMPT(id, fn)    DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT,       id, -1, (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_DOUBLECLICK(id, fn)        DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK,           id, -1, (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_MODIFIED(id, fn)           DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED,              id, -1, (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_MARGINCLICK(id, fn)        DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK,           id, -1, (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_PAINTED(id, fn)            DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED,               id, -1, (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_URIDROPPED(id, fn)         DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED,            id, -1, (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_DWELLEND(id, fn)           DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND,              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, -1, (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_DO_DROP(id, fn)            DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP,               id, -1, (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_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_DCLICK(id, fn)     DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK,        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, -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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, wxID_ANY, (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, 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, 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, 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, wxID_ANY, (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, 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, 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, wxID_ANY, (wxObjectEventFunction) (wxEventFunction)  wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ),
 
 #endif
 
index 5a233bf158afe09db556ee27a603a224fb011f16..c9f53d0d843efea96a8bf5beebcc0ab20ee9396d 100644 (file)
@@ -100,8 +100,8 @@ BEGIN_EVENT_TABLE (Edit, wxStyledTextCtrl)
     EVT_MENU (myID_CONVERTCRLF,        Edit::OnConvertEOL)
     EVT_MENU (myID_CONVERTLF,          Edit::OnConvertEOL)
     // stc
-    EVT_STC_MARGINCLICK (-1,           Edit::OnMarginClick)
-    EVT_STC_CHARADDED (-1,             Edit::OnCharAdded)
+    EVT_STC_MARGINCLICK (wxID_ANY,     Edit::OnMarginClick)
+    EVT_STC_CHARADDED (wxID_ANY,       Edit::OnCharAdded)
 END_EVENT_TABLE()
 
 Edit::Edit (wxWindow *parent, wxWindowID id,
@@ -532,9 +532,9 @@ bool Edit::LoadFile (const wxString &filename) {
 //         InsertText (0, buf);
 //     }
 //     file.Close();
-    
+
     wxStyledTextCtrl::LoadFile(m_filename);
-    
+
     EmptyUndoBuffer();
 
     // determine lexer language
@@ -580,7 +580,7 @@ bool Edit::SaveFile (const wxString &filename) {
 //     return true;
 
     return wxStyledTextCtrl::SaveFile(filename);
-    
+
 }
 
 bool Edit::Modified () {
@@ -595,7 +595,7 @@ bool Edit::Modified () {
 
 EditProperties::EditProperties (Edit *edit,
                                 long style)
-        : wxDialog (edit, -1, wxEmptyString,
+        : wxDialog (edit, wxID_ANY, wxEmptyString,
                     wxDefaultPosition, wxDefaultSize,
                     style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
 
@@ -606,24 +606,24 @@ EditProperties::EditProperties (Edit *edit,
     // fullname
     wxBoxSizer *fullname = new wxBoxSizer (wxHORIZONTAL);
     fullname->Add (10, 0);
-    fullname->Add (new wxStaticText (this, -1, _("Full filename"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    fullname->Add (new wxStaticText (this, wxID_ANY, _("Full filename"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
-    fullname->Add (new wxStaticText (this, -1, edit->GetFilename()),
+    fullname->Add (new wxStaticText (this, wxID_ANY, edit->GetFilename()),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL);
 
     // text info
     wxGridSizer *textinfo = new wxGridSizer (4, 0, 2);
-    textinfo->Add (new wxStaticText (this, -1, _("Language"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, _("Language"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
-    textinfo->Add (new wxStaticText (this, -1, edit->m_language->name),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, edit->m_language->name),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
-    textinfo->Add (new wxStaticText (this, -1, _("Lexer-ID: "),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetLexer());
-    textinfo->Add (new wxStaticText (this, -1, text),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, text),
                    0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
     wxString EOLtype = _T("");
     switch (edit->GetEOLMode()) {
@@ -631,49 +631,49 @@ EditProperties::EditProperties (Edit *edit,
         case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; }
         case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; }
     }
-    textinfo->Add (new wxStaticText (this, -1, _("Line endings"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
-    textinfo->Add (new wxStaticText (this, -1, EOLtype),
+    textinfo->Add (new wxStaticText (this, wxID_ANY, EOLtype),
                    0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
 
     // text info box
     wxStaticBoxSizer *textinfos = new wxStaticBoxSizer (
-                     new wxStaticBox (this, -1, _("Informations")),
+                     new wxStaticBox (this, wxID_ANY, _("Informations")),
                      wxVERTICAL);
     textinfos->Add (textinfo, 0, wxEXPAND);
     textinfos->Add (0, 6);
 
     // statistic
     wxGridSizer *statistic = new wxGridSizer (4, 0, 2);
-    statistic->Add (new wxStaticText (this, -1, _("Total lines"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetLineCount());
-    statistic->Add (new wxStaticText (this, -1, text),
+    statistic->Add (new wxStaticText (this, wxID_ANY, text),
                     0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
-    statistic->Add (new wxStaticText (this, -1, _("Total chars"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetTextLength());
-    statistic->Add (new wxStaticText (this, -1, text),
+    statistic->Add (new wxStaticText (this, wxID_ANY, text),
                     0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
-    statistic->Add (new wxStaticText (this, -1, _("Current line"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetCurrentLine());
-    statistic->Add (new wxStaticText (this, -1, text),
+    statistic->Add (new wxStaticText (this, wxID_ANY, text),
                     0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
-    statistic->Add (new wxStaticText (this, -1, _("Current pos"),
-                                     wxDefaultPosition, wxSize(80, -1)),
+    statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"),
+                                     wxDefaultPosition, wxSize(80, wxDefaultCoord)),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4);
     text = wxString::Format (_T("%d"), edit->GetCurrentPos());
-    statistic->Add (new wxStaticText (this, -1, text),
+    statistic->Add (new wxStaticText (this, wxID_ANY, text),
                     0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4);
 
     // char/line statistics
     wxStaticBoxSizer *statistics = new wxStaticBoxSizer (
-                     new wxStaticBox (this, -1, _("Statistics")),
+                     new wxStaticBox (this, wxID_ANY, _("Statistics")),
                      wxVERTICAL);
     statistics->Add (statistic, 0, wxEXPAND);
     statistics->Add (0, 6);
index 22d5c8cac37f5ebf0b369440bf54df0a4556797e..54034003ae9115571d4f0afdf61c4d7437a33150 100644 (file)
@@ -45,7 +45,7 @@ class Edit: public wxStyledTextCtrl {
 
 public:
     //! constructor
-    Edit (wxWindow *parent, wxWindowID id = -1,
+    Edit (wxWindow *parent, wxWindowID id = wxID_ANY,
           const wxPoint &pos = wxDefaultPosition,
           const wxSize &size = wxDefaultSize,
           long style = wxSUNKEN_BORDER|wxVSCROLL
index 636934d79ced5cbf5d77039ac7a473a3ebab8ae9..93711b1d1c0789585e9b13e20c10b7f70c906c0e 100644 (file)
@@ -289,7 +289,7 @@ BEGIN_EVENT_TABLE (AppFrame, wxFrame)
 END_EVENT_TABLE ()
 
 AppFrame::AppFrame (const wxString &title)
-        : wxFrame ((wxFrame *)NULL, -1, title, wxDefaultPosition, wxSize(750,550),
+        : wxFrame ((wxFrame *)NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750,550),
                     wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) {
 
     // intitialize important variables
@@ -308,7 +308,7 @@ AppFrame::AppFrame (const wxString &title)
     CreateMenu ();
 
     // open first page
-    m_edit = new Edit (this, -1);
+    m_edit = new Edit (this, wxID_ANY);
     m_edit->SetFocus();
 
     FileOpen (_T("stctest.cpp"));
@@ -586,7 +586,7 @@ END_EVENT_TABLE ()
 AppAbout::AppAbout (wxWindow *parent,
                     int milliseconds,
                     long style)
-        : wxDialog (parent, -1, wxEmptyString,
+        : wxDialog (parent, wxID_ANY, wxEmptyString,
                     wxDefaultPosition, wxDefaultSize,
                     style | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {
 
@@ -602,27 +602,27 @@ AppAbout::AppAbout (wxWindow *parent,
 
     // about info
     wxGridSizer *aboutinfo = new wxGridSizer (2, 0, 2);
-    aboutinfo->Add (new wxStaticText(this, -1, _("Written by: ")),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Written by: ")),
                     0, wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, APP_MAINT),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_MAINT),
                     1, wxEXPAND | wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, _("Version: ")),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Version: ")),
                     0, wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, APP_VERSION),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_VERSION),
                     1, wxEXPAND | wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, _("Licence type: ")),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Licence type: ")),
                     0, wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, APP_LICENCE),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_LICENCE),
                     1, wxEXPAND | wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, _("Copyright: ")),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, _("Copyright: ")),
                     0, wxALIGN_LEFT);
-    aboutinfo->Add (new wxStaticText(this, -1, APP_COPYRIGTH),
+    aboutinfo->Add (new wxStaticText(this, wxID_ANY, APP_COPYRIGTH),
                     1, wxEXPAND | wxALIGN_LEFT);
 
     // about icontitle//info
     wxBoxSizer *aboutpane = new wxBoxSizer (wxHORIZONTAL);
     wxBitmap bitmap = wxBitmap(wxICON (mondrian));
-    aboutpane->Add (new wxStaticBitmap (this, -1, bitmap),
+    aboutpane->Add (new wxStaticBitmap (this, wxID_ANY, bitmap),
                     0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 20);
     aboutpane->Add (aboutinfo, 1, wxEXPAND);
     aboutpane->Add (60, 0);
@@ -630,12 +630,12 @@ AppAbout::AppAbout (wxWindow *parent,
     // about complete
     wxBoxSizer *totalpane = new wxBoxSizer (wxVERTICAL);
     totalpane->Add (0, 20);
-    wxStaticText *appname = new wxStaticText(this, -1, *g_appname);
+    wxStaticText *appname = new wxStaticText(this, wxID_ANY, *g_appname);
     appname->SetFont (wxFont (24, wxDEFAULT, wxNORMAL, wxBOLD));
     totalpane->Add (appname, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 40);
     totalpane->Add (0, 10);
     totalpane->Add (aboutpane, 0, wxEXPAND | wxALL, 4);
-    totalpane->Add (new wxStaticText(this, -1, APP_DESCR),
+    totalpane->Add (new wxStaticText(this, wxID_ANY, APP_DESCR),
                     0, wxALIGN_CENTER | wxALL, 10);
     wxButton *okButton = new wxButton (this, wxID_OK, _("OK"));
     okButton->SetDefault();
index b20f68fa34ca18f7c1315d2b886a0b18d5ae91f6..4b983f1cd6f27ca3fa90793f15680203f6ba68be 100644 (file)
@@ -574,7 +574,7 @@ Window::~Window() {
 
 void Window::Destroy() {
     if (id) {
-        Show(FALSE);
+        Show(false);
         GETWIN(id)->Destroy();
     }
     id = 0;
@@ -684,7 +684,7 @@ public:
         : wxListView(parent, id, pos, size, style)
     {}
 
-    
+
     void OnFocus(wxFocusEvent& event) {
         GetParent()->SetFocus();
         event.Skip();
@@ -693,7 +693,7 @@ public:
     void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
         // Do nothing.  Prevents base class from resetting the colors...
     }
-    
+
 #ifdef __WXMAC__
     // 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
@@ -708,9 +708,9 @@ public:
     // And we need to force the focus back when being destroyed
     ~wxSTCListBox() {
         GetGrandParent()->SetFocus();
-    }    
-#endif    
-    
+    }
+#endif
+
 private:
     DECLARE_EVENT_TABLE()
 };
@@ -751,7 +751,7 @@ public:
         Hide();
     }
 
-            
+
     // On OSX and (possibly others) there can still be pending
     // messages/events for the list control when Scintilla wants to
     // close it, so do a pending delete of it instead of destroying
@@ -767,10 +767,10 @@ public:
 #endif
         if ( !wxPendingDelete.Member(this) )
             wxPendingDelete.Append(this);
-        return TRUE;
+        return true;
     }
 
-    
+
     int IconWidth() {
         wxImageList* il = lv->GetImageList(wxIMAGE_LIST_SMALL);
         if (il != NULL) {
@@ -816,9 +816,9 @@ private:
 
 
 BEGIN_EVENT_TABLE(wxSTCListBoxWin, wxWindow)
-    EVT_SET_FOCUS          (    wxSTCListBoxWin::OnFocus)
-    EVT_SIZE               (    wxSTCListBoxWin::OnSize)
-    EVT_LIST_ITEM_ACTIVATED(-1, wxSTCListBoxWin::OnActivate)
+    EVT_SET_FOCUS          (          wxSTCListBoxWin::OnFocus)
+    EVT_SIZE               (          wxSTCListBoxWin::OnSize)
+    EVT_LIST_ITEM_ACTIVATED(wxID_ANY, wxSTCListBoxWin::OnActivate)
 END_EVENT_TABLE()
 
 
@@ -981,10 +981,10 @@ int ListBoxImpl::Length() {
 
 
 void ListBoxImpl::Select(int n) {
-    bool select = TRUE;
+    bool select = true;
     if (n == -1) {
         n = 0;
-        select = FALSE;
+        select = false;
     }
     GETLB(id)->Focus(n);
     GETLB(id)->Select(n, select);
@@ -998,7 +998,7 @@ int ListBoxImpl::GetSelection() {
 
 int ListBoxImpl::Find(const char *WXUNUSED(prefix)) {
     // No longer used
-    return -1;
+    return wxNOT_FOUND;
 }
 
 
@@ -1019,7 +1019,7 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) {
 
     if (! imgList) {
         // 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;
     }
 
@@ -1121,7 +1121,7 @@ unsigned int Platform::DoubleClickTime() {
 }
 
 bool Platform::MouseButtonBounce() {
-       return FALSE;
+    return false;
 }
 void Platform::DebugDisplay(const char *s) {
     wxLogDebug(stc2wx(s));
@@ -1183,31 +1183,31 @@ void Platform::DebugPrintf(const char *format, ...) {
 static bool assertionPopUps = true;
 
 bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
-       bool ret = assertionPopUps;
-       assertionPopUps = assertionPopUps_;
-       return ret;
+    bool ret = assertionPopUps;
+    assertionPopUps = assertionPopUps_;
+    return ret;
 }
 
 void Platform::Assert(const char *c, const char *file, int line) {
-       char buffer[2000];
-       sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
-       if (assertionPopUps) {
-            /*int idButton = */
-            wxMessageBox(stc2wx(buffer),
-                         wxT("Assertion failure"),
-                         wxICON_HAND | wxOK);
-//             if (idButton == IDRETRY) {
-//                     ::DebugBreak();
-//             } else if (idButton == IDIGNORE) {
-//                     // all OK
-//             } else {
-//                     abort();
-//             }
-       } else {
-               strcat(buffer, "\r\n");
-               Platform::DebugDisplay(buffer);
-               abort();
-       }
+    char buffer[2000];
+    sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
+    if (assertionPopUps) {
+        /*int idButton = */
+        wxMessageBox(stc2wx(buffer),
+                     wxT("Assertion failure"),
+                     wxICON_HAND | wxOK);
+//      if (idButton == IDRETRY) {
+//          ::DebugBreak();
+//      } else if (idButton == IDIGNORE) {
+//          // all OK
+//      } else {
+//          abort();
+//      }
+    } else {
+        strcat(buffer, "\r\n");
+        Platform::DebugDisplay(buffer);
+        abort();
+    }
 }
 
 
index 0e6d4c6874cb2195e13fac6fc3a7568e27a99a20..c12d3ff2691a4da890f9bc9885dd521d313b2add 100644 (file)
@@ -73,7 +73,7 @@ class wxSTCCallTip : public wxSTCCallTipBase {
 public:
     wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx)
         : 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
     }
 
-    bool AcceptsFocus() const { return FALSE; }
+    bool AcceptsFocus() const { return false; }
 
     void OnPaint(wxPaintEvent& WXUNUSED(evt)) {
         wxBufferedPaintDC dc(this);
@@ -113,11 +113,11 @@ public:
     virtual void DoSetSize(int x, int y,
                            int width, int height,
                            int sizeFlags = wxSIZE_AUTO) {
-        if (x != -1) {
+        if (x != wxDefaultCoord) {
             m_cx = x;
             GetParent()->ClientToScreen(&x, NULL);
         }
-        if (y != -1) {
+        if (y != wxDefaultCoord) {
             m_cy = y;
             GetParent()->ClientToScreen(NULL, &y);
         }
@@ -128,7 +128,7 @@ public:
     wxPoint GetMyPosition() {
         return wxPoint(m_cx, m_cy);
     }
-    
+
 private:
     CallTip*      m_ct;
     ScintillaWX*  m_swx;
@@ -148,27 +148,27 @@ END_EVENT_TABLE()
 static wxTextFileType wxConvertEOLMode(int scintillaMode)
 {
     wxTextFileType type;
-    
+
     switch (scintillaMode) {
         case wxSTC_EOL_CRLF:
             type = wxTextFileType_Dos;
             break;
-            
+
         case wxSTC_EOL_CR:
             type = wxTextFileType_Mac;
             break;
-                
+
         case wxSTC_EOL_LF:
             type = wxTextFileType_Unix;
             break;
-            
+
         default:
             type = wxTextBuffer::typeDefault;
             break;
     }
     return type;
 }
-    
+
 
 //----------------------------------------------------------------------
 // Constructor/Destructor
@@ -222,7 +222,7 @@ void ScintillaWX::StartDrag() {
     wxStyledTextEvent evt(wxEVT_STC_START_DRAG, stc->GetId());
     evt.SetEventObject(stc);
     evt.SetDragText(dragText);
-    evt.SetDragAllowMove(TRUE);
+    evt.SetDragAllowMove(true);
     evt.SetPosition(wxMin(stc->GetSelectionStart(),
                           stc->GetSelectionEnd()));
     stc->GetEventHandler()->ProcessEvent(evt);
@@ -234,11 +234,11 @@ void ScintillaWX::StartDrag() {
         wxDragResult        result;
 
         source.SetData(data);
-        dropWentOutside = TRUE;
+        dropWentOutside = true;
         result = source.DoDragDrop(evt.GetDragAllowMove());
         if (result == wxDragMove && dropWentOutside)
             ClearSelection();
-        inDragDrop = FALSE;
+        inDragDrop = false;
         SetDragPosition(invalidPosition);
     }
 #endif
@@ -248,18 +248,18 @@ void ScintillaWX::StartDrag() {
 bool ScintillaWX::SetIdle(bool on) {
     if (idler.state != on) {
         // connect or disconnect the EVT_IDLE handler
-        if (on) 
-            stc->Connect(-1, wxEVT_IDLE,
+        if (on)
+            stc->Connect(wxID_ANY, wxEVT_IDLE,
                          (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
         else
-            stc->Disconnect(-1, wxEVT_IDLE,
+            stc->Disconnect(wxID_ANY, wxEVT_IDLE,
                             (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle);
         idler.state = on;
     }
     return idler.state;
 }
 
-    
+
 void ScintillaWX::SetTicking(bool on) {
     wxSTCTimer* steTimer;
     if (timer.ticking != on) {
@@ -425,10 +425,10 @@ void ScintillaWX::Paste() {
     ClearSelection();
 
     wxTextDataObject data;
-    bool gotData = FALSE;
+    bool gotData = false;
 
     if (wxTheClipboard->Open()) {
-        wxTheClipboard->UsePrimarySelection(FALSE);
+        wxTheClipboard->UsePrimarySelection(false);
         gotData = wxTheClipboard->GetData(data);
         wxTheClipboard->Close();
     }
@@ -449,7 +449,7 @@ void ScintillaWX::Paste() {
 
 void ScintillaWX::CopyToClipboard(const SelectionText& st) {
     if (wxTheClipboard->Open()) {
-        wxTheClipboard->UsePrimarySelection(FALSE);
+        wxTheClipboard->UsePrimarySelection(false);
         wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len));
         wxTheClipboard->SetData(new wxTextDataObject(text));
         wxTheClipboard->Close();
@@ -458,7 +458,7 @@ void ScintillaWX::CopyToClipboard(const SelectionText& st) {
 
 
 bool ScintillaWX::CanPaste() {
-    bool canPaste = FALSE;
+    bool canPaste = false;
     bool didOpen;
 
     if (Editor::CanPaste()) {
@@ -467,7 +467,7 @@ bool ScintillaWX::CanPaste() {
             wxTheClipboard->Open();
 
         if (wxTheClipboard->IsOpened()) {
-            wxTheClipboard->UsePrimarySelection(FALSE);
+            wxTheClipboard->UsePrimarySelection(false);
             canPaste = wxTheClipboard->IsSupported(wxUSE_UNICODE ? wxDF_UNICODETEXT : wxDF_TEXT);
             if (didOpen)
                 wxTheClipboard->Close();
@@ -508,10 +508,10 @@ void ScintillaWX::ClaimSelection() {
         SelectionText st;
         CopySelectionRange(&st);
         if (wxTheClipboard->Open()) {
-            wxTheClipboard->UsePrimarySelection(TRUE);
+            wxTheClipboard->UsePrimarySelection(true);
             wxString text = stc2wx(st.s, st.len);
             wxTheClipboard->SetData(new wxTextDataObject(text));
-            wxTheClipboard->UsePrimarySelection(FALSE);
+            wxTheClipboard->UsePrimarySelection(false);
             wxTheClipboard->Close();
         }
     }
@@ -561,7 +561,7 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar
       }
 
 #ifdef SCI_LEXER
-       case SCI_LOADLEXERLIBRARY:
+      case SCI_LOADLEXERLIBRARY:
             LexerManager::GetInstance()->Load((const char*)lParam);
             break;
 #endif
@@ -679,9 +679,6 @@ void ScintillaWX::DoMouseWheel(int rotation, int delta,
 
 
 void ScintillaWX::DoSize(int WXUNUSED(width), int WXUNUSED(height)) {
-//      PRectangle rcClient(0,0,width,height);
-//      SetScrollBarsTo(rcClient);
-//      DropGraphics();
     ChangeSize();
 }
 
@@ -722,11 +719,11 @@ void ScintillaWX::DoMiddleButtonUp(Point pt) {
 
     pdoc->BeginUndoAction();
     wxTextDataObject data;
-    bool gotData = FALSE;
+    bool gotData = false;
     if (wxTheClipboard->Open()) {
-        wxTheClipboard->UsePrimarySelection(TRUE);
+        wxTheClipboard->UsePrimarySelection(true);
         gotData = wxTheClipboard->GetData(data);
-        wxTheClipboard->UsePrimarySelection(FALSE);
+        wxTheClipboard->UsePrimarySelection(false);
         wxTheClipboard->Close();
     }
     if (gotData) {
@@ -819,7 +816,7 @@ int  ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool WXUNU
         }
     }
 #endif
-    
+
     int rv = KeyDown(key, shift, ctrl, alt, consumed);
 
     if (key)
@@ -843,7 +840,7 @@ void ScintillaWX::DoOnListBox() {
     AutoCompleteCompleted();
 }
 
+
 void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
 
     if ( Idle() )
@@ -851,7 +848,7 @@ void ScintillaWX::DoOnIdle(wxIdleEvent& evt) {
     else
         SetIdle(false);
 }
+
 //----------------------------------------------------------------------
 
 #if wxUSE_DRAG_AND_DROP
@@ -860,7 +857,7 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
 
     wxString text = wxTextBuffer::Translate(data,
                                             wxConvertEOLMode(pdoc->eolMode));
-    
+
     // Send an event to allow the drag details to be changed
     wxStyledTextEvent evt(wxEVT_STC_DO_DROP, stc->GetId());
     evt.SetEventObject(stc);
@@ -876,10 +873,10 @@ bool ScintillaWX::DoDropText(long x, long y, const wxString& data) {
         DropAt(evt.GetPosition(),
                wx2stc(evt.GetDragText()),
                dragResult == wxDragMove,
-               FALSE); // TODO: rectangular?
-        return TRUE;
+               false); // TODO: rectangular?
+        return true;
     }
-    return FALSE;
+    return false;
 }
 
 
@@ -960,6 +957,6 @@ void ScintillaWX::SetUseAntiAliasing(bool useAA) {
 bool ScintillaWX::GetUseAntiAliasing() {
     return vs.extraFontFlag;
 }
+
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
index d5a0127b7c87f39708fa9b1b32d92773dd82d8a6..a902db5ed64ffcd317152ec79bf71feea6ae4410 100644 (file)
@@ -144,7 +144,7 @@ public:
     int  DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool meta, bool* consumed);
     void DoTick() { Tick(); }
     void DoOnIdle(wxIdleEvent& evt);
-    
+
 #if wxUSE_DRAG_AND_DROP
     bool DoDropText(long x, long y, const wxString& data);
     wxDragResult DoDragEnter(wxCoord x, wxCoord y, wxDragResult def);
index 57ba993f8f47f8e570387233bb4ce5b77dce8ece..e0e4260914bb4a6edd3876cf4c63acc31e0fa4dd 100644 (file)
@@ -54,7 +54,7 @@ static wxColour wxColourFromLong(long c) {
 static wxColour wxColourFromSpec(const wxString& spec) {
     // spec should be a colour name or "#RRGGBB"
     if (spec.GetChar(0) == wxT('#')) {
-        
+
         long red, green, blue;
         red = green = blue = 0;
         spec.Mid(1,2).ToLong(&red,   16);
@@ -120,7 +120,7 @@ BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
     EVT_SYS_COLOUR_CHANGED      (wxStyledTextCtrl::OnSysColourChanged)
     EVT_ERASE_BACKGROUND        (wxStyledTextCtrl::OnEraseBackground)
     EVT_MENU_RANGE              (10, 16, wxStyledTextCtrl::OnMenu)
-    EVT_LISTBOX_DCLICK          (-1, wxStyledTextCtrl::OnListBox)
+    EVT_LISTBOX_DCLICK          (wxID_ANY, wxStyledTextCtrl::OnListBox)
 END_EVENT_TABLE()
 
 
@@ -166,7 +166,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent,
 #endif
     m_swx = new ScintillaWX(this);
     m_stopWatch.Start();
-    m_lastKeyDownConsumed = FALSE;
+    m_lastKeyDownConsumed = false;
     m_vScrollBar = NULL;
     m_hScrollBar = NULL;
 #if wxUSE_UNICODE
@@ -497,7 +497,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp)
         buff[len] = 0;
         SendMsg(2049, markerNumber, (long)buff);
         delete [] buff;
-        
+
 }
 
 // Set a margin to be either numeric or symbolic.
@@ -881,7 +881,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) {
         buff[len] = 0;
         SendMsg(2405, type, (long)buff);
         delete [] buff;
-     
+
 }
 
 // Clear all the registered images.
@@ -1056,7 +1056,7 @@ int wxStyledTextCtrl::FindText(int minPos, int maxPos,
                 int    startPos,
                 int    endPos,
                 wxDC*  draw,
-                wxDC*  target, 
+                wxDC*  target,
                 wxRect renderRect,
                 wxRect pageRect) {
              RangeToFormat fr;
@@ -2566,7 +2566,7 @@ bool wxStyledTextCtrl::SaveFile(const wxString& filename)
     wxFile file(filename, wxFile::write);
 
     if (!file.IsOpened())
-        return FALSE;
+        return false;
 
     bool success = file.Write(GetText(), *wxConvCurrent);
 
@@ -2584,13 +2584,13 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
     if (file.IsOpened())
     {
         wxString contents;
-        off_t len = file.Length();
+        size_t len = file.Length();
         if (len > 0)
         {
 #if wxUSE_UNICODE
             wxMemoryBuffer buffer(len+1);
             success = (file.Read(buffer.GetData(), len) == len);
-           if (success) {
+            if (success) {
                 ((char*)buffer.GetData())[len] = 0;
                 contents = wxString(buffer, *wxConvCurrent, len);
             }
@@ -2601,7 +2601,7 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
 #endif
         }
         else
-            success = true;            // empty file is ok
+            success = true; // empty file is ok
 
         if (success)
         {
@@ -2616,12 +2616,12 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
 
 
 #if wxUSE_DRAG_AND_DROP
-wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult def) { 
-        return m_swx->DoDragOver(x, y, def); 
-} 
+wxDragResult wxStyledTextCtrl::DoDragOver(wxCoord x, wxCoord y, wxDragResult 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);
 }
 #endif
@@ -2982,7 +2982,7 @@ wxStyledTextEvent::wxStyledTextEvent(wxEventType commandType, int id)
     m_listType = 0;
     m_x = 0;
     m_y = 0;
-    m_dragAllowMove = FALSE;
+    m_dragAllowMove = false;
 #if wxUSE_DRAG_AND_DROP
     m_dragResult = wxDragNone;
 #endif