]>
Commit | Line | Data |
---|---|---|
1e181c7a | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/osx/cocoa/private/textimpl.h |
1e181c7a SC |
3 | // Purpose: textcontrol implementation classes that have to be exposed |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 03/02/99 | |
2903e699 | 7 | // RCS-ID: $Id$ |
1e181c7a SC |
8 | // Copyright: (c) Stefan Csomor |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_ | |
13 | #define _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_ | |
14 | ||
c84030e0 | 15 | #include "wx/combobox.h" |
1e181c7a SC |
16 | #include "wx/osx/private.h" |
17 | ||
2903e699 | 18 | // implementation exposed, so that search control can pull it |
1e181c7a SC |
19 | |
20 | class wxNSTextFieldControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl | |
21 | { | |
22 | public : | |
c072b9ec VZ |
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 | |
26 | // us the entry. | |
27 | wxNSTextFieldControl( wxTextCtrl *text, WXWidget w ); | |
28 | wxNSTextFieldControl( wxWindow *wxPeer, wxTextEntry *entry, WXWidget w ); | |
1e181c7a | 29 | virtual ~wxNSTextFieldControl(); |
2903e699 | 30 | |
1e181c7a SC |
31 | virtual wxString GetStringValue() const ; |
32 | virtual void SetStringValue( const wxString &str) ; | |
33 | virtual void Copy() ; | |
34 | virtual void Cut() ; | |
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) ; | |
e908dbcc | 41 | virtual bool HasOwnContextMenu() const { return true; } |
99eb484a | 42 | virtual bool SetHint(const wxString& hint); |
03647350 | 43 | |
e32090ba | 44 | virtual void controlAction(WXWidget slf, void* _cmd, void *sender); |
c072b9ec | 45 | |
e32090ba SC |
46 | protected : |
47 | NSTextField* m_textField; | |
50b5e38d SC |
48 | long m_selStart; |
49 | long m_selEnd; | |
c072b9ec VZ |
50 | |
51 | private: | |
52 | // Common part of both ctors. | |
53 | void Init(WXWidget w); | |
1e181c7a SC |
54 | }; |
55 | ||
c824c165 KO |
56 | class wxNSTextViewControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl |
57 | { | |
58 | public: | |
59 | wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w ); | |
60 | virtual ~wxNSTextViewControl(); | |
61 | ||
62 | virtual wxString GetStringValue() const ; | |
63 | virtual void SetStringValue( const wxString &str) ; | |
64 | virtual void Copy() ; | |
65 | virtual void Cut() ; | |
66 | virtual void Paste() ; | |
67 | virtual bool CanPaste() const ; | |
68 | virtual void SetEditable(bool editable) ; | |
69 | virtual void GetSelection( long* from, long* to) const ; | |
70 | virtual void SetSelection( long from , long to ); | |
71 | virtual void WriteText(const wxString& str) ; | |
f95dd972 | 72 | virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ); |
ce00f59b | 73 | |
16671f22 KO |
74 | virtual bool GetStyle(long position, wxTextAttr& style); |
75 | virtual void SetStyle(long start, long end, const wxTextAttr& style); | |
ce00f59b | 76 | |
78a17075 | 77 | virtual bool CanFocus() const; |
ce00f59b | 78 | |
e908dbcc | 79 | virtual bool HasOwnContextMenu() const { return true; } |
ce00f59b | 80 | |
b9cf2753 | 81 | virtual void CheckSpelling(bool check); |
9ab7ff53 | 82 | virtual wxSize GetBestSize() const; |
c824c165 KO |
83 | |
84 | protected: | |
85 | NSScrollView* m_scrollView; | |
86 | NSTextView* m_textView; | |
87 | }; | |
88 | ||
c84030e0 KO |
89 | class wxNSComboBoxControl : public wxNSTextFieldControl, public wxComboWidgetImpl |
90 | { | |
91 | public : | |
c072b9ec | 92 | wxNSComboBoxControl( wxComboBox *wxPeer, WXWidget w ); |
c84030e0 | 93 | virtual ~wxNSComboBoxControl(); |
ce00f59b | 94 | |
c84030e0 KO |
95 | virtual int GetSelectedItem() const; |
96 | virtual void SetSelectedItem(int item); | |
ce00f59b | 97 | |
c84030e0 | 98 | virtual int GetNumberOfItems() const; |
ce00f59b | 99 | |
c84030e0 KO |
100 | virtual void InsertItem(int pos, const wxString& item); |
101 | virtual void RemoveItem(int pos); | |
ce00f59b | 102 | |
c84030e0 | 103 | virtual void Clear(); |
ce00f59b | 104 | |
c84030e0 | 105 | virtual wxString GetStringAtIndex(int pos) const; |
ce00f59b | 106 | |
c84030e0 KO |
107 | virtual int FindString(const wxString& text) const; |
108 | private: | |
109 | NSComboBox* m_comboBox; | |
110 | }; | |
111 | ||
1e181c7a | 112 | #endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_ |