当前位置: 首页>>代码示例>>C++>>正文


C++ GridLayout::add方法代码示例

本文整理汇总了C++中GridLayout::add方法的典型用法代码示例。如果您正苦于以下问题:C++ GridLayout::add方法的具体用法?C++ GridLayout::add怎么用?C++ GridLayout::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GridLayout的用法示例。


在下文中一共展示了GridLayout::add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Dialog

MessageReader::MessageReader()
  : Dialog("MessageReader"), mMessageList(NULL), mMessagePane(NULL), mCloseButton(NULL)
{
  setBackground(new FrameBackground());
  Dimension screenSize = rGUIManager()->getScreenDimension();
  setSize(MAGIC_MESSAGE_READER_WIDTH, MAGIC_MESSAGE_READER_HEIGHT);
  centerOnScreen();

  mMessageList = new List(3, this, true);
  mMessageList->setBackground(new FrameBackground());
  mMessageList->setColumnWidth(0, 0.15);
  mMessageList->setColumnWidth(1, 0.30);
  mMessageList->setColumnWidth(2, 0.55);
  
  mMessagePane = new Label();
  mMessagePane->setBackground(new FrameBackground());

  mCloseButton = new Button(L"Close", this);

  GridLayout* gridLayout = new GridLayout(this, 32, 24);
  gridLayout->set_borders(3);
  gridLayout->set_padding(2);

  gridLayout->add(new Label(L"Messages"), 0, 0, 26, 1);
  gridLayout->add(mCloseButton, 26, 0, 6, 1);
  gridLayout->add(mMessageList, 0, 1, 32, 11);
  gridLayout->add(mMessagePane, 0, 12, 32, 12);
  layout();
}
开发者ID:MrPhil,项目名称:ShortHike,代码行数:29,代码来源:MessageReader.cpp

示例2: mList

	CompleteView() : mList(1) {
		View::mRootWidget = &mList;
		mList.setBackground(true);

		GridLayout* layout = new GridLayout(2);

		layout->add(new Image(R_IMAGE_1), 0);
		layout->add(new Image(R_IMAGE_2), 0);
		layout->add(new Label("Hello World!", GREEN), 1);	//should wind up on the top left?
		layout->add(new StringLabel("String", GREEN), 1);
		layout->add(new Textbox(10, 20, GREEN, GREEN), 1);

		mList.add(layout, 0, -1, true);
		Textbox* t = new Textbox(10, 200, GREEN, WHITE/*BRIGHT_RED*/);
		mList.add(t, 0, -1, true);
		t->setQwerty();
		t->activate();
		mList.add(new MultilineLabel("Line 1\nLine 10\nYet another line\n ", GREEN), 0);
		mList.add(new Label("Next label", WHITE), 0);
		mList.add(new HyperlinkLabel(this, "To close the program, \1click here\1.\n Now for a \1line-\nbroken\1 link.", GREEN, SKY_BLUE), 0);
	}
开发者ID:Felard,项目名称:MoSync,代码行数:21,代码来源:test.cpp

示例3: Dialog

Debrief::Debrief()
  : Dialog("Debrief"), mDebriefing(NULL), mNextMission(NULL), mReplay(NULL), mHomeBase(NULL), mMissionSelector(NULL)
{
  setBackground(new FrameBackground());
  Dimension screenSize = rGUIManager()->getScreenDimension();
  setSize(MAGIC_DEBRIEF_WIDTH, MAGIC_DEBRIEF_HEIGHT);
  centerOnScreen();

  mDebriefing = new Label(L"DEBRIEFING");

  mNextMission = new Button(L"Next Mission", this);
  mReplay = new Button(L"Replay Mission", this);
  mHomeBase = new Button(L"Home Base", this);
  mMissionSelector = new Button(L"Missions", this);

  GridLayout* gridLayout = new GridLayout(this, 32, 24);
  gridLayout->set_borders(3);
  gridLayout->set_padding(2);

  gridLayout->add(new Label(L"Mission Complete: Debriefing"), 0, 0, 26, 1);

  gridLayout->add(mDebriefing, 0, 1, 32, 22);

  gridLayout->add(mMissionSelector, 0, 23, 6, 1);
  gridLayout->add(mHomeBase, 6, 23, 6, 1);
  gridLayout->add(mReplay, 20, 23, 6, 1);
  gridLayout->add(mNextMission, 26, 23, 6, 1);

  layout();
}
开发者ID:MrPhil,项目名称:ShortHike,代码行数:30,代码来源:Debrief.cpp

示例4: Dialog

MissionSelector::MissionSelector()
  : Dialog("MissionSelector"),
    mCampaignList(NULL), mCampaignDesc(NULL),
    mMissionList(NULL), mMissionDesc(NULL),
    mHomeBaseButton(NULL), mStartButton(NULL), mCloseButton(NULL),
    mMissionNum(0), mCurrentCampaign(NULL)
{
  setBackground(new FrameBackground());
  Dimension screenSize = rGUIManager()->getScreenDimension();
  setSize(MAGIC_MISSION_SELECTOR_WIDTH, MAGIC_MISSION_SELECTOR_HEIGHT);
  centerOnScreen();

  mCampaignList = new List(1, this);
  mCampaignList->setBackground(new FrameBackground());
  mCampaignDesc = new Label();
  mCampaignDesc->setBackground(new FrameBackground());

  mMissionList = new List(1, this);
  mMissionList->setBackground(new FrameBackground());  
  mMissionDesc = new Label();
  mMissionDesc->setBackground(new FrameBackground());

  mHomeBaseButton = new Button(L"Home Base", this);
  mStartButton = new Button(L"Start Mission", this);
  mCloseButton = new Button(L"Close", this);

  GridLayout* gridLayout = new GridLayout(this, 32, 24);
  gridLayout->set_borders(3);
  gridLayout->set_padding(2);

  gridLayout->add(new Label(L"Missions available - Select Campaign"), 0, 0, 26, 1);

  gridLayout->add(mCampaignList, 0, 1, 14, 7);
  gridLayout->add(mCampaignDesc, 14, 1, 18, 7);
    
  gridLayout->add(new Label(L"Available missions"), 0, 8, 26, 1);
  gridLayout->add(mMissionList, 0, 9, 14, 14);
  gridLayout->add(mMissionDesc, 14, 9, 18, 14);

  gridLayout->add(mHomeBaseButton, 6, 23, 6, 1);
  gridLayout->add(mStartButton, 0, 23, 6, 1);
  gridLayout->add(mCloseButton, 26, 23, 6, 1);
  layout();
}
开发者ID:MrPhil,项目名称:ShortHike,代码行数:44,代码来源:MissionSelector.cpp

示例5: mPrototype

PrototypeLayer::PrototypeLayer()
  : mPrototype(new Prototype()), mFileName(""), mCurrentPort(0), mRightPanel(NULL),
    mRenderNormals(false), mRenderTexture(true), mRenderWireframe(false),
    mImportOBJButton(NULL), mImportSSMButton(NULL),
    mImportTGAButton(NULL), mImportPNGButton(NULL),
    mToggleNormalsButton(NULL), mToggleTextureButton(NULL),

    mPortNumLabel(NULL),
    mPortPosLabel(NULL),

    mPortNextButton(NULL),
    mPortPrevButton(NULL),
    mPortAddButton(NULL),
    mPortRemoveButton(NULL),

    mPortMovXAddButton(NULL),
    mPortMovXSubButton(NULL),
    mPortMovYAddButton(NULL),
    mPortMovYSubButton(NULL),
    mPortMovZAddButton(NULL),
    mPortMovZSubButton(NULL),

    mPortRotXAddButton(NULL),
    mPortRotXSubButton(NULL),
    mPortRotYAddButton(NULL),
    mPortRotYSubButton(NULL),
    mPortRotZAddButton(NULL),
    mPortRotZSubButton(NULL),

    mPortMesh(NULL),
    mNormalMesh(NULL)
{
  GridLayout* layout = new GridLayout(this, 32, 24);

  mRightPanel = new Frame();
  mRightPanel->setBackground(new FrameBackground());
  layout->add(mRightPanel, 27, 2, 5, 10);
  mRightPanel->setLayoutManager(new FlowLayout(FlowLayout::VERTICAL, FlowLayout::RIGHT, FlowLayout::TOP));
  mRightPanel->add(mNewPrototypeButton = new Button(L"New Module", this));
  mRightPanel->add(mLoadPrototypeButton = new Button(L"Load Module", this));
  mRightPanel->add(mSavePrototypeButton = new Button(L"Save Module", this));
  mRightPanel->add(mSaveAsPrototypeButton = new Button(L"Save Module As", this));
  mRightPanel->add(mImportOBJButton = new Button(L"Import OBJ Mesh", this));
  mRightPanel->add(mImportSSMButton = new Button(L"Import SSM Mesh", this));
  mRightPanel->add(mImportTGAButton = new Button(L"Import TGA Texture", this));
  mRightPanel->add(mImportPNGButton = new Button(L"Import PNG Texture", this));
  mRightPanel->add(mImportIconButton = new Button(L"Import PNG Icon", this));
  mRightPanel->add(mToggleNormalsButton = new Button(L"Toggle Normals", this));
  mRightPanel->add(mToggleTextureButton = new Button(L"Toggle Texture", this));
  mRightPanel->add(mToggleWireframeButton = new Button(L"Toggle Wireframe", this));
  mRightPanel->add(mQuitButton = new Button(L"Quit", this));
  
  mStatPanel = new Frame();
  mStatPanel->setBackground(new FrameBackground());
  layout->add(mStatPanel, 0, 0, 20, 1);
  mStatPanel->add(mStatLabel = new Label(L"Mesh stats"));

  mIconPanel = new Frame();
  mIconPanel->setBackground(new FrameBackground());
  layout->add(mIconPanel, 27, 12, 5, 5);
  mIconPanel->add(mIconImage = new RasterImage(mPrototype->getIconSurface128()));
  mIconImage->setPadding(32);

  mPortPanel = new Frame();
  mPortPanel->setBackground(new FrameBackground());
  layout->add(mPortPanel, 24, 20, 8, 4);
  GridLayout* portLayout = new GridLayout(mPortPanel, 8, 6);
  portLayout->set_borders(2);
  portLayout->set_padding(2);
  portLayout->add(mPortNumLabel = new Label(L"Port 1/2"), 0, 0, 6, 1);
  portLayout->add(mPortPosLabel = new Label(L"Pos: 31.0 32.0 33.0"), 0, 1, 8, 1);

  portLayout->add(mPortNextButton = new Button(L"Next", this), 6, 2, 2, 1);
  portLayout->add(mPortPrevButton = new Button(L"Prev", this), 6, 3, 2, 1);
  portLayout->add(mPortAddButton = new Button(L"Add", this), 6, 4, 2, 1);
  portLayout->add(mPortRemoveButton = new Button(L"Remove", this), 6, 5, 2, 1);

  portLayout->add(mPortMovXAddButton = new Button(L"Mov +X", this), 0, 2, 2, 1);
  portLayout->add(mPortMovXSubButton = new Button(L"Mov -X", this), 0, 3, 2, 1);
  portLayout->add(mPortMovYAddButton = new Button(L"Mov +Y", this), 2, 2, 2, 1);
  portLayout->add(mPortMovYSubButton = new Button(L"Mov -Y", this), 2, 3, 2, 1);
  portLayout->add(mPortMovZAddButton = new Button(L"Mov +Z", this), 4, 2, 2, 1);
  portLayout->add(mPortMovZSubButton = new Button(L"Mov -Z", this), 4, 3, 2, 1);

  portLayout->add(mPortRotXAddButton = new Button(L"Rot +X", this), 0, 4, 2, 1);
  portLayout->add(mPortRotXSubButton = new Button(L"Rot -X", this), 0, 5, 2, 1);
  portLayout->add(mPortRotYAddButton = new Button(L"Rot +Y", this), 2, 4, 2, 1);
  portLayout->add(mPortRotYSubButton = new Button(L"Rot -Y", this), 2, 5, 2, 1);
  portLayout->add(mPortRotZAddButton = new Button(L"Rot +Z", this), 4, 4, 2, 1);
  portLayout->add(mPortRotZSubButton = new Button(L"Rot -Z", this), 4, 5, 2, 1);  

  mPortMesh = rRenderSystem()->createMesh();
  mPortMesh->load("assets/user_interface/editor_port.shd");
  mNormalMesh = rRenderSystem()->createMesh();

  clear();
}
开发者ID:MrPhil,项目名称:ShortHike,代码行数:97,代码来源:PrototypeLayer.cpp

示例6: sunDirection

Orbit::Orbit(Main* _main)
  : main(_main), planetFrontBuffer(NULL), planetBackBuffer(NULL), frameTime(0.1), meshGeneration(0), station(NULL), mExclusiveInput(false)
{
  for(int iProt = 0; iProt < 5; ++iProt) quickPrototypes[iProt] = NULL;

  LoadingScreen::tick(L"Orbit::SceneManager");
  Root& ogreRoot = Root::getSingleton();
  sceneManager = static_cast<OctreeSceneManager*>(ogreRoot.getSceneManager(ST_GENERIC));
  sceneManager->_setDestinationRenderSystem(ogreRoot.getRenderSystem());
  sceneManager->setSkyBox(true, "ShortHike/Orbit/Skybox_Stars");
  // Make this a display option
//   sceneManager->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE);
  sceneManager->setAmbientLight(ColourValue(0.35, 0.35, 0.35));

  rootNode = sceneManager->getRootSceneNode();

  LoadingScreen::tick(L"Orbit::Lights");
  Light* sunLight = sceneManager->createLight("SunLight");
  sunLight->setType(Light::LT_DIRECTIONAL);
  Vector sunDirection(-80, -4, -100);
  sunDirection.normalise();
  sunLight->setPosition(80, 4, 100);
  sunLight->setDirection(sunDirection);
  sunLight->setDiffuseColour(.9f, .9f, .9f);
  sunLight->setSpecularColour(1.0f, 1.0f, 1.0f);
  rootNode->attachObject(sunLight);

  Light* earthLight = sceneManager->createLight("EarthLight");
  earthLight->setType(Light::LT_DIRECTIONAL);
  Vector earthDirection(0, 0, 50);
  earthDirection.normalise();
  earthLight->setPosition(0, 0, -50);
  earthLight->setDirection(earthDirection);
  earthLight->setDiffuseColour(0.55f, 0.55f, 0.70f);
  earthLight->setSpecularColour(0, 0, 0);
  rootNode->attachObject(earthLight);

  trackBallCamera = new TrackBallCamera(sceneManager);

  LoadingScreen::tick(L"Orbit::setPlanetResolution");
  setPlanetResolution(MAGIC_DEFAULT_PLANET_RESOLUTION, false);

  LoadingScreen::tick(L"Orbit::UI - BottomFrame");
  
  // New UI
  {
    interfaceContainer = new Widget();
    Widget* rootContainer = rGUIManager()->getRootContainer();
    rootContainer->add(interfaceContainer);
    interfaceContainer->setPosition(0, 0);
    interfaceContainer->setSize(rootContainer->getSize());
    GridLayout* interfaceLayout = new GridLayout(interfaceContainer, 24, 18);    
    interfaceLayout->set_padding(0);
    interfaceLayout->set_borders(0);
    
    {
      stationInfo = new Label(L"Station information");
      stationInfo->setVerticalAlignment(Label::TOP);
      
      Frame* stationInfoFrame = new Frame("Orbit/StationInfoFrame");
      stationInfoFrame->setLayoutManager(new BorderLayout());
      stationInfoFrame->setBackground(new FrameBackground());
      stationInfoFrame->add(stationInfo, "center");
      interfaceLayout->add(stationInfoFrame, 0, 15, 4, 3);
    }
    
    {
      toolInfo = new Label(L"Tool/Module information");
      toolInfo->setVerticalAlignment(Label::TOP);

      Frame* toolInfoFrame = new Frame("Orbit/ToolInfoFrame");
      toolInfoFrame->setLayoutManager(new BorderLayout());
      toolInfoFrame->setBackground(new FrameBackground());
      toolInfoFrame->add(toolInfo, "center");

      interfaceLayout->add(toolInfoFrame, 20, 15, 4, 3);
    }    
    
    {
      int mapWidth = 300;
      int mapHeight = 150;
      orbitMap = new OrbitMap(this, "user_interface/EarthMap.png");
      orbitMap->setPreferredSize(mapWidth, mapHeight);
      layerDock = new LayerDock(this, orbitMap);
    }

    interfaceLayout->add(ModuleDock::getSingletonPtr(), 0, 1, 4, 14);
    interfaceLayout->add(ControlDock::getSingletonPtr(), 0, 0, 24, 1);
    interfaceLayout->add(layerDock, 4, 15, 16, 3);

    // DEBUG:
//     Frame* debugFrame = new Frame("DEBUGFRAME");
//     debugFrame->setLayoutManager(new BorderLayout());
//     mDebugLabel = new Label();
//     debugFrame->add(mDebugLabel, "center");
//     interfaceLayout->add(debugFrame, 18, 1, 6, 15);
  }

  LoadingScreen::tick(L"Orbit::UI - States");
  readyState = new OrbitReadyState(this);
//.........这里部分代码省略.........
开发者ID:MrPhil,项目名称:ShortHike,代码行数:101,代码来源:Orbit.cpp


注:本文中的GridLayout::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。