本文整理汇总了C++中PanelRecPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PanelRecPtr::get方法的具体用法?C++ PanelRecPtr::get怎么用?C++ PanelRecPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PanelRecPtr
的用法示例。
在下文中一共展示了PanelRecPtr::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
// OSG init
osgInit(argc,argv);
{
// Set up Window
WindowEventProducerRecPtr TutorialWindow = createNativeWindow();
TutorialWindow->initWindow();
// Create the SimpleSceneManager helper
SimpleSceneManager sceneManager;
TutorialWindow->setDisplayCallback(boost::bind(display, &sceneManager));
TutorialWindow->setReshapeCallback(boost::bind(reshape, _1, &sceneManager));
// Tell the Manager what to manage
sceneManager.setWindow(TutorialWindow);
TutorialWindow->connectKeyTyped(boost::bind(keyPressed, _1));
// Make Torus Node (creates Torus in background of scene)
NodeRecPtr TorusGeometryNode = makeTorus(.5, 2, 16, 16);
// Make Main Scene Node and add the Torus
NodeRecPtr scene = Node::create();
scene->setCore(Group::create());
scene->addChild(TorusGeometryNode);
// Create the Graphics
GraphicsRecPtr TutorialGraphics = Graphics2D::create();
// Initialize the LookAndFeelManager to enable default settings
LookAndFeelManager::the()->getLookAndFeel()->init();
/******************************************************
Create BorderLayout and some
BorderLayoutConstraints to be used
to set up CardLayout.
******************************************************/
BorderLayoutRecPtr MainInternalWindowLayout = BorderLayout::create();
BorderLayoutConstraintsRecPtr ExampleButton1Constraints = BorderLayoutConstraints::create();
BorderLayoutConstraintsRecPtr ExampleButton2Constraints = BorderLayoutConstraints::create();
BorderLayoutConstraintsRecPtr ExampleButton7Constraints = BorderLayoutConstraints::create();
BorderLayoutConstraintsRecPtr ExampleButton8Constraints = BorderLayoutConstraints::create();
BorderLayoutConstraintsRecPtr ExampleCardPanelConstraints = BorderLayoutConstraints::create();
ExampleButton1Constraints->setRegion(BorderLayoutConstraints::BORDER_EAST);
ExampleButton2Constraints->setRegion(BorderLayoutConstraints::BORDER_WEST);
ExampleButton7Constraints->setRegion(BorderLayoutConstraints::BORDER_NORTH);
ExampleButton8Constraints->setRegion(BorderLayoutConstraints::BORDER_SOUTH);
ExampleCardPanelConstraints->setRegion(BorderLayoutConstraints::BORDER_CENTER);
/******************************************************
Create CardLayout. CardLayout shows
a single Component at a time, meaning
it is not exactly practical to use it
alone for a Layout. This tutorial uses
the BorderLayout to include a Panel in
the Center Region, and within that Panel
using a CardLayout. A single card is
displayed at one time within a
ComponentContainer using CardLayout.
CardLayout has four functions:
next, previous, first, and last.
->next(CardContainerName): Causes
CardLayout to display the next card.
->previous(CardContainerName): Causes
CardLayout to display the
previous card.
->first(CardContainerName): Causes
CardLayout to display the
first card.
->last(CardContainerName): Causes
CardLayout to display the
last card.
These are most useful when combined with
Action, as shown at the top of
this Tutorial, to assign actions to the
Buttons or Components to allow the user
to cycle through the Card Layout and
view different ExampleCards.
Note that CardContainerName is the name
of the ComponentContainer which is using the
CardLayout, while the begin/endEditCP
is performed on the CardLayout itself.
******************************************************/
//.........这里部分代码省略.........