本文整理汇总了C++中JRect::height方法的典型用法代码示例。如果您正苦于以下问题:C++ JRect::height方法的具体用法?C++ JRect::height怎么用?C++ JRect::height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRect
的用法示例。
在下文中一共展示了JRect::height方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScrollToRect
JBoolean
JXWidget::ScrollToRectCentered
(
const JRect& origRect,
const JBoolean forceScroll
)
{
const JRect ap = GetAperture();
if (!forceScroll && ap.Contains(origRect))
{
return kJFalse;
}
JRect r = origRect;
const JCoordinate dw = ap.width() - r.width();
if (dw > 0)
{
r.Shrink(-dw/2, 0);
}
const JCoordinate dh = ap.height() - r.height();
if (dh > 0)
{
r.Shrink(0, -dh/2);
}
return ScrollToRect(r);
}
示例2: GetFrame
void
JXWidget::FitToEnclosure
(
const JBoolean fitHoriz,
const JBoolean fitVert
)
{
const JRect frame = GetFrame();
const JPoint oldPt = frame.topLeft();
const JRect enclBounds = (GetEnclosure())->GetBounds();
JCoordinate dx=0, dy=0, dw=0, dh=0;
if (fitHoriz)
{
dx = enclBounds.left - oldPt.x;
dw = enclBounds.width() - frame.width();
}
if (fitVert)
{
dy = enclBounds.top - oldPt.y;
dh = enclBounds.height() - frame.height();
}
Move(dx,dy);
AdjustSize(dw,dh);
}
示例3: GetApertureGlobal
void
JXExprEditor::EIPBoundsChanged()
{
const JRect newBounds = (GetRectList())->GetBoundsRect();
const JRect apG = GetApertureGlobal();
const JCoordinate w = JMax(newBounds.width(), apG.width());
const JCoordinate h = JMax(newBounds.height(), apG.height());
SetBounds(w,h);
}
示例4: CreateXInputField
JBoolean
JXEditTable::CreateInputField
(
const JPoint& cell,
const JRect& cellRect
)
{
itsInputField = CreateXInputField(cell, cellRect.left, cellRect.top,
cellRect.width(), cellRect.height());
assert( itsInputField != NULL );
itsInputField->SetTable(this);
itsInputField->SetFocusColor(GetFocusColor());
if (itsEditMenuHandler != NULL && itsEditMenuHandler->HasEditMenu())
{
itsInputField->ShareEditMenu(itsEditMenuHandler, kJFalse, kJFalse);
}
if (itsInputField->Focus())
{
return kJTrue;
}
else
{
DeleteInputField();
return kJFalse;
}
}
示例5: JXImage
void
TestWidget::CreateImageBuffer()
{
// clear itsImageBuffer so Draw() will work correctly
jdelete itsImageBuffer;
itsImageBuffer = NULL;
// create image
const JRect bounds = GetBounds();
JXImage* imageBuffer =
jnew JXImage(GetDisplay(), bounds.width(), bounds.height());
assert( imageBuffer != NULL );
imageBuffer->SetDefaultState(JXImage::kRemoteStorage);
// draw to image
JXImagePainter* p = imageBuffer->CreatePainter();
Draw(*p, GetBounds());
jdelete p;
// save object
itsImageBuffer = imageBuffer;
}
示例6: JXTextButton
void
JXGetStringDialog::BuildWindow
(
const JCharacter* windowTitle,
const JCharacter* prompt,
const JCharacter* initialValue,
const JBoolean password
)
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 310,110, "");
assert( window != NULL );
JXTextButton* okButton =
new JXTextButton(JGetString("okButton::JXGetStringDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 190,80, 60,20);
assert( okButton != NULL );
okButton->SetShortcuts(JGetString("okButton::JXGetStringDialog::shortcuts::JXLayout"));
JXTextButton* cancelButton =
new JXTextButton(JGetString("cancelButton::JXGetStringDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 60,80, 60,20);
assert( cancelButton != NULL );
cancelButton->SetShortcuts(JGetString("cancelButton::JXGetStringDialog::shortcuts::JXLayout"));
itsInputField =
new JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 20,40, 270,20);
assert( itsInputField != NULL );
JXStaticText* promptDisplay =
new JXStaticText(JGetString("promptDisplay::JXGetStringDialog::JXLayout"), window,
JXWidget::kHElastic, JXWidget::kFixedTop, 20,20, 270,20);
assert( promptDisplay != NULL );
promptDisplay->SetToLabel();
// end JXLayout
window->SetTitle(windowTitle);
SetButtons(okButton, cancelButton);
promptDisplay->SetText(prompt);
if (password)
{
const JRect r = itsInputField->GetFrame();
delete itsInputField;
itsInputField =
new JXPasswordInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop,
r.left, r.top, r.width(), r.height());
assert( itsInputField != NULL );
}
else if (!JStringEmpty(initialValue))
{
itsInputField->SetText(initialValue);
}
itsInputField->SetIsRequired();
}
示例7: if
void
JXTabGroup::PlaceCardFile()
{
const JSize h = kSelMargin + kBorderWidth + 2*kTextMargin +
(GetFontManager())->GetLineHeight(itsFontName, itsFontSize, itsFontStyle);
JRect r = GetAperture();
if (itsEdge == kTop)
{
r.top += h;
}
else if (itsEdge == kLeft)
{
r.left += h;
}
else if (itsEdge == kBottom)
{
r.bottom -= h;
}
else if (itsEdge == kRight)
{
r.right -= h;
}
else
{
assert( 0 );
}
r.Shrink(kBorderWidth, kBorderWidth);
itsCardFile->Place(r.left, r.top);
itsCardFile->SetSize(r.width(), r.height());
}
示例8: GetBoundsGlobal
void
JXColorWheel::SetColor
(
const JPoint& pt
)
{
if (itsImage == NULL)
{
Redraw();
}
const JRect bounds = GetBoundsGlobal();
const JCoordinate max = JMin(bounds.height(), bounds.width() - kSliderWidth - kSliderMargin);
const JCoordinate size = max - 2*kWheelMargin - 1;
const JCoordinate center = size/2 + kWheelMargin;
const JCoordinate dx = - pt.x + center;
const JCoordinate dy = pt.y - center;
const JFloat r = JMin(sqrt(dx*dx + dy*dy) / center, 1.0);
const JFloat a = 0.5 + atan2(dy, dx) / (2.0 * kJPi);
const JSize b = JRound(itsBrightnessSlider->GetValue());
SetColor(JHSB(JRound(a * kJMaxHSBValue), JRound(r * kJMaxHSBValue), b));
}
示例9: AdjustRectForSeparator
void
JXStyleMenuTable::TableDrawCell
(
JPainter& p,
const JPoint& cell,
const JRect& origRect
)
{
if (cell.x == kTextColumnIndex && cell.y >= JXStyleMenu::kFirstColorCmd)
{
JRect rect = AdjustRectForSeparator(cell.y, origRect);
JRect colorRect = rect;
colorRect.Shrink(0, kHilightBorderWidth);
colorRect.right = colorRect.left + colorRect.height();
const JBoolean origFill = p.IsFilling();
p.SetFilling(kJTrue);
p.SetPenColor(itsStyleMenu->IndexToColor(cell.y));
p.Rect(colorRect);
p.SetFilling(origFill);
rect = origRect;
rect.left += colorRect.width() + kHMarginWidth;
JXTextMenuTable::TableDrawCell(p, cell, rect);
}
else
{
JXTextMenuTable::TableDrawCell(p, cell, origRect);
}
}
示例10: JXTextButton
void
ResizeWidgetDialog::BuildWindow
(
const JXWidget* widget
)
{
// begin JXLayout
JXWindow* window = new JXWindow(this, 160,120, "");
assert( window != NULL );
JXTextButton* cancelButton =
new JXTextButton(JGetString("cancelButton::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 20,90, 50,20);
assert( cancelButton != NULL );
JXTextButton* okButton =
new JXTextButton(JGetString("okButton::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 90,90, 50,20);
assert( okButton != NULL );
okButton->SetShortcuts(JGetString("okButton::ResizeWidgetDialog::shortcuts::JXLayout"));
itsWidth =
new JXIntegerInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 70,20, 70,20);
assert( itsWidth != NULL );
itsHeight =
new JXIntegerInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 70,50, 70,20);
assert( itsHeight != NULL );
JXStaticText* obj1_JXLayout =
new JXStaticText(JGetString("obj1_JXLayout::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 50,20);
assert( obj1_JXLayout != NULL );
obj1_JXLayout->SetToLabel();
JXStaticText* obj2_JXLayout =
new JXStaticText(JGetString("obj2_JXLayout::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,50, 50,20);
assert( obj2_JXLayout != NULL );
obj2_JXLayout->SetToLabel();
// end JXLayout
window->SetTitle("Change widget size");
SetButtons(okButton, cancelButton);
const JRect r = widget->GetBoundsGlobal();
itsWidth->SetLowerLimit(50);
itsWidth->SetUpperLimit(2000);
itsWidth->SetValue(r.width());
itsHeight->SetLowerLimit(50);
itsHeight->SetUpperLimit(2000);
itsHeight->SetValue(r.height());
}
示例11: GetApertureGlobal
void
JXWidget::SetBorderWidth
(
const JSize width
)
{
if (width != itsBorderWidth)
{
const JRect origApG = GetApertureGlobal();
itsBorderWidth = width;
const JRect newApG = GetApertureGlobal();
ApertureMoved(newApG.left - origApG.left, newApG.top - origApG.top);
ApertureResized(newApG.width() - origApG.width(),
newApG.height() - origApG.height());
}
}
示例12: if
void
JSummation::Render
(
const JExprRenderer& renderer,
const JExprRectList& rectList
)
const
{
// find ourselves in the list
JIndex ourIndex;
const JBoolean found = rectList.FindFunction(this, &ourIndex);
assert( found );
const JRect ourRect = rectList.GetRect(ourIndex);
const JCoordinate ourMidline = rectList.GetMidline(ourIndex);
const JSize fontSize = rectList.GetFontSize(ourIndex);
// draw ourselves
JCoordinate h = ourRect.left;
const JSize spaceWidth = renderer.GetStringWidth(fontSize, " ");
const JSize argCount = GetArgCount();
for (JIndex i=1; i<=argCount; i++)
{
const JFunction* f = this;
const JFunction* arg = GetArg(i);
if (arg->GetType() == kJNegationType)
{
renderer.DrawString(h, ourMidline, fontSize, JPGetSubtractionString());
f = arg;
const JNegation* neg = dynamic_cast<const JNegation*>(arg);
assert( neg != NULL );
arg = neg->GetArg();
}
else if (i > 1)
{
renderer.DrawString(h, ourMidline, fontSize, JPGetAdditionString());
}
arg->Render(renderer, rectList);
JIndex argIndex;
const JBoolean found = rectList.FindFunction(arg, &argIndex);
assert( found );
const JRect argRect = rectList.GetRect(argIndex);
h = argRect.right;
if (ParenthesizeArgForRender(*f, *arg))
{
renderer.DrawParentheses(argRect);
h += renderer.GetParenthesisWidth(argRect.height());
}
h += spaceWidth;
}
}
示例13:
JXImage::JXImage
(
JXDisplay* display,
JXColormap* colormap,
Drawable source,
const JRect& rect
)
:
JImage(rect.width(), rect.height(), colormap)
{
JXImageFromDrawable(display, colormap, source, rect);
}
示例14: boxRect
void
JXTextCheckbox::Draw
(
JXWindowPainter& p,
const JRect& rect
)
{
const JRect bounds = GetBounds();
const JCoordinate y = bounds.ycenter();
// draw button
const JRect boxRect(y - kBoxHalfHeight, kMarginWidth,
y + kBoxHalfHeight, kMarginWidth + kBoxHeight);
const JBoolean drawChecked = DrawChecked();
const JBoolean isActive = IsActive();
if (drawChecked && isActive)
{
JXDrawDownFrame(p, boxRect, kJXDefaultBorderWidth, kJTrue, itsPushedColor);
}
else if (isActive)
{
JXDrawUpFrame(p, boxRect, kJXDefaultBorderWidth, kJTrue, itsNormalColor);
}
else
{
p.SetFilling(kJTrue);
if (drawChecked)
{
p.SetPenColor(itsPushedColor);
}
else
{
p.SetPenColor(itsNormalColor);
}
p.JPainter::Rect(boxRect);
p.SetFilling(kJFalse);
p.SetLineWidth(kJXDefaultBorderWidth);
p.SetPenColor((GetColormap())->GetInactiveLabelColor());
p.RectInside(boxRect);
}
// draw text
JRect textRect = bounds;
textRect.left += 2*kMarginWidth + kBoxHeight;
p.SetFont(itsFontName, itsFontSize, itsFontStyle);
p.String(textRect.left, textRect.top, itsLabel, itsULIndex,
textRect.width(), JPainter::kHAlignLeft,
textRect.height(), JPainter::kVAlignCenter);
}
示例15:
void
JAbsValue::Render
(
const JExprRenderer& renderer,
const JExprRectList& rectList
)
const
{
// find ourselves in the list
JIndex ourIndex;
const JBoolean found = rectList.FindFunction(this, &ourIndex);
assert( found );
const JRect ourRect = rectList.GetRect(ourIndex);
// draw ourselves
renderer.DrawVertBar(ourRect.left, ourRect.top, ourRect.height());
(GetArg())->Render(renderer, rectList);
renderer.DrawVertBar(ourRect.right - renderer.GetVertBarWidth(),
ourRect.top, ourRect.height());
}