]>
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( wxWindow
*wxPeer
, WXWidget w
);
24 virtual ~wxNSTextFieldControl();
26 virtual wxString
GetStringValue() const ;
27 virtual void SetStringValue( const wxString
&str
) ;
30 virtual void Paste() ;
31 virtual bool CanPaste() const ;
32 virtual void SetEditable(bool editable
) ;
33 virtual void GetSelection( long* from
, long* to
) const ;
34 virtual void SetSelection( long from
, long to
);
35 virtual void WriteText(const wxString
& str
) ;
36 virtual bool HasOwnContextMenu() const { return true; }
38 virtual void controlAction(WXWidget slf
, void* _cmd
, void *sender
);
40 NSTextField
* m_textField
;
45 class wxNSTextViewControl
: public wxWidgetCocoaImpl
, public wxTextWidgetImpl
48 wxNSTextViewControl( wxTextCtrl
*wxPeer
, WXWidget w
);
49 virtual ~wxNSTextViewControl();
51 virtual wxString
GetStringValue() const ;
52 virtual void SetStringValue( const wxString
&str
) ;
55 virtual void Paste() ;
56 virtual bool CanPaste() const ;
57 virtual void SetEditable(bool editable
) ;
58 virtual void GetSelection( long* from
, long* to
) const ;
59 virtual void SetSelection( long from
, long to
);
60 virtual void WriteText(const wxString
& str
) ;
61 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
, bool ignoreBlack
= true );
63 virtual bool GetStyle(long position
, wxTextAttr
& style
);
64 virtual void SetStyle(long start
, long end
, const wxTextAttr
& style
);
66 virtual bool CanFocus() const;
68 virtual bool HasOwnContextMenu() const { return true; }
70 virtual void CheckSpelling(bool check
);
71 virtual wxSize
GetBestSize() const;
74 NSScrollView
* m_scrollView
;
75 NSTextView
* m_textView
;
78 class wxNSComboBoxControl
: public wxNSTextFieldControl
, public wxComboWidgetImpl
81 wxNSComboBoxControl( wxWindow
*wxPeer
, WXWidget w
);
82 virtual ~wxNSComboBoxControl();
84 virtual int GetSelectedItem() const;
85 virtual void SetSelectedItem(int item
);
87 virtual int GetNumberOfItems() const;
89 virtual void InsertItem(int pos
, const wxString
& item
);
90 virtual void RemoveItem(int pos
);
94 virtual wxString
GetStringAtIndex(int pos
) const;
96 virtual int FindString(const wxString
& text
) const;
98 NSComboBox
* m_comboBox
;
101 #endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_