Ejemplo n.º 1
0
bool wxStatusBarGeneric::Create(wxWindow *parent,
                                wxWindowID id,
                                long style,
                                const wxString& name)
{
    style |= wxTAB_TRAVERSAL | wxFULL_REPAINT_ON_RESIZE;
    if ( !wxWindow::Create(parent, id,
                           wxDefaultPosition, wxDefaultSize,
                           style, name) )
        return false;

    // The status bar should have a themed background
    SetThemeEnabled( true );

    InitColours();

    int height = (int)((11*GetCharHeight())/10 + 2*GetBorderY());
    SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height);

    SetFieldsCount(1);

#if defined( __WXGTK20__ )
#if GTK_CHECK_VERSION(2,12,0)
    if (HasFlag(wxSTB_SHOW_TIPS) && wx_is_at_least_gtk2(12))
    {
        g_object_set(m_widget, "has-tooltip", TRUE, NULL);
        g_signal_connect(m_widget, "query-tooltip",
                         G_CALLBACK(statusbar_query_tooltip), this);
    }
#endif
#endif

    return true;
}
Ejemplo n.º 2
0
void wxStatusBar95::SetMinHeight(int height)
{
    SendMessage(GetHwnd(), SB_SETMINHEIGHT, height + 2*GetBorderY(), 0);

    // have to send a (dummy) WM_SIZE to redraw it now
    SendMessage(GetHwnd(), WM_SIZE, 0, 0);
}
Ejemplo n.º 3
0
bool wxStatusBarGeneric::Create(wxWindow *parent,
                                wxWindowID id,
                                long style,
                                const wxString& name)
{
  if ( !wxWindow::Create(parent, id,
                         wxDefaultPosition, wxDefaultSize,
                         style | wxTAB_TRAVERSAL, name) )
      return false;

  // The status bar should have a themed background
  SetThemeEnabled( true );

  InitColours();
  
#ifdef __WXPM__
  SetFont(*wxSMALL_FONT);
#endif

  // Set the height according to the font and the border size
  wxClientDC dc(this);
  dc.SetFont(GetFont());

  wxCoord y;
  dc.GetTextExtent(_T("X"), NULL, &y );

  int height = (int)( (11*y)/10 + 2*GetBorderY());

  SetSize(wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, height);

  SetFieldsCount(1);

  return true;
}
Ejemplo n.º 4
0
wxSize wxStatusBarGeneric::DoGetBestSize() const
{
    int width, height;

    // best width is the width of the parent
    if (GetParent())
        GetParent()->GetClientSize(&width, NULL);
    else
        width = 80;     // a dummy value

    // best height is as calculated above in Create()
    height = (int)((11*GetCharHeight())/10 + 2*GetBorderY());

    return wxSize(width, height);
}
Ejemplo n.º 5
0
wxSize wxStatusBarGeneric::DoGetBestSize() const
{
    int width, height;

    // best width is the width of the parent
    GetParent()->GetClientSize(&width, NULL);

    // best height is as calculated above in Create
    wxClientDC dc((wxWindow*)this);
    dc.SetFont(GetFont());
    wxCoord y;
    dc.GetTextExtent(_T("X"), NULL, &y );
    height = (int)( (11*y)/10 + 2*GetBorderY());

    return wxSize(width, height);
}
Ejemplo n.º 6
0
void wxStatusBar::SetMinHeight(int height)
{
    // It looks like we need to count the border twice to really make the
    // controls taking exactly height pixels fully fit in the status bar:
    // at least under Windows 7 the checkbox in the custom status bar of the
    // statbar sample gets truncated otherwise.
    height += 4*GetBorderY();

    // We need to set the size and not the size to reflect the height because
    // wxFrame uses our size and not the minimal size as it assumes that the
    // size of a status bar never changes anyhow.
    SetSize(-1, height);

    SendMessage(GetHwnd(), SB_SETMINHEIGHT, height, 0);

    // we have to send a (dummy) WM_SIZE to redraw it now
    SendMessage(GetHwnd(), WM_SIZE, 0, 0);
}
Ejemplo n.º 7
0
wxCoord wxStatusBarUniv::GetHeight() const
{
    return GetCharHeight() + 2*GetBorderY();
}