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


C++ TabControl类代码示例

本文整理汇总了C++中TabControl的典型用法代码示例。如果您正苦于以下问题:C++ TabControl类的具体用法?C++ TabControl怎么用?C++ TabControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: refreshPageList

  void refreshPageList()
  {
    Window* root = d_guiContext->getRootWindow();
    // Check if the windows exists
    Listbox* lbox = 0;
    TabControl* tc = 0;

    if (root->isChild("Frame/TabControl/Page1/PageList"))
    {
      lbox = static_cast<Listbox*>(root->getChild(
        "Frame/TabControl/Page1/PageList"));
    }

    if (root->isChild("Frame/TabControl"))
    {
      tc = static_cast<TabControl*>(root->getChild(
        "Frame/TabControl"));
    }

    if (lbox && tc)
    {
      lbox->resetList();

      for (size_t i = 0; i < tc->getTabCount(); i++)
      {
        lbox->addItem(new MyListItem(
          tc->getTabContentsAtIndex(i)->getName()));
      }
    }
  }
开发者ID:jherico,项目名称:VirtualChess,代码行数:30,代码来源:UiTest.cpp

示例2: getParent

	const UString& TabItem::getCaption()
	{
		TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
		if (owner != nullptr)
			return owner->getItemName(this);
		return Base::getCaption();
	}
开发者ID:Bewolf2,项目名称:Genesis-3D,代码行数:7,代码来源:MyGUI_TabItem.cpp

示例3: CanvasPosToLocal

bool TabStrip::DragAndDrop_HandleDrop(Gwen::DragAndDrop::Package* /*pPackage*/, int x, int y)
{
	Gwen::Point LocalPos = CanvasPosToLocal(Gwen::Point(x, y));

	Base* el = DragAndDrop::SourceControl;

	TabButton* pButton = el ? el->DynamicCastTabButton() : 0;
	TabControl* pTabControl = GetParent() ? GetParent()->DynamicCastTabControl() : 0;
	if (pTabControl && pButton)
	{
		if (pButton->GetTabControl() != pTabControl)
		{
			// We've moved tab controls!
			pTabControl->AddPage(pButton);
		}
	}

	Base* DroppedOn = GetControlAt(LocalPos.x, LocalPos.y);
	if (DroppedOn)
	{
		Gwen::Point DropPos = DroppedOn->CanvasPosToLocal(Gwen::Point(x, y));
		DragAndDrop::SourceControl->BringNextToControl(DroppedOn, DropPos.x > DroppedOn->Width() / 2);
	}
	else
	{
		DragAndDrop::SourceControl->BringToFront();
	}
	return true;
}
开发者ID:Hongtae,项目名称:bullet3,代码行数:29,代码来源:TabStrip.cpp

示例4: getLookNFeel

    void FalagardTabButton::render()
    {
        TabButton* w = (TabButton*)d_window;
        // get WidgetLookFeel for the assigned look.
        const WidgetLookFeel& wlf = getLookNFeel();

		TabControl* tc = static_cast<TabControl*>(w->getParent()->getParent());

        String state;
		String prefix((tc->getTabPanePosition() == TabControl::Top) ? "Top" : "Bottom");

		if (w->isDisabled())
		    state = "Disabled";
		else if (w->isSelected())
		    state = "Selected";
		else if (w->isPushed())
		    state = "Pushed";
		else if (w->isHovering())
		    state = "Hover";
		else
		    state = "Normal";

        if (!wlf.isStateImageryPresent(prefix + state))
        {
            state = "Normal";
			if (!wlf.isStateImageryPresent(prefix + state))
				prefix = "";
        }

        wlf.getStateImagery(prefix + state).render(*w);
    }
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:31,代码来源:FalTabButton.cpp

示例5: initialiseWidgetInspector

void WidgetDemo::initialiseWidgetInspector(CEGUI::Window* container)
{
    WindowManager& winMgr = WindowManager::getSingleton();

    //Add a tabcontrol serving as WidgetInspector, allowing to switch between events+widgets and the properties display
    TabControl* tabControl = static_cast<TabControl*>(winMgr.createWindow("TaharezLook/TabControl", "WidgetDemoWidgetInspector"));
    container->addChild(tabControl);
    tabControl->setSize(CEGUI::USize(cegui_reldim(0.55f), cegui_reldim(0.96f)));
    tabControl->setPosition(CEGUI::UVector2(cegui_reldim(0.02f), cegui_reldim(0.02f)));

    //Create the respective windows containing the displays
    CEGUI::Window* widgetMainInspectionContainer = winMgr.createWindow("DefaultWindow", "WidgetInspectionContainer");
    CEGUI::Window* widgetPropertiesInspectionContainer = winMgr.createWindow("DefaultWindow", "WidgetPropertiesInspectionContainer");


    //Add the pages to the tab control
    widgetMainInspectionContainer->setText("Widget Inspector");
    tabControl->addTab(widgetMainInspectionContainer);
    widgetPropertiesInspectionContainer->setText("Widget Properties");
    tabControl->addTab(widgetPropertiesInspectionContainer);

    //Create properties window
    initialiseWidgetPropertiesDisplayWindow(widgetPropertiesInspectionContainer);

    //Create the widget display windows
    initialiseWidgetDisplayWindow();
    widgetMainInspectionContainer->addChild(d_widgetDisplayWindow);

    initialiseWidgetsEventsLog();
    widgetMainInspectionContainer->addChild(d_widgetsEventsLog);

    initialiseEventLights(widgetMainInspectionContainer);
}
开发者ID:AjaxWang1989,项目名称:cegui,代码行数:33,代码来源:WidgetDemo.cpp

示例6: handleTabSelectionChanged

bool MenuNavigationSample::handleTabSelectionChanged(const CEGUI::EventArgs& e)
{
    TabControl* tabControl = static_cast<TabControl*>(static_cast<const WindowEventArgs&>(e).window);

    // only the first tab has a window navigator
    if (tabControl->getSelectedTabIndex() == 0)
        d_root->getGUIContext().setWindowNavigator(d_matrixWindowNavigator);
    else
        d_root->getGUIContext().setWindowNavigator(d_linearWindowNavigator);
    return true;
}
开发者ID:arkana-fts,项目名称:cegui,代码行数:11,代码来源:MenuNavigation.cpp

示例7: GetWindowLongPtr

LRESULT CALLBACK TabControl::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	TabControl* tabControl = (TabControl*) GetWindowLongPtr(hwnd,GWLP_USERDATA);

	switch (msg)
	{
	case WM_SIZE:
		tabControl->OnResize();
		break;
	}

	return (LRESULT)CallWindowProc((WNDPROC)tabControl->oldProc,hwnd,msg,wParam,lParam);
}
开发者ID:AdmiralCurtiss,项目名称:ppsspp,代码行数:13,代码来源:TabControl.cpp

示例8: SetInitProShopCityChild

void SetInitProShopCityChild(Window* pageWnd)
{
	TabControl* tbc = WTabControl(pageWnd);
	//默认第一个可见
	tbc->setSelectedTabAtIndex(0);
	Window* ctt1 = tbc->getTabContentsAtIndex(tbc->getSelectedTabIndex());
	if(ctt1)
	{
		ctt1->setVisible(true);
		//把ShopCityItemSet 加到他上面
		ctt1->addChildWindow(InitShopCityItemSet());
	}
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:13,代码来源:ShopCityChild.cpp

示例9: onMouseDown

void tabButton::onMouseDown( wxMouseEvent& event )
{
	if (m_bSelected)
		return;

	TabControl* temp = dynamic_cast<TabControl*>(GetParent());

	if (temp)
	{
		temp->setActivePage_ID(this->GetId());
	}

	event.Skip();
}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:14,代码来源:TabButton.cpp

示例10: handleAddTab

  bool handleAddTab(const EventArgs&)
  {
    Window* root = d_guiContext->getRootWindow();

    // Check if the window exists
    if (root->isChild("Frame/TabControl"))
    {
      TabControl* tc = static_cast<TabControl*>(root->getChild(
        "Frame/TabControl"));

      // Add some tab buttons once
      for (int num = 3; num <= 16; num++)
      {
        std::stringstream pgname;
        pgname << "Page" << num;

        if (root->isChild(String("Frame/TabControl/") + pgname.str().c_str()))
          // Next
          continue;

        Window* pg = 0;

        pg = WindowManager::getSingleton().loadLayoutFromFile("TabPage.layout");
        CEGUI_TRY
        {
          pg = WindowManager::getSingleton().loadLayoutFromFile("TabPage.layout");
          pg->setName(String(pgname.str().c_str()));
        }
          CEGUI_CATCH(CEGUI::Exception&)
        {
          Logger::getSingleton().logEvent("Some error occured while adding a tabpage. Please see the logfile.");
          break;
        }

        // This window has just been created while loading the layout
        if (pg->isChild("Text"))
        {
          Window* txt = pg->getChild("Text");
          txt->setText(PageText[num - 3]);

          pg->setText(pgname.str().c_str());
          tc->addTab(pg);

          refreshPageList();
          break;
        }
      }
开发者ID:jherico,项目名称:VirtualChess,代码行数:47,代码来源:UiTest.cpp

示例11: OnShopCityChildTabContentSelChanged

bool OnShopCityChildTabContentSelChanged(const CEGUI::EventArgs& e)
{
	TabControl* tbc = WTabControl(WEArgs(e).window);
	if(tbc)
	{
		CEGUI::Window* tbcontent = tbc->getTabContentsAtIndex(tbc->getSelectedTabIndex());
		if(tbcontent)
		{
			//把唯一ShopCityItemSet加到单前选中项上
			CEGUI::Window* itemSet = GetWindow(SHOPCITY_ITEMSET_PAGE_NAME);
			tbcontent->addChildWindow(itemSet);
			//更新ItemSet的显示
			FireUIEvent(SHOPCITY_ITEMSET_PAGE_NAME,SHOPCITY_ITEMSET_EVENT_UPDATE);
			//更新右搜索(筛选)菜单
			FireUIEvent(SHOPCITY_SEARCH_RIGHTWND_NAME,SHOPCITY_SEARCHRIGHT_EVENT_MENUUPDATE_NAME);
			//更新左搜索(导购)菜单
			FireUIEvent(SHOPCITY_SEARCH_LEFTWND_NAME,SHOPCITY_SEARCHLEFT_EVENT_MENUUPDATE_NAME);
		}
	}
	return true;
}
开发者ID:xiongshaogang,项目名称:mmo-resourse,代码行数:21,代码来源:ShopCityChild.cpp

示例12: switch

//  Gui Shortcut  alt-letters
//.......................................................................................
void CGui::GuiShortcut(WND_Types wnd, int tab, int subtab)
{
	if (subtab == -1 && (!app->bGuiFocus || pSet->inMenu != wnd))  subtab = -2;  // cancel subtab cycling

	if (!app->bGuiFocus)
	if (app->edMode != ED_PrvCam)  {
		app->bGuiFocus = !app->bGuiFocus;  app->UpdVisGui();  }

	//isFocGui = true;
	pSet->isMain = false;  pSet->inMenu = wnd;
	
	TabPtr mWndTabs = 0;
	std::vector<TabControl*>* subt = 0;
	
	switch (wnd)
	{	case WND_Track:		mWndTabs = app->mWndTabsTrack; subt = &vSubTabsTrack; break;
		case WND_Edit:		mWndTabs = app->mWndTabsEdit;  subt = &vSubTabsEdit;  break;
		case WND_Help:		mWndTabs = app->mWndTabsHelp;  subt = &vSubTabsHelp;  break;
		case WND_Options:	mWndTabs = app->mWndTabsOpts;  subt = &vSubTabsOpts;  break;
	}
	if (wnd != WND_Edit)
		app->mWndPick->setVisible(false);
	toggleGui(false);


	size_t t = mWndTabs->getIndexSelected();
	mWndTabs->setIndexSelected(tab);

	if (!subt)  return;
	TabControl* tc = (*subt)[tab];  if (!tc)  return;
	int  cnt = tc->getItemCount();

	if (t == tab && subtab == -1)  // cycle subpages if same tab
	{	if (app->shift)
			tc->setIndexSelected( (tc->getIndexSelected()-1+cnt) % cnt );
		else
			tc->setIndexSelected( (tc->getIndexSelected()+1) % cnt );
	}
	if (subtab > -1)
		tc->setIndexSelected( std::min(cnt-1, subtab) );
}
开发者ID:ddxxpp,项目名称:stuntrally,代码行数:43,代码来源:Gui_Util.cpp

示例13: key

bool App::keyPressed(const SDL_KeyboardEvent &arg)
{
	SDL_Scancode skey = arg.keysym.scancode;
	#define key(a)  SDL_SCANCODE_##a
	
	///  Preview camera  ---------------------
	if (edMode == ED_PrvCam)
	{
		switch (skey)
		{
			case key(ESCAPE):  // exit
			case key(F7):  togPrvCam();  break;

			case key(RETURN):  // save screen
			{	int u = pSet->allow_save ? pSet->gui.track_user : 1;
				rt[RTs-1].tex->writeContentsToFile(gcom->pathTrk[u] + pSet->gui.track + "/preview/view.jpg");
				gcom->listTrackChng(gcom->trkList,0);  // upd gui img
				gui->Status("Preview saved", 1,1,0);
			}	break;

			case key(F12):  // screenshot
				mWindow->writeContentsToTimestampedFile(PATHMANAGER::Screenshots() + "/", ".jpg");
				return true;
		}
		return true;
	}

	//  main menu keys
	Widget* wf = InputManager::getInstance().getKeyFocusWidget();
	bool edFoc = wf && wf->getTypeName() == "EditBox";

	if (pSet->isMain && bGuiFocus)
	{
		switch (skey)
		{
		case key(UP):  case key(KP_8):
			pSet->inMenu = (pSet->inMenu-1+WND_ALL)%WND_ALL;
			gui->toggleGui(false);  return true;

		case key(DOWN):  case key(KP_2):
			pSet->inMenu = (pSet->inMenu+1)%WND_ALL;
			gui->toggleGui(false);  return true;

		case key(RETURN):
			pSet->isMain = false;
			gui->toggleGui(false);  return true;
		}
	}
	if (!pSet->isMain && bGuiFocus)
	{
		switch (skey)
		{
		case key(BACKSPACE):
			if (pSet->isMain)  break;
			if (bGuiFocus)
			{	if (edFoc)  break;
				pSet->isMain = true;  gui->toggleGui(false);  }
			return true;
		}
	}

	//  change gui tabs
	TabPtr tab = 0;  TabControl* sub = 0;  int iTab1 = 1;
	if (bGuiFocus && !pSet->isMain)
	switch (pSet->inMenu)
	{
		case WND_Track:   tab = mWndTabsTrack;  sub = gui->vSubTabsTrack[tab->getIndexSelected()];  break;
		case WND_Edit:    tab = mWndTabsEdit;  sub = gui->vSubTabsEdit[tab->getIndexSelected()];  break;
		case WND_Help:    tab = sub = gui->vSubTabsHelp[1];  iTab1 = 0;  break;
		case WND_Options: tab = mWndTabsOpts;  sub = gui->vSubTabsOpts[tab->getIndexSelected()];  break;
	}
	bool bRoad = edMode == ED_Road && road && bEdit();

	//  global keys
	//------------------------------------------------------------------------------------------------------------------------------
	switch (skey)
	{
		case key(ESCAPE): //  quit
			if (pSet->escquit)
			{
				mShutDown = true;
			}	return true;

		case key(F1):
		case key(GRAVE):
			if (ctrl)  // context help (show for cur mode)
			{
				if (bMoveCam)		 gui->GuiShortcut(WND_Help, 1, 0);
				else switch (edMode)
				{	case ED_Smooth: case ED_Height: case ED_Filter:
					case ED_Deform:  gui->GuiShortcut(WND_Help, 1, 3);  break;
					case ED_Road:    gui->GuiShortcut(WND_Help, 1, 5);  break;
					case ED_Start:   gui->GuiShortcut(WND_Help, 1, 6);  break;
					case ED_Fluids:  gui->GuiShortcut(WND_Help, 1, 7);  break;
					case ED_Objects: gui->GuiShortcut(WND_Help, 1, 8);  break;
					default:		 gui->GuiShortcut(WND_Help, 1, 0);  break;
			}	}
			else	//  Gui mode, Options
				gui->toggleGui(true);
			return true;
//.........这里部分代码省略.........
开发者ID:dimaursu,项目名称:stuntrally,代码行数:101,代码来源:Update_Key.cpp

示例14: UiTest

  UiTest(const uvec2 & )  {
    Gui::init(uvec2(100, 200));
    gameList = Fics::GameSummary::parseList(Platform::getResourceString(Resource::MISC_GAMELIST_TXT));
    try {
      WindowManager & wmgr = WindowManager::getSingleton();
      rootWindow = wmgr.createWindow("DefaultWindow", "root");
      System::getSingleton().getDefaultGUIContext().setRootWindow(rootWindow);
      rootWindow->addChild(wmgr.loadLayoutFromFile("Login.layout"));


      //rb->setSelected(tc->getTabPanePosition() == TabControl::Top);
      //rb->subscribeEvent(
      //  RadioButton::EventSelectStateChanged,
      //  Event::Subscriber(&TabControlDemo::handleTabPanePos, this));
      //    bool handleTabPanePos(const EventArgs& e)
      //dumpWindows(rootWindow);
      rootWindow->getChild("LoginWindow/Login")->
        subscribeEvent(PushButton::EventClicked, [&](const EventArgs& e) -> bool {
          return true;
        });

#if 0
      rootWindow->addChild(wmgr.loadLayoutFromFile("TabControl.layout"));
      TabControl* tc = static_cast<TabControl*>(rootWindow->getChild("TabControl"));

      //// Add some pages to tab control
      tc->addTab(wmgr.loadLayoutFromFile("TabPage1.layout"));
      tc->addTab(wmgr.loadLayoutFromFile("TabPage2.layout"));

      MultiColumnList* mcl = static_cast<MultiColumnList*>(rootWindow->getChild("TabControl/Page1/MultiColumnList"));

      //MultiColumnList* mcl = static_cast<CEGUI::MultiColumnList*>(
      //  wmgr.createWindow("TaharezLook/MultiColumnList", "WidgetPropertiesDisplay")
      //);
      //Create the properties display window
      //mcl->setSize(CEGUI::USize(cegui_reldim(0.9f), cegui_reldim(0.9f)));
      //mcl->setPosition(CEGUI::UVector2(cegui_reldim(0.05f), cegui_reldim(0.05f)));
      //rootWindow->addChild(mcl);
      dumpWindows(rootWindow);



      //mcl->setShowHorzScrollbar(false);
      //mcl->setUserColumnDraggingEnabled(false);
      //mcl->setUserColumnSizingEnabled(true);

      //mcl->addColumn("Name", 0, cegui_reldim(0.45f));
      //mcl->addColumn("Type ", 1, cegui_reldim(0.25f));
      //mcl->addColumn("Value", 2, cegui_reldim(0.8f));


      //d_widgetPropertiesDisplayWindow->setSortColumnByID(0);
      //d_widgetPropertiesDisplayWindow->setSortDirection(CEGUI::ListHeaderSegment::Ascending);

      mcl->addColumn("Id", 0, cegui_reldim(0.05f));
      mcl->addColumn("Type", 1, cegui_reldim(0.07f));
      mcl->addColumn("Player (White)", 2, cegui_reldim(0.15f));
      mcl->addColumn("Rating", 3, cegui_reldim(0.07f));
      mcl->addColumn("Player (Black)", 4, cegui_reldim(0.15f));
      mcl->addColumn("Rating", 5, cegui_reldim(0.07f));
      mcl->addColumn("Private", 6, cegui_reldim(0.05f));
      mcl->addColumn("Rated", 7, cegui_reldim(0.05f));
      for (int i = 0; i < gameList.size(); ++i) {
        Fics::GameSummary & g = gameList[i];
        
        mcl->addRow();
        mcl->setItem(new ListboxTextItem(Platform::format("%d", g.id)), 0, i);
        mcl->setItem(new ListboxTextItem(g.private_ ? "Y" : "N"), 6, i);
        mcl->setItem(new ListboxTextItem(g.rated ? "Y" : "N"), 7, i);
        mcl->setItem(new ListboxTextItem(Chess::getTypeName(g.type)), 1, i);
        for (int j = 0; j < 2; ++j) {
          mcl->setItem(new ListboxTextItem(g.players[j]), 2 + (j * 2), i);
          mcl->setItem(new ListboxTextItem(Platform::format("%d", g.ratings[j])), 3 + (j * 2), i);
        }
      }
      // Add some empty rows to the MCL
      //multilineColumnList->addRow();
      //multilineColumnList->addRow();
      //multilineColumnList->addRow();
      //multilineColumnList->addRow();
      //multilineColumnList->addRow();

      //// Set first row item texts for the MCL
      //multilineColumnList->setItem(new MyListItem("Laggers World"), 0, 0);
      //multilineColumnList->setItem(new MyListItem("yourgame.some-server.com"), 1, 0);
      //multilineColumnList->setItem(new MyListItem("[colour='FFFF0000']1000ms"), 2, 0);

      //// Set second row item texts for the MCL
      //multilineColumnList->setItem(new MyListItem("Super-Server"), 0, 1);
      //multilineColumnList->setItem(new MyListItem("whizzy.fakenames.net"), 1, 1);
      //multilineColumnList->setItem(new MyListItem("[colour='FF00FF00']8ms"), 2, 1);

      //// Set third row item texts for the MCL
      //multilineColumnList->setItem(new MyListItem("Cray-Z-Eds"), 0, 2);
      //multilineColumnList->setItem(new MyListItem("crayzeds.notarealserver.co.uk"), 1, 2);
      //multilineColumnList->setItem(new MyListItem("[colour='FF00FF00']43ms"), 2, 2);

      //// Set fourth row item texts for the MCL
      //multilineColumnList->setItem(new MyListItem("Fake IPs"), 0, 3);
      //multilineColumnList->setItem(new MyListItem("123.320.42.242"), 1, 3);
//.........这里部分代码省略.........
开发者ID:jherico,项目名称:VirtualChess,代码行数:101,代码来源:UiTest.cpp

示例15: Build

void GuiConfig::Build(ZProtoGUI *pGUI)
{
	mGUI = (ZProtoGUI*)pGUI;
	root = mGUI->root;
	mFontArial8 = mGUI->mFontArial8;
	mFontArial24 = mGUI->mFontArial24;


	// Create a FrameWindow in the TaharezLook style, and name it 'Demo Window'
	mCondigWindow = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "Config Window");
	mCondigWindow->setTitleBarEnabled(false);
	mCondigWindow->setCloseButtonEnabled(false);
	mCondigWindow->setSizingEnabled(false);
	root->addChildWindow(mCondigWindow);
	mCondigWindow->setAlpha(0.6f);
	mCondigWindow ->hide();
	mCondigWindow->setSizingEnabled(false);


	FrameWindow* wnd1 = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "tabPage0");
	wnd1->setTitleBarEnabled(false);
	wnd1->setFrameEnabled(false);//>setTitleBarEnabled(false);
	wnd1->setCloseButtonEnabled(false);
	wnd1->setText(GLoc->GetString("PLAYER").c_str());


	FrameWindow* wnd2 = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "tabPage1");
	wnd2->setTitleBarEnabled(false);
	wnd2->setFrameEnabled(false);//>setTitleBarEnabled(false);
	wnd2->setCloseButtonEnabled(false);
	wnd2->setText(GLoc->GetString("Controls").c_str());


	FrameWindow* wnd3 = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "tabPage2");
	wnd3->setTitleBarEnabled(false);
	wnd3->setCloseButtonEnabled(false);
	wnd3->setText(GLoc->GetString("Graphics").c_str());
	wnd3->setFrameEnabled(false);//

	FrameWindow* wnd4 = (FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "tabPage3");
	wnd4->setTitleBarEnabled(false);
	wnd4->setFrameEnabled(false);//>setTitleBarEnabled(false);
	wnd4->setCloseButtonEnabled(false);
	wnd4->setText(GLoc->GetString("SOUND").c_str());
	//wnd->addChildWindow (winMgr.loadWindowLayout ("TabControlDemo.layout", "TabControlDemo/"));

	TabControl *tc = (TabControl *)winMgr.createWindow("TaharezLook/TabControl", "Config/Tabs");

	mCondigWindow->setPosition(UVector2(cegui_reldim(0.f), cegui_reldim( 0.f)));
	mCondigWindow->setSize(UVector2(cegui_reldim(1.f), cegui_reldim( 0.9f)));
	tc->setArea(UVector2(cegui_reldim(0.1f), cegui_reldim( 0.05f)), UVector2(cegui_reldim(0.9f), cegui_reldim( 0.85f)) );



	// Add some pages to tab control
	tc->addTab (wnd1);
	tc->addTab (wnd2);
	tc->addTab (wnd3);
	tc->addTab (wnd4);

	tc->setTabHeight(UDim (0.06f, 0.13f));
	tc->setTabTextPadding(UDim (0.06f, 0.1f));


	mCondigWindow->addChildWindow(tc);

	mCondigWindow->setPosition(UVector2(cegui_reldim(0), cegui_reldim( 0.15f)));
	mCondigWindow->setSize(UVector2(cegui_reldim(1.1f), cegui_reldim( 0.70f)));
	mCondigWindow->setAlpha(0.88f);


	wnd1->setPosition(UVector2(cegui_reldim(0.0f), cegui_reldim( 0.0f)));
	wnd1->setSize(UVector2(cegui_reldim(1.f), cegui_reldim( 1.f)));

	wnd2->setPosition(UVector2(cegui_reldim(0.0f), cegui_reldim( 0.0f)));
	wnd2->setSize(UVector2(cegui_reldim(1.f), cegui_reldim( 1.f)));

	wnd3->setPosition(UVector2(cegui_reldim(0.0f), cegui_reldim( 0.0f)));
	wnd3->setSize(UVector2(cegui_reldim(1.f), cegui_reldim( 1.f)));

	wnd4->setPosition(UVector2(cegui_reldim(0.0f), cegui_reldim( 0.0f)));
	wnd4->setSize(UVector2(cegui_reldim(1.f), cegui_reldim( 1.f)));

	// controls


	for (int allCtrl = 0;allCtrl<sizeof(aCtrlList)/sizeof(CTRLEntry); allCtrl++)
	{
		static const float interligne = 0.06f*1.6f;
		static const float intersize = 0.05f*1.4f;
		tstring numb;
		numb.Printf("%d", allCtrl);

		Window* txtlib = winMgr.createWindow("TaharezLook/StaticText", String(aCtrlList[allCtrl].mName)+String("CtrlLib")+String(numb.c_str()));

		txtlib->setText(GLoc->GetString(aCtrlList[allCtrl].mName).c_str());
		txtlib->setProperty("FrameEnabled", "false");
		txtlib->setProperty("BackgroundEnabled", "false");
		//txtlib->setHorizontalAlignment(HA_CENTRE);
		txtlib->setPosition(UVector2(cegui_reldim(0.05f), cegui_reldim( 0.01f + interligne*allCtrl)));
//.........这里部分代码省略.........
开发者ID:pulkomandy,项目名称:.theRush-,代码行数:101,代码来源:ZGuiConfig.cpp


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