Implement wxTextCtrl::PositionToXY() and XYToPosition() (wxOSX)

Apparently there is no native API to retrieve such information in a simple
way so all calculations have to be done with raw text stored in
the corresponding control(s).

Closes #4146.
See #17811.
This commit is contained in:
Artur Wieczorek
2017-07-22 20:51:57 +02:00
parent c4acd5f9dd
commit d233b8939b
3 changed files with 91 additions and 0 deletions

View File

@@ -62,6 +62,8 @@ public :
virtual void SetEditable(bool editable) ;
virtual void GetSelection( long* from, long* to) const ;
virtual void SetSelection( long from , long to );
virtual bool PositionToXY(long pos, long *x, long *y) const wxOVERRIDE;
virtual long XYToPosition(long x, long y) const wxOVERRIDE;
virtual void WriteText(const wxString& str) ;
virtual bool HasOwnContextMenu() const { return true; }
virtual bool SetHint(const wxString& hint);
@@ -102,6 +104,8 @@ public:
virtual void SetEditable(bool editable) ;
virtual void GetSelection( long* from, long* to) const ;
virtual void SetSelection( long from , long to );
virtual bool PositionToXY(long pos, long *x, long *y) const wxOVERRIDE;
virtual long XYToPosition(long x, long y) const wxOVERRIDE;
virtual void WriteText(const wxString& str) ;
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );