support for hints, fixing textfield implementation on iOS

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-01-26 15:51:39 +00:00
parent 01470e3741
commit 99eb484a70
6 changed files with 115 additions and 33 deletions

View File

@@ -39,6 +39,7 @@ public :
virtual void SetSelection( long from , long to );
virtual void WriteText(const wxString& str) ;
virtual bool HasOwnContextMenu() const { return true; }
virtual bool SetHint(const wxString& hint);
virtual void controlAction(WXWidget slf, void* _cmd, void *sender);

View File

@@ -648,6 +648,7 @@ public :
virtual wxSize GetBestSize() const { return wxDefaultSize; }
virtual bool SetHint(const wxString& WXUNUSED(hint)) { return false; }
private:
wxTextEntry * const m_entry;

View File

@@ -20,7 +20,7 @@
class wxUITextFieldControl : public wxWidgetIPhoneImpl, public wxTextWidgetImpl
{
public :
wxUITextFieldControl( wxWindow *wxPeer, UITextField* w );
wxUITextFieldControl( wxTextCtrl *wxPeer, UITextField* w );
virtual ~wxUITextFieldControl();
virtual wxString GetStringValue() const ;
@@ -35,9 +35,14 @@ public :
virtual void WriteText(const wxString& str) ;
virtual bool HasOwnContextMenu() const { return true; }
virtual wxSize GetBestSize() const;
virtual bool SetHint(const wxString& hint);
virtual void controlAction(WXWidget slf, void* _cmd, void *sender);
protected :
UITextField* m_textField;
NSObject<UITextFieldDelegate>* m_delegate;
long m_selStart;
long m_selEnd;
};
@@ -71,6 +76,7 @@ public:
virtual wxSize GetBestSize() const;
protected:
NSObject<UITextViewDelegate>* m_delegate;
UITextView* m_textView;
};

View File

@@ -79,6 +79,10 @@ public:
// in a single line text control
virtual void SetMaxLength(unsigned long len);
// set the grayed out hint text
virtual bool SetHint(const wxString& hint);
virtual wxString GetHint() const;
// text control under some platforms supports the text styles: these
// methods apply the given text style to the given selection or to
// set/get the style which will be used for all appended text
@@ -152,6 +156,7 @@ protected:
private :
wxMenu *m_privateContextMenu;
wxString m_hintString;
DECLARE_EVENT_TABLE()
};