/** ** Parse the flag section of a tile definition. ** ** @param l Lua state. ** @param back pointer for the flags (return). ** @param j pointer for the location in the array. in and out ** */ void ParseTilesetTileFlags(lua_State *l, int *back, int *j) { unsigned int flags = 3; // Parse the list: flags of the slot while (1) { lua_rawgeti(l, -1, *j + 1); if (!lua_isstring(l, -1)) { lua_pop(l, 1); break; } ++(*j); const char *value = LuaToString(l, -1); lua_pop(l, 1); // Flags are only needed for the editor if (ModifyFlag(value, &flags) == false) { LuaError(l, "solid: unsupported tag: %s" _C_ value); } } *back = flags; }
CDexWidgetScrollBarV::CDexWidgetScrollBarV() { m_type = widget_scrollbar_v; m_fTotalValue = 0; m_fCurrValue = 0; m_pTopBtn = NULL; m_pBottomBtn = NULL; m_pHandleBtn = NULL; m_pTopBtn = (CDexWidgetButton* )getWidgetFactory()->createWidget(widget_button, "滚动条向上按钮"); GetChildrenContainer()->AddWidgetToBack(m_pTopBtn); m_pTopBtn->m_MouseLUp += UI_DELEGATE(this, CDexWidgetScrollBarV, OnClickTopBtn); m_pBottomBtn = (CDexWidgetButton* )getWidgetFactory()->createWidget(widget_button, "滚动条向下按钮"); GetChildrenContainer()->AddWidgetToBack(m_pBottomBtn); m_pBottomBtn->m_MouseLUp += UI_DELEGATE(this, CDexWidgetScrollBarV, OnClickBottomBtn); m_pHandleBtn = (CDexWidgetButton* )getWidgetFactory()->createWidget(widget_button, "滚动条中间按钮"); m_pHandleBtn->ModifyFlag(Add_Flag, mouse_l_drag); GetChildrenContainer()->AddWidgetToBack(m_pHandleBtn); m_pHandleBtn->m_MouseLDrag += UI_DELEGATE(this, CDexWidgetScrollBarV, OnDragHandleBtn); ModifyFlag(Add_Flag, mouse_l_drag); }