Exemplo n.º 1
0
WidgetListBox::WidgetListBox(::Engines::GUI &gui, const Common::UString &tag,
                             const Common::UString &model) :
	ModelWidget(gui, tag, model), _contentX(0.0f), _contentY(0.0f), _contentZ(0.0f),
	_startItem(0), _selectedItem(0xFFFFFFFF), _up(0), _down(0), _scrollbar(0), _locked(false),
	_mode(kModeStatic), _hasScrollbar(false), _dblClicked(false) {

	_model->setClickable(true);

	getProperties();

	createScrollbar();
}
void RenderLayerScrollableArea::setHasVerticalScrollbar(bool hasScrollbar)
{
    if (hasScrollbar == hasVerticalScrollbar())
        return;

    if (hasScrollbar) {
        // Hits in compositing/overflow/automatically-opt-into-composited-scrolling-after-style-change.html
        DisableCompositingQueryAsserts disabler;
        m_vBar = createScrollbar(VerticalScrollbar);
    } else {
        destroyScrollbar(VerticalScrollbar);
    }
}
void RenderLayerScrollableArea::setHasHorizontalScrollbar(bool hasScrollbar)
{
    if (hasScrollbar == hasHorizontalScrollbar())
        return;

    if (hasScrollbar) {
        // This doesn't hit in any tests, but since the equivalent code in setHasVerticalScrollbar
        // does, presumably this code does as well.
        DisableCompositingQueryAsserts disabler;
        m_hBar = createScrollbar(HorizontalScrollbar);
    } else {
        destroyScrollbar(HorizontalScrollbar);
    }
}
Exemplo n.º 4
0
GUI_ListBox::GUI_ListBox(RECT _mRect, int _id, GUI_ElementStyle *_style, bool _selectBox, bool _noSelect)
	: GUI_BaseElement(_mRect, _id, _style)
{
	swapState(new GUI_ListBoxState(this));
	//calculating how many lines the ListBox can display and max length of line
	style = _style;
	lineSpace = 2;
	nLines = (height - style->MarginBottom() - style->MarginTop()) / (font->GetfHeight() + lineSpace);
	//default justification is left
	listJustification = T_LEFT;
	//line position
	selected = 2;

	auto s = cState();
	s->SetSelectBox(_selectBox);
	s->SetnoSelect(_noSelect);
	createScrollbar();
	src = GUI_Looks::GetResource(this);
}
Exemplo n.º 5
0
		Control* createScrollbarH(const Loader& e) { return createScrollbar(e,Scrollbar::HORIZONTAL); }
Exemplo n.º 6
0
		Control* createScrollbarV(const Loader& e) { return createScrollbar(e,Scrollbar::VERTICAL); }