TRUE/FALSE/etc. cleanup in the *.in files, regenerated the .h and .cpp

files


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29516 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2004-09-28 23:36:33 +00:00
parent 163c36827d
commit dc8005e206
8 changed files with 96 additions and 96 deletions

View File

@ -1969,7 +1969,7 @@ public:
int startPos,
int endPos,
wxDC* draw,
wxDC* target,
wxDC* target,
wxRect renderRect,
wxRect pageRect);

View File

@ -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;
@ -2584,13 +2584,13 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
if (file.IsOpened())
{
wxString contents;
size_t len = file.Length();
size_t len = (size_t)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)
{

View 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
@ -340,7 +340,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);
@ -358,13 +358,13 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
if (file.IsOpened())
{
wxString contents;
off_t len = file.Length();
size_t len = (size_t)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);
}
@ -390,12 +390,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
@ -756,7 +756,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

View File

@ -91,7 +91,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,
@ -99,7 +99,7 @@ public:
const wxString& name = wxSTCNameStr);
wxStyledTextCtrl() { m_swx = NULL; }
~wxStyledTextCtrl();
#endif
void Create(wxWindow *parent, wxWindowID id=wxID_ANY,
@ -204,7 +204,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);
@ -217,7 +217,7 @@ public:
// Returns the current UseAntiAliasing setting.
bool GetUseAntiAliasing();
//----------------------------------------------------------------------
@ -245,7 +245,7 @@ private:
void OnMenu(wxCommandEvent& evt);
void OnListBox(wxCommandEvent& evt);
void OnIdle(wxIdleEvent& evt);
virtual wxSize DoGetBestSize() const;
// Turn notifications from Scintilla into events
@ -431,31 +431,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

View File

@ -1969,7 +1969,7 @@ public:
int startPos,
int endPos,
wxDC* draw,
wxDC* target,
wxDC* target,
wxRect renderRect,
wxRect pageRect);

View File

@ -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;
@ -2584,13 +2584,13 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
if (file.IsOpened())
{
wxString contents;
size_t len = file.Length();
size_t len = (size_t)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)
{

View 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
@ -340,7 +340,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);
@ -358,13 +358,13 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename)
if (file.IsOpened())
{
wxString contents;
off_t len = file.Length();
size_t len = (size_t)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);
}
@ -390,12 +390,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
@ -756,7 +756,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

View File

@ -91,7 +91,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,
@ -99,7 +99,7 @@ public:
const wxString& name = wxSTCNameStr);
wxStyledTextCtrl() { m_swx = NULL; }
~wxStyledTextCtrl();
#endif
void Create(wxWindow *parent, wxWindowID id=wxID_ANY,
@ -204,7 +204,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);
@ -217,7 +217,7 @@ public:
// Returns the current UseAntiAliasing setting.
bool GetUseAntiAliasing();
//----------------------------------------------------------------------
@ -245,7 +245,7 @@ private:
void OnMenu(wxCommandEvent& evt);
void OnListBox(wxCommandEvent& evt);
void OnIdle(wxIdleEvent& evt);
virtual wxSize DoGetBestSize() const;
// Turn notifications from Scintilla into events
@ -431,31 +431,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