X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6726a6b09748c707351987da56226ac0316d1a00..e951b8e4e6c07fe5d5200b8cbf6148e7317aa0e5:/include/wx/msw/textctrl.h diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index 58d298125d..1fb28361f6 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -104,6 +104,12 @@ public: virtual void ShowPosition(long pos); virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; + virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, + wxTextCoord *col, + wxTextCoord *row) const + { + return wxTextCtrlBase::HitTest(pt, col, row); + } // Clipboard operations virtual void Copy(); @@ -142,8 +148,7 @@ public: virtual void Command(wxCommandEvent& event); virtual bool MSWCommand(WXUINT param, WXWORD id); - virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, - WXUINT message, WXWPARAM wParam, WXLPARAM lParam); + virtual WXHBRUSH MSWControlColor(WXHDC hDC); #if wxUSE_RICHEDIT virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result); @@ -214,10 +219,10 @@ protected: // replace the contents of the selection or of the entire control with the // given text - void DoWriteText(const wxString& text, bool selectionOnly = TRUE); + void DoWriteText(const wxString& text, bool selectionOnly = true); // set the selection possibly without scrolling the caret into view - void DoSetSelection(long from, long to, bool scrollCaret = TRUE); + void DoSetSelection(long from, long to, bool scrollCaret = true); // return true if there is a non empty selection in the control bool HasSelection() const; @@ -226,7 +231,7 @@ protected: // position long GetLengthOfLineContainingPos(long pos) const; - // send TEXT_UPDATED event, return TRUE if it was handled, FALSE otherwise + // send TEXT_UPDATED event, return true if it was handled, false otherwise bool SendUpdateEvent(); // override some base class virtuals @@ -242,9 +247,11 @@ protected: int m_verRichEdit; #endif // wxUSE_RICHEDIT - // if TRUE, SendUpdateEvent() will eat the next event (see comments in the - // code as to why this is needed) - bool m_suppressNextUpdate; + // number of EN_UPDATE events sent by Windows when we change the controls + // text ourselves: we want this to be exactly 1 + int m_updatesCount; + + virtual wxVisualAttributes GetDefaultAttributes() const; private: DECLARE_EVENT_TABLE() @@ -253,6 +260,12 @@ private: wxMenu* m_privateContextMenu; bool m_isNativeCaretShown; + + // this is an optimization: instead of checking all the time whether we + // need to move the caret to the end of text (before appending to the + // control), we remember whether it is already at the end of text in this + // variable + bool m_isCaretAtEnd; }; #endif