// Using WB_AUTOHSCROLL, WB_AUTOVSCROLL here sucks big time, there is a // problem in the toolkit class where there are some clashing IDs // ( css::awt::VclWindowPeerAttribute::VSCROLL has the same value // as css::awt::WindowAttribute::NODECORATION and they are used // in the same bitmap :-( WB_VSCROLL & WB_HSCROLL apparently are only for // child classes ( whole thing is a mess if you ask me )
ScrollableDialog::ScrollableDialog( vcl::Window* pParent, WinBits nStyle, Dialog::InitFlag eFlag )
: Dialog( pParent, nStyle & ~( WB_AUTOHSCROLL | WB_AUTOVSCROLL ), eFlag ),
maHScrollBar( VclPtr<ScrollBar>::Create(this, WB_HSCROLL | WB_DRAG) ),
maVScrollBar( VclPtr<ScrollBar>::Create(this, WB_VSCROLL | WB_DRAG) ),
mbHasHoriBar( false ),
mbHasVertBar( false ),
maScrollVis( None )
{
Link<ScrollBar*,void> aLink( LINK( this, ScrollableDialog, ScrollBarHdl ) );
maVScrollBar->SetScrollHdl( aLink );
maHScrollBar->SetScrollHdl( aLink );
ScrollBarVisibility aVis = None;
if ( nStyle & ( WB_AUTOHSCROLL | WB_AUTOVSCROLL ) )
{ if ( nStyle & WB_AUTOHSCROLL )
aVis = Hori; if ( nStyle & WB_AUTOVSCROLL )
{ if ( aVis == Hori )
aVis = Both; else
aVis = Vert;
}
}
setScrollVisibility( aVis );
mnScrWidth = Dialog::GetSettings().GetStyleSettings().GetScrollBarSize();
}
void ScrollableDialog::setScrollVisibility( ScrollBarVisibility rVisState )
{
maScrollVis = rVisState; if ( maScrollVis == Hori || maScrollVis == Both )
{
mbHasHoriBar = true;
maHScrollBar->Show();
} if ( maScrollVis == Vert || maScrollVis == Both )
{
mbHasVertBar = true;
maVScrollBar->Show();
} if ( mbHasHoriBar || mbHasVertBar )
SetStyle( Dialog::GetStyle() | WB_CLIPCHILDREN );
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.