示例#1
0
/*************************************************************************
	Event generated internally whenever the roll-up / shade state of the
	window changes.
*************************************************************************/
void FrameWindow::onRollupToggled(WindowEventArgs& e)
{
    invalidate(true);
    notifyScreenAreaChanged();
    ElementEventArgs size_args(e.window);
    onSized(size_args);

	fireEvent(EventRollupToggled, e, EventNamespace);
}
示例#2
0
文件: window.cpp 项目: galek/gamegui
void base_window::setSize(const Size& sz) 
{
	if(sz != m_area.getSize())
	{
		invalidate();
		m_area.setSize(sz);
		onSized();
		send_event(events::SizedEvent());
	}
}
示例#3
0
//----------------------------------------------------------------------------//
void Element::fireAreaChangeEvents(const bool moved, const bool sized)
{
    if (moved)
    {
        ElementEventArgs args(this);
        onMoved(args);
    }

    if (sized)
    {
        ElementEventArgs args(this);
        onSized(args);
    }
}
示例#4
0
//----------------------------------------------------------------------------//
void ScrollablePane::configureScrollbars(void)
{
    // controls should all be valid by this stage
    Scrollbar* const vertScrollbar = getVertScrollbar();
    Scrollbar* const horzScrollbar = getHorzScrollbar();

    const bool horzScrollBarWasVisible = horzScrollbar->isVisible();
    const bool vertScrollBarWasVisible = vertScrollbar->isVisible();

    // enable required scrollbars
    vertScrollbar->setVisible(isVertScrollbarNeeded());
    horzScrollbar->setVisible(isHorzScrollbarNeeded());
    
    // Check if the addition of the horizontal scrollbar means we
    // now also need the vertical bar.
    if (horzScrollbar->isVisible())
        vertScrollbar->setVisible(isVertScrollbarNeeded());

    if (horzScrollBarWasVisible != horzScrollbar->isVisible() ||
        vertScrollBarWasVisible != vertScrollbar->isVisible())
    {
        ElementEventArgs args(this);
        onSized(args);
    }

    performChildWindowLayout();
    
    // get viewable area
    const Rectf viewableArea(getViewableArea());
    
    // set up vertical scroll bar values
    vertScrollbar->setDocumentSize(fabsf(d_contentRect.getHeight()));
    vertScrollbar->setPageSize(viewableArea.getHeight());
    vertScrollbar->setStepSize(ceguimax(1.0f, viewableArea.getHeight() * d_vertStep));
    vertScrollbar->setOverlapSize(ceguimax(1.0f, viewableArea.getHeight() * d_vertOverlap));
    vertScrollbar->setScrollPosition(vertScrollbar->getScrollPosition());
    
    // set up horizontal scroll bar values
    horzScrollbar->setDocumentSize(fabsf(d_contentRect.getWidth()));
    horzScrollbar->setPageSize(viewableArea.getWidth());
    horzScrollbar->setStepSize(ceguimax(1.0f, viewableArea.getWidth() * d_horzStep));
    horzScrollbar->setOverlapSize(ceguimax(1.0f, viewableArea.getWidth() * d_horzOverlap));
    horzScrollbar->setScrollPosition(horzScrollbar->getScrollPosition());
}
示例#5
0
int dwtMain(dwt::Application& app)
{
	auto window = new dwt::Window();
	window->create();
	window->onClosing([] { return ::PostQuitMessage(0), true; });

	auto split = window->addChild(dwt::SplitterContainer::Seed(0.3, true));

	split->addChild(dwt::Label::Seed(_T("First row")));
	split->addChild(dwt::Label::Seed(_T("Second row")));
	split->addChild(dwt::Label::Seed(_T("Third row")));

	split->resize(window->getClientSize());
	window->onSized([=](const dwt::SizedEvent&) { split->resize(window->getClientSize()); });

	app.run();

	return 0;
}
示例#6
0
文件: window.cpp 项目: galek/gamegui
void base_window::setArea(const Rect& rc) 
{ 
	m_area = rc;
	onMoved();
	onSized();
}