2010-04-30 14:29:17 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/osx/iphone/private/textimpl.h
|
2010-04-30 14:29:17 -04:00
|
|
|
// Purpose: textcontrol implementation classes that have to be exposed
|
|
|
|
// Author: Stefan Csomor
|
|
|
|
// Modified by:
|
|
|
|
// Created: 03/02/99
|
|
|
|
// Copyright: (c) Stefan Csomor
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_
|
|
|
|
#define _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_
|
|
|
|
|
|
|
|
#include "wx/combobox.h"
|
|
|
|
#include "wx/osx/private.h"
|
|
|
|
|
|
|
|
// implementation exposed, so that search control can pull it
|
|
|
|
|
|
|
|
class wxUITextFieldControl : public wxWidgetIPhoneImpl, public wxTextWidgetImpl
|
|
|
|
{
|
|
|
|
public :
|
2011-01-26 10:51:39 -05:00
|
|
|
wxUITextFieldControl( wxTextCtrl *wxPeer, UITextField* w );
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual ~wxUITextFieldControl();
|
|
|
|
|
|
|
|
virtual wxString GetStringValue() const ;
|
|
|
|
virtual void SetStringValue( const wxString &str) ;
|
|
|
|
virtual void Copy() ;
|
|
|
|
virtual void Cut() ;
|
|
|
|
virtual void Paste() ;
|
|
|
|
virtual bool CanPaste() const ;
|
|
|
|
virtual void SetEditable(bool editable) ;
|
|
|
|
virtual void GetSelection( long* from, long* to) const ;
|
|
|
|
virtual void SetSelection( long from , long to );
|
|
|
|
virtual void WriteText(const wxString& str) ;
|
|
|
|
virtual bool HasOwnContextMenu() const { return true; }
|
|
|
|
|
2011-01-26 10:51:39 -05:00
|
|
|
virtual wxSize GetBestSize() const;
|
|
|
|
|
|
|
|
virtual bool SetHint(const wxString& hint);
|
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual void controlAction(WXWidget slf, void* _cmd, void *sender);
|
|
|
|
protected :
|
|
|
|
UITextField* m_textField;
|
2011-01-26 10:51:39 -05:00
|
|
|
NSObject<UITextFieldDelegate>* m_delegate;
|
2010-04-30 14:29:17 -04:00
|
|
|
long m_selStart;
|
|
|
|
long m_selEnd;
|
|
|
|
};
|
|
|
|
|
|
|
|
class wxUITextViewControl : public wxWidgetIPhoneImpl, public wxTextWidgetImpl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxUITextViewControl( wxTextCtrl *wxPeer, UITextView* w );
|
|
|
|
virtual ~wxUITextViewControl();
|
|
|
|
|
|
|
|
virtual wxString GetStringValue() const ;
|
|
|
|
virtual void SetStringValue( const wxString &str) ;
|
|
|
|
virtual void Copy() ;
|
|
|
|
virtual void Cut() ;
|
|
|
|
virtual void Paste() ;
|
|
|
|
virtual bool CanPaste() const ;
|
|
|
|
virtual void SetEditable(bool editable) ;
|
|
|
|
virtual void GetSelection( long* from, long* to) const ;
|
|
|
|
virtual void SetSelection( long from , long to );
|
|
|
|
virtual void WriteText(const wxString& str) ;
|
|
|
|
virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual bool GetStyle(long position, wxTextAttr& style);
|
|
|
|
virtual void SetStyle(long start, long end, const wxTextAttr& style);
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual bool CanFocus() const;
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual bool HasOwnContextMenu() const { return true; }
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual void CheckSpelling(bool check);
|
|
|
|
virtual wxSize GetBestSize() const;
|
|
|
|
|
|
|
|
protected:
|
2011-01-26 10:51:39 -05:00
|
|
|
NSObject<UITextViewDelegate>* m_delegate;
|
2010-04-30 14:29:17 -04:00
|
|
|
UITextView* m_textView;
|
|
|
|
};
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
class wxNSComboBoxControl : public wxUITextFieldControl, public wxComboWidgetImpl
|
|
|
|
{
|
|
|
|
public :
|
|
|
|
wxNSComboBoxControl( wxWindow *wxPeer, WXWidget w );
|
|
|
|
virtual ~wxNSComboBoxControl();
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual int GetSelectedItem() const;
|
|
|
|
virtual void SetSelectedItem(int item);
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual int GetNumberOfItems() const;
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual void InsertItem(int pos, const wxString& item);
|
|
|
|
virtual void RemoveItem(int pos);
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual void Clear();
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual wxString GetStringAtIndex(int pos) const;
|
2010-09-30 07:44:45 -04:00
|
|
|
|
2010-04-30 14:29:17 -04:00
|
|
|
virtual int FindString(const wxString& text) const;
|
|
|
|
private:
|
|
|
|
NSComboBox* m_comboBox;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_
|