예제 #1
0
ui::UIListBox::UIListBox(SCROLL_DIRECTION scrollDirection, UISize preferredBitmapSize)
    : m_scrollDirection(scrollDirection)
    , m_preferredBitmapSize(preferredBitmapSize)
    , m_preferredTextAreaSize(UISize(0.0f, 0.0f))
    , m_marginBetweenBitmapAndText(4.0f)
    , m_marginBetweenItems(4.0f)
    , m_itemWidth(0.0f)
    , m_itemHeight(0.0f)
    , m_scrollBarMarginFromSide(8.0f)
    , m_scrollBarThick(20.0f)
    , m_rectFigure(std::make_unique<graphics::figure::RectangleFigure>())
    , m_colorSet(std::make_shared<graphics::color::ColorSet>(UILISTBOX_COLORSETDEF))
    , m_scrollBar(std::make_shared<ui::UIScrollBar>())
    , m_displayPositionOffset(0.0f) {
#ifdef DEBUG_UILISTBOX
  LOG_ENTER(SEVERITY_LEVEL_DEBUG);
#endif
  AddElement(m_scrollBar);
  AddBeforeAddElementCallback([&](std::shared_ptr<UIBase> element) -> bool {
    element->SetParentContainer(shared_from_this());
    return true;
  });
  SetFocusable(false);
#ifdef DEBUG_UILISTBOX
  LOG_LEAVE(SEVERITY_LEVEL_DEBUG);
#endif
}
예제 #2
0
파일: window.cpp 프로젝트: ksdjfdf/HUI
void UIWindow::SetWindowMaxSize(int width,int height) { SetWindowMaxSize(UISize(width,height)); }