]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/cocoa/private/textimpl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: textcontrol implementation classes that have to be exposed
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_
13 #define _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_
15 #include "wx/combobox.h"
16 #include "wx/osx/private.h"
18 // implementation exposed, so that search control can pull it
20 class wxNSTextFieldControl
: public wxWidgetCocoaImpl
, public wxTextWidgetImpl
23 // wxNSTextFieldControl must always be associated with a wxTextEntry. If
24 // it's associated with a wxTextCtrl then we can get the associated entry
25 // from it but otherwise the second ctor should be used to explicitly pass
27 wxNSTextFieldControl( wxTextCtrl
*text
, WXWidget w
);
28 wxNSTextFieldControl( wxWindow
*wxPeer
, wxTextEntry
*entry
, WXWidget w
);
29 virtual ~wxNSTextFieldControl();
31 virtual wxString
GetStringValue() const ;
32 virtual void SetStringValue( const wxString
&str
) ;
35 virtual void Paste() ;
36 virtual bool CanPaste() const ;
37 virtual void SetEditable(bool editable
) ;
38 virtual void GetSelection( long* from
, long* to
) const ;
39 virtual void SetSelection( long from
, long to
);
40 virtual void WriteText(const wxString
& str
) ;
41 virtual bool HasOwnContextMenu() const { return true; }
43 virtual void controlAction(WXWidget slf
, void* _cmd
, void *sender
);
46 NSTextField
* m_textField
;
51 // Common part of both ctors.
52 void Init(WXWidget w
);
55 class wxNSTextViewControl
: public wxWidgetCocoaImpl
, public wxTextWidgetImpl
58 wxNSTextViewControl( wxTextCtrl
*wxPeer
, WXWidget w
);
59 virtual ~wxNSTextViewControl();
61 virtual wxString
GetStringValue() const ;
62 virtual void SetStringValue( const wxString
&str
) ;
65 virtual void Paste() ;
66 virtual bool CanPaste() const ;
67 virtual void SetEditable(bool editable
) ;
68 virtual void GetSelection( long* from
, long* to
) const ;
69 virtual void SetSelection( long from
, long to
);
70 virtual void WriteText(const wxString
& str
) ;
71 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
, bool ignoreBlack
= true );
73 virtual bool GetStyle(long position
, wxTextAttr
& style
);
74 virtual void SetStyle(long start
, long end
, const wxTextAttr
& style
);
76 virtual bool CanFocus() const;
78 virtual bool HasOwnContextMenu() const { return true; }
80 virtual void CheckSpelling(bool check
);
81 virtual wxSize
GetBestSize() const;
84 NSScrollView
* m_scrollView
;
85 NSTextView
* m_textView
;
88 class wxNSComboBoxControl
: public wxNSTextFieldControl
, public wxComboWidgetImpl
91 wxNSComboBoxControl( wxComboBox
*wxPeer
, WXWidget w
);
92 virtual ~wxNSComboBoxControl();
94 virtual int GetSelectedItem() const;
95 virtual void SetSelectedItem(int item
);
97 virtual int GetNumberOfItems() const;
99 virtual void InsertItem(int pos
, const wxString
& item
);
100 virtual void RemoveItem(int pos
);
102 virtual void Clear();
104 virtual wxString
GetStringAtIndex(int pos
) const;
106 virtual int FindString(const wxString
& text
) const;
108 NSComboBox
* m_comboBox
;
111 #endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_