当前位置: 首页>>代码示例>>C++>>正文


C++ UIWindow类代码示例

本文整理汇总了C++中UIWindow的典型用法代码示例。如果您正苦于以下问题:C++ UIWindow类的具体用法?C++ UIWindow怎么用?C++ UIWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UIWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Window_

int Window_( lua_State* L )
{
  UIWindow* window = new UIWindow;

  SetName(L, window);
  SetTopLeftWidthHeight(L, window);
  SetTooltip(L, window);
  SetAnim(L, window, UIPanel::NORMAL_ANIM_, "normalAnim");
  SetAnim(L, window, UIPanel::DISABLED_ANIM_, "disabledAnim");
  SetTextUserData(L, window);

  AddWidget(L, window);

  // 配置关闭按钮

  if (util::HasField(L, "closeBtn"))
  {
    lua_pushstring(L, "closeBtn");
    lua_gettable(L, -2);
    if (lua_istable(L, -1))
      SetButton(L, window->GetCloseButton());
    lua_pop(L, 1);
  }

  SetAlpha(L, window);

  lua_pushlightuserdata(L, window);

  return 1;
}
开发者ID:lrh,项目名称:SFGE,代码行数:30,代码来源:ui_lua.cpp

示例2: render

void UI::render ()
{
	std::vector<UIWindow*> renderOrder;
	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		renderOrder.push_back(window);
		// we can skip here
		if (window->isFullscreen())
			break;
	}

	for (std::vector<UIWindow*>::reverse_iterator i = renderOrder.rbegin(); i != renderOrder.rend(); ++i) {
		(*i)->render(0, 0);
	}

	// TODO: move cursor and progress bar into frontend
	if (_progress.active) {
		renderProgress();
	}

	if (_cursorX != -1 && _cursorY != -1 && _cursor) {
		const int w = _mouseCursor->getWidth();
		const int h = _mouseCursor->getHeight();
		_frontend->renderImage(_mouseCursor.get(), _cursorX, _cursorY, w, h, 0, 1.0f);
	}

	const bool debug = Config.getConfigVar("debugui")->getBoolValue();
	if (debug) {
		const BitmapFontPtr& font = getFont();
		const std::string s = String::format("%i:%i", _cursorX, _cursorY);
		font->print(s, colorWhite, 0, 0);
	}
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:34,代码来源:UI.cpp

示例3: Vector2

bool LayoutManager::ProcessPointer(float x, float y, float z, Msg msg, int button, PointerType pointerType, unsigned int pointerID)
{
#ifndef NDEBUG
    _lastPointerLocation[pointerID] = Vector2(x, y);
#endif

	if(UIWindow *captured = GetCapture(pointerID) )
	{
		// calc relative mouse position and route message to captured window
		for(UIWindow *wnd = captured; _desktop.Get() != wnd; wnd = wnd->GetParent() )
		{
			assert(wnd);
			x -= wnd->GetX();
			y -= wnd->GetY();
		}
		if( ProcessPointerInternal(captured, x, y, z, msg, button, pointerType, pointerID, true) ||
            ProcessPointerInternal(captured, x, y, z, msg, button, pointerType, pointerID, false))
			return true;
	}
	else
	{
		// handle all children of the desktop recursively; offer to topmost windows first
		if( ProcessPointerInternal(_desktop.Get(), x, y, z, msg, button, pointerType, pointerID, true) ||
            ProcessPointerInternal(_desktop.Get(), x, y, z, msg, button, pointerType, pointerID, false))
			return true;
	}
	if( _hotTrackWnd.Get() )
	{
		_hotTrackWnd->OnMouseLeave();
		_hotTrackWnd.Set(nullptr);
	}
	return false;
}
开发者ID:olitvinenko,项目名称:battle_tanks,代码行数:33,代码来源:GuiManager.cpp

示例4: main

int main(int argc, char *argv[])
{
    cout<<"Under Construction ... "<<endl<<"Hello"<<argc<<endl;
    QApplication app(argc, argv);
    UIWindow window;
    window.show();
    return app.exec();
}
开发者ID:sanmayaj,项目名称:task-scheduler,代码行数:8,代码来源:main.cpp

示例5: Widget

void UICanvas::showMessageBox(const String& message)
{
	Widget* modalBackground = new Widget();
	
	UIWindow* surface = addSurface("modal");
	surface->attach(modalBackground);
	modalBackground->setRect(surface->getRect());

	UILabel* label = new UILabel(message);
	label->setSize(700,50);
	//label->setCenter(modalBackground->getMiddlePosition());
	modalBackground->attach(label);
};
开发者ID:GrimshawA,项目名称:Nephilim,代码行数:13,代码来源:UICanvas.cpp

示例6: onMouseButtonPress

void UI::onMouseButtonPress (int32_t x, int32_t y, uint8_t button)
{
	if (_restart)
		return;

	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		if (window->onMouseButtonPress(_cursorX, _cursorY, button))
			break;
		if (window->isModal() || window->isFullscreen())
			break;
	}
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:14,代码来源:UI.cpp

示例7: GetChildByIndex

void UIButtonGroup::SetFocusedIndex(int index)
{
    if (index >=0 && (unsigned int)index < GetChildrenCount())
    {
        m_currentFocusedIndex = index;
#ifndef KINDLE_FOR_TOUCH
        UIWindow* pWin = GetChildByIndex(index);
        if (pWin)
        {
            pWin->SetFocus(true);
        }
#endif
    }
}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:14,代码来源:UIButtonGroup.cpp

示例8: hr

HRESULT UIButtonGroup::Draw(DK_IMAGE drawingImg)
{
    if (!m_bIsVisible)
        return S_OK;
    
    HRESULT hr(S_OK);
    DK_IMAGE imgSelf;
    int left = m_iLeft, top = m_iTop, right = m_iLeft + m_iWidth, bottom = m_iTop + m_iHeight;
    DK_RECT rcSelf={left, top, right, bottom};
    RTN_HR_IF_FAILED(CropImage(
        drawingImg,
        rcSelf,
        &imgSelf
        ));
    CTpGraphics grf(imgSelf);
    ValidChildBtnShown();
    int iSize = GetChildrenCount();
    for (int i = 0; i < iSize; i++)
    {
        UIWindow* pWin = GetChildByIndex(i);
        if (pWin && pWin->IsVisible())
        {
            DebugPrintf(DLC_GUI_VERBOSE,
                    "%s: Drawing Child %d / %d : %s, (%d, %d)-(%d, %d), %s ...",
                    GetClassName(), i, iSize, pWin->GetClassName(),
                    pWin->GetX(), pWin->GetY(),
                    pWin->GetWidth(), pWin->GetHeight(),
                    pWin->GetText());
            hr = pWin->Draw(imgSelf);
            if (!SUCCEEDED(hr))
            {
                DebugPrintf(DLC_GUI_VERBOSE, "Draw child failed");
            }
        }
        else
        {
            DebugPrintf(DLC_ERROR, "%s: FAILED to get child %d/%d !!!", GetClassName(), i, iSize);
        }
    }

    if (m_btnsDirection == BGD_Horizontal)
    {
        DrawTopLine(grf);
        DrawBottomLine(grf);
    }
    DrawSplitLine(grf);

    if (m_currentFocusedIndex >= 0 && (unsigned int)m_currentFocusedIndex < GetChildrenCount())
    {
        DrawFocusedSymbol(imgSelf);
    }

    return hr;
}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:54,代码来源:UIButtonGroup.cpp

示例9: onGestureRecord

void UI::onGestureRecord (int64_t gestureId)
{
	if (_restart)
		return;

	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		if (window->onGestureRecord(gestureId))
			return;
		if (window->isModal() || window->isFullscreen())
			return;
	}
	debug(LOG_CLIENT, "gesture record event was not handled");
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:15,代码来源:UI.cpp

示例10: onControllerButtonPress

void UI::onControllerButtonPress (const std::string& button)
{
	if (_restart)
		return;

	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		if (window->onControllerButtonPress(_cursorX, _cursorY, button))
			return;
		if (window->isModal() || window->isFullscreen())
			return;
	}
	debug(LOG_CLIENT, "controller button " + button + " was pressed and not handled");
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:15,代码来源:UI.cpp

示例11: onGesture

void UI::onGesture (int64_t gestureId, float error, int32_t numFingers)
{
	if (_restart)
		return;

	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		if (window->onGesture(gestureId, error, numFingers))
			return;
		if (window->isModal() || window->isFullscreen())
			return;
	}
	debug(LOG_CLIENT, "gesture event was not handled");
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:15,代码来源:UI.cpp

示例12: onJoystickButtonPress

void UI::onJoystickButtonPress (uint8_t button)
{
	if (_restart)
		return;

	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		if (window->onJoystickButtonPress(_cursorX, _cursorY, button))
			return;
		if (window->isModal() || window->isFullscreen())
			return;
	}
	debug(LOG_CLIENT, String::format("joystick button %i was pressed and not handled", (int)button));
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:15,代码来源:UI.cpp

示例13: onTextInput

bool UI::onTextInput (const std::string& text)
{
	if (_restart)
		return false;

	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		if (window->onTextInput(text))
			return true;
		if (window->isModal() || window->isFullscreen())
			break;
	}
	return false;
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:15,代码来源:UI.cpp

示例14: onMultiGesture

void UI::onMultiGesture (float theta, float dist, int32_t numFingers)
{
	if (_restart)
		return;

	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		if (window->onMultiGesture(theta, dist, numFingers))
			return;
		if (window->isModal() || window->isFullscreen())
			return;
	}
	debug(LOG_CLIENT, "multi gesture event was not handled");
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:15,代码来源:UI.cpp

示例15: GETSCALE_W

void UI::onMouseWheel (int32_t x, int32_t y)
{
	if (_restart)
		return;

	GETSCALE_W(x);
	GETSCALE_H(y);
	UIStack stack = _stack;
	for (UIStackReverseIter i = stack.rbegin(); i != stack.rend(); ++i) {
		UIWindow* window = *i;
		if (window->onMouseWheel(x, y))
			break;
		if (window->isModal() || window->isFullscreen())
			break;
	}
}
开发者ID:masterDuncan,项目名称:caveexpress,代码行数:16,代码来源:UI.cpp


注:本文中的UIWindow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。