#include "wx/osx/private.h"
-IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxTextCtrlBase)
-
BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase)
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
EVT_CHAR(wxTextCtrl::OnChar)
const wxValidator& validator,
const wxString& name )
{
- m_macIsUserPane = false ;
+ DontCreatePeer();
m_editable = true ;
if ( ! (style & wxNO_BORDER) )
}
- m_peer = wxWidgetImpl::CreateTextControl( this, GetParent(), GetId(), str, pos, size, style, GetExtraStyle() );
+ SetPeer(wxWidgetImpl::CreateTextControl( this, GetParent(), GetId(), str, pos, size, style, GetExtraStyle() ));
MacPostControlCreate(pos, size) ;
-
+
#if wxOSX_USE_COCOA
// under carbon everything can already be set before the MacPostControlCreate embedding takes place
// but under cocoa for single line textfields this only works after everything has been set up
GetTextPeer()->SetStringValue(str);
#endif
-
+
// only now the embedding is correct and we can do a positioning update
MacSuperChangedPosition() ;
if (size.x > 0 && size.y > 0)
return size;
}
-
+
int wText, hText;
// these are the numbers from the HIG:
{
if (CanCopy())
{
- wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_COPY, GetId());
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_COPY, GetId());
evt.SetEventObject(this);
if (!GetEventHandler()->ProcessEvent(evt))
{
{
if (CanCut())
{
- wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_CUT, GetId());
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_CUT, GetId());
evt.SetEventObject(this);
if (!GetEventHandler()->ProcessEvent(evt))
{
{
if (CanPaste())
{
- wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_PASTE, GetId());
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_PASTE, GetId());
evt.SetEventObject(this);
if (!GetEventHandler()->ProcessEvent(evt))
{
return true ;
}
+bool wxTextCtrl::SetHint(const wxString& hint)
+{
+ m_hintString = hint;
+
+ if ( GetTextPeer() && GetTextPeer()->SetHint(hint) )
+ return true;
+
+ return false;
+}
+
+wxString wxTextCtrl::GetHint() const
+{
+ return m_hintString;
+}
+
// ----------------------------------------------------------------------------
// implementation base class
// ----------------------------------------------------------------------------