Esempio n. 1
0
void wxWindowQt::Refresh( bool WXUNUSED( eraseBackground ), const wxRect *rect )
{
    QWidget *widget;

    // get the inner widget in scroll areas:
    if ( QtGetScrollBarsContainer() )
    {
        widget = QtGetScrollBarsContainer()->viewport();
    } else {
        widget = GetHandle();
    }

    if ( widget != NULL )
    {
        if ( rect != NULL )
        {
            wxLogDebug(wxT("wxWindow::Refresh %s rect %d %d %d %d"),
                       (const char*)GetName(),
                       rect->x, rect->y, rect->width, rect->height);
            widget->update( wxQtConvertRect( *rect ));
        }
        else
        {
            wxLogDebug(wxT("wxWindow::Refresh %s"),
                       (const char*)GetName());
            widget->update();
        }
    }
}
Esempio n. 2
0
wxRect wxListCtrl::GetViewRect() const
{
    // this may not be exact but should be a good aproximation:
    wxRect rect = wxQtConvertRect(m_qtTreeWidget->rect());
    int h = m_qtTreeWidget->header()->defaultSectionSize();
    rect.SetTop(h);
    rect.SetHeight(rect.GetHeight() - h);
    return rect;
}
Esempio n. 3
0
bool wxStatusBar::GetFieldRect(int i, wxRect& rect) const
{
    wxCHECK_MSG( (i >= 0) && ((size_t)i < m_panes.GetCount()), false,
                 "invalid statusbar field index" );

    if ( m_qtPanes->count() != m_panes.GetCount() )
        const_cast<wxStatusBar*>(this)->UpdateFields();
    
    rect = wxQtConvertRect((*m_qtPanes)[i]->geometry());
    return true;
}
Esempio n. 4
0
bool wxListCtrl::GetItemRect(long item, wxRect& rect, int WXUNUSED(code)) const
{
    QTreeWidgetItem *qitem = QtGetItem(item);
    if ( qitem != NULL )
    {
        rect = wxQtConvertRect( m_qtTreeWidget->visualItemRect(qitem) );
        return true;
    }
    else
        return false;
}
Esempio n. 5
0
// scroll window to the specified position
void wxWindowQt::ScrollWindow( int dx, int dy, const wxRect *rect )
{
    // check if this is a scroll area (scroll only inner viewport)
    QWidget *widget;
    if ( QtGetScrollBarsContainer() )
        widget = QtGetScrollBarsContainer()->viewport();
    else
        widget = GetHandle();
    // scroll the widget or the specified rect (not children)
    if ( rect != NULL )
        widget->scroll( dx, dy, wxQtConvertRect( *rect ));
    else
        widget->scroll( dx, dy );
}
Esempio n. 6
0
bool wxListCtrl::GetSubItemRect(long item, long subItem, wxRect& rect, int WXUNUSED(code)) const
{
    QTreeWidgetItem *qitem = QtGetItem(item);
    if ( qitem != NULL )
    {
        wxCHECK_MSG( item >= 0 && item < GetItemCount(), NULL,
                     wxT("invalid row index in GetSubItemRect") );
        wxCHECK_MSG( subItem >= 0 && subItem < GetColumnCount(), NULL,
                     wxT("invalid column index in GetSubItemRect") );
        QModelIndex qindex = m_qtTreeWidget->model()->index(item, subItem);
        rect = wxQtConvertRect( m_qtTreeWidget->visualRect(qindex) );
        return true;
    }
    else
        return false;
}
Esempio n. 7
0
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
{
    return wxBitmap(M_PIXDATA.copy(wxQtConvertRect(rect)));
}