]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/cocoa/private/textimpl.h
Activate the view of a newly created document.
[wxWidgets.git] / include / wx / osx / cocoa / private / textimpl.h
CommitLineData
1e181c7a
SC
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
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
20class wxNSTextFieldControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
21{
22public :
c84030e0 23 wxNSTextFieldControl( wxWindow *wxPeer, WXWidget w );
1e181c7a 24 virtual ~wxNSTextFieldControl();
2903e699 25
1e181c7a
SC
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) ;
e908dbcc 36 virtual bool HasOwnContextMenu() const { return true; }
03647350 37
e32090ba
SC
38 virtual void controlAction(WXWidget slf, void* _cmd, void *sender);
39protected :
40 NSTextField* m_textField;
50b5e38d
SC
41 long m_selStart;
42 long m_selEnd;
1e181c7a
SC
43};
44
c824c165
KO
45class wxNSTextViewControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
46{
47public:
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) ;
f95dd972 61 virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
16671f22
KO
62
63 virtual bool GetStyle(long position, wxTextAttr& style);
64 virtual void SetStyle(long start, long end, const wxTextAttr& style);
b9cf2753 65
78a17075
KO
66 virtual bool CanFocus() const;
67
e908dbcc
KO
68 virtual bool HasOwnContextMenu() const { return true; }
69
b9cf2753 70 virtual void CheckSpelling(bool check);
9ab7ff53 71 virtual wxSize GetBestSize() const;
c824c165
KO
72
73protected:
74 NSScrollView* m_scrollView;
75 NSTextView* m_textView;
76};
77
c84030e0
KO
78class wxNSComboBoxControl : public wxNSTextFieldControl, public wxComboWidgetImpl
79{
80public :
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;
97private:
98 NSComboBox* m_comboBox;
99};
100
1e181c7a 101#endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_