Example #1
0
bool wxTextCtrlBase::SetHint(const wxString& hint)
{
    wxCHECK_MSG( IsSingleLine(), false,
                 wxS("Hints can only be set for single line text controls") );

    return wxTextEntry::SetHint(hint);
}
Example #2
0
wxSize wxTextCtrl::DoGetBestSize() const
{
    if( IsSingleLine() )
    {
        wxSize best = wxControl::DoGetBestSize();
#if wxCHECK_MOTIF_VERSION( 2, 3 )
        // OpenMotif 2.3 gives way too big X sizes
        wxSize other_best = wxDoGetSingleTextCtrlBestSize
                                ( (Widget) GetTopWidget(), this );
        return wxSize( other_best.x, best.y );
#else
        if( best.x < 90 ) best.x = 90;

        return best;
#endif
    }
    else
        return wxWindow::DoGetBestSize();
}
Example #3
0
// wxGTK-specific: called recursively by Enable,
// to give widgets an oppprtunity to correct their colours after they
// have been changed by Enable
void wxTextCtrl::OnEnabled( bool WXUNUSED(enable) )
{
    if ( IsSingleLine() )
        return;

    // If we have a custom background colour, we use this colour in both
    // disabled and enabled mode, or we end up with a different colour under the
    // text.
    wxColour oldColour = GetBackgroundColour();
    if (oldColour.Ok())
    {
        // Need to set twice or it'll optimize the useful stuff out
        if (oldColour == * wxWHITE)
            SetBackgroundColour(*wxBLACK);
        else
            SetBackgroundColour(*wxWHITE);
        SetBackgroundColour(oldColour);
    }
}