本文整理汇总了C++中GuiControl::setWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ GuiControl::setWidth方法的具体用法?C++ GuiControl::setWidth怎么用?C++ GuiControl::setWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuiControl
的用法示例。
在下文中一共展示了GuiControl::setWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GuiWindow
PhysicsFrameSplineEditor::PhysicsFrameSplineEditor(const GuiText& caption, GuiPane* dockPane, GuiTheme::Ref theme) :
GuiWindow(caption,
theme,
Rect2D::xywh(0,0,100,40),
GuiTheme::TOOL_WINDOW_STYLE,
GuiWindow::HIDE_ON_CLOSE),
m_selectedControlPointIndex(0),
m_isDocked(dockPane != NULL) {
m_cachedPhysicsFrameString = CFrame(m_cachedPhysicsFrameValue).toAny().unparse();
m_spline.append(CFrame());
m_surface = new SplineSurface(this);
m_nodeManipulator = ThirdPersonManipulator::create();
m_nodeManipulator->setEnabled(false);
GuiPane* p = dockPane;
if (p == NULL) {
// Place into the window
p = pane();
} else {
// No need to show the window
setVisible(false);
}
GuiPane* cpPane = p->addPane("Control Point", GuiTheme::ORNATE_PANE_STYLE);
cpPane->moveBy(0, -15);
if (false) {
static float x,y,z;
//static const float translationControlWidth = 80;
static const float rotationControlWidth = 40;
//static const float captionWidth = 10;
static const float rotationPrecision = 0.1;
//static const float translationPrecision = 0.001;
static const std::string degrees = "\xba";
cpPane->beginRow(); {
GuiNumberBox<float>* c = NULL;
static std::string s = "100.0, 100.0, 100.0";
GuiControl* t = cpPane->addTextBox("xyz (", &s);
t->setWidth(155);
t->setCaptionWidth(26);
cpPane->addLabel(") m");
c = cpPane->addNumberBox("", &x, degrees, GuiTheme::NO_SLIDER, -finf(), finf(), rotationPrecision);
c->moveBy(20, 0);
c->setCaptionWidth(0); c->setWidth(rotationControlWidth); c->setUnitsSize(8);
c = cpPane->addNumberBox("", &y, degrees, GuiTheme::NO_SLIDER, -finf(), finf(), rotationPrecision);
c->setCaptionWidth(0); c->setWidth(rotationControlWidth); c->setUnitsSize(8);
c = cpPane->addNumberBox("", &z, degrees, GuiTheme::NO_SLIDER, -finf(), finf(), rotationPrecision);
c->setCaptionWidth(0); c->setWidth(rotationControlWidth); c->setUnitsSize(8);
} cpPane->endRow();
}
cpPane->addLabel("Control point: 0");
cpPane->addNumberBox("Time", Pointer<float>(this, &PhysicsFrameSplineEditor::selectedNodeTime, &PhysicsFrameSplineEditor::setSelectedNodeTime), "s");
cpPane->addTextBox("", Pointer<std::string>(this, &PhysicsFrameSplineEditor::selectedNodePFrameAsString, &PhysicsFrameSplineEditor::setSelectedNodePFrameFromString));
cpPane->beginRow(); {
GuiButton* b = cpPane->addButton("Add new", this, &PhysicsFrameSplineEditor::addControlPoint);
b->moveBy(-2, -7);
m_removeSelectedButton = cpPane->addButton("Remove", this, &PhysicsFrameSplineEditor::removeSelectedControlPoint);
} cpPane->endRow();
cpPane->pack();
GuiControl* prev = p->addCheckBox("Loop with final interval", Pointer<bool>(this, &PhysicsFrameSplineEditor::cyclic, &PhysicsFrameSplineEditor::setCyclic));
GuiPane* finalIntervalPane = p->addPane("", GuiTheme::NO_PANE_STYLE);
finalIntervalPane->moveRightOf(prev);
finalIntervalPane->moveBy(-1, -5);
static int m_explicitFinalInterval = 0;
m_finalIntervalChoice[0] = finalIntervalPane->addRadioButton("automatic", 0, &m_explicitFinalInterval);
finalIntervalPane->beginRow(); {
m_finalIntervalChoice[1] = finalIntervalPane->addRadioButton("", 1, &m_explicitFinalInterval);
m_finalIntervalBox = finalIntervalPane->addNumberBox("", &m_spline.finalInterval, "s", GuiTheme::NO_SLIDER, -1.0f, 10000.0f, 0.001f);
m_finalIntervalBox->setWidth(76);
m_finalIntervalBox->moveBy(-2, 0);
} finalIntervalPane->endRow();
pack();
setEnabled(false);
}