textentry.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/textentry.h
  3. // Purpose: wxOS2-specific wxTextEntry implementation
  4. // Author: Stefan Neis
  5. // Created: 2007-11-18
  6. // Copyright: (c) 2007 Stefan Neis
  7. // Licence: wxWindows licence
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_OS2_TEXTENTRY_H_
  10. #define _WX_OS2_TEXTENTRY_H_
  11. // ----------------------------------------------------------------------------
  12. // wxTextEntry: common part of wxComboBox and (single line) wxTextCtrl
  13. // ----------------------------------------------------------------------------
  14. class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
  15. {
  16. public:
  17. wxTextEntry() { }
  18. // implement wxTextEntryBase pure virtual methods
  19. virtual void WriteText(const wxString& text);
  20. virtual void Remove(long from, long to);
  21. virtual void Copy();
  22. virtual void Cut();
  23. virtual void Paste();
  24. virtual void Undo();
  25. virtual void Redo();
  26. virtual bool CanUndo() const;
  27. virtual bool CanRedo() const;
  28. virtual void SetInsertionPoint(long pos);
  29. virtual long GetInsertionPoint() const;
  30. virtual long GetLastPosition() const;
  31. virtual void SetSelection(long from, long to)
  32. { DoSetSelection(from, to); }
  33. virtual void GetSelection(long *from, long *to) const;
  34. virtual bool IsEditable() const;
  35. virtual void SetEditable(bool editable);
  36. virtual void SetMaxLength(unsigned long len);
  37. protected:
  38. virtual wxString DoGetValue() const;
  39. // this is really a hook for multiline text controls as the single line
  40. // ones don't need to ever scroll to show the selection but having it here
  41. // allows us to put Remove() in the base class
  42. enum
  43. {
  44. SetSel_NoScroll = 0, // don't do anything special
  45. SetSel_Scroll = 1 // default: scroll to make the selection visible
  46. };
  47. virtual void DoSetSelection(long from, long to, int flags = SetSel_Scroll);
  48. private:
  49. // implement this to return the HWND of the EDIT control
  50. virtual WXHWND GetEditHWND() const = 0;
  51. };
  52. #endif // _WX_OS2_TEXTENTRY_H_