From: Stefan Csomor Date: Fri, 30 Apr 2010 18:29:17 +0000 (+0000) Subject: textctrl impl X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/170ea46e847651fa34bfb56150061366ef576d55 textctrl impl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/osx/iphone/private/textimpl.h b/include/wx/osx/iphone/private/textimpl.h new file mode 100644 index 0000000000..7a099be63f --- /dev/null +++ b/include/wx/osx/iphone/private/textimpl.h @@ -0,0 +1,102 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: textimpl.h +// Purpose: textcontrol implementation classes that have to be exposed +// Author: Stefan Csomor +// Modified by: +// Created: 03/02/99 +// RCS-ID: $Id: textimpl.h 63564 2010-02-27 02:51:45Z KO $ +// 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 : + wxUITextFieldControl( wxWindow *wxPeer, UITextField* w ); + 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; } + + virtual void controlAction(WXWidget slf, void* _cmd, void *sender); +protected : + UITextField* m_textField; + 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 ); + + virtual bool GetStyle(long position, wxTextAttr& style); + virtual void SetStyle(long start, long end, const wxTextAttr& style); + + virtual bool CanFocus() const; + + virtual bool HasOwnContextMenu() const { return true; } + + virtual void CheckSpelling(bool check); + virtual wxSize GetBestSize() const; + +protected: + UITextView* m_textView; +}; + +#if 0 +class wxNSComboBoxControl : public wxUITextFieldControl, public wxComboWidgetImpl +{ +public : + wxNSComboBoxControl( wxWindow *wxPeer, WXWidget w ); + virtual ~wxNSComboBoxControl(); + + virtual int GetSelectedItem() const; + virtual void SetSelectedItem(int item); + + virtual int GetNumberOfItems() const; + + virtual void InsertItem(int pos, const wxString& item); + virtual void RemoveItem(int pos); + + virtual void Clear(); + + virtual wxString GetStringAtIndex(int pos) const; + + virtual int FindString(const wxString& text) const; +private: + NSComboBox* m_comboBox; +}; +#endif + +#endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_