Пример #1
0
void wxCustomStatusBar::SetText(const wxString& message)
{
    m_text = message;
    SetToolTip(message);
    
    // Make sure we draw only when the "art" objects are in sync with the field
    // and with the bar itself
    wxRect mainRect = DoGetMainFieldRect();
    wxBitmap bmp(mainRect.GetSize());
    wxMemoryDC memDc;
    memDc.SelectObject(bmp);
    
    // update the rect
    m_mainText->SetRect(mainRect);
    m_mainText->Cast<wxCustomStatusBarFieldText>()->SetText(m_text);
    m_mainText->Cast<wxCustomStatusBarFieldText>()->SetTooltip(m_text);
}
Пример #2
0
void wxCustomStatusBar::SetText(const wxString& message, int secondsToLive)
{
    // Stop any timer
    if(m_timer->IsRunning()) {
        m_timer->Stop();
    }

    m_text = message;
    SetToolTip(message);

    // Make sure we draw only when the "art" objects are in sync with the field
    // and with the bar itself
    wxRect mainRect = DoGetMainFieldRect();

    // update the rect
    m_mainText->SetRect(mainRect);
    m_mainText->Cast<wxCustomStatusBarFieldText>()->SetText(m_text);
    m_mainText->Cast<wxCustomStatusBarFieldText>()->SetTooltip(m_text);

    if(secondsToLive != wxNOT_FOUND) {
        m_timer->Start(secondsToLive * 1000, true);
    }
}