X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05adb9d2fdc40d8620730be490bf406b8e367cf8..c5c5dad5950a43edbb9a4e7144f44b8f3bd6bf80:/include/wx/mac/textctrl.h diff --git a/include/wx/mac/textctrl.h b/include/wx/mac/textctrl.h index d7f946d3d1..df3a964339 100644 --- a/include/wx/mac/textctrl.h +++ b/include/wx/mac/textctrl.h @@ -1,25 +1,24 @@ ///////////////////////////////////////////////////////////////////////////// // Name: textctrl.h // Purpose: wxTextCtrl class -// Author: AUTHOR +// Author: Stefan Csomor // Modified by: -// Created: ??/??/98 +// Created: 1998-01-01 // RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence +// Copyright: (c) Stefan Csomor +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TEXTCTRL_H_ #define _WX_TEXTCTRL_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface "textctrl.h" #endif #include "wx/control.h" -WXDLLEXPORT_DATA(extern const char*) wxTextCtrlNameStr; -WXDLLEXPORT_DATA(extern const char*) wxEmptyString; +WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlNameStr; // Single-line text item class WXDLLEXPORT wxTextCtrl: public wxTextCtrlBase @@ -29,15 +28,18 @@ class WXDLLEXPORT wxTextCtrl: public wxTextCtrlBase public: // creation // -------- - wxTextCtrl(); - inline wxTextCtrl(wxWindow *parent, wxWindowID id, - const wxString& value = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxTextCtrlNameStr) + wxTextCtrl() { Init(); } + ~wxTextCtrl(); + wxTextCtrl(wxWindow *parent, wxWindowID id, + const wxString& value = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxTextCtrlNameStr) { - Create(parent, id, value, pos, size, style, validator, name); + Init(); + + Create(parent, id, value, pos, size, style, validator, name); } bool Create(wxWindow *parent, wxWindowID id, @@ -74,9 +76,20 @@ public: // load the controls contents from the file virtual bool LoadFile(const wxString& file); - // clears the dirty flag + // sets/clears the dirty flag + virtual void MarkDirty(); virtual void DiscardEdits(); + // set the max number of characters which may be entered in a single line + // text control + virtual void SetMaxLength(unsigned long len) ; + + // text control under some platforms supports the text styles: these + // methods allow to apply the given text style to the given selection or to + // set/get the style which will be used for all appended text + virtual bool SetStyle(long start, long end, const wxTextAttr& style); + virtual bool SetDefaultStyle(const wxTextAttr& style); + // writing text inserts it at the current position, appending always // inserts it at the end virtual void WriteText(const wxString& text); @@ -140,10 +153,29 @@ public: void OnUpdateUndo(wxUpdateUIEvent& event); void OnUpdateRedo(wxUpdateUIEvent& event); - virtual bool MacCanFocus() const { return true ; } - + virtual bool MacCanFocus() const { return true ; } + virtual bool MacSetupCursor( const wxPoint& pt ) ; + + virtual void MacSuperShown( bool show ) ; + virtual bool Show(bool show = TRUE) ; + protected: + // common part of all ctors + void Init(); + virtual wxSize DoGetBestSize() const; + + bool m_editable ; + + // flag is set to true when the user edits the controls contents + bool m_dirty; + + // one of the following objects is used for representation, the other one is NULL + void* m_macTE ; + void* m_macTXN ; + void* m_macTXNvars ; + bool m_macUsesTXN ; + unsigned long m_maxLength ; DECLARE_EVENT_TABLE() };