X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/692c9b869686c97963c693e99efba19edeaba8cc..af867f957d81d1c6838c5a37992972bc9505850d:/include/wx/univ/textctrl.h diff --git a/include/wx/univ/textctrl.h b/include/wx/univ/textctrl.h index e756e912e3..667ee48b9e 100644 --- a/include/wx/univ/textctrl.h +++ b/include/wx/univ/textctrl.h @@ -12,10 +12,6 @@ #ifndef _WX_UNIV_TEXTCTRL_H_ #define _WX_UNIV_TEXTCTRL_H_ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma interface "univtextctrl.h" -#endif - class WXDLLEXPORT wxCaret; class WXDLLEXPORT wxTextCtrlCommandProcessor; @@ -70,13 +66,14 @@ class WXDLLEXPORT wxTextCtrlCommandProcessor; // wxTextCtrl // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase, public wxScrollHelper +class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase, + public wxScrollHelper { public: // creation // -------- - wxTextCtrl() { Init(); } + wxTextCtrl() : wxScrollHelper(this) { Init(); } wxTextCtrl(wxWindow *parent, wxWindowID id, @@ -86,6 +83,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr) + : wxScrollHelper(this) { Init(); @@ -176,8 +174,8 @@ public: // ----------------------- // caret stuff - virtual void ShowCaret(bool show = TRUE); - void HideCaret() { ShowCaret(FALSE); } + virtual void ShowCaret(bool show = true); + void HideCaret() { ShowCaret(false); } void CreateCaret(); // for the current font size // helpers for cursor movement @@ -221,9 +219,6 @@ public: virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const; virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const; - // ensure we have correct default border - virtual wxBorder GetDefaultBorder() const { return wxBORDER_SUNKEN; } - // perform an action virtual bool PerformAction(const wxControlAction& action, long numArg = -1, @@ -231,7 +226,7 @@ public: // override these methods to handle the caret virtual bool SetFont(const wxFont &font); - virtual bool Enable(bool enable = TRUE); + virtual bool Enable(bool enable = true); // more readable flag testing methods bool IsPassword() const { return (GetWindowStyle() & wxTE_PASSWORD) != 0; } @@ -241,7 +236,17 @@ public: // only for wxStdTextCtrlInputHandler void RefreshSelection(); + // override wxScrollHelper method to prevent (auto)scrolling beyond the end + // of line + virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const; + + // idle processing + virtual void OnInternalIdle(); + protected: + // ensure we have correct default border + virtual wxBorder GetDefaultBorder() const { return wxBORDER_SUNKEN; } + // override base class methods virtual void DoDrawBorder(wxDC& dc, const wxRect& rect); virtual void DoDraw(wxControlRenderer *renderer); @@ -295,7 +300,7 @@ protected: wxRect GetRealTextArea() const; // refresh the text in the given (in logical coords) rect - void RefreshTextRect(const wxRect& rect, bool textOnly = TRUE); + void RefreshTextRect(const wxRect& rect, bool textOnly = true); // refresh the line wrap marks for the given range of lines (inclusive) void RefreshLineWrapMarks(wxTextCoord rowFirst, wxTextCoord rowLast); @@ -330,7 +335,7 @@ protected: wxCoord *widthReal = NULL) const; // get the start and end of the selection for this line: if the line is - // outside the selection, both will be -1 and FALSE will be returned + // outside the selection, both will be -1 and false will be returned bool GetSelectedPartOfLine(wxTextCoord line, wxTextPos *start, wxTextPos *end) const; @@ -377,7 +382,7 @@ protected: wxTextCoord *colStart, wxTextCoord *colEnd, wxTextCoord *colRowStart, - bool devCoords = TRUE) const; + bool devCoords = true) const; // HitTest() version which takes the logical text coordinates and not the // device ones @@ -386,7 +391,7 @@ protected: wxTextCoord *row) const; // get the line and the row in this line corresponding to the given row, - // return TRUE if ok and FALSE if row is out of range + // return true if ok and false if row is out of range // // NB: this function can only be called for controls which wrap lines bool GetLineAndRow(wxTextCoord row, @@ -427,10 +432,6 @@ protected: void OnChar(wxKeyEvent& event); void OnSize(wxSizeEvent& event); - // overrdie wxScrollHelper method to prevent (auto)scrolling beyond the end - // of line - virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const; - // return the struct containing control-type dependent data struct wxTextSingleLineData& SData() { return *m_data.sdata; } struct wxTextMultiLineData& MData() { return *m_data.mdata; } @@ -444,8 +445,6 @@ protected: bool DoCut(); bool DoPaste(); - // idle processing - virtual void OnInternalIdle(); private: // all these methods are for multiline text controls only @@ -456,7 +455,7 @@ private: inline const wxArrayString& GetLines() const; inline size_t GetLineCount() const; - // replace a line (returns TRUE if the number of rows in thel ine changed) + // replace a line (returns true if the number of rows in thel ine changed) bool ReplaceLine(wxTextCoord line, const wxString& text); // remove a line @@ -519,6 +518,8 @@ private: DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxTextCtrl) + + friend class wxWrappedLineData; }; // ----------------------------------------------------------------------------