1. better kbd interface to wxTextCtrl (selection...)
2. mouse input handling git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
class WXDLLEXPORT wxCaret;
|
||||
|
||||
#include "wx/scrolwin.h" // for wxScrollHelper
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl actions
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -48,11 +50,15 @@ class WXDLLEXPORT wxCaret;
|
||||
#define wxACTION_TEXT_PREFIX_SEL _T("sel")
|
||||
#define wxACTION_TEXT_PREFIX_DEL _T("del")
|
||||
|
||||
// mouse selection
|
||||
#define wxACTION_TEXT_ANCHOR_SEL _T("anchorsel")
|
||||
#define wxACTION_TEXT_EXTEND_SEL _T("extendsel")
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase
|
||||
class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase, public wxScrollHelper
|
||||
{
|
||||
public:
|
||||
// creation
|
||||
@@ -155,6 +161,11 @@ public:
|
||||
long GetWordStart() const;
|
||||
long GetWordEnd() const;
|
||||
|
||||
// selection helpers
|
||||
bool HasSelection() const { return m_selStart != -1; }
|
||||
void ClearSelection();
|
||||
void RemoveSelection();
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
@@ -162,6 +173,11 @@ public:
|
||||
virtual bool IsContainerWindow() const { return TRUE; }
|
||||
virtual wxBorder GetDefaultBorder() const { return wxBORDER_SUNKEN; }
|
||||
|
||||
// perform an action
|
||||
virtual bool PerformAction(const wxControlAction& action,
|
||||
long numArg = -1,
|
||||
const wxString& strArg = wxEmptyString);
|
||||
|
||||
protected:
|
||||
// draw the text
|
||||
virtual void DoDraw(wxControlRenderer *renderer);
|
||||
@@ -170,9 +186,6 @@ protected:
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
// input support
|
||||
virtual bool PerformAction(const wxControlAction& action,
|
||||
long numArg = -1,
|
||||
const wxString& strArg = wxEmptyString);
|
||||
virtual wxString GetInputHandlerType() const;
|
||||
|
||||
// common part of all ctors
|
||||
@@ -194,7 +207,8 @@ private:
|
||||
m_curRow;
|
||||
|
||||
// selection
|
||||
long m_selStart,
|
||||
long m_selAnchor,
|
||||
m_selStart,
|
||||
m_selEnd;
|
||||
|
||||
// flags
|
||||
|
Reference in New Issue
Block a user