本文整理汇总了C++中JXStaticText::GetFrameHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ JXStaticText::GetFrameHeight方法的具体用法?C++ JXStaticText::GetFrameHeight怎么用?C++ JXStaticText::GetFrameHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXStaticText
的用法示例。
在下文中一共展示了JXStaticText::GetFrameHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JXScrollbarSet
void
CBEditSearchPathsDialog::BuildWindow
(
const CBDirList& dirList,
CBRelPathCSF* csf
)
{
// begin JXLayout
JXWindow* window = jnew JXWindow(this, 370,370, "");
assert( window != NULL );
JXScrollbarSet* scrollbarSet =
jnew JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kFixedBottom, 20,100, 240,220);
assert( scrollbarSet != NULL );
JXTextButton* cancelButton =
jnew JXTextButton(JGetString("cancelButton::CBEditSearchPathsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 70,340, 70,20);
assert( cancelButton != NULL );
JXTextButton* okButton =
jnew JXTextButton(JGetString("okButton::CBEditSearchPathsDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 230,340, 70,20);
assert( okButton != NULL );
JXStaticText* instrText =
jnew JXStaticText(JGetString("instrText::CBEditSearchPathsDialog::JXLayout"), window,
JXWidget::kHElastic, JXWidget::kVElastic, 20,20, 330,70);
assert( instrText != NULL );
JXTextButton* addPathButton =
jnew JXTextButton(JGetString("addPathButton::CBEditSearchPathsDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 280,110, 70,20);
assert( addPathButton != NULL );
addPathButton->SetShortcuts(JGetString("addPathButton::CBEditSearchPathsDialog::shortcuts::JXLayout"));
JXTextButton* removePathButton =
jnew JXTextButton(JGetString("removePathButton::CBEditSearchPathsDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 280,140, 70,20);
assert( removePathButton != NULL );
removePathButton->SetShortcuts(JGetString("removePathButton::CBEditSearchPathsDialog::shortcuts::JXLayout"));
JXTextButton* choosePathButton =
jnew JXTextButton(JGetString("choosePathButton::CBEditSearchPathsDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 280,190, 70,20);
assert( choosePathButton != NULL );
choosePathButton->SetShortcuts(JGetString("choosePathButton::CBEditSearchPathsDialog::shortcuts::JXLayout"));
// end JXLayout
instrText->SetText(JGetString(kInstructionsID));
window->AdjustSize(0, instrText->GetBoundsHeight() - instrText->GetFrameHeight());
instrText->SetSizing(JXWidget::kHElastic, JXWidget::kFixedTop);
scrollbarSet->SetSizing(JXWidget::kHElastic, JXWidget::kVElastic);
addPathButton->SetSizing(JXWidget::kFixedRight, JXWidget::kFixedTop);
removePathButton->SetSizing(JXWidget::kFixedRight, JXWidget::kFixedTop);
choosePathButton->SetSizing(JXWidget::kFixedRight, JXWidget::kFixedTop);
window->SetTitle("Search Paths for Symbol Database");
window->PlaceAsDialogWindow();
window->LockCurrentMinSize();
UseModalPlacement(kJFalse);
SetButtons(okButton, cancelButton);
itsTable =
jnew CBPathTable(dirList, addPathButton, removePathButton,
choosePathButton, csf,
scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 10,10);
assert( itsTable != NULL );
}
示例2: JXStaticText
void
JXRadioGroupDialog::BuildWindow
(
const JCharacter* windowTitle,
const JCharacter* prompt,
const JPtrArray<JString>& choiceList,
const JPtrArray<JString>* shortcutList
)
{
JIndex i;
const JSize actionCount = choiceList.GetElementCount();
JXWindow* window = new JXWindow(this, 10,10, windowTitle);
assert( window != NULL );
JCoordinate y = kFirstItemTop;
// instructions
JXStaticText* instrText =
new JXStaticText(prompt, window,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
kHMarginWidth,y, 0,0);
assert( instrText != NULL );
y += instrText->GetFrameHeight() + kItemVDelta;
// radio group
const JCoordinate kInitRGWidth = 10; // arbitrary, >0
itsRG =
new JXRadioGroup(window, JXWidget::kFixedLeft, JXWidget::kFixedTop,
kHMarginWidth,y,
kInitRGWidth, kItemVDelta + actionCount * kItemVSeparation);
assert( itsRG != NULL );
// choices
JCoordinate wmin = 0;
JPtrArray<JXRadioButton> buttonList(JPtrArrayT::kForgetAll, actionCount);
for (i=1; i<=actionCount; i++)
{
JXTextRadioButton* button =
new JXTextRadioButton(i, *(choiceList.NthElement(i)), itsRG,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
kRGHLMarginWidth, kItemVDelta + (i-1) * kItemVSeparation,
10,kTextHeight);
assert( button != NULL );
if (shortcutList != NULL)
{
button->SetShortcuts(*(shortcutList->NthElement(i)));
}
buttonList.Append(button);
wmin = JMax(button->GetPreferredWidth(), wmin);
}
// all choices should be the same width
for (i=1; i<=actionCount; i++)
{
(buttonList.NthElement(i))->SetSize(wmin, kTextHeight);
}
wmin += kRGHLMarginWidth + kRGHRMarginWidth;
itsRG->AdjustSize(wmin - kInitRGWidth, 0);
const JCoordinate wminInstr = instrText->GetFrameWidth();
if (wmin < wminInstr)
{
const JCoordinate delta = (wminInstr - wmin)/2;
itsRG->Move(delta, 0);
wmin = wminInstr;
}
y = (itsRG->GetFrame()).bottom + kRGButtonVDelta;
// OK and Cancel buttons
wmin += 2*kHMarginWidth;
const JCoordinate wminButton = 3*kMinButtonHMargin + 2*kButtonWidth;
if (wmin < wminButton)
{
const JCoordinate delta = (wminButton - wmin)/2;
instrText->Move(delta, 0);
itsRG->Move(delta, 0);
wmin = wminButton;
}
const JCoordinate buttonX = (wmin - 2*kButtonWidth)/3;
JXTextButton* cancelButton =
new JXTextButton("Cancel", window,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
buttonX,y, kButtonWidth,kTextHeight);
assert( cancelButton != NULL );
//.........这里部分代码省略.........