]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/cocoa/private/textimpl.h
no real change: just fix RCS-ID so that it reflects the current revision number
[wxWidgets.git] / include / wx / osx / cocoa / private / textimpl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: textimpl.h
3 // Purpose: textcontrol implementation classes that have to be exposed
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 03/02/99
7 // RCS-ID: $Id$
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
15 #include "wx/combobox.h"
16 #include "wx/osx/private.h"
17
18 // implementation exposed, so that search control can pull it
19
20 class wxNSTextFieldControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
21 {
22 public :
23 wxNSTextFieldControl( wxWindow *wxPeer, WXWidget w );
24 virtual ~wxNSTextFieldControl();
25
26 virtual wxString GetStringValue() const ;
27 virtual void SetStringValue( const wxString &str) ;
28 virtual void Copy() ;
29 virtual void Cut() ;
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; }
37
38 virtual void controlAction(WXWidget slf, void* _cmd, void *sender);
39 protected :
40 NSTextField* m_textField;
41 long m_selStart;
42 long m_selEnd;
43 };
44
45 class wxNSTextViewControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
46 {
47 public:
48 wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w );
49 virtual ~wxNSTextViewControl();
50
51 virtual wxString GetStringValue() const ;
52 virtual void SetStringValue( const wxString &str) ;
53 virtual void Copy() ;
54 virtual void Cut() ;
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 );
62
63 virtual bool GetStyle(long position, wxTextAttr& style);
64 virtual void SetStyle(long start, long end, const wxTextAttr& style);
65
66 virtual bool CanFocus() const;
67
68 virtual bool HasOwnContextMenu() const { return true; }
69
70 virtual void CheckSpelling(bool check);
71 virtual wxSize GetBestSize() const;
72
73 protected:
74 NSScrollView* m_scrollView;
75 NSTextView* m_textView;
76 };
77
78 class wxNSComboBoxControl : public wxNSTextFieldControl, public wxComboWidgetImpl
79 {
80 public :
81 wxNSComboBoxControl( wxWindow *wxPeer, WXWidget w );
82 virtual ~wxNSComboBoxControl();
83
84 virtual int GetSelectedItem() const;
85 virtual void SetSelectedItem(int item);
86
87 virtual int GetNumberOfItems() const;
88
89 virtual void InsertItem(int pos, const wxString& item);
90 virtual void RemoveItem(int pos);
91
92 virtual void Clear();
93
94 virtual wxString GetStringAtIndex(int pos) const;
95
96 virtual int FindString(const wxString& text) const;
97 private:
98 NSComboBox* m_comboBox;
99 };
100
101 #endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_