本文整理汇总了C++中mygui::IntCoord类的典型用法代码示例。如果您正苦于以下问题:C++ IntCoord类的具体用法?C++ IntCoord怎么用?C++ IntCoord使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IntCoord类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCellDimension
void WeaponCellView::getCellDimension(MyGUI::Widget* _sender, MyGUI::IntCoord& _coord, bool _drop)
{
if (_drop)
_coord.set(0, 0,230, 50);
else
_coord.set(0, 0,230, 50);
}
示例2: getCellDimension
void CellView::getCellDimension(MyGUI::Widget* _sender, MyGUI::IntCoord& _coord, bool _drop)
{
if (_drop)
_coord.set(0, 0, 90, 74);
else
_coord.set(0, 0, 90, 74);
}
示例3: setWindowCoord
void Application::setWindowCoord(const MyGUI::IntCoord& _value)
{
#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
if (_value.empty())
return;
MyGUI::IntCoord coord = _value;
if (coord.left < 0)
coord.left = 0;
if (coord.top < 0)
coord.top = 0;
if (coord.width < 640)
coord.width = 640;
if (coord.height < 480)
coord.height = 480;
if (coord.width > GetSystemMetrics(SM_CXSCREEN))
coord.width = GetSystemMetrics(SM_CXSCREEN);
if (coord.height > GetSystemMetrics(SM_CYSCREEN))
coord.height = GetSystemMetrics(SM_CYSCREEN);
if (coord.right() > GetSystemMetrics(SM_CXSCREEN))
coord.left = GetSystemMetrics(SM_CXSCREEN) - coord.width;
if (coord.bottom() > GetSystemMetrics(SM_CYSCREEN))
coord.top = GetSystemMetrics(SM_CYSCREEN) - coord.height;
size_t handle = getWindowHandle();
::MoveWindow((HWND)handle, coord.left, coord.top, coord.width, coord.height, true);
#endif
}
示例4: updateCoords
void IndexTextureController::updateCoords(const std::string& _value)
{
MyGUI::IntCoord coord;
if (MyGUI::utility::parseComplex(_value, coord.left, coord.top, coord.width, coord.height))
mSize = coord.size();
else
mSize.clear();
updateFrames();
}
示例5: writeState
pugi::xml_node SkinExportSerializer::writeState(pugi::xml_node _parent, DataPtr _data, const MyGUI::IntCoord& _value)
{
MyGUI::IntPoint point = MyGUI::IntPoint::parse(_data->getPropertyValue("Point"));
MyGUI::IntCoord coord = _value + point;
pugi::xml_node node = _parent.append_child("State");
node.append_attribute("name").set_value(convertEditorToExportStateName(_data->getPropertyValue("Name")).c_str());
node.append_attribute("offset").set_value(coord.print().c_str());
return node;
}
示例6: notifyChangePosition
void RegionTextureControl::notifyChangePosition()
{
mCoordValue = mAreaSelectorControl->getCoord();
// снапим к гриду
if (!MyGUI::InputManager::getInstance().isShiftPressed())
{
MyGUI::IntCoord coord = mCoordValue;
MyGUI::IntCoord actionScale = mAreaSelectorControl->getActionScale();
if (actionScale.left != 0 && actionScale.width != 0)
{
int right = coord.right();
coord.left = Grid::getInstance().toGrid(coord.left);
coord.width = right - coord.left;
}
else if (actionScale.width != 0)
{
int right = Grid::getInstance().toGrid(coord.right());
coord.width = right - coord.left;
}
else if (actionScale.left != 0)
{
coord.left = Grid::getInstance().toGrid(coord.left);
}
if (actionScale.top != 0 && actionScale.height != 0)
{
int bottom = coord.bottom();
coord.top = Grid::getInstance().toGrid(coord.top);
coord.height = bottom - coord.top;
}
else if (actionScale.height != 0)
{
int bottom = Grid::getInstance().toGrid(coord.bottom());
coord.height = bottom - coord.top;
}
else if (actionScale.top != 0)
{
coord.top = Grid::getInstance().toGrid(coord.top);
}
if (coord != mCoordValue)
{
mCoordValue = coord;
mAreaSelectorControl->setCoord(mCoordValue);
}
}
if (getCurrentRegion() != nullptr)
getCurrentRegion()->getPropertySet()->setPropertyValue("Position", mCoordValue.print(), mTypeName);
}
示例7: loadMouseRelative
void TextureControl::loadMouseRelative()
{
MyGUI::IntPoint viewOffset = mView->getViewOffset();
MyGUI::IntCoord viewCoord = mView->getViewCoord();
MyGUI::IntSize canvasSize = mView->getCanvasSize();
MyGUI::IntPoint mousePoint = MyGUI::InputManager::getInstance().getMousePositionByLayer();
// смещение мыши относительно вью
MyGUI::IntPoint mouseOffset = mousePoint - mView->getAbsolutePosition() - viewCoord.point();
// смещение нужной точки внутри текстуры в пикселях
MyGUI::IntPoint canvasPointOffset((int)(mMouseRelative.left * (float)canvasSize.width), (int)(mMouseRelative.top * (float)canvasSize.height));
// смещение вью в пикселях
MyGUI::IntPoint canvasOffset = canvasPointOffset - mouseOffset;
mView->setViewOffset(MyGUI::IntPoint(-canvasOffset.left, -canvasOffset.top));
}
示例8: updateCoord
void StateTextureControl::updateCoord()
{
MyGUI::UString value;
if (getCurrentSkin() != nullptr)
value = getCurrentSkin()->getPropertySet()->getPropertyValue("Coord");
MyGUI::IntCoord coord;
if (MyGUI::utility::parseComplex(value, coord.left, coord.top, coord.width, coord.height))
{
if (mSizeValue != coord.size())
{
mSizeValue = coord.size();
updateSelectorsSize();
}
}
}
示例9: setWindowCoord
void BaseManager::setWindowCoord(const MyGUI::IntCoord& _value)
{
if (_value.empty())
return;
MyGUI::IntCoord coord = _value;
SDL_SetWindowPosition(mWindow, coord.left, coord.top);
}
示例10: createSkin
void TestWindow::createSkin()
{
if (mSkinItem == nullptr)
return;
MyGUI::IntSize canvasSize = mBackgroundControl->getCanvas()->getSize();
generateSkin();
mSkinButton = mBackgroundControl->getCanvas()->createWidget<MyGUI::Button>(mSkinName, MyGUI::IntCoord(0, 0, canvasSize.width, canvasSize.height), MyGUI::Align::Stretch);
mSkinButton->setFontName(mDefaultFontName);
mSkinButton->setTextAlign(MyGUI::Align::Center);
mSkinButton->setCaption("Caption");
mSkinButton->eventMouseButtonPressed += MyGUI::newDelegate(this, &TestWindow::notifyMouseButtonPressed);
MyGUI::IntCoord coord = mSkinItem->getPropertyValue<MyGUI::IntCoord>("Size");
MyGUI::IntSize windowSize = coord.size() + mMainWidget->getSize() - canvasSize;
MyGUI::IntSize parentSize = mMainWidget->getParentSize();
mMainWidget->setCoord((parentSize.width - windowSize.width) / 2, (parentSize.height - windowSize.height) / 2, windowSize.width, windowSize.height);
}
示例11: notifyDrawItem
void ListBox::notifyDrawItem(MyGUI::ListCtrl* _sender, MyGUI::Widget* _item, const MyGUI::IBDrawItemInfo& _info, MyGUI::IntCoord& _coord)
{
MyGUI::Button* text = *_item->getUserData<MyGUI::Button*>();
if (_info.update)
{
text->setCaption(mItemsInfo[_info.index]);
MyGUI::IntSize size = text->getTextSize() + (text->getSize() - text->getTextRegion().size());
size.height = mHeightLine;
_coord.set(0, 0, size.width, size.height);
}
text->setButtonPressed(_info.select);
text->_setMouseFocus(_info.active);
}
示例12: moveSeparator
void SeparatePanel::moveSeparator(const MyGUI::IntPoint& _mousePosition)
{
MyGUI::IntPoint offset = _mousePosition - mMousePressedOffset - mMainWidget->getAbsolutePosition();
// сбрасываем дефолтный размер панели
mDefaultPanelSize.clear();
MyGUI::IntCoord firstPanel = mFirstPanel->getCoord();
MyGUI::IntCoord separatorH = mSeparatorH->getCoord();
MyGUI::IntCoord separatorV = mSeparatorV->getCoord();
MyGUI::IntCoord secondPanel = mSecondPanel->getCoord();
if (mPanelAlign.isLeft())
{
firstPanel.width = offset.left - firstPanel.left;
separatorH.left = offset.left;
secondPanel.width = secondPanel.right() - (offset.left + separatorH.width);
secondPanel.left = offset.left + separatorH.width;
}
else if (mPanelAlign.isRight())
{
secondPanel.width = offset.left - secondPanel.left;
separatorH.left = offset.left;
firstPanel.width = firstPanel.right() - (offset.left + separatorH.width);
firstPanel.left = offset.left + separatorH.width;
}
else if (mPanelAlign.isTop())
{
firstPanel.height = offset.top - firstPanel.top;
separatorV.top = offset.top;
secondPanel.height = secondPanel.bottom() - (offset.top + separatorV.height);
secondPanel.top = offset.top + separatorV.height;
}
else if (mPanelAlign.isBottom())
{
secondPanel.height = offset.top - secondPanel.top;
separatorV.top = offset.top;
firstPanel.height = firstPanel.bottom() - (offset.top + separatorV.height);
firstPanel.top = offset.top + separatorV.height;
}
invalidateSize(firstPanel, separatorH, separatorV, secondPanel);
// запоминаем дефолтный размер панели
mDefaultPanelSize = mFirstPanel->getSize();
}
示例13: notifyChangePosition
void WorkspaceControl::notifyChangePosition()
{
if (!mMoveableWidget)
return;
mCoordValue = mAreaSelectorControl->getCoord();
// конвертируем в локальные координаты
if (mCurrentWidget != nullptr)
{
MyGUI::Widget* parent = mCurrentWidget->getParent();
if (parent != nullptr && !mCurrentWidget->isRootWidget())
mCoordValue = mCoordValue - parent->getAbsolutePosition();
}
// снапим к гриду
if (!MyGUI::InputManager::getInstance().isShiftPressed())
{
MyGUI::IntCoord coord = mCoordValue;
MyGUI::IntCoord actionScale = mAreaSelectorControl->getActionScale();
if (actionScale.left != 0 && actionScale.width != 0)
{
int right = coord.right();
coord.width = toGrid(coord.width + (mGridStep / 2));
coord.left = right - coord.width;
}
else if (actionScale.width != 0)
{
int right = toGrid(coord.right() + (mGridStep / 2));
coord.width = right - coord.left;
}
else if (actionScale.left != 0)
{
coord.left = toGrid(coord.left + (mGridStep / 2));
}
if (actionScale.top != 0 && actionScale.height != 0)
{
int bottom = coord.bottom();
coord.height = toGrid(coord.height + (mGridStep / 2));
coord.top = bottom - coord.height;
}
else if (actionScale.height != 0)
{
int bottom = toGrid(coord.bottom() + (mGridStep / 2));
coord.height = bottom - coord.top;
}
else if (actionScale.top != 0)
{
coord.top = toGrid(coord.top + (mGridStep / 2));
}
if (coord != mCoordValue)
{
mCoordValue = coord;
updateSelectionFromValue();
}
}
if (mCurrentWidget != nullptr)
setWidgetCoord(mCurrentWidget, mCoordValue);
UndoManager::getInstance().addValue(PR_POSITION);
}
示例14: getCellDimension
void ColourWindowCellView::getCellDimension(MyGUI::Widget* _sender, MyGUI::IntCoord& _coord, bool _drop)
{
_coord.set(0, 0, _sender->getClientCoord().width, 20);
}
示例15: invalidateSize
void SeparatePanel::invalidateSize(const MyGUI::IntCoord& _firstPanel, const MyGUI::IntCoord& _separatorH, const MyGUI::IntCoord& _separatorV, const MyGUI::IntCoord& _secondPanel)
{
if (mMainWidget->getWidth() <= 0 ||
mMainWidget->getHeight() <= 0)
return;
MyGUI::IntCoord firstPanel = _firstPanel;
MyGUI::IntCoord separatorH = _separatorH;
MyGUI::IntCoord separatorV = _separatorV;
MyGUI::IntCoord secondPanel = _secondPanel;
if (mPanelAlign.isLeft())
{
updateSize(firstPanel.width, secondPanel.width, separatorH.width, mMainWidget->getWidth(), mDefaultPanelSize.width);
firstPanel.top = separatorH.top = secondPanel.top = 0;
firstPanel.height = separatorH.height = secondPanel.height = mMainWidget->getHeight();
firstPanel.left = 0;
separatorH.left = firstPanel.right();
secondPanel.left = separatorH.right();
}
else if (mPanelAlign.isRight())
{
updateSize(firstPanel.width, secondPanel.width, separatorH.width, mMainWidget->getWidth(), mDefaultPanelSize.width);
firstPanel.top = separatorH.top = secondPanel.top = 0;
firstPanel.height = separatorH.height = secondPanel.height = mMainWidget->getHeight();
secondPanel.left = 0;
separatorH.left = secondPanel.right();
firstPanel.left = separatorH.right();
}
else if (mPanelAlign.isTop())
{
updateSize(firstPanel.height, secondPanel.height, separatorV.height, mMainWidget->getHeight(), mDefaultPanelSize.height);
firstPanel.left = separatorV.left = secondPanel.left = 0;
firstPanel.width = separatorV.width = secondPanel.width = mMainWidget->getWidth();
firstPanel.top = 0;
separatorV.top = firstPanel.bottom();
secondPanel.top = separatorV.bottom();
}
else if (mPanelAlign.isBottom())
{
updateSize(firstPanel.height, secondPanel.height, separatorV.height, mMainWidget->getHeight(), mDefaultPanelSize.height);
firstPanel.left = separatorV.left = secondPanel.left = 0;
firstPanel.width = separatorV.width = secondPanel.width = mMainWidget->getWidth();
secondPanel.top = 0;
separatorV.top = secondPanel.bottom();
firstPanel.top = separatorV.bottom();
}
if (firstPanel != mFirstPanel->getCoord())
mFirstPanel->setCoord(firstPanel);
if (separatorH != mSeparatorH->getCoord())
mSeparatorH->setCoord(separatorH);
if (separatorV != mSeparatorV->getCoord())
mSeparatorV->setCoord(separatorV);
if (secondPanel != mSecondPanel->getCoord())
mSecondPanel->setCoord(secondPanel);
}