wxTextPos for all GetLastPosition with constants for special cases. Make it virtual everywhere. Avoid doubling typedefs. Always include textctrl.h for combobox.h. Source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -180,7 +180,7 @@ Returns the insertion point for the combobox's text field.
|
||||
|
||||
\membersection{wxComboBox::GetLastPosition}\label{wxcomboboxgetlastposition}
|
||||
|
||||
\constfunc{long}{GetLastPosition}{\void}
|
||||
\constfunc{virtual wxTextPos}{GetLastPosition}{\void}
|
||||
|
||||
Returns the last position in the combobox text field.
|
||||
|
||||
|
@@ -683,7 +683,7 @@ point or the zero character if the point is at the end of the control.
|
||||
|
||||
\membersection{wxTextCtrl::GetLastPosition}\label{wxtextctrlgetlastposition}
|
||||
|
||||
\constfunc{virtual long}{GetLastPosition}{\void}
|
||||
\constfunc{virtual wxTextPos}{GetLastPosition}{\void}
|
||||
|
||||
Returns the zero based index of the last position in the text control,
|
||||
which is equal to the number of characters in the control.
|
||||
|
@@ -12,8 +12,6 @@
|
||||
#ifndef __WX_COCOA_COMBOBOX_H__
|
||||
#define __WX_COCOA_COMBOBOX_H__
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
//#include "wx/cocoa/NSTableView.h"
|
||||
|
||||
// ========================================================================
|
||||
@@ -114,7 +112,7 @@ public:
|
||||
{ wxTextCtrl::SetInsertionPointEnd(); }
|
||||
virtual long GetInsertionPoint() const
|
||||
{ return wxTextCtrl::GetInsertionPoint(); }
|
||||
virtual long GetLastPosition() const
|
||||
virtual wxTextPos GetLastPosition() const
|
||||
{ return wxTextCtrl::GetLastPosition(); }
|
||||
virtual void Replace(long from, long to, const wxString& value)
|
||||
{ wxTextCtrl::Replace(from,to,value); }
|
||||
|
@@ -108,7 +108,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
// virtual void SelectAll();
|
||||
|
@@ -22,6 +22,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr;
|
||||
// wxComboBoxBase: this interface defines the methods wxComboBox must implement
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/ctrlsub.h"
|
||||
|
||||
class WXDLLEXPORT wxComboBoxBase : public wxItemContainer
|
||||
@@ -36,7 +37,7 @@ public:
|
||||
virtual void Paste() = 0;
|
||||
virtual void SetInsertionPoint(long pos) = 0;
|
||||
virtual long GetInsertionPoint() const = 0;
|
||||
virtual long GetLastPosition() const = 0;
|
||||
virtual wxTextPos GetLastPosition() const = 0;
|
||||
virtual void Replace(long from, long to, const wxString& value) = 0;
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
virtual void SetEditable(bool editable) = 0;
|
||||
|
@@ -111,7 +111,7 @@ public:
|
||||
void SetInsertionPoint( long pos );
|
||||
void SetInsertionPointEnd() { SetInsertionPoint( -1 ); }
|
||||
long GetInsertionPoint() const;
|
||||
long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
void Remove(long from, long to) { Replace(from, to, wxEmptyString); }
|
||||
void Replace( long from, long to, const wxString& value );
|
||||
void SetSelection( long from, long to );
|
||||
|
@@ -114,12 +114,12 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
virtual bool Enable( bool enable = true );
|
||||
|
||||
// Implementation from now on
|
||||
void OnDropFiles( wxDropFilesEvent &event );
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
void UpdateFontIfNeeded();
|
||||
#endif // __WXGTK20__/!__WXGTK20__
|
||||
|
||||
void SetModified() { m_modified = TRUE; }
|
||||
void SetModified() { m_modified = true; }
|
||||
|
||||
// GTK+ textctrl is so dumb that you need to freeze/thaw it manually to
|
||||
// avoid horrible flicker/scrolling back and forth
|
||||
|
@@ -111,7 +111,7 @@ public:
|
||||
void SetInsertionPoint( long pos );
|
||||
void SetInsertionPointEnd() { SetInsertionPoint( -1 ); }
|
||||
long GetInsertionPoint() const;
|
||||
long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
void Remove(long from, long to) { Replace(from, to, wxEmptyString); }
|
||||
void Replace( long from, long to, const wxString& value );
|
||||
void SetSelection( long from, long to );
|
||||
|
@@ -114,12 +114,12 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
virtual bool Enable( bool enable = true );
|
||||
|
||||
// Implementation from now on
|
||||
void OnDropFiles( wxDropFilesEvent &event );
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
void UpdateFontIfNeeded();
|
||||
#endif // __WXGTK20__/!__WXGTK20__
|
||||
|
||||
void SetModified() { m_modified = TRUE; }
|
||||
void SetModified() { m_modified = true; }
|
||||
|
||||
// GTK+ textctrl is so dumb that you need to freeze/thaw it manually to
|
||||
// avoid horrible flicker/scrolling back and forth
|
||||
|
@@ -16,7 +16,6 @@
|
||||
#pragma interface "combobox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/choice.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr;
|
||||
@@ -39,8 +38,8 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
// forward these functions to all subcontrols
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual bool Show(bool show = true);
|
||||
virtual void SetFocus();
|
||||
|
||||
// callback functions
|
||||
@@ -111,7 +110,7 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const ;
|
||||
virtual long GetLastPosition() const ;
|
||||
virtual wxTextPos GetLastPosition() const ;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
|
@@ -126,7 +126,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
@@ -16,7 +16,6 @@
|
||||
#pragma interface "combobox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/choice.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr;
|
||||
@@ -34,8 +33,8 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
// forward these functions to all subcontrols
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
virtual bool Show(bool show = TRUE);
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual bool Show(bool show = true);
|
||||
virtual void SetFocus();
|
||||
|
||||
// callback functions
|
||||
@@ -106,7 +105,7 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const ;
|
||||
virtual long GetLastPosition() const ;
|
||||
virtual wxTextPos GetLastPosition() const ;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
|
@@ -123,7 +123,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
||||
|
||||
virtual void MacSuperShown( bool show ) ;
|
||||
virtual bool Show(bool show = TRUE) ;
|
||||
virtual bool Show(bool show = true) ;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
|
@@ -95,14 +95,14 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const ;
|
||||
virtual long GetLastPosition() const ;
|
||||
virtual wxTextPos GetLastPosition() const ;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
// Implementation
|
||||
virtual void ChangeFont(bool keepOriginalSize = TRUE);
|
||||
virtual void ChangeFont(bool keepOriginalSize = true);
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
WXWidget GetTopWidget() const { return m_mainWidget; }
|
||||
|
@@ -74,7 +74,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
|
||||
// implementation from here to the end
|
||||
// -----------------------------------
|
||||
virtual void ChangeFont(bool keepOriginalSize = TRUE);
|
||||
virtual void ChangeFont(bool keepOriginalSize = true);
|
||||
virtual void ChangeBackgroundColour();
|
||||
virtual void ChangeForegroundColour();
|
||||
void SetModified(bool mod) { m_modified = mod; }
|
||||
|
@@ -92,7 +92,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
|
||||
|
@@ -131,7 +131,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
@@ -124,7 +124,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
@@ -110,7 +110,7 @@ class WXDLLEXPORT wxComboBox : public wxChoice
|
||||
virtual void SetInsertionPoint(long lPos);
|
||||
virtual void SetInsertionPointEnd(void);
|
||||
virtual long GetInsertionPoint(void) const;
|
||||
virtual long GetLastPosition(void) const;
|
||||
virtual wxTextPos GetLastPosition(void) const;
|
||||
virtual void Replace( long lFrom
|
||||
,long lTo
|
||||
,const wxString& rsValue
|
||||
|
@@ -112,7 +112,7 @@ public:
|
||||
virtual void SetInsertionPoint(long lPos);
|
||||
virtual void SetInsertionPointEnd(void);
|
||||
virtual long GetInsertionPoint(void) const;
|
||||
virtual long GetLastPosition(void) const;
|
||||
virtual wxTextPos GetLastPosition(void) const;
|
||||
|
||||
virtual void SetSelection( long lFrom
|
||||
,long lTo
|
||||
|
@@ -85,7 +85,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
|
||||
|
@@ -123,7 +123,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
@@ -70,6 +70,11 @@ typedef long wxTextCoord;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlNameStr;
|
||||
|
||||
// this is intentionally not enum to avoid warning fixes with
|
||||
// typecasting from enum type to wxTextCoord
|
||||
const wxTextCoord wxOutOfRangeTextCoord = -1;
|
||||
const wxTextCoord wxInvalidTextCoord = -2;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl style flags
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -359,7 +364,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos) = 0;
|
||||
virtual void SetInsertionPointEnd() = 0;
|
||||
virtual long GetInsertionPoint() const = 0;
|
||||
virtual long GetLastPosition() const = 0;
|
||||
virtual wxTextPos GetLastPosition() const = 0;
|
||||
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
virtual void SelectAll();
|
||||
|
@@ -277,7 +277,7 @@ public:
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
|
@@ -183,18 +183,18 @@ public:
|
||||
virtual void Redo() {}
|
||||
|
||||
virtual bool CanUndo() const { return (m_undos.GetCount() > 0); }
|
||||
virtual bool CanRedo() const { return FALSE; }
|
||||
virtual bool CanRedo() const { return false; }
|
||||
|
||||
// Insertion point
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
virtual bool Enable( bool enable = true );
|
||||
|
||||
void OnCut(wxCommandEvent& event);
|
||||
void OnCopy(wxCommandEvent& event);
|
||||
@@ -212,7 +212,7 @@ public:
|
||||
bool SetForegroundColour(const wxColour& colour);
|
||||
bool SetBackgroundColour(const wxColour& colour);
|
||||
|
||||
void SetModified() { m_modified = TRUE; }
|
||||
void SetModified() { m_modified = true; }
|
||||
|
||||
virtual void Freeze();
|
||||
virtual void Thaw();
|
||||
@@ -266,7 +266,7 @@ public:
|
||||
void OnInternalIdle();
|
||||
void RefreshLine( int n );
|
||||
void RefreshDown( int n );
|
||||
void MoveCursor( int new_x, int new_y, bool shift = FALSE, bool centre = FALSE );
|
||||
void MoveCursor( int new_x, int new_y, bool shift = false, bool centre = false );
|
||||
void MyAdjustScrollbars();
|
||||
|
||||
protected:
|
||||
@@ -370,13 +370,6 @@ private:
|
||||
// wxTextCtrl types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// wxTextPos is the position in the text
|
||||
typedef long wxTextPos;
|
||||
|
||||
// wxTextCoord is the line or row number (which should have been unsigned but
|
||||
// is long for backwards compatibility)
|
||||
typedef long wxTextCoord;
|
||||
|
||||
class WXDLLEXPORT wxStdTextCtrlInputHandler : public wxStdInputHandler
|
||||
{
|
||||
public:
|
||||
@@ -384,10 +377,10 @@ public:
|
||||
|
||||
virtual bool HandleKey(wxInputConsumer *consumer,
|
||||
const wxKeyEvent& event,
|
||||
bool pressed) { return FALSE; }
|
||||
virtual bool HandleMouse(wxInputConsumer *consumer, const wxMouseEvent& event) { return FALSE; }
|
||||
virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event) { return FALSE; }
|
||||
virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event) { return FALSE; }
|
||||
bool pressed) { return false; }
|
||||
virtual bool HandleMouse(wxInputConsumer *consumer, const wxMouseEvent& event) { return false; }
|
||||
virtual bool HandleMouseMove(wxInputConsumer *consumer, const wxMouseEvent& event) { return false; }
|
||||
virtual bool HandleFocus(wxInputConsumer *consumer, const wxFocusEvent& event) { return false; }
|
||||
|
||||
protected:
|
||||
// get the position of the mouse click
|
||||
|
@@ -177,7 +177,7 @@ int wxTextCtrl::GetLineLength(long) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@@ -220,7 +220,7 @@ bool wxTextCtrlBase::LoadFile(const wxString& filename)
|
||||
|
||||
bool wxTextCtrlBase::SaveFile(const wxString& filename)
|
||||
{
|
||||
wxString filenameToUse = filename.IsEmpty() ? m_filename : filename;
|
||||
wxString filenameToUse = filename.empty() ? m_filename : filename;
|
||||
if ( filenameToUse.empty() )
|
||||
{
|
||||
// what kind of message to give? is it an error or a program bug?
|
||||
@@ -394,9 +394,8 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
|
||||
case WXK_NUMPAD_DELETE:
|
||||
// delete the character at cursor
|
||||
{
|
||||
const long pos = GetInsertionPoint(),
|
||||
last = GetLastPosition();
|
||||
if ( pos < last )
|
||||
const long pos = GetInsertionPoint();
|
||||
if ( pos < GetLastPosition() )
|
||||
Remove(pos, pos + 1);
|
||||
}
|
||||
break;
|
||||
|
@@ -644,7 +644,7 @@ void wxLogWindow::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
|
||||
|
||||
// remove selection (WriteText is in fact ReplaceSelection)
|
||||
#ifdef __WXMSW__
|
||||
long nLen = pText->GetLastPosition();
|
||||
wxTextPos nLen = pText->GetLastPosition();
|
||||
pText->SetSelection(nLen, nLen);
|
||||
#endif // Windows
|
||||
|
||||
|
@@ -51,7 +51,7 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
|
||||
|
||||
if (combo->m_ignoreNextUpdate)
|
||||
{
|
||||
combo->m_ignoreNextUpdate = FALSE;
|
||||
combo->m_ignoreNextUpdate = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,16 +192,16 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
||||
long style, const wxValidator& validator,
|
||||
const wxString& name )
|
||||
{
|
||||
m_ignoreNextUpdate = FALSE;
|
||||
m_needParent = TRUE;
|
||||
m_acceptsFocus = TRUE;
|
||||
m_ignoreNextUpdate = false;
|
||||
m_needParent = true;
|
||||
m_acceptsFocus = true;
|
||||
m_prevSelection = 0;
|
||||
|
||||
if (!PreCreation( parent, pos, size ) ||
|
||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxComboBox creation failed") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_widget = gtk_combo_new();
|
||||
@@ -276,7 +276,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
||||
wxSize setsize = GetSize();
|
||||
gtk_widget_set_usize( m_widget, setsize.x, setsize.y );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxComboBox::~wxComboBox()
|
||||
@@ -780,7 +780,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return (long) GET_EDITABLE_POS( GTK_COMBO(m_widget)->entry );
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||
int pos = GTK_ENTRY(entry)->text_length;
|
||||
|
@@ -292,8 +292,8 @@ END_EVENT_TABLE()
|
||||
void wxTextCtrl::Init()
|
||||
{
|
||||
m_ignoreNextUpdate =
|
||||
m_modified = FALSE;
|
||||
SetUpdateFont(FALSE);
|
||||
m_modified = false;
|
||||
SetUpdateFont(false);
|
||||
m_text =
|
||||
m_vScrollbar = (GtkWidget *)NULL;
|
||||
#ifdef __WXGTK20__
|
||||
@@ -324,18 +324,18 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
const wxValidator& validator,
|
||||
const wxString &name )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
m_acceptsFocus = TRUE;
|
||||
m_needParent = true;
|
||||
m_acceptsFocus = true;
|
||||
|
||||
if (!PreCreation( parent, pos, size ) ||
|
||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxTextCtrl creation failed") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
m_vScrollbarVisible = FALSE;
|
||||
m_vScrollbarVisible = false;
|
||||
|
||||
bool multi_line = (style & wxTE_MULTILINE) != 0;
|
||||
|
||||
@@ -370,7 +370,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
m_text = gtk_text_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
|
||||
|
||||
// ... and put into the upper left hand corner of the table
|
||||
bool bHasHScrollbar = FALSE;
|
||||
bool bHasHScrollbar = false;
|
||||
m_widget = gtk_table_new(bHasHScrollbar ? 2 : 1, 2, FALSE);
|
||||
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
|
||||
gtk_table_attach( GTK_TABLE(m_widget), m_text, 0, 1, 0, 1,
|
||||
@@ -431,7 +431,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
}
|
||||
#endif // GTK+ 1.x
|
||||
|
||||
if (!value.IsEmpty())
|
||||
if (!value.empty())
|
||||
{
|
||||
#ifdef __WXGTK20__
|
||||
SetValue( value );
|
||||
@@ -526,7 +526,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
wxTextAttr attrDef(GetForegroundColour(), GetBackgroundColour(), GetFont());
|
||||
SetDefaultStyle( attrDef );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -542,7 +542,7 @@ void wxTextCtrl::CalculateScrollbar()
|
||||
if (m_vScrollbarVisible)
|
||||
{
|
||||
gtk_widget_hide( m_vScrollbar );
|
||||
m_vScrollbarVisible = FALSE;
|
||||
m_vScrollbarVisible = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -550,7 +550,7 @@ void wxTextCtrl::CalculateScrollbar()
|
||||
if (!m_vScrollbarVisible)
|
||||
{
|
||||
gtk_widget_show( m_vScrollbar );
|
||||
m_vScrollbarVisible = TRUE;
|
||||
m_vScrollbarVisible = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -629,7 +629,7 @@ void wxTextCtrl::SetValue( const wxString &value )
|
||||
// customize this behaviour.
|
||||
SetInsertionPoint(0);
|
||||
|
||||
m_modified = FALSE;
|
||||
m_modified = false;
|
||||
}
|
||||
|
||||
void wxTextCtrl::WriteText( const wxString &text )
|
||||
@@ -683,7 +683,7 @@ void wxTextCtrl::WriteText( const wxString &text )
|
||||
// in UpdateFontIfNeeded() any longer
|
||||
if ( !text.empty() )
|
||||
{
|
||||
SetUpdateFont(FALSE);
|
||||
SetUpdateFont(false);
|
||||
}
|
||||
|
||||
// Bring editable's cursor back uptodate.
|
||||
@@ -785,7 +785,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
|
||||
|
||||
// cast to prevent warning. But pos really should've been unsigned.
|
||||
if( (unsigned long)pos > text.Len() )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
*x=0; // First Col
|
||||
*y=0; // First Line
|
||||
@@ -812,11 +812,11 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
|
||||
else
|
||||
{
|
||||
// index out of bounds
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
long wxTextCtrl::XYToPosition(long x, long y ) const
|
||||
@@ -957,7 +957,7 @@ bool wxTextCtrl::Enable( bool enable )
|
||||
if (!wxWindowBase::Enable(enable))
|
||||
{
|
||||
// nothing to do
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
@@ -974,7 +974,7 @@ bool wxTextCtrl::Enable( bool enable )
|
||||
gtk_widget_set_sensitive( m_text, enable );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// wxGTK-specific: called recursively by Enable,
|
||||
@@ -999,12 +999,12 @@ void wxTextCtrl::OnParentEnable( bool enable )
|
||||
|
||||
void wxTextCtrl::MarkDirty()
|
||||
{
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::DiscardEdits()
|
||||
{
|
||||
m_modified = FALSE;
|
||||
m_modified = false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -1013,19 +1013,19 @@ void wxTextCtrl::DiscardEdits()
|
||||
|
||||
void wxTextCtrl::IgnoreNextTextUpdate()
|
||||
{
|
||||
m_ignoreNextUpdate = TRUE;
|
||||
m_ignoreNextUpdate = true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::IgnoreTextUpdate()
|
||||
{
|
||||
if ( m_ignoreNextUpdate )
|
||||
{
|
||||
m_ignoreNextUpdate = FALSE;
|
||||
m_ignoreNextUpdate = false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetMaxLength(unsigned long len)
|
||||
@@ -1178,7 +1178,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
}
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
wxCHECK_MSG( m_text != NULL, 0, wxT("invalid text ctrl") );
|
||||
|
||||
@@ -1227,7 +1227,7 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value )
|
||||
|
||||
Remove( from, to );
|
||||
|
||||
if (!value.IsEmpty())
|
||||
if (!value.empty())
|
||||
{
|
||||
#ifdef __WXGTK20__
|
||||
SetInsertionPoint( from );
|
||||
@@ -1297,14 +1297,14 @@ bool wxTextCtrl::CanUndo() const
|
||||
{
|
||||
// TODO
|
||||
//wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::CanRedo() const
|
||||
{
|
||||
// TODO
|
||||
//wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the return values from and to are the same, there is no
|
||||
@@ -1315,7 +1315,7 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
|
||||
gint from = -1;
|
||||
gint to = -1;
|
||||
bool haveSelection = FALSE;
|
||||
bool haveSelection = false;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
@@ -1323,7 +1323,7 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
GtkTextIter ifrom, ito;
|
||||
if ( gtk_text_buffer_get_selection_bounds(m_buffer, &ifrom, &ito) )
|
||||
{
|
||||
haveSelection = TRUE;
|
||||
haveSelection = true;
|
||||
from = gtk_text_iter_get_offset(&ifrom);
|
||||
to = gtk_text_iter_get_offset(&ito);
|
||||
}
|
||||
@@ -1333,13 +1333,13 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
if ( gtk_editable_get_selection_bounds( GTK_EDITABLE(m_text),
|
||||
&from, &to) )
|
||||
{
|
||||
haveSelection = TRUE;
|
||||
haveSelection = true;
|
||||
}
|
||||
}
|
||||
#else // not GTK2
|
||||
if ( (GTK_EDITABLE(m_text)->has_selection) )
|
||||
{
|
||||
haveSelection = TRUE;
|
||||
haveSelection = true;
|
||||
from = (long) GTK_EDITABLE(m_text)->selection_start_pos;
|
||||
to = (long) GTK_EDITABLE(m_text)->selection_end_pos;
|
||||
}
|
||||
@@ -1365,7 +1365,7 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
|
||||
bool wxTextCtrl::IsEditable() const
|
||||
{
|
||||
wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") );
|
||||
wxCHECK_MSG( m_text != NULL, false, wxT("invalid text ctrl") );
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
@@ -1451,24 +1451,24 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
// the font will change for subsequent text insertiongs
|
||||
bool wxTextCtrl::SetFont( const wxFont &font )
|
||||
{
|
||||
wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") );
|
||||
wxCHECK_MSG( m_text != NULL, false, wxT("invalid text ctrl") );
|
||||
|
||||
if ( !wxTextCtrlBase::SetFont(font) )
|
||||
{
|
||||
// font didn't change, nothing to do
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( m_windowStyle & wxTE_MULTILINE )
|
||||
{
|
||||
SetUpdateFont(TRUE);
|
||||
SetUpdateFont(true);
|
||||
|
||||
m_defaultStyle.SetFont(font);
|
||||
|
||||
ChangeFontGlobally();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::ChangeFontGlobally()
|
||||
@@ -1487,9 +1487,9 @@ void wxTextCtrl::ChangeFontGlobally()
|
||||
#endif
|
||||
|
||||
wxString value = GetValue();
|
||||
if ( !value.IsEmpty() )
|
||||
if ( !value.empty() )
|
||||
{
|
||||
SetUpdateFont(FALSE);
|
||||
SetUpdateFont(false);
|
||||
|
||||
Clear();
|
||||
AppendText(value);
|
||||
@@ -1509,35 +1509,35 @@ void wxTextCtrl::UpdateFontIfNeeded()
|
||||
bool wxTextCtrl::SetForegroundColour(const wxColour& colour)
|
||||
{
|
||||
if ( !wxControl::SetForegroundColour(colour) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// update default fg colour too
|
||||
m_defaultStyle.SetTextColour(colour);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::SetBackgroundColour( const wxColour &colour )
|
||||
{
|
||||
wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") );
|
||||
wxCHECK_MSG( m_text != NULL, false, wxT("invalid text ctrl") );
|
||||
|
||||
if ( !wxControl::SetBackgroundColour( colour ) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#ifndef __WXGTK20__
|
||||
if (!m_widget->window)
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!m_backgroundColour.Ok())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
{
|
||||
#ifndef __WXGTK20__
|
||||
GdkWindow *window = GTK_TEXT(m_text)->text_area;
|
||||
if (!window)
|
||||
return FALSE;
|
||||
return false;
|
||||
m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
|
||||
gdk_window_set_background( window, m_backgroundColour.GetColor() );
|
||||
gdk_window_clear( window );
|
||||
@@ -1547,7 +1547,7 @@ bool wxTextCtrl::SetBackgroundColour( const wxColour &colour )
|
||||
// change active background color too
|
||||
m_defaultStyle.SetBackgroundColour( colour );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style )
|
||||
@@ -1557,12 +1557,12 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style )
|
||||
if ( style.IsDefault() )
|
||||
{
|
||||
// nothing to do
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#ifdef __WXGTK20__
|
||||
gint l = gtk_text_buffer_get_char_count( m_buffer );
|
||||
|
||||
wxCHECK_MSG( start >= 0 && end <= l, FALSE,
|
||||
wxCHECK_MSG( start >= 0 && end <= l, false,
|
||||
_T("invalid range in wxTextCtrl::SetStyle") );
|
||||
|
||||
GtkTextIter starti, endi;
|
||||
@@ -1576,14 +1576,14 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style )
|
||||
|
||||
wxGtkTextApplyTagsFromAttr( m_buffer, attr, &starti, &endi );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
#else
|
||||
// VERY dirty way to do that - removes the required text and re-adds it
|
||||
// with styling (FIXME)
|
||||
|
||||
gint l = gtk_text_get_length( GTK_TEXT(m_text) );
|
||||
|
||||
wxCHECK_MSG( start >= 0 && end <= l, FALSE,
|
||||
wxCHECK_MSG( start >= 0 && end <= l, false,
|
||||
_T("invalid range in wxTextCtrl::SetStyle") );
|
||||
|
||||
gint old_pos = gtk_editable_get_position( GTK_EDITABLE(m_text) );
|
||||
@@ -1615,12 +1615,12 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style )
|
||||
gtk_editable_set_position( GTK_EDITABLE(m_text), old_pos ); */
|
||||
SetInsertionPoint( old_pos );
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else // singe line
|
||||
{
|
||||
// cannot do this for GTK+'s Entry widget
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1808,7 +1808,7 @@ bool wxTextCtrl::DoScroll(GtkAdjustment *adj, int diff)
|
||||
if ( fabs(adj->value - value) < 0.2 )
|
||||
{
|
||||
// well, this is what Robert does in wxScrollBar, so it must be good...
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
adj->value = value;
|
||||
@@ -1819,14 +1819,14 @@ bool wxTextCtrl::DoScroll(GtkAdjustment *adj, int diff)
|
||||
gtk_signal_emit_by_name(GTK_OBJECT(adj), "value_changed");
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::ScrollLines(int lines)
|
||||
{
|
||||
GtkAdjustment *adj = GetVAdj();
|
||||
if ( !adj )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
int diff = (int)ceil(lines*adj->step_increment);
|
||||
@@ -1842,7 +1842,7 @@ bool wxTextCtrl::ScrollPages(int pages)
|
||||
{
|
||||
GtkAdjustment *adj = GetVAdj();
|
||||
if ( !adj )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return DoScroll(adj, (int)ceil(pages*adj->page_increment));
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
|
||||
|
||||
if (combo->m_ignoreNextUpdate)
|
||||
{
|
||||
combo->m_ignoreNextUpdate = FALSE;
|
||||
combo->m_ignoreNextUpdate = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,16 +192,16 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
||||
long style, const wxValidator& validator,
|
||||
const wxString& name )
|
||||
{
|
||||
m_ignoreNextUpdate = FALSE;
|
||||
m_needParent = TRUE;
|
||||
m_acceptsFocus = TRUE;
|
||||
m_ignoreNextUpdate = false;
|
||||
m_needParent = true;
|
||||
m_acceptsFocus = true;
|
||||
m_prevSelection = 0;
|
||||
|
||||
if (!PreCreation( parent, pos, size ) ||
|
||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxComboBox creation failed") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_widget = gtk_combo_new();
|
||||
@@ -276,7 +276,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
||||
wxSize setsize = GetSize();
|
||||
gtk_widget_set_usize( m_widget, setsize.x, setsize.y );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxComboBox::~wxComboBox()
|
||||
@@ -780,7 +780,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return (long) GET_EDITABLE_POS( GTK_COMBO(m_widget)->entry );
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
|
||||
int pos = GTK_ENTRY(entry)->text_length;
|
||||
|
@@ -292,8 +292,8 @@ END_EVENT_TABLE()
|
||||
void wxTextCtrl::Init()
|
||||
{
|
||||
m_ignoreNextUpdate =
|
||||
m_modified = FALSE;
|
||||
SetUpdateFont(FALSE);
|
||||
m_modified = false;
|
||||
SetUpdateFont(false);
|
||||
m_text =
|
||||
m_vScrollbar = (GtkWidget *)NULL;
|
||||
#ifdef __WXGTK20__
|
||||
@@ -324,18 +324,18 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
const wxValidator& validator,
|
||||
const wxString &name )
|
||||
{
|
||||
m_needParent = TRUE;
|
||||
m_acceptsFocus = TRUE;
|
||||
m_needParent = true;
|
||||
m_acceptsFocus = true;
|
||||
|
||||
if (!PreCreation( parent, pos, size ) ||
|
||||
!CreateBase( parent, id, pos, size, style, validator, name ))
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxTextCtrl creation failed") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
m_vScrollbarVisible = FALSE;
|
||||
m_vScrollbarVisible = false;
|
||||
|
||||
bool multi_line = (style & wxTE_MULTILINE) != 0;
|
||||
|
||||
@@ -370,7 +370,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
m_text = gtk_text_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL );
|
||||
|
||||
// ... and put into the upper left hand corner of the table
|
||||
bool bHasHScrollbar = FALSE;
|
||||
bool bHasHScrollbar = false;
|
||||
m_widget = gtk_table_new(bHasHScrollbar ? 2 : 1, 2, FALSE);
|
||||
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
|
||||
gtk_table_attach( GTK_TABLE(m_widget), m_text, 0, 1, 0, 1,
|
||||
@@ -431,7 +431,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
}
|
||||
#endif // GTK+ 1.x
|
||||
|
||||
if (!value.IsEmpty())
|
||||
if (!value.empty())
|
||||
{
|
||||
#ifdef __WXGTK20__
|
||||
SetValue( value );
|
||||
@@ -526,7 +526,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
wxTextAttr attrDef(GetForegroundColour(), GetBackgroundColour(), GetFont());
|
||||
SetDefaultStyle( attrDef );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -542,7 +542,7 @@ void wxTextCtrl::CalculateScrollbar()
|
||||
if (m_vScrollbarVisible)
|
||||
{
|
||||
gtk_widget_hide( m_vScrollbar );
|
||||
m_vScrollbarVisible = FALSE;
|
||||
m_vScrollbarVisible = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -550,7 +550,7 @@ void wxTextCtrl::CalculateScrollbar()
|
||||
if (!m_vScrollbarVisible)
|
||||
{
|
||||
gtk_widget_show( m_vScrollbar );
|
||||
m_vScrollbarVisible = TRUE;
|
||||
m_vScrollbarVisible = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -629,7 +629,7 @@ void wxTextCtrl::SetValue( const wxString &value )
|
||||
// customize this behaviour.
|
||||
SetInsertionPoint(0);
|
||||
|
||||
m_modified = FALSE;
|
||||
m_modified = false;
|
||||
}
|
||||
|
||||
void wxTextCtrl::WriteText( const wxString &text )
|
||||
@@ -683,7 +683,7 @@ void wxTextCtrl::WriteText( const wxString &text )
|
||||
// in UpdateFontIfNeeded() any longer
|
||||
if ( !text.empty() )
|
||||
{
|
||||
SetUpdateFont(FALSE);
|
||||
SetUpdateFont(false);
|
||||
}
|
||||
|
||||
// Bring editable's cursor back uptodate.
|
||||
@@ -785,7 +785,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
|
||||
|
||||
// cast to prevent warning. But pos really should've been unsigned.
|
||||
if( (unsigned long)pos > text.Len() )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
*x=0; // First Col
|
||||
*y=0; // First Line
|
||||
@@ -812,11 +812,11 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
|
||||
else
|
||||
{
|
||||
// index out of bounds
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
long wxTextCtrl::XYToPosition(long x, long y ) const
|
||||
@@ -957,7 +957,7 @@ bool wxTextCtrl::Enable( bool enable )
|
||||
if (!wxWindowBase::Enable(enable))
|
||||
{
|
||||
// nothing to do
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
@@ -974,7 +974,7 @@ bool wxTextCtrl::Enable( bool enable )
|
||||
gtk_widget_set_sensitive( m_text, enable );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// wxGTK-specific: called recursively by Enable,
|
||||
@@ -999,12 +999,12 @@ void wxTextCtrl::OnParentEnable( bool enable )
|
||||
|
||||
void wxTextCtrl::MarkDirty()
|
||||
{
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::DiscardEdits()
|
||||
{
|
||||
m_modified = FALSE;
|
||||
m_modified = false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -1013,19 +1013,19 @@ void wxTextCtrl::DiscardEdits()
|
||||
|
||||
void wxTextCtrl::IgnoreNextTextUpdate()
|
||||
{
|
||||
m_ignoreNextUpdate = TRUE;
|
||||
m_ignoreNextUpdate = true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::IgnoreTextUpdate()
|
||||
{
|
||||
if ( m_ignoreNextUpdate )
|
||||
{
|
||||
m_ignoreNextUpdate = FALSE;
|
||||
m_ignoreNextUpdate = false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetMaxLength(unsigned long len)
|
||||
@@ -1178,7 +1178,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
}
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
wxCHECK_MSG( m_text != NULL, 0, wxT("invalid text ctrl") );
|
||||
|
||||
@@ -1227,7 +1227,7 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value )
|
||||
|
||||
Remove( from, to );
|
||||
|
||||
if (!value.IsEmpty())
|
||||
if (!value.empty())
|
||||
{
|
||||
#ifdef __WXGTK20__
|
||||
SetInsertionPoint( from );
|
||||
@@ -1297,14 +1297,14 @@ bool wxTextCtrl::CanUndo() const
|
||||
{
|
||||
// TODO
|
||||
//wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::CanRedo() const
|
||||
{
|
||||
// TODO
|
||||
//wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") );
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the return values from and to are the same, there is no
|
||||
@@ -1315,7 +1315,7 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
|
||||
gint from = -1;
|
||||
gint to = -1;
|
||||
bool haveSelection = FALSE;
|
||||
bool haveSelection = false;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
@@ -1323,7 +1323,7 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
GtkTextIter ifrom, ito;
|
||||
if ( gtk_text_buffer_get_selection_bounds(m_buffer, &ifrom, &ito) )
|
||||
{
|
||||
haveSelection = TRUE;
|
||||
haveSelection = true;
|
||||
from = gtk_text_iter_get_offset(&ifrom);
|
||||
to = gtk_text_iter_get_offset(&ito);
|
||||
}
|
||||
@@ -1333,13 +1333,13 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
if ( gtk_editable_get_selection_bounds( GTK_EDITABLE(m_text),
|
||||
&from, &to) )
|
||||
{
|
||||
haveSelection = TRUE;
|
||||
haveSelection = true;
|
||||
}
|
||||
}
|
||||
#else // not GTK2
|
||||
if ( (GTK_EDITABLE(m_text)->has_selection) )
|
||||
{
|
||||
haveSelection = TRUE;
|
||||
haveSelection = true;
|
||||
from = (long) GTK_EDITABLE(m_text)->selection_start_pos;
|
||||
to = (long) GTK_EDITABLE(m_text)->selection_end_pos;
|
||||
}
|
||||
@@ -1365,7 +1365,7 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
|
||||
bool wxTextCtrl::IsEditable() const
|
||||
{
|
||||
wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") );
|
||||
wxCHECK_MSG( m_text != NULL, false, wxT("invalid text ctrl") );
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
@@ -1451,24 +1451,24 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
// the font will change for subsequent text insertiongs
|
||||
bool wxTextCtrl::SetFont( const wxFont &font )
|
||||
{
|
||||
wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") );
|
||||
wxCHECK_MSG( m_text != NULL, false, wxT("invalid text ctrl") );
|
||||
|
||||
if ( !wxTextCtrlBase::SetFont(font) )
|
||||
{
|
||||
// font didn't change, nothing to do
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( m_windowStyle & wxTE_MULTILINE )
|
||||
{
|
||||
SetUpdateFont(TRUE);
|
||||
SetUpdateFont(true);
|
||||
|
||||
m_defaultStyle.SetFont(font);
|
||||
|
||||
ChangeFontGlobally();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::ChangeFontGlobally()
|
||||
@@ -1487,9 +1487,9 @@ void wxTextCtrl::ChangeFontGlobally()
|
||||
#endif
|
||||
|
||||
wxString value = GetValue();
|
||||
if ( !value.IsEmpty() )
|
||||
if ( !value.empty() )
|
||||
{
|
||||
SetUpdateFont(FALSE);
|
||||
SetUpdateFont(false);
|
||||
|
||||
Clear();
|
||||
AppendText(value);
|
||||
@@ -1509,35 +1509,35 @@ void wxTextCtrl::UpdateFontIfNeeded()
|
||||
bool wxTextCtrl::SetForegroundColour(const wxColour& colour)
|
||||
{
|
||||
if ( !wxControl::SetForegroundColour(colour) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// update default fg colour too
|
||||
m_defaultStyle.SetTextColour(colour);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::SetBackgroundColour( const wxColour &colour )
|
||||
{
|
||||
wxCHECK_MSG( m_text != NULL, FALSE, wxT("invalid text ctrl") );
|
||||
wxCHECK_MSG( m_text != NULL, false, wxT("invalid text ctrl") );
|
||||
|
||||
if ( !wxControl::SetBackgroundColour( colour ) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#ifndef __WXGTK20__
|
||||
if (!m_widget->window)
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (!m_backgroundColour.Ok())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (m_windowStyle & wxTE_MULTILINE)
|
||||
{
|
||||
#ifndef __WXGTK20__
|
||||
GdkWindow *window = GTK_TEXT(m_text)->text_area;
|
||||
if (!window)
|
||||
return FALSE;
|
||||
return false;
|
||||
m_backgroundColour.CalcPixel( gdk_window_get_colormap( window ) );
|
||||
gdk_window_set_background( window, m_backgroundColour.GetColor() );
|
||||
gdk_window_clear( window );
|
||||
@@ -1547,7 +1547,7 @@ bool wxTextCtrl::SetBackgroundColour( const wxColour &colour )
|
||||
// change active background color too
|
||||
m_defaultStyle.SetBackgroundColour( colour );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style )
|
||||
@@ -1557,12 +1557,12 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style )
|
||||
if ( style.IsDefault() )
|
||||
{
|
||||
// nothing to do
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#ifdef __WXGTK20__
|
||||
gint l = gtk_text_buffer_get_char_count( m_buffer );
|
||||
|
||||
wxCHECK_MSG( start >= 0 && end <= l, FALSE,
|
||||
wxCHECK_MSG( start >= 0 && end <= l, false,
|
||||
_T("invalid range in wxTextCtrl::SetStyle") );
|
||||
|
||||
GtkTextIter starti, endi;
|
||||
@@ -1576,14 +1576,14 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style )
|
||||
|
||||
wxGtkTextApplyTagsFromAttr( m_buffer, attr, &starti, &endi );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
#else
|
||||
// VERY dirty way to do that - removes the required text and re-adds it
|
||||
// with styling (FIXME)
|
||||
|
||||
gint l = gtk_text_get_length( GTK_TEXT(m_text) );
|
||||
|
||||
wxCHECK_MSG( start >= 0 && end <= l, FALSE,
|
||||
wxCHECK_MSG( start >= 0 && end <= l, false,
|
||||
_T("invalid range in wxTextCtrl::SetStyle") );
|
||||
|
||||
gint old_pos = gtk_editable_get_position( GTK_EDITABLE(m_text) );
|
||||
@@ -1615,12 +1615,12 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style )
|
||||
gtk_editable_set_position( GTK_EDITABLE(m_text), old_pos ); */
|
||||
SetInsertionPoint( old_pos );
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else // singe line
|
||||
{
|
||||
// cannot do this for GTK+'s Entry widget
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1808,7 +1808,7 @@ bool wxTextCtrl::DoScroll(GtkAdjustment *adj, int diff)
|
||||
if ( fabs(adj->value - value) < 0.2 )
|
||||
{
|
||||
// well, this is what Robert does in wxScrollBar, so it must be good...
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
adj->value = value;
|
||||
@@ -1819,14 +1819,14 @@ bool wxTextCtrl::DoScroll(GtkAdjustment *adj, int diff)
|
||||
gtk_signal_emit_by_name(GTK_OBJECT(adj), "value_changed");
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::ScrollLines(int lines)
|
||||
{
|
||||
GtkAdjustment *adj = GetVAdj();
|
||||
if ( !adj )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
int diff = (int)ceil(lines*adj->step_increment);
|
||||
@@ -1842,7 +1842,7 @@ bool wxTextCtrl::ScrollPages(int pages)
|
||||
{
|
||||
GtkAdjustment *adj = GetVAdj();
|
||||
if ( !adj )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return DoScroll(adj, (int)ceil(pages*adj->page_increment));
|
||||
}
|
||||
|
@@ -269,17 +269,17 @@ void wxComboBox::DoMoveWindow(int x, int y, int width, int height)
|
||||
bool wxComboBox::Enable(bool enable)
|
||||
{
|
||||
if ( !wxControl::Enable(enable) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxComboBox::Show(bool show)
|
||||
{
|
||||
if ( !wxControl::Show(show) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxComboBox::SetFocus()
|
||||
@@ -330,7 +330,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style ,
|
||||
wxDefaultValidator, name) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_choice = new wxComboBoxChoice(this, style );
|
||||
@@ -358,7 +358,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
SetBestSize(size); // Needed because it is a wxControlWithItems
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetValue() const
|
||||
@@ -452,7 +452,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
@@ -569,10 +569,10 @@ bool wxComboBox::SetStringSelection(const wxString& sel)
|
||||
if (s > -1)
|
||||
{
|
||||
SetSelection (s);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString& s)
|
||||
|
@@ -293,17 +293,17 @@ void wxComboBox::DoMoveWindow(int x, int y, int width, int height) {
|
||||
bool wxComboBox::Enable(bool enable)
|
||||
{
|
||||
if ( !wxControl::Enable(enable) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxComboBox::Show(bool show)
|
||||
{
|
||||
if ( !wxControl::Show(show) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxComboBox::SetFocus()
|
||||
@@ -358,12 +358,12 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
m_text = NULL;
|
||||
m_choice = NULL;
|
||||
#if USE_HICOMBOBOX
|
||||
m_macIsUserPane = FALSE ;
|
||||
m_macIsUserPane = false ;
|
||||
#endif
|
||||
if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style ,
|
||||
wxDefaultValidator, name) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
#if USE_HICOMBOBOX
|
||||
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
|
||||
@@ -431,7 +431,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
SetBestSize(csize); // Needed because it is a wxControlWithItems
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetValue() const
|
||||
@@ -532,7 +532,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
@@ -686,7 +686,7 @@ int wxComboBox::FindString(const wxString& s) const
|
||||
#if USE_HICOMBOBOX
|
||||
for( int i = 0 ; i < GetCount() ; i++ )
|
||||
{
|
||||
if ( GetString( i ).IsSameAs(s, FALSE) )
|
||||
if ( GetString( i ).IsSameAs(s, false) )
|
||||
return i ;
|
||||
}
|
||||
return wxNOT_FOUND ;
|
||||
@@ -725,10 +725,10 @@ bool wxComboBox::SetStringSelection(const wxString& sel)
|
||||
if (s > -1)
|
||||
{
|
||||
SetSelection (s);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString& s)
|
||||
|
@@ -171,7 +171,7 @@ public :
|
||||
virtual void Paste() ;
|
||||
virtual bool CanPaste() const ;
|
||||
virtual void SetEditable(bool editable) ;
|
||||
virtual long GetLastPosition() const ;
|
||||
virtual wxTextPos GetLastPosition() const ;
|
||||
virtual void Replace( long from , long to , const wxString str ) ;
|
||||
virtual void Remove( long from , long to ) = 0 ;
|
||||
virtual void SetSelection( long from , long to ) = 0 ;
|
||||
@@ -210,7 +210,7 @@ public :
|
||||
virtual void Paste() ;
|
||||
virtual bool CanPaste() const ;
|
||||
virtual void SetEditable(bool editable) ;
|
||||
virtual long GetLastPosition() const ;
|
||||
virtual wxTextPos GetLastPosition() const ;
|
||||
virtual void Replace( long from , long to , const wxString str ) ;
|
||||
virtual void Remove( long from , long to ) ;
|
||||
virtual void GetSelection( long* from, long* to) const ;
|
||||
@@ -352,14 +352,14 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
m_macIsUserPane = FALSE ;
|
||||
m_macIsUserPane = false ;
|
||||
m_editable = true ;
|
||||
|
||||
if ( ! ( style & wxNO_BORDER) )
|
||||
style = ( style & ~wxBORDER_MASK) | wxSUNKEN_BORDER ;
|
||||
|
||||
if ( !wxTextCtrlBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
|
||||
|
||||
@@ -404,8 +404,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
SetEditable( false ) ;
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::MacVisibilityChanged()
|
||||
@@ -449,7 +448,7 @@ void wxTextCtrl::SetMaxLength(unsigned long len)
|
||||
bool wxTextCtrl::SetFont( const wxFont& font )
|
||||
{
|
||||
if ( !wxTextCtrlBase::SetFont( font ) )
|
||||
return FALSE ;
|
||||
return false ;
|
||||
|
||||
GetPeer()->SetFont( font , GetForegroundColour() , GetWindowStyle() ) ;
|
||||
return true ;
|
||||
@@ -465,7 +464,7 @@ bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style)
|
||||
{
|
||||
wxTextCtrlBase::SetDefaultStyle( style ) ;
|
||||
SetStyle( kTXNUseCurrentSelection , kTXNUseCurrentSelection , GetDefaultStyle() ) ;
|
||||
return TRUE ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
// Clipboard operations
|
||||
@@ -525,7 +524,7 @@ bool wxTextCtrl::CanCut() const
|
||||
bool wxTextCtrl::CanPaste() const
|
||||
{
|
||||
if (!IsEditable())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return GetPeer()->CanPaste() ;
|
||||
}
|
||||
@@ -546,7 +545,7 @@ void wxTextCtrl::SetInsertionPoint(long pos)
|
||||
|
||||
void wxTextCtrl::SetInsertionPointEnd()
|
||||
{
|
||||
long pos = GetLastPosition();
|
||||
wxTextPos pos = GetLastPosition();
|
||||
SetInsertionPoint(pos);
|
||||
}
|
||||
|
||||
@@ -557,7 +556,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
return begin ;
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
return GetPeer()->GetLastPosition( ) ;
|
||||
}
|
||||
@@ -581,10 +580,10 @@ bool wxTextCtrl::LoadFile(const wxString& file)
|
||||
{
|
||||
if ( wxTextCtrlBase::LoadFile(file) )
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxTextCtrl::WriteText(const wxString& str)
|
||||
@@ -853,7 +852,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
// this will make wxWidgets eat the ENTER key so that
|
||||
// we actually prevent line wrapping in a single line
|
||||
// text control
|
||||
eat_key = TRUE;
|
||||
eat_key = true;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1044,7 +1043,7 @@ void wxMacTextControl::SetEditable(bool editable)
|
||||
{
|
||||
}
|
||||
|
||||
long wxMacTextControl::GetLastPosition() const
|
||||
wxTextPos wxMacTextControl::GetLastPosition() const
|
||||
{
|
||||
return GetStringValue().Length() ;
|
||||
}
|
||||
@@ -1350,7 +1349,6 @@ wxString wxMacMLTEControl::GetStringValue() const
|
||||
#if SIZEOF_WCHAR_T == 2
|
||||
ptr = new wxChar[actualSize + 1 ] ;
|
||||
wxStrncpy( ptr , (wxChar*) *theText , actualSize ) ;
|
||||
|
||||
#else
|
||||
SetHandleSize( theText , ( actualSize + 1 ) * sizeof( UniChar ) ) ;
|
||||
HLock( theText ) ;
|
||||
@@ -1461,7 +1459,6 @@ void wxMacMLTEControl::AdjustCreationAttributes( const wxColour &background, boo
|
||||
iControlData[1].uValue = kTXNNoAutoWrap ;
|
||||
else
|
||||
iControlData[1].uValue = kTXNAutoWrap ;
|
||||
|
||||
}
|
||||
verify_noerr( TXNSetTXNObjectControls( m_txn, false, toptag,
|
||||
iControlTags, iControlData )) ;
|
||||
@@ -1594,9 +1591,9 @@ void wxMacMLTEControl::SetEditable(bool editable)
|
||||
TXNSetTXNObjectControls( m_txn , false , sizeof(tag) / sizeof (TXNControlTag) , tag , data ) ;
|
||||
}
|
||||
|
||||
long wxMacMLTEControl::GetLastPosition() const
|
||||
wxTextPos wxMacMLTEControl::GetLastPosition() const
|
||||
{
|
||||
long actualsize = 0 ;
|
||||
wxTextPos actualsize = 0 ;
|
||||
|
||||
Handle theText ;
|
||||
OSErr err = TXNGetDataEncoded( m_txn, kTXNStartOffset, kTXNEndOffset, &theText , kTXNTextData );
|
||||
@@ -1700,7 +1697,7 @@ long wxMacMLTEControl::XYToPosition(long x, long y) const
|
||||
{
|
||||
Point curpt ;
|
||||
|
||||
long lastpos = GetLastPosition() ;
|
||||
wxTextPos lastpos = GetLastPosition() ;
|
||||
|
||||
// TODO find a better implementation : while we can get the
|
||||
// line metrics of a certain line, we don't get its starting
|
||||
@@ -1735,7 +1732,7 @@ bool wxMacMLTEControl::PositionToXY(long pos, long *x, long *y) const
|
||||
{
|
||||
Point curpt ;
|
||||
|
||||
long lastpos = GetLastPosition() ;
|
||||
wxTextPos lastpos = GetLastPosition() ;
|
||||
|
||||
if ( y ) *y = 0 ;
|
||||
if ( x ) *x = 0 ;
|
||||
@@ -1769,7 +1766,7 @@ bool wxMacMLTEControl::PositionToXY(long pos, long *x, long *y) const
|
||||
if ( x ) *x = xpos ;
|
||||
}
|
||||
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
void wxMacMLTEControl::ShowPosition( long pos )
|
||||
@@ -2019,7 +2016,6 @@ OSStatus MLTESetObjectVisibility( STPTextPaneVars *varsp, Boolean vis , long wxS
|
||||
{
|
||||
TXNSetFrameBounds( varsp->fTXNRec, varsp->fRTextArea.top + 20000 , varsp->fRTextArea.left + 20000 ,
|
||||
varsp->fRTextArea.bottom + 20000 , varsp->fRTextArea.right + 20000 , varsp->fTXNFrame);
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -2062,7 +2058,6 @@ static void TPUpdateVisibility(ControlRef theControl) {
|
||||
|
||||
// make correct activations
|
||||
static void TPActivatePaneText(STPTextPaneVars *varsp, Boolean setActive) {
|
||||
|
||||
wxTextCtrl* textctrl = (wxTextCtrl*) GetControlReference(varsp->fUserPaneRec);
|
||||
if (varsp->fTXNObjectActive != setActive && textctrl->MacIsReallyShown() )
|
||||
{
|
||||
@@ -2075,7 +2070,6 @@ static void TPActivatePaneText(STPTextPaneVars *varsp, Boolean setActive) {
|
||||
|
||||
// update focus outlines
|
||||
static void TPRedrawFocusOutline(STPTextPaneVars *varsp) {
|
||||
|
||||
/* state changed */
|
||||
if (varsp->fFocusDrawState != (varsp->fIsActive && varsp->fInFocus))
|
||||
{
|
||||
@@ -2112,7 +2106,6 @@ static pascal void TPPaneDrawProc(ControlRef theControl, ControlPartCode thePart
|
||||
DrawThemeEditTextFrame(&varsp->fRTextOutline, varsp->fIsActive ? kThemeStateActive: kThemeStateInactive);
|
||||
TPRedrawFocusOutline( varsp ) ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2190,7 +2183,6 @@ static pascal ControlPartCode TPPaneTrackingProc(ControlRef theControl, Point st
|
||||
|
||||
switch (TPPaneHitTestProc(theControl, startPt))
|
||||
{
|
||||
|
||||
/* handle clicks in the text part */
|
||||
case kmUPTextPart:
|
||||
{
|
||||
@@ -2546,7 +2538,6 @@ wxMacMLTEHIViewControl::wxMacMLTEHIViewControl( wxWindow *wxPeer,
|
||||
m_controlRef = m_textView ;
|
||||
}
|
||||
|
||||
|
||||
SetTXNData( st , kTXNStartOffset, kTXNEndOffset ) ;
|
||||
|
||||
TXNSetSelection( m_txn, 0, 0);
|
||||
|
@@ -223,17 +223,17 @@ void wxComboBox::DoMoveWindow(int x, int y, int width, int height) {
|
||||
bool wxComboBox::Enable(bool enable)
|
||||
{
|
||||
if ( !wxControl::Enable(enable) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxComboBox::Show(bool show)
|
||||
{
|
||||
if ( !wxControl::Show(show) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxComboBox::SetFocus()
|
||||
@@ -284,7 +284,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
if ( !wxControl::Create(parent, id, wxDefaultPosition, wxDefaultSize, style ,
|
||||
wxDefaultValidator, name) )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_choice = new wxComboBoxChoice(this, style );
|
||||
@@ -309,7 +309,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
m_choice->DoAppend( choices[ i ] );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetValue() const
|
||||
@@ -400,7 +400,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
@@ -517,10 +517,10 @@ bool wxComboBox::SetStringSelection(const wxString& sel)
|
||||
if (s > -1)
|
||||
{
|
||||
SetSelection (s);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString& s)
|
||||
@@ -530,7 +530,6 @@ void wxComboBox::SetString(int n, const wxString& s)
|
||||
|
||||
bool wxComboBox::IsEditable() const
|
||||
{
|
||||
|
||||
return m_text != NULL && !HasFlag(wxCB_READONLY);
|
||||
}
|
||||
|
||||
|
@@ -728,7 +728,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
// base initialization
|
||||
if ( !wxTextCtrlBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
wxSize mySize = size ;
|
||||
if ( m_macUsesTXN )
|
||||
@@ -767,7 +767,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
if ( m_windowStyle & wxTE_READONLY)
|
||||
{
|
||||
m_editable = FALSE ;
|
||||
m_editable = false ;
|
||||
}
|
||||
|
||||
wxString st = str ;
|
||||
@@ -813,7 +813,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
TXNShowSelection( (TXNObject) m_macTXN, kTXNShowStart);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString wxTextCtrl::GetValue() const
|
||||
@@ -990,14 +990,14 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
|
||||
if ( !formerEditable )
|
||||
SetEditable(formerEditable) ;
|
||||
}
|
||||
return TRUE ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style)
|
||||
{
|
||||
wxTextCtrlBase::SetDefaultStyle( style ) ;
|
||||
SetStyle( kTXNUseCurrentSelection , kTXNUseCurrentSelection , GetDefaultStyle() ) ;
|
||||
return TRUE ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
// Clipboard operations
|
||||
@@ -1089,7 +1089,7 @@ bool wxTextCtrl::CanCut() const
|
||||
bool wxTextCtrl::CanPaste() const
|
||||
{
|
||||
if (!IsEditable())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#if TARGET_CARBON
|
||||
OSStatus err = noErr;
|
||||
@@ -1105,20 +1105,20 @@ bool wxTextCtrl::CanPaste() const
|
||||
{
|
||||
if (( err = GetScrapFlavorSize( scrapRef, 'TEXT', &byteCount )) == noErr)
|
||||
{
|
||||
return TRUE ;
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
#else
|
||||
long offset ;
|
||||
if ( GetScrap( NULL , 'TEXT' , &offset ) > 0 )
|
||||
{
|
||||
return TRUE ;
|
||||
return true ;
|
||||
}
|
||||
#endif
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetEditable(bool editable)
|
||||
@@ -1149,7 +1149,7 @@ void wxTextCtrl::SetInsertionPoint(long pos)
|
||||
|
||||
void wxTextCtrl::SetInsertionPointEnd()
|
||||
{
|
||||
long pos = GetLastPosition();
|
||||
wxTextPos pos = GetLastPosition();
|
||||
SetInsertionPoint(pos);
|
||||
}
|
||||
|
||||
@@ -1160,7 +1160,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
return begin ;
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
if ( !m_macUsesTXN )
|
||||
{
|
||||
@@ -1278,10 +1278,10 @@ bool wxTextCtrl::LoadFile(const wxString& file)
|
||||
{
|
||||
if ( wxTextCtrlBase::LoadFile(file) )
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxTextCtrl::WriteText(const wxString& str)
|
||||
@@ -1414,7 +1414,7 @@ bool wxTextCtrl::CanUndo() const
|
||||
{
|
||||
return TXNCanUndo((TXNObject)m_macTXN,NULL);
|
||||
}
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::CanRedo() const
|
||||
@@ -1427,7 +1427,7 @@ bool wxTextCtrl::CanRedo() const
|
||||
{
|
||||
return TXNCanRedo((TXNObject)m_macTXN,NULL);
|
||||
}
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// Makes modifie or unmodified
|
||||
@@ -1470,7 +1470,7 @@ long wxTextCtrl::XYToPosition(long x, long y) const
|
||||
|
||||
bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
|
||||
{
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
void wxTextCtrl::ShowPosition(long pos)
|
||||
@@ -1641,7 +1641,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
// this will make wxWidgets eat the ENTER key so that
|
||||
// we actually prevent line wrapping in a single line
|
||||
// text control
|
||||
eat_key = TRUE;
|
||||
eat_key = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@@ -53,7 +53,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& name)
|
||||
{
|
||||
if( !CreateControl( parent, id, pos, size, style, validator, name ) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
m_noStrings = n;
|
||||
|
||||
@@ -83,7 +83,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
SetValue(value);
|
||||
|
||||
ChangeFont(FALSE);
|
||||
ChangeFont(false);
|
||||
|
||||
XtAddCallback (buttonWidget, XmNselectionCallback, (XtCallbackProc) wxComboBoxCallback,
|
||||
(XtPointer) this);
|
||||
@@ -94,7 +94,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
ChangeBackgroundColour();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
@@ -141,11 +141,11 @@ wxString wxComboBox::GetValue() const
|
||||
|
||||
void wxComboBox::SetValue(const wxString& value)
|
||||
{
|
||||
m_inSetValue = TRUE;
|
||||
m_inSetValue = true;
|
||||
if( !value.empty() )
|
||||
XmComboBoxSetString( (Widget)m_mainWidget,
|
||||
wxConstCast(value.c_str(), char) );
|
||||
m_inSetValue = FALSE;
|
||||
m_inSetValue = false;
|
||||
}
|
||||
|
||||
void wxComboBox::SetString(int n, const wxString& s)
|
||||
@@ -281,9 +281,9 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return (long) XmComboBoxGetInsertionPosition ((Widget) m_mainWidget);
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
return (long) XmComboBoxGetLastPosition ((Widget) m_mainWidget);
|
||||
return (wxTextPos) XmComboBoxGetLastPosition ((Widget) m_mainWidget);
|
||||
}
|
||||
|
||||
void wxComboBox::Replace(long from, long to, const wxString& value)
|
||||
|
@@ -333,7 +333,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return (long)XmTextGetInsertionPosition( GetXmText(this) );
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
XmTextPosition pos = XmTextGetLastPosition( GetXmText(this) );
|
||||
return (long)pos;
|
||||
|
@@ -97,8 +97,8 @@ static void wxTextWindowActivateProc(Widget w, XtPointer clientData, XmAnyCallba
|
||||
wxTextCtrl::wxTextCtrl()
|
||||
{
|
||||
m_tempCallbackStruct = (void*) NULL;
|
||||
m_modified = FALSE;
|
||||
m_processedDefault = FALSE;
|
||||
m_modified = false;
|
||||
m_processedDefault = false;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::Create(wxWindow *parent,
|
||||
@@ -114,8 +114,8 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
||||
return false;
|
||||
|
||||
m_tempCallbackStruct = (void*) NULL;
|
||||
m_modified = FALSE;
|
||||
m_processedDefault = FALSE;
|
||||
m_modified = false;
|
||||
m_processedDefault = false;
|
||||
|
||||
m_backgroundColour = *wxWHITE;
|
||||
|
||||
@@ -194,7 +194,7 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
||||
XtAddCallback((Widget) m_mainWidget, XmNlosingFocusCallback, (XtCallbackProc)wxTextWindowLoseFocusProc, (XtPointer)this);
|
||||
|
||||
// font
|
||||
ChangeFont(FALSE);
|
||||
ChangeFont(false);
|
||||
|
||||
wxSize best = GetBestSize();
|
||||
if( size.x != -1 ) best.x = size.x;
|
||||
@@ -205,7 +205,7 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
||||
|
||||
ChangeBackgroundColour();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
WXWidget wxTextCtrl::GetTopWidget() const
|
||||
@@ -248,7 +248,7 @@ wxString wxTextCtrl::GetValue() const
|
||||
|
||||
void wxTextCtrl::SetValue(const wxString& value)
|
||||
{
|
||||
m_inSetValue = TRUE;
|
||||
m_inSetValue = true;
|
||||
|
||||
// do this instead... MB
|
||||
//
|
||||
@@ -262,7 +262,7 @@ void wxTextCtrl::SetValue(const wxString& value)
|
||||
Clear();
|
||||
AppendText( value );
|
||||
|
||||
m_inSetValue = FALSE;
|
||||
m_inSetValue = false;
|
||||
}
|
||||
|
||||
// Clipboard operations
|
||||
@@ -316,13 +316,13 @@ void wxTextCtrl::Redo()
|
||||
bool wxTextCtrl::CanUndo() const
|
||||
{
|
||||
// No Undo in Motif
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::CanRedo() const
|
||||
{
|
||||
// No Redo in Motif
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the return values from and to are the same, there is no
|
||||
@@ -354,7 +354,7 @@ void wxTextCtrl::SetInsertionPoint(long pos)
|
||||
|
||||
void wxTextCtrl::SetInsertionPointEnd()
|
||||
{
|
||||
long pos = GetLastPosition();
|
||||
wxTextPos pos = GetLastPosition();
|
||||
SetInsertionPoint(pos);
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
return (long) XmTextGetInsertionPosition ((Widget) m_mainWidget);
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
return (long) XmTextGetLastPosition ((Widget) m_mainWidget);
|
||||
}
|
||||
@@ -398,24 +398,24 @@ void wxTextCtrl::WriteText(const wxString& text)
|
||||
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
|
||||
SetInsertionPoint(textPosition);
|
||||
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::AppendText(const wxString& text)
|
||||
{
|
||||
long textPosition = GetLastPosition() + text.length();
|
||||
wxTextPos textPosition = GetLastPosition() + text.length();
|
||||
XmTextInsert ((Widget) m_mainWidget, GetLastPosition(),
|
||||
wxConstCast(text.c_str(), char));
|
||||
XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL);
|
||||
SetInsertionPoint(textPosition);
|
||||
XmTextShowPosition ((Widget) m_mainWidget, textPosition);
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::Clear()
|
||||
{
|
||||
XmTextSetString ((Widget) m_mainWidget, "");
|
||||
m_modified = FALSE;
|
||||
m_modified = false;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::IsModified() const
|
||||
@@ -426,12 +426,12 @@ bool wxTextCtrl::IsModified() const
|
||||
// Makes modified or unmodified
|
||||
void wxTextCtrl::MarkDirty()
|
||||
{
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::DiscardEdits()
|
||||
{
|
||||
m_modified = FALSE;
|
||||
m_modified = false;
|
||||
}
|
||||
|
||||
int wxTextCtrl::GetNumberOfLines() const
|
||||
@@ -442,7 +442,7 @@ int wxTextCtrl::GetNumberOfLines() const
|
||||
{
|
||||
long i = 0;
|
||||
int currentLine = 0;
|
||||
bool finished = FALSE;
|
||||
bool finished = false;
|
||||
while (!finished)
|
||||
{
|
||||
int ch = s[i];
|
||||
@@ -453,7 +453,7 @@ int wxTextCtrl::GetNumberOfLines() const
|
||||
}
|
||||
else if (ch == 0)
|
||||
{
|
||||
finished = TRUE;
|
||||
finished = true;
|
||||
}
|
||||
else
|
||||
i++;
|
||||
@@ -488,7 +488,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
|
||||
if ( y )
|
||||
*y = yy;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::ShowPosition(long pos)
|
||||
@@ -551,7 +551,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
|
||||
// Indicates that we should generate a normal command, because
|
||||
// we're letting default behaviour happen (otherwise it's vetoed
|
||||
// by virtue of overriding OnChar)
|
||||
m_processedDefault = TRUE;
|
||||
m_processedDefault = true;
|
||||
|
||||
if (m_tempCallbackStruct)
|
||||
{
|
||||
@@ -588,12 +588,12 @@ void wxTextCtrl::ChangeBackgroundColour()
|
||||
NULL);
|
||||
wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
|
||||
if (hsb)
|
||||
wxDoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
|
||||
wxDoChangeBackgroundColour((WXWidget) hsb, backgroundColour, true);
|
||||
if (vsb)
|
||||
wxDoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
|
||||
wxDoChangeBackgroundColour((WXWidget) vsb, backgroundColour, true);
|
||||
|
||||
// MBN: why change parent background?
|
||||
// DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
|
||||
// DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -756,14 +756,14 @@ wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer WXUNUSED(ptr)
|
||||
return;
|
||||
|
||||
wxTextCtrl *tw = (wxTextCtrl *) clientData;
|
||||
tw->SetModified(TRUE);
|
||||
tw->SetModified(true);
|
||||
}
|
||||
|
||||
static void
|
||||
wxTextWindowModifyProc (Widget WXUNUSED(w), XtPointer clientData, XmTextVerifyCallbackStruct *cbs)
|
||||
{
|
||||
wxTextCtrl *tw = (wxTextCtrl *) clientData;
|
||||
tw->m_processedDefault = FALSE;
|
||||
tw->m_processedDefault = false;
|
||||
|
||||
// First, do some stuff if it's a password control: in this case, we need
|
||||
// to store the string inside the class because GetValue() can't retrieve
|
||||
|
@@ -620,7 +620,7 @@ void wxComboBox::SetInsertionPointEnd()
|
||||
// setting insertion point doesn't make sense for read only comboboxes
|
||||
if ( !(GetWindowStyle() & wxCB_READONLY) )
|
||||
{
|
||||
long pos = GetLastPosition();
|
||||
wxTextPos pos = GetLastPosition();
|
||||
SetInsertionPoint(pos);
|
||||
}
|
||||
}
|
||||
@@ -635,15 +635,15 @@ long wxComboBox::GetInsertionPoint() const
|
||||
#endif
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
HWND hEditWnd = (HWND) GetEditHWND();
|
||||
|
||||
// Get number of characters in the last (only) line. We'll add this to the character
|
||||
// index for the last line, 1st position.
|
||||
int lineLength = (int)SendMessage(hEditWnd, EM_LINELENGTH, (WPARAM) 0, (LPARAM)0L);
|
||||
wxTextPos lineLength = (wxTextPos)SendMessage(hEditWnd, EM_LINELENGTH, (WPARAM) 0, (LPARAM)0L);
|
||||
|
||||
return (long)(lineLength);
|
||||
return lineLength;
|
||||
}
|
||||
|
||||
void wxComboBox::Replace(long from, long to, const wxString& value)
|
||||
|
@@ -1141,7 +1141,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
return Pos & 0xFFFF;
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
int numLines = GetNumberOfLines();
|
||||
long posStartLastLine = XYToPosition(0, numLines - 1);
|
||||
@@ -2466,7 +2466,7 @@ bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style)
|
||||
{
|
||||
// we have to do this or the style wouldn't apply for the text typed by
|
||||
// the user
|
||||
long posLast = GetLastPosition();
|
||||
wxTextPos posLast = GetLastPosition();
|
||||
SetStyle(posLast, posLast, m_defaultStyle);
|
||||
}
|
||||
|
||||
|
@@ -566,7 +566,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
return Pos & 0xFFFF;
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
int numLines = GetNumberOfLines();
|
||||
long posStartLastLine = XYToPosition(0, numLines - 1);
|
||||
|
@@ -81,9 +81,9 @@ bool wxComboBox::OS2Command(
|
||||
}
|
||||
//
|
||||
// There is no return value for the CBN_ notifications, so always return
|
||||
// FALSE from here to pass the message to DefWindowProc()
|
||||
// false from here to pass the message to DefWindowProc()
|
||||
//
|
||||
return FALSE;
|
||||
return false;
|
||||
} // end of wxComboBox::OS2Command
|
||||
|
||||
bool wxComboBox::Create(
|
||||
@@ -117,7 +117,7 @@ bool wxComboBox::Create(
|
||||
, const wxString& rsName
|
||||
)
|
||||
{
|
||||
m_isShown = FALSE;
|
||||
m_isShown = false;
|
||||
|
||||
if (!CreateControl( pParent
|
||||
,vId
|
||||
@@ -127,7 +127,7 @@ bool wxComboBox::Create(
|
||||
,rValidator
|
||||
,rsName
|
||||
))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
//
|
||||
// Get the right style
|
||||
@@ -150,7 +150,7 @@ bool wxComboBox::Create(
|
||||
if (!OS2CreateControl( "COMBOBOX"
|
||||
,lSstyle
|
||||
))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
//
|
||||
// A choice/combobox normally has a white background (or other, depending
|
||||
@@ -171,7 +171,7 @@ bool wxComboBox::Create(
|
||||
,rSize.x
|
||||
,rSize.y
|
||||
);
|
||||
if (!rsValue.IsEmpty())
|
||||
if (!rsValue.empty())
|
||||
{
|
||||
SetValue(rsValue);
|
||||
}
|
||||
@@ -179,8 +179,8 @@ bool wxComboBox::Create(
|
||||
,(PFNWP)wxComboEditWndProc
|
||||
);
|
||||
::WinSetWindowULong(GetHwnd(), QWL_USER, (ULONG)this);
|
||||
Show(TRUE);
|
||||
return TRUE;
|
||||
Show(true);
|
||||
return true;
|
||||
} // end of wxComboBox::Create
|
||||
|
||||
void wxComboBox::SetValue(
|
||||
@@ -237,7 +237,7 @@ void wxComboBox::SetInsertionPoint(
|
||||
|
||||
void wxComboBox::SetInsertionPointEnd()
|
||||
{
|
||||
long lPos = GetLastPosition();
|
||||
wxTextPos lPos = GetLastPosition();
|
||||
|
||||
SetInsertionPoint(lPos);
|
||||
} // end of wxComboBox::SetInsertionPointEnd
|
||||
@@ -254,7 +254,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return lPos;
|
||||
} // end of wxComboBox::GetInsertionPoint
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
long lLineLength = 0L;
|
||||
WNDPARAMS vParams;
|
||||
@@ -381,7 +381,7 @@ bool wxComboBox::ProcessEditMsg(
|
||||
case KC_CHAR:
|
||||
return (HandleChar( wParam
|
||||
,lParam
|
||||
,TRUE /* isASCII */
|
||||
,true /* isASCII */
|
||||
));
|
||||
|
||||
case KC_PREVDOWN:
|
||||
@@ -403,7 +403,7 @@ bool wxComboBox::ProcessEditMsg(
|
||||
return(HandleKillFocus((WXHWND)(HWND)wParam));
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
} // end of WinGuiBase_CComboBox::ProcessEditMsg
|
||||
|
||||
MRESULT EXPENTRY wxComboEditWndProc(
|
||||
|
@@ -112,7 +112,7 @@ bool wxTextCtrl::Create(
|
||||
,rValidator
|
||||
,rsName
|
||||
))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
wxPoint vPos = rPos; // The OS/2 position
|
||||
SWP vSwp;
|
||||
@@ -123,7 +123,7 @@ bool wxTextCtrl::Create(
|
||||
}
|
||||
|
||||
m_windowStyle = lStyle;
|
||||
m_bIsMLE = FALSE;
|
||||
m_bIsMLE = false;
|
||||
|
||||
long lSstyle = WS_VISIBLE | WS_TABSTOP;
|
||||
|
||||
@@ -133,7 +133,7 @@ bool wxTextCtrl::Create(
|
||||
if ( m_windowStyle & wxTE_MULTILINE )
|
||||
{
|
||||
lSstyle |= MLS_BORDER | MLS_WORDWRAP;
|
||||
m_bIsMLE = TRUE;
|
||||
m_bIsMLE = true;
|
||||
|
||||
if ((m_windowStyle & wxTE_NO_VSCROLL) == 0)
|
||||
lSstyle |= MLS_VSCROLL;
|
||||
@@ -191,7 +191,7 @@ bool wxTextCtrl::Create(
|
||||
|
||||
if (m_hWnd == 0)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
SubclassWin(GetHWND());
|
||||
@@ -205,7 +205,7 @@ bool wxTextCtrl::Create(
|
||||
,wxNORMAL
|
||||
);
|
||||
SetFont(*pTextFont);
|
||||
if (!rsValue.IsEmpty())
|
||||
if (!rsValue.empty())
|
||||
{
|
||||
SetValue(rsValue);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ bool wxTextCtrl::Create(
|
||||
,rSize.y
|
||||
);
|
||||
delete pTextFont;
|
||||
return TRUE;
|
||||
return true;
|
||||
} // end of wxTextCtrl::Create
|
||||
|
||||
//
|
||||
@@ -456,10 +456,10 @@ bool wxTextCtrl::CanCut() const
|
||||
|
||||
bool wxTextCtrl::CanPaste() const
|
||||
{
|
||||
bool bIsTextAvailable = FALSE;
|
||||
bool bIsTextAvailable = false;
|
||||
|
||||
if (!IsEditable())
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
//
|
||||
// Check for straight text on clipboard
|
||||
@@ -502,7 +502,7 @@ void wxTextCtrl::SetInsertionPoint(
|
||||
|
||||
void wxTextCtrl::SetInsertionPointEnd()
|
||||
{
|
||||
long lPos = GetLastPosition();
|
||||
wxTextPos lPos = GetLastPosition();
|
||||
|
||||
//
|
||||
// We must not do anything if the caret is already there because calling
|
||||
@@ -530,7 +530,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
return (dwPos & 0xFFFF);
|
||||
} // end of wxTextCtrl::GetInsertionPoint
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
HWND hWnd = GetHwnd();
|
||||
long lCharIndex;
|
||||
@@ -687,9 +687,9 @@ bool wxTextCtrl::LoadFile(
|
||||
// Update the size limit if needed
|
||||
//
|
||||
AdjustSpaceLimit();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
} // end of wxTextCtrl::LoadFile
|
||||
|
||||
bool wxTextCtrl::IsModified() const
|
||||
@@ -773,7 +773,7 @@ bool wxTextCtrl::PositionToXY(
|
||||
if (nLineNo == -1)
|
||||
{
|
||||
// no such line
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -805,7 +805,7 @@ bool wxTextCtrl::PositionToXY(
|
||||
|
||||
if (lCharIndex == -1)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -816,7 +816,7 @@ bool wxTextCtrl::PositionToXY(
|
||||
if (plY)
|
||||
*plY = nLineNo;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
} // end of wxTextCtrl::PositionToXY
|
||||
|
||||
void wxTextCtrl::ShowPosition(
|
||||
@@ -956,7 +956,7 @@ bool wxTextCtrl::CanUndo() const
|
||||
if (m_bIsMLE)
|
||||
bOk = (::WinSendMsg(GetHwnd(), MLM_QUERYUNDO, 0, 0) != 0);
|
||||
else
|
||||
bOk = FALSE; // can't undo regular edit fields in PM
|
||||
bOk = false; // can't undo regular edit fields in PM
|
||||
return bOk;
|
||||
} // end of wxTextCtrl::CanUndo
|
||||
|
||||
@@ -967,7 +967,7 @@ bool wxTextCtrl::CanRedo() const
|
||||
if (m_bIsMLE)
|
||||
bOk = (::WinSendMsg(GetHwnd(), MLM_QUERYUNDO, 0, 0) != 0);
|
||||
else
|
||||
bOk = FALSE; // can't undo regular edit fields in PM
|
||||
bOk = false; // can't undo regular edit fields in PM
|
||||
return bOk;
|
||||
} // end of wxTextCtrl::CanRedo
|
||||
|
||||
@@ -1065,7 +1065,7 @@ void wxTextCtrl::OnChar(
|
||||
wxNavigationKeyEvent vEventNav;
|
||||
|
||||
vEventNav.SetDirection(!rEvent.ShiftDown());
|
||||
vEventNav.SetWindowChange(FALSE);
|
||||
vEventNav.SetWindowChange(false);
|
||||
vEventNav.SetEventObject(this);
|
||||
|
||||
if ( GetEventHandler()->ProcessEvent(vEventNav) )
|
||||
@@ -1117,15 +1117,15 @@ bool wxTextCtrl::OS2Command(
|
||||
case EN_SCROLL:
|
||||
case EN_INSERTMODETOGGLE:
|
||||
case EN_MEMERROR:
|
||||
return FALSE;
|
||||
return false;
|
||||
default:
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Processed
|
||||
//
|
||||
return TRUE;
|
||||
return true;
|
||||
} // end of wxTextCtrl::OS2Command
|
||||
|
||||
void wxTextCtrl::AdjustSpaceLimit()
|
||||
@@ -1325,7 +1325,7 @@ bool wxTextCtrl::SetBackgroundColour(
|
||||
{
|
||||
if (m_bIsMLE)
|
||||
::WinSendMsg(GetHwnd(), MLM_SETBACKCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
|
||||
return TRUE;
|
||||
return true;
|
||||
} // end of wxTextCtrl::SetBackgroundColour
|
||||
|
||||
bool wxTextCtrl::SetForegroundColour(
|
||||
@@ -1334,7 +1334,7 @@ bool wxTextCtrl::SetForegroundColour(
|
||||
{
|
||||
if (m_bIsMLE)
|
||||
::WinSendMsg(GetHwnd(), MLM_SETTEXTCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
|
||||
return TRUE;
|
||||
return true;
|
||||
} // end of wxTextCtrl::SetForegroundColour
|
||||
|
||||
bool wxTextCtrl::SetStyle(
|
||||
@@ -1381,6 +1381,6 @@ bool wxTextCtrl::SetStyle(
|
||||
//
|
||||
// TODO:: finish this part
|
||||
//
|
||||
return TRUE;
|
||||
return true;
|
||||
} // end of wxTextCtrl::SetStyle
|
||||
|
||||
|
@@ -244,7 +244,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@@ -378,7 +378,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@@ -763,7 +763,7 @@ long wxComboBox::GetInsertionPoint() const
|
||||
return GetText()->GetInsertionPoint();
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
return GetText()->GetLastPosition();
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@
|
||||
is true in which case a single LINE may correspond to multiple ROWs.
|
||||
|
||||
A text position is an unsigned int (which for reasons of compatibility is
|
||||
still a long) from 0 to GetLastPosition() inclusive. The positions
|
||||
still a long as wxTextPos) from 0 to GetLastPosition() inclusive. The positions
|
||||
correspond to the gaps between the letters so the position 0 is just
|
||||
before the first character and the last position is the one beyond the last
|
||||
character. For an empty text control GetLastPosition() returns 0.
|
||||
@@ -197,7 +197,7 @@ static inline void OrderPositions(wxTextPos& from, wxTextPos& to)
|
||||
|
||||
// the value which is never used for text position, even not -1 which is
|
||||
// sometimes used for some special meaning
|
||||
static const wxTextPos INVALID_POS_VALUE = -2;
|
||||
static const wxTextPos INVALID_POS_VALUE = wxInvalidTextCoord;
|
||||
|
||||
// overlap between pages (when using PageUp/Dn) in lines
|
||||
static const size_t PAGE_OVERLAP_IN_LINES = 1;
|
||||
@@ -1670,7 +1670,7 @@ wxTextPos wxTextCtrl::XYToPosition(wxTextCoord x, wxTextCoord y) const
|
||||
// if they are out of range
|
||||
if ( IsSingleLine() )
|
||||
{
|
||||
return x > GetLastPosition() || y > 0 ? wxDefaultCoord : x;
|
||||
return ( x > GetLastPosition() || y > 0 ) ? wxOutOfRangeTextCoord : x;
|
||||
}
|
||||
else // multiline
|
||||
{
|
||||
|
@@ -154,12 +154,12 @@ END_EVENT_TABLE()
|
||||
|
||||
void wxTextCtrl::Init()
|
||||
{
|
||||
m_editable = TRUE;
|
||||
m_modified = FALSE;
|
||||
m_editable = true;
|
||||
m_modified = false;
|
||||
|
||||
m_lang = wxSOURCE_LANG_NONE;
|
||||
|
||||
m_capturing = FALSE;
|
||||
m_capturing = false;
|
||||
|
||||
m_cursorX = 0;
|
||||
m_cursorY = 0;
|
||||
@@ -169,8 +169,8 @@ void wxTextCtrl::Init()
|
||||
m_bracketX = -1;
|
||||
m_bracketY = -1;
|
||||
|
||||
m_overwrite = FALSE;
|
||||
m_ignoreInput = FALSE;
|
||||
m_overwrite = false;
|
||||
m_ignoreInput = false;
|
||||
|
||||
ClearSelection();
|
||||
|
||||
@@ -255,7 +255,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
|
||||
MyAdjustScrollbars();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -277,7 +277,7 @@ wxString wxTextCtrl::GetValue() const
|
||||
|
||||
void wxTextCtrl::SetValue(const wxString& value)
|
||||
{
|
||||
m_modified = FALSE;
|
||||
m_modified = false;
|
||||
|
||||
wxString oldValue = GetValue();
|
||||
|
||||
@@ -287,7 +287,7 @@ void wxTextCtrl::SetValue(const wxString& value)
|
||||
m_lines.Clear();
|
||||
m_longestLine = 0;
|
||||
|
||||
if (value.IsEmpty())
|
||||
if (value.empty())
|
||||
{
|
||||
m_lines.Add( new wxSourceLine( wxT("") ) );
|
||||
}
|
||||
@@ -391,7 +391,7 @@ void wxTextCtrl::GetSelection(long* from, long* to) const
|
||||
|
||||
void wxTextCtrl::Clear()
|
||||
{
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
m_cursorX = 0;
|
||||
m_cursorY = 0;
|
||||
ClearSelection();
|
||||
@@ -410,7 +410,6 @@ void wxTextCtrl::Replace(long from, long to, const wxString& value)
|
||||
|
||||
void wxTextCtrl::Remove(long from, long to)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void wxTextCtrl::DiscardEdits()
|
||||
@@ -432,7 +431,7 @@ int wxTextCtrl::PosToPixel( int line, int pos )
|
||||
|
||||
wxString text = m_lines[line].m_text;
|
||||
|
||||
if (text.IsEmpty()) return 0;
|
||||
if (text.empty()) return 0;
|
||||
|
||||
if (pos < (int)text.Len())
|
||||
text.Remove( pos, text.Len()-pos );
|
||||
@@ -477,9 +476,9 @@ void wxTextCtrl::SetLanguage( wxSourceLanguage lang )
|
||||
|
||||
void wxTextCtrl::WriteText(const wxString& text2)
|
||||
{
|
||||
if (text2.IsEmpty()) return;
|
||||
if (text2.empty()) return;
|
||||
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
|
||||
wxString text( text2 );
|
||||
wxArrayString lines;
|
||||
@@ -535,9 +534,9 @@ void wxTextCtrl::WriteText(const wxString& text2)
|
||||
|
||||
void wxTextCtrl::AppendText(const wxString& text2)
|
||||
{
|
||||
if (text2.IsEmpty()) return;
|
||||
if (text2.empty()) return;
|
||||
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
|
||||
wxString text( text2 );
|
||||
wxArrayString lines;
|
||||
@@ -578,7 +577,7 @@ void wxTextCtrl::AppendText(const wxString& text2)
|
||||
|
||||
bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
long wxTextCtrl::XYToPosition(long x, long y) const
|
||||
@@ -628,7 +627,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
|
||||
xx = pos;
|
||||
if (x) *x = xx;
|
||||
if (y) *y = yy;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
pos -= (m_lines[i].m_text.Len() + 1);
|
||||
yy++;
|
||||
@@ -640,7 +639,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
|
||||
if (x) *x = xx;
|
||||
if (y) *y = yy;
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxTextCtrl::ShowPosition(long pos)
|
||||
@@ -740,7 +739,7 @@ void wxTextCtrl::Paste()
|
||||
|
||||
if (!ret) return;
|
||||
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
|
||||
wxString text( data.GetText() );
|
||||
wxArrayString lines;
|
||||
@@ -806,7 +805,7 @@ void wxTextCtrl::Undo()
|
||||
delete undo;
|
||||
m_undos.Erase( node );
|
||||
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetInsertionPoint(long pos)
|
||||
@@ -830,7 +829,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
return XYToPosition( m_cursorX, m_cursorY );
|
||||
}
|
||||
|
||||
long wxTextCtrl::GetLastPosition() const
|
||||
wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
{
|
||||
size_t lineCount = m_lines.GetCount() - 1;
|
||||
// It's the length of the line, not the length - 1,
|
||||
@@ -849,7 +848,7 @@ void wxTextCtrl::SetEditable(bool editable)
|
||||
|
||||
bool wxTextCtrl::Enable( bool enable )
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::SetFont(const wxFont& font)
|
||||
@@ -867,7 +866,7 @@ bool wxTextCtrl::SetFont(const wxFont& font)
|
||||
|
||||
MyAdjustScrollbars();
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::SetForegroundColour(const wxColour& colour)
|
||||
@@ -1057,7 +1056,7 @@ void wxTextCtrl::Delete()
|
||||
{
|
||||
if (!HasSelection()) return;
|
||||
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
|
||||
int selStartY = m_selStartY;
|
||||
int selEndY = m_selEndY;
|
||||
@@ -1137,7 +1136,7 @@ void wxTextCtrl::DeleteLine()
|
||||
|
||||
void wxTextCtrl::DoChar( char c )
|
||||
{
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
|
||||
m_undos.Append( new wxSourceUndoStep( wxSOURCE_UNDO_LINE, m_cursorY, m_cursorY, this ) );
|
||||
|
||||
@@ -1182,10 +1181,10 @@ void wxTextCtrl::DoChar( char c )
|
||||
int x = PosToPixel( m_cursorY, m_cursorX-1 );
|
||||
CalcScrolledPosition( x, y, &x, &y );
|
||||
wxRect rect( x+2, y+2, 10000, m_lineHeight );
|
||||
Refresh( TRUE, &rect );
|
||||
Refresh( true, &rect );
|
||||
// refresh whole line for syntax colour highlighting
|
||||
rect.x = 0;
|
||||
Refresh( FALSE, &rect );
|
||||
Refresh( false, &rect );
|
||||
|
||||
int size_x = 0;
|
||||
int size_y = 0;
|
||||
@@ -1207,7 +1206,7 @@ void wxTextCtrl::DoChar( char c )
|
||||
|
||||
void wxTextCtrl::DoBack()
|
||||
{
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
|
||||
if (m_cursorX == 0)
|
||||
{
|
||||
@@ -1241,16 +1240,16 @@ void wxTextCtrl::DoBack()
|
||||
int x = PosToPixel( m_cursorY, m_cursorX );
|
||||
CalcScrolledPosition( x, y, &x, &y );
|
||||
wxRect rect( x+2, y+2, 10000, m_lineHeight );
|
||||
Refresh( TRUE, &rect );
|
||||
Refresh( true, &rect );
|
||||
// refresh whole line for syntax colour highlighting
|
||||
rect.x = 0;
|
||||
Refresh( FALSE, &rect );
|
||||
Refresh( false, &rect );
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextCtrl::DoDelete()
|
||||
{
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
|
||||
wxString tmp( m_lines[m_cursorY].m_text );
|
||||
tmp.Trim();
|
||||
@@ -1284,16 +1283,16 @@ void wxTextCtrl::DoDelete()
|
||||
int x = PosToPixel( m_cursorY, m_cursorX );
|
||||
CalcScrolledPosition( x, y, &x, &y );
|
||||
wxRect rect( x+2, y+2, 10000, m_lineHeight );
|
||||
Refresh( TRUE, &rect );
|
||||
Refresh( true, &rect );
|
||||
// refresh whole line for syntax colour highlighting
|
||||
rect.x = 0;
|
||||
Refresh( FALSE, &rect );
|
||||
Refresh( false, &rect );
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextCtrl::DoReturn()
|
||||
{
|
||||
m_modified = TRUE;
|
||||
m_modified = true;
|
||||
|
||||
m_undos.Append( new wxSourceUndoStep( wxSOURCE_UNDO_ENTER, m_cursorY, m_cursorY, this ) );
|
||||
|
||||
@@ -1754,13 +1753,13 @@ void wxTextCtrl::OnMouse( wxMouseEvent &event )
|
||||
|
||||
if (event.LeftDown())
|
||||
{
|
||||
m_capturing = TRUE;
|
||||
m_capturing = true;
|
||||
CaptureMouse();
|
||||
}
|
||||
|
||||
if (event.LeftUp())
|
||||
{
|
||||
m_capturing = FALSE;
|
||||
m_capturing = false;
|
||||
ReleaseMouse();
|
||||
}
|
||||
|
||||
@@ -1816,7 +1815,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &event )
|
||||
if (m_ignoreInput) return;
|
||||
if (m_cursorY > 0)
|
||||
MoveCursor( m_cursorX, m_cursorY-1, event.ShiftDown() );
|
||||
m_ignoreInput = TRUE;
|
||||
m_ignoreInput = true;
|
||||
return;
|
||||
}
|
||||
case WXK_DOWN:
|
||||
@@ -1824,7 +1823,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &event )
|
||||
if (m_ignoreInput) return;
|
||||
if (m_cursorY < (int)(m_lines.GetCount()-1))
|
||||
MoveCursor( m_cursorX, m_cursorY+1, event.ShiftDown() );
|
||||
m_ignoreInput = TRUE;
|
||||
m_ignoreInput = true;
|
||||
return;
|
||||
}
|
||||
case WXK_LEFT:
|
||||
@@ -1839,7 +1838,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &event )
|
||||
if (m_cursorY > 0)
|
||||
MoveCursor( m_lines[m_cursorY-1].m_text.Len(), m_cursorY-1, event.ShiftDown() );
|
||||
}
|
||||
m_ignoreInput = TRUE;
|
||||
m_ignoreInput = true;
|
||||
return;
|
||||
}
|
||||
case WXK_RIGHT:
|
||||
@@ -1847,7 +1846,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &event )
|
||||
if (m_ignoreInput) return;
|
||||
if (m_cursorX < 1000)
|
||||
MoveCursor( m_cursorX+1, m_cursorY, event.ShiftDown() );
|
||||
m_ignoreInput = TRUE;
|
||||
m_ignoreInput = true;
|
||||
return;
|
||||
}
|
||||
case WXK_HOME:
|
||||
@@ -1870,14 +1869,14 @@ void wxTextCtrl::OnChar( wxKeyEvent &event )
|
||||
{
|
||||
if (m_ignoreInput) return;
|
||||
MoveCursor( m_cursorX, wxMin( (int)(m_lines.GetCount()-1), m_cursorY+size_y ), event.ShiftDown() );
|
||||
m_ignoreInput = TRUE;
|
||||
m_ignoreInput = true;
|
||||
return;
|
||||
}
|
||||
case WXK_PRIOR:
|
||||
{
|
||||
if (m_ignoreInput) return;
|
||||
MoveCursor( m_cursorX, wxMax( 0, m_cursorY-size_y ), event.ShiftDown() );
|
||||
m_ignoreInput = TRUE;
|
||||
m_ignoreInput = true;
|
||||
return;
|
||||
}
|
||||
case WXK_INSERT:
|
||||
@@ -1916,7 +1915,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &event )
|
||||
if (HasSelection())
|
||||
Delete();
|
||||
bool save_overwrite = m_overwrite;
|
||||
m_overwrite = FALSE;
|
||||
m_overwrite = false;
|
||||
int i = 4-(m_cursorX % 4);
|
||||
if (i == 0) i = 4;
|
||||
for (int c = 0; c < i; c++)
|
||||
@@ -1970,7 +1969,7 @@ void wxTextCtrl::OnInternalIdle()
|
||||
{
|
||||
wxControl::OnInternalIdle();
|
||||
|
||||
m_ignoreInput = FALSE;
|
||||
m_ignoreInput = false;
|
||||
|
||||
if (m_lang != wxSOURCE_LANG_NONE)
|
||||
SearchForBrackets();
|
||||
@@ -2048,7 +2047,7 @@ void wxTextCtrl::RefreshLine( int n )
|
||||
int x = 0;
|
||||
CalcScrolledPosition( x, y, &x, &y );
|
||||
wxRect rect( 0+2, y+2, 10000, m_lineHeight );
|
||||
Refresh( TRUE, &rect );
|
||||
Refresh( true, &rect );
|
||||
}
|
||||
|
||||
void wxTextCtrl::RefreshDown( int n )
|
||||
@@ -2072,7 +2071,7 @@ void wxTextCtrl::RefreshDown( int n )
|
||||
CalcScrolledPosition( x, y, &x, &y );
|
||||
|
||||
wxRect rect( 0+2, y+2, 10000, size_y );
|
||||
Refresh( TRUE, &rect );
|
||||
Refresh( true, &rect );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2088,13 +2087,13 @@ void wxTextCtrl::MoveCursor( int new_x, int new_y, bool shift, bool centre )
|
||||
|
||||
if ((new_x == m_cursorX) && (new_y == m_cursorY)) return;
|
||||
|
||||
bool no_cursor_refresh = FALSE;
|
||||
bool no_cursor_refresh = false;
|
||||
bool has_selection = HasSelection();
|
||||
|
||||
if (shift)
|
||||
{
|
||||
int x,y,w,h;
|
||||
bool erase_background = TRUE;
|
||||
bool erase_background = true;
|
||||
|
||||
if (!has_selection)
|
||||
{
|
||||
@@ -2126,7 +2125,7 @@ void wxTextCtrl::MoveCursor( int new_x, int new_y, bool shift, bool centre )
|
||||
h = (-new_y+m_selStartY+1)*m_lineHeight;
|
||||
}
|
||||
|
||||
no_cursor_refresh = TRUE;
|
||||
no_cursor_refresh = true;
|
||||
m_cursorX = new_x;
|
||||
m_cursorY = new_y;
|
||||
}
|
||||
@@ -2171,7 +2170,7 @@ void wxTextCtrl::MoveCursor( int new_x, int new_y, bool shift, bool centre )
|
||||
erase_background = ((m_selEndY > m_selStartY) ||
|
||||
((m_selEndY == m_selStartY) && (m_selEndX > m_selStartX)));
|
||||
}
|
||||
no_cursor_refresh = TRUE;
|
||||
no_cursor_refresh = true;
|
||||
m_cursorX = new_x;
|
||||
m_cursorY = new_y;
|
||||
}
|
||||
@@ -2207,7 +2206,7 @@ void wxTextCtrl::MoveCursor( int new_x, int new_y, bool shift, bool centre )
|
||||
CalcScrolledPosition( x, y, &x, &y );
|
||||
wxRect rect( 0, y+2, 10000, (ry2-ry1+1)*m_lineHeight );
|
||||
|
||||
Refresh( TRUE, &rect );
|
||||
Refresh( true, &rect );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2229,7 +2228,7 @@ void wxTextCtrl::MoveCursor( int new_x, int new_y, bool shift, bool centre )
|
||||
m_cursorX = new_x;
|
||||
m_cursorY = new_y;
|
||||
|
||||
Refresh( TRUE, &rect );
|
||||
Refresh( true, &rect );
|
||||
|
||||
if (FindFocus() == this)
|
||||
{
|
||||
@@ -2403,13 +2402,13 @@ bool wxTextCtrl::ScrollLines(int lines)
|
||||
{
|
||||
wxFAIL_MSG( "wxTextCtrl::ScrollLines not implemented");
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::ScrollPages(int pages)
|
||||
{
|
||||
wxFAIL_MSG( "wxTextCtrl::ScrollPages not implemented");
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user