本文整理汇总了C++中mygui::TextBox::setFontHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ TextBox::setFontHeight方法的具体用法?C++ TextBox::setFontHeight怎么用?C++ TextBox::setFontHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mygui::TextBox
的用法示例。
在下文中一共展示了TextBox::setFontHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefreshNumbers
void CurveEditor::RefreshNumbers()
{
DeleteNumbersY();
auto size = mCurveCanvasWidget->getSize();
auto width = size.width;
auto height = size.height;
auto inteveralX = width / (gridNumX + 2);
auto inteveralY = height / (gridNumY + 2);
float step = (mValueRange.y - mValueRange.x) / gridNumY;
for (auto i = 0; i <= gridNumY; i += 2)
{
MyGUI::TextBox* text = mCurveCanvasWidget->createWidget<MyGUI::TextBox>("TextBox",
MyGUI::IntCoord(3, i * inteveralY + 5, 30, 15), MyGUI::Align::Default);
text->setFontHeight(14);
text->setTextShadow(true);
text->setTextShadowColour(MyGUI::Colour::Black);
DiString s;
s.Format("%.1f", step*(gridNumY - i) + mValueRange.x);
text->setCaption(s.c_str());
mNumbersY.push_back(text);
}
}
示例2: InitGrid
void CurveEditor::InitGrid()
{
auto size = mCurveCanvasWidget->getSize();
auto width = size.width;
auto height= size.height;
auto inteveralX = width / (gridNumX + 2);
auto inteveralY = height / (gridNumY + 2);
MyGUI::Colour dark(0.1f, 0.1f, 0.1f);
MyGUI::Colour light(0.2f, 0.2f, 0.2f);
std::vector<MyGUI::Colour> colors;
std::vector<MyGUI::FloatPoint> lines;
for (auto i = 1; i <= gridNumX+1; ++i)
{
lines.push_back(MyGUI::FloatPoint(i*inteveralX, 3));
lines.push_back(MyGUI::FloatPoint(i*inteveralX, height-4));
colors.push_back(i == 1 ? dark : light);
colors.push_back(i == 1 ? dark : light);
}
lines.push_back(MyGUI::FloatPoint(inteveralX - 1, 3));
lines.push_back(MyGUI::FloatPoint(inteveralX - 1, height - 4));
colors.push_back(dark);
colors.push_back(dark);
for (auto i = 1; i <= gridNumY + 1; ++i)
{
lines.push_back(MyGUI::FloatPoint(3, i*inteveralY));
lines.push_back(MyGUI::FloatPoint(width - 4, i*inteveralY));
colors.push_back(i == gridNumY + 1 ? dark : light);
colors.push_back(i == gridNumY + 1 ? dark : light);
}
lines.push_back(MyGUI::FloatPoint(3, (gridNumY + 1)*inteveralY + 1));
lines.push_back(MyGUI::FloatPoint(width - 4, (gridNumY + 1)*inteveralY + 1));
colors.push_back(dark);
colors.push_back(dark);
mCurveLines->setPoints(lines, true);
mCurveLines->setColors(colors);
for (auto i = 1; i <= gridNumX + 1; i += 2)
{
MyGUI::TextBox* text = mCurveCanvasWidget->createWidget<MyGUI::TextBox>("TextBox",
MyGUI::IntCoord(i * inteveralX + 2, height - 19, 30, 15), MyGUI::Align::Default);
text->setFontHeight(14);
text->setTextShadow(true);
text->setTextShadowColour(MyGUI::Colour::Black);
DiString s;
s.Format("%.1f", (i - 1) / (float)gridNumX);
text->setCaption(s.c_str());
mNumbersX.push_back(text);
}
}