本文整理汇总了C++中JXWindow::GetFrameWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow::GetFrameWidth方法的具体用法?C++ JXWindow::GetFrameWidth怎么用?C++ JXWindow::GetFrameWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXWindow
的用法示例。
在下文中一共展示了JXWindow::GetFrameWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWindow
void
CBExecOutputDocument::PlaceCmdLineWidgets()
{
JXWindow* window = GetWindow();
JXWidget::HSizingOption hSizing;
JXWidget::VSizingOption vSizing;
const JRect fileRect = GetFileDisplayInfo(&hSizing, &vSizing);
itsCmdPrompt->Place(fileRect.left, fileRect.top);
itsCmdPrompt->AdjustSize(0, fileRect.height() - itsCmdPrompt->GetFrameHeight());
const JCoordinate promptWidth = itsCmdPrompt->GetFrameWidth();
const JCoordinate eofWidth =
itsEOFButton->GetFont().GetStringWidth(itsEOFButton->GetLabel()) +
2 * itsEOFButton->GetPadding().x +
2 * itsEOFButton->GetBorderWidth();
itsCmdInput->Place(fileRect.left + promptWidth, fileRect.top);
JCoordinate cmdInputWidth = fileRect.width() - promptWidth - eofWidth;
if (cmdInputWidth < kMinCmdInputWidth)
{
window->AdjustSize(kMinCmdInputWidth - cmdInputWidth, 0);
cmdInputWidth = kMinCmdInputWidth;
}
itsCmdInput->SetSize(cmdInputWidth, fileRect.height());
const JPoint p = window->GetMinSize();
window->SetMinSize(window->GetFrameWidth() - (cmdInputWidth - kMinCmdInputWidth), p.y);
itsEOFButton->Place(fileRect.right - eofWidth, fileRect.top);
itsEOFButton->SetSize(eofWidth, fileRect.height());
UpdateButtons();
}
示例2: JXMenuBar
void
GMessageViewDir::BuildWindow
(
const JString& mailfile
)
{
JSize w = 500;
JSize h = 300;
JXWindow* window = new JXWindow(this, w,h, mailfile);
assert( window != NULL );
window->SetWMClass(GMGetWMClassInstance(), GMGetViewWindowClass());
GGetPrefsMgr()->GetViewWindowSize(window);
w = window->GetFrameWidth();
h = window->GetFrameHeight();
window->SetMinSize(w, 150);
window->ShouldFocusWhenShow(kJTrue);
JXMenuBar* menuBar =
new JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop,
0, 0, w - kJXDefaultMenuBarHeight, kJXDefaultMenuBarHeight);
assert(menuBar != NULL);
JXEngravedRect* eRect =
new JXEngravedRect(window,
JXWidget::kFixedRight, JXWidget::kFixedTop,
w - kJXDefaultMenuBarHeight, 0, kJXDefaultMenuBarHeight, kJXDefaultMenuBarHeight);
assert(eRect != NULL);
GMMessageDragSource* mds =
new GMMessageDragSource(this, window,
JXWidget::kFixedRight, JXWidget::kFixedTop,
w - kJXDefaultMenuBarHeight + kJXDefaultBorderWidth,
0 + kJXDefaultBorderWidth,
kJXDefaultMenuBarHeight - 2 * kJXDefaultBorderWidth + 1,
kJXDefaultMenuBarHeight - 2 * kJXDefaultBorderWidth + 1);
assert(mds != NULL);
itsFileMenu = menuBar->AppendTextMenu(kFileMenuTitleStr);
itsFileMenu->SetMenuItems(kFileMenuStr);
itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFileMenu);
JPtrArray<JString> nodes(JPtrArrayT::kDeleteAll);
GGetMailboxTreeDir()->GetTopLevelNodes(&nodes);
itsTransferMenu = new JXFSDirMenu(nodes, itsFileMenu, kTransferToCmd, menuBar);
assert(itsTransferMenu != NULL);
ListenTo(itsTransferMenu);
JDirInfo* info;
if (itsTransferMenu->GetDirInfo(&info))
{
info->SetContentFilter(GMGetMailRegexStr());
}
itsCopyMenu = new JXFSDirMenu(nodes, itsFileMenu, kCopyToCmd, menuBar);
assert(itsCopyMenu != NULL);
ListenTo(itsCopyMenu);
if (itsCopyMenu->GetDirInfo(&info))
{
info->SetContentFilter(GMGetMailRegexStr());
}
ListenTo(GGetMailboxTreeDir());
itsMessageMenu = menuBar->AppendTextMenu(kMessageMenuTitleStr);
itsMessageMenu->SetMenuItems(kMessageMenuStr);
itsMessageMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsMessageMenu);
itsToolBar =
new JXToolBar(GGetPrefsMgr(), kGViewToolBarID,
menuBar, w, 150, window,
JXWidget::kHElastic, JXWidget::kVElastic,
0, kJXDefaultMenuBarHeight, w, h - kJXDefaultMenuBarHeight);
assert(itsToolBar != NULL);
const JSize newHeight = itsToolBar->GetWidgetEnclosure()->GetBoundsHeight();
const JFontManager* fm = window->GetFontManager();
JSize lineHeight =
fm->GetLineHeight(GGetPrefsMgr()->GetDefaultMonoFont(),
GGetPrefsMgr()->GetDefaultFontSize(),
JFontStyle());
const JCoordinate headerheight = (lineHeight * 4) + (lineHeight/2); //58;
JArray<JCoordinate> sizes;
JArray<JCoordinate> minSizes;
sizes.AppendElement(headerheight);
minSizes.AppendElement(20);
sizes.AppendElement(w - headerheight);
minSizes.AppendElement(50);
JIndex elasticIndex = 2;
//.........这里部分代码省略.........
示例3: JXMenuBar
void
CMSourceDirector::BuildWindow()
{
const JIndex prefID = itsType == kMainSourceType ? kMainSrcToolBarID :
itsType == kMainAsmType ? kMainAsmToolBarID :
itsType == kAsmType ? kOtherAsmToolBarID :
kOtherSrcToolBarID;
// begin JXLayout
JXWindow* window = jnew JXWindow(this, 600,550, "");
assert( window != NULL );
itsMenuBar =
jnew JXMenuBar(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 0,0, 600,30);
assert( itsMenuBar != NULL );
itsToolBar =
jnew JXToolBar(CMGetPrefsManager(), prefID, itsMenuBar, window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,30, 600,500);
assert( itsToolBar != NULL );
itsFileDisplay =
jnew JXFileNameDisplay("", window,
JXWidget::kHElastic, JXWidget::kFixedBottom, 20,530, 580,20);
assert( itsFileDisplay != NULL );
CMFileDragSource* dragSource =
jnew CMFileDragSource(this, window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 0,530, 20,20);
assert( dragSource != NULL );
// end JXLayout
window->SetTitle(JGetString(
itsType == kMainAsmType ? "InitAsmWindowTitle::CMSourceDirector" :
"InitSourceWindowTitle::CMSourceDirector"));
window->SetMinSize(300, 200);
if (itsType == kMainSourceType)
{
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->SetWMClass(CMGetWMClassInstance(), CMGetMainSourceWindowClass());
CMGetPrefsManager()->GetWindowSize(kMainCodeWindSizeID, window);
JXDisplay* display = GetDisplay();
JXImage* icon = jnew JXImage(display, medic_current_source_window);
assert( icon != NULL );
window->SetIcon(icon);
}
else if (itsType == kMainAsmType)
{
window->SetCloseAction(JXWindow::kDeactivateDirector);
window->SetWMClass(CMGetWMClassInstance(), CMGetMainAsmWindowClass());
CMGetPrefsManager()->GetWindowSize(kMainAsmWindSizeID, window);
JXDisplay* display = GetDisplay();
JXImage* icon = jnew JXImage(display, medic_current_asm_window);
assert( icon != NULL );
window->SetIcon(icon);
}
else if (itsType == kAsmType)
{
window->SetWMClass(CMGetWMClassInstance(), CMGetAsmViewWindowClass());
CMGetPrefsManager()->GetWindowSize(kAsmWindSizeID, window, kJTrue);
}
else
{
window->SetWMClass(CMGetWMClassInstance(), CMGetSourceViewWindowClass());
CMGetPrefsManager()->GetWindowSize(kCodeWindSizeID, window, kJTrue);
}
JCoordinate w = window->GetFrameWidth();
itsFileMenu = itsMenuBar->AppendTextMenu(kFileMenuTitleStr);
itsFileMenu->SetMenuItems(kFileMenuStr, "CMSourceDirector");
itsFileMenu->SetUpdateAction(JXMenu::kDisableNone);
ListenTo(itsFileMenu);
itsFileMenu->SetItemImage(kOpenCmd, jx_file_open);
itsFileMenu->SetItemImage(kPrintCmd, jx_file_print);
// appends Edit & Search menus
const JCoordinate kInitTableWidth = 50;
JXScrollbarSet* scrollbarSet =
jnew JXScrollbarSet(itsToolBar->GetWidgetEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 100,100);
assert( scrollbarSet != NULL );
scrollbarSet->FitToEnclosure();
JXContainer* encl = scrollbarSet->GetScrollEnclosure();
itsText =
jnew CMSourceText(this, itsCommandDir, itsMenuBar, scrollbarSet, encl,
//.........这里部分代码省略.........