本文整理汇总了C++中JXWindow::LockCurrentSize方法的典型用法代码示例。如果您正苦于以下问题:C++ JXWindow::LockCurrentSize方法的具体用法?C++ JXWindow::LockCurrentSize怎么用?C++ JXWindow::LockCurrentSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JXWindow
的用法示例。
在下文中一共展示了JXWindow::LockCurrentSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JXMenuBar
void
MenuHelloDir::BuildWindow()
{
// Create the window and give it to the director.
JXWindow* window = new JXWindow(this, 200,100, "Hello World Program");
assert( window != NULL );
SetWindow(window);
// This sets the minimum and maximum size to be the
// current size.
window->LockCurrentSize();
// Create the menu bar so that it stays on top, but expands as the window
// expands.
JXMenuBar* menuBar =
new JXMenuBar(window, JXWidget::kHElastic, JXWidget::kFixedTop,
0,0, 200,kJXDefaultMenuBarHeight);
assert( menuBar != NULL );
// Attach our menu to the menu bar.
itsTextMenu = menuBar->AppendTextMenu(kTextMenuTitleStr);
// Set the menu items in our menu.
itsTextMenu->SetMenuItems(kTextMenuStr);
// Set the menu to never disable the menu items.
itsTextMenu->SetUpdateAction(JXMenu::kDisableNone);
// The director needs to listen to the menu for messages. The message
// we care about is JXMenu::kItemSelected.
ListenTo(itsTextMenu);
// Create the object to display the text. This time, we need to keep a
// pointer to it so we can change the text later.
itsText =
new JXStaticText("Hello world!", window,
JXWidget::kFixedLeft, JXWidget::kFixedTop,
20, 40, 160, 20);
assert( itsText != NULL );
}