本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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();
}
示例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);
};
示例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;
}
}
示例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
}
}
示例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;
}
示例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");
}
示例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");
}
示例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");
}
示例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));
}
示例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;
}
示例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");
}
示例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;
}
}