correct small errors in wxqt implementation
This commit is contained in:
committed by
Vadim Zeitlin
parent
5261d3eb05
commit
2a2e17c050
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include "wx/object.h"
|
#include "wx/object.h"
|
||||||
|
|
||||||
|
class wxWindow;
|
||||||
class WXDLLIMPEXP_CORE wxToolTip : public wxObject
|
class WXDLLIMPEXP_CORE wxToolTip : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -47,8 +47,6 @@ wxStatusBar::wxStatusBar(wxWindow *parent, wxWindowID winid,
|
|||||||
bool wxStatusBar::Create(wxWindow *parent, wxWindowID WXUNUSED(winid),
|
bool wxStatusBar::Create(wxWindow *parent, wxWindowID WXUNUSED(winid),
|
||||||
long style, const wxString& WXUNUSED(name))
|
long style, const wxString& WXUNUSED(name))
|
||||||
{
|
{
|
||||||
wxMISSING_IMPLEMENTATION( "wxStatusBar::Create parameters" );
|
|
||||||
|
|
||||||
m_qtStatusBar = new wxQtStatusBar( parent, this );
|
m_qtStatusBar = new wxQtStatusBar( parent, this );
|
||||||
m_qtPanes = new QList < QLabel* >;
|
m_qtPanes = new QList < QLabel* >;
|
||||||
|
|
||||||
@@ -67,6 +65,9 @@ bool wxStatusBar::GetFieldRect(int i, wxRect& rect) const
|
|||||||
wxCHECK_MSG( (i >= 0) && ((size_t)i < m_panes.GetCount()), false,
|
wxCHECK_MSG( (i >= 0) && ((size_t)i < m_panes.GetCount()), false,
|
||||||
"invalid statusbar field index" );
|
"invalid statusbar field index" );
|
||||||
|
|
||||||
|
if(m_qtPanes->count() != m_panes.GetCount())
|
||||||
|
const_cast<wxStatusBar*>(this)->UpdateFields();
|
||||||
|
|
||||||
rect = wxQtConvertRect((*m_qtPanes)[i]->geometry());
|
rect = wxQtConvertRect((*m_qtPanes)[i]->geometry());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -88,6 +89,9 @@ int wxStatusBar::GetBorderY() const
|
|||||||
|
|
||||||
void wxStatusBar::DoUpdateStatusText(int number)
|
void wxStatusBar::DoUpdateStatusText(int number)
|
||||||
{
|
{
|
||||||
|
if(m_qtPanes->count() != m_panes.GetCount())
|
||||||
|
UpdateFields();
|
||||||
|
|
||||||
(*m_qtPanes)[number]->setText( wxQtConvertString( m_panes[number].GetText() ) );
|
(*m_qtPanes)[number]->setText( wxQtConvertString( m_panes[number].GetText() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +108,6 @@ void wxStatusBar::Init()
|
|||||||
m_qtPanes = NULL;
|
m_qtPanes = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxStatusBar::UpdateFields()
|
void wxStatusBar::UpdateFields()
|
||||||
{
|
{
|
||||||
// is it a good idea to recreate all the panes every update?
|
// is it a good idea to recreate all the panes every update?
|
||||||
|
@@ -1109,6 +1109,7 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event )
|
|||||||
|
|
||||||
// send the paint event (wxWindowDC will draw directly):
|
// send the paint event (wxWindowDC will draw directly):
|
||||||
wxPaintEvent paint( GetId() );
|
wxPaintEvent paint( GetId() );
|
||||||
|
paint.SetEventObject(this);
|
||||||
handled = ProcessWindowEvent(paint);
|
handled = ProcessWindowEvent(paint);
|
||||||
m_updateRegion.Clear();
|
m_updateRegion.Clear();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user