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


C++ CViewContainer::addView方法代码示例

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


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

示例1: initGui

void Editor::initGui( void* systemWindow )
{
	CRect rc      = childFrame_->getViewSize();
    CCoord middle = rc.width() - 276;
    CCoord bottom = rc.height() - 55;

    CRect rcTabView( rc.left+8, rc.top+8, rc.right-8, rc.bottom-8 );
	CRect rcTabButtons( -3, 0, 100, 64 );	            // size of a TabButton (double height)
	CRect rcDisplay( 0, 0, rc.right-16, bottom );	    // area without tab bar
	CRect rcProgramView( 0, 0, middle, bottom );
	CRect rcCtrlView( middle, 0, rc.right-8, bottom );
    CRect rcBankView( 0, 0, rc.right-8, bottom );
    CRect rcSystemView( 0, 0, rc.right-16, bottom );

	tabView_     = new TabView( rcTabView, rcTabButtons, this );
   	ctrlView_    = new CtrlView( rcCtrlView, this );
	programView_ = new ProgramView( rcProgramView, this, ctrlView_ );
    bankView_    = new BankView( rcBankView, this );
    
	CViewContainer* programTab = new CViewContainer( rcDisplay, childFrame_ );
    programTab->setAutosizeFlags( kAutosizeAll );
    programTab->setTransparency( true );
    programTab->addView( programView_->getScrollView() );
	programTab->addView( ctrlView_ );

    tabView_->addTab( programTab, new TabButton( "Program" ));
	tabView_->addTab( bankView_, new TabButton( "Bank" ) );
	
    if( isStandalone() )
    {
        systemView_ = new SystemView( rcSystemView, this );
        tabView_->addTab( systemView_, new TabButton( "System" ) );
    }

    tabView_->init();	
    childFrame_->addView( tabView_ );
    checkAppState();
    setColorScheme();
}
开发者ID:dreieier,项目名称:Nexus,代码行数:39,代码来源:Editor.cpp

示例2: newView

//-----------------------------------------------------------------------------
ExchangeViewAnimation::ExchangeViewAnimation (CView* oldView, CView* newView, AnimationStyle style)
: newView (newView)
, viewToRemove (oldView)
, style (style)
{
	assert (newView->isAttached () == false);
	assert (viewToRemove->isAttached ());

	viewToRemove->remember ();
	newView->remember ();
	CViewContainer* parent = reinterpret_cast<CViewContainer*> (viewToRemove->getParentView ());
	if (parent)
		parent->addView (newView);

	newViewValueEnd = newView->getAlphaValue ();
	newView->setAlphaValue (0.f);
}
开发者ID:sa-tsuklog,项目名称:MyLib,代码行数:18,代码来源:animations.cpp

示例3: verifyView

//----------------------------------------------------------------------------------------------------
CView* UIDialogController::verifyView (CView* view, const UIAttributes& attributes, IUIDescription* description)
{
	CControl* control = dynamic_cast<CControl*>(view);
	if (control)
	{
		if (control->getTag () == kButton1Tag)
		{
			CTextButton* button = dynamic_cast<CTextButton*>(control);
			if (button)
			{
				button1 = button;
				button->setTitle (dialogButton1.c_str ());
				layoutButtons ();
			}
		}
		else if (control->getTag () == kButton2Tag)
		{
			CTextButton* button = dynamic_cast<CTextButton*>(control);
			if (button)
			{
				button2 = button;
				if (dialogButton2.empty ())
				{
					button->setVisible (false);
				}
				else
				{
					button->setTitle (dialogButton2.c_str ());
				}
				layoutButtons ();
			}
		}
		else if (control->getTag () == kTitleTag)
		{
			CTextLabel* label = dynamic_cast<CTextLabel*>(control);
			if (label)
			{
				label->setText (dialogTitle.c_str ());
			}
		}
	}
	const std::string* name = attributes.getAttributeValue ("custom-view-name");
	if (name)
	{
		if (*name == "view")
		{
			IController* controller = dialogController.cast<IController> ();
			CView* subView = dialogDescription->createView (templateName.c_str (), controller);
			if (subView)
			{
				subView->setAttribute (kCViewControllerAttribute, sizeof (IController*), &controller);
				sizeDiff.x = subView->getWidth () - view->getWidth ();
				sizeDiff.y = subView->getHeight () - view->getHeight ();
				CRect size = view->getViewSize ();
				size.setWidth (subView->getWidth ());
				size.setHeight (subView->getHeight ());
				view->setViewSize (size);
				view->setMouseableArea (size);
				CViewContainer* container = dynamic_cast<CViewContainer*> (view);
				if (container)
					container->addView (subView);
			}
		}
	}
	return view;
}
开发者ID:sa-tsuklog,项目名称:MyLib,代码行数:67,代码来源:uidialogcontroller.cpp

示例4: open

bool GuiEditor::open (void *ptr)
{
	AEffGUIEditor::open (ptr);
	CRect size (rect.left , rect.top, rect.right, rect.bottom);


	CBitmap* hHFaderBody   = new CBitmap (kHFaderBodyId);
	CBitmap* hHFaderHandle = new CBitmap (kHFaderHandleId);



	CFrame* lFrame = new CFrame(size, ptr, this);
	//lFrame->setBackgroundColor(kGreyCColor);

	int middle = 150;

	size(0,0,dWidth,middle);

	CViewContainer* graphicsView = new CViewContainer(size, lFrame);
	graphicsView->setBackgroundColor(kBlackCColor);

	lFrame->addView(graphicsView);

	size(0,middle,dWidth,dBottom);
	CViewContainer* controlsView = new CViewContainer(size, lFrame);
	controlsView->setBackgroundColor(kGreyCColor);

	lFrame->addView(controlsView);


	size(0,0,700,150);
	mySpectrumView = new SpectrumView(size,effect);
	graphicsView->addView(mySpectrumView);


	int left, top, right, bottom, minPos, maxPos;

	//------------------------------------------------------------------------------
	left = 20;
	top = 10;
	right = left + 70;
	bottom = top + 16;

	size(left, top, right, bottom);
	CTextLabel* bufferLabel = new CTextLabel(size,"BufferSize");
	bufferLabel->setFont (kNormalFontSmall);
	bufferLabel->setFontColor (kWhiteCColor);
	bufferLabel->setBackColor (kBlackCColor);
	bufferLabel->setFrameColor (kBlackCColor);
	controlsView->addView(bufferLabel);

	//------------------------------------------------------------------------------
	left = right + 10;
	top = 10;
	right = left + 70;
	bottom = top + 16;

	size(left, top, right, bottom);
	bufferMenu = new COptionMenu(size, this,kBufferSize);
	bufferMenu->setFont (kNormalFontSmall);
	bufferMenu->setFontColor (kWhiteCColor);
	bufferMenu->setBackColor (kBlackCColor);
	bufferMenu->setFrameColor (kWhiteCColor);

	bufferMenu->addEntry("512",0);
	bufferMenu->addEntry("1024",1);
	bufferMenu->addEntry("2048",2);
	bufferMenu->addEntry("4096",3);
	bufferMenu->addEntry("8192",4);
	bufferMenu->setCurrent(3);

	controlsView->addView(bufferMenu);

	//----------------------------------------------------------------------------

	left = right + 10;
	right = left + 60;


		size(left, top, right, bottom);
	CTextLabel* displayLabel = new CTextLabel(size,"Display");
	displayLabel->setFont (kNormalFontSmall);
	displayLabel->setFontColor (kWhiteCColor);
	displayLabel->setBackColor (kBlackCColor);
	displayLabel->setFrameColor (kBlackCColor);
	controlsView->addView(displayLabel);


	left = right + 10;
	right = left + 50;

	size(left, top, right, bottom);
	displayMenu = new COptionMenu(size, this,kDisplay);
	displayMenu->setFont (kNormalFontSmall);
	displayMenu->setFontColor (kWhiteCColor);
	displayMenu->setBackColor (kBlackCColor);
	displayMenu->setFrameColor (kWhiteCColor);

	displayMenu->addEntry("Bands",0);
	displayMenu->addEntry("Lines",1);
//.........这里部分代码省略.........
开发者ID:vinz9,项目名称:vstoscspectrum,代码行数:101,代码来源:GuiEditor.cpp

示例5: setTabView

void DrawTestEditor::setTabView (CFrame* frame, const CRect& r, long position)
{
	frame->removeAll ();
	CBitmap* tabButtonBitmap = new CBitmap (kTabButtonBitmap);
	CTabView* tabView = new MyTabView (r, frame, tabButtonBitmap, NULL, position, this);
	tabView->setTransparency (true);
	frame->addView (tabView);
	CRect tabSize = tabView->getTabViewSize (tabSize);
//	tabSize.inset (1, 1);
	// add tabs
	CView* testView;
	CBitmap* testBitmap = new CBitmap (kTestBitmap);
	CRect containerSize;
	containerSize.right = testBitmap->getWidth () + 1000;
	containerSize.bottom = testBitmap->getHeight () + 1000;
	// the first tab is a scroll view with a movie bitmap
	CScrollView* scrollview = new CScrollView (tabSize, containerSize, frame, CScrollView::kHorizontalScrollbar|CScrollView::kVerticalScrollbar/*|CScrollView::kDontDrawFrame*/);
	scrollview->setBackgroundColor (kWhiteCColor);
//	scrollview->setTransparency (true);
	CPoint p (0,0);
	CRect mbSize (containerSize);
	mbSize.setWidth (testBitmap->getWidth ());
	mbSize.setHeight (testBitmap->getHeight ());
	testView = new CMovieBitmap (mbSize, NULL, 0, 1, testBitmap->getHeight (), testBitmap, p);
	testBitmap->forget ();
	scrollview->addView (testView);
	CRect controlsGUISize2 (0, 0, 420, 210);
	controlsGUISize2.offset (mbSize.right, 5);
	testView = new ControlsGUI (controlsGUISize2, frame);
	scrollview->addView (testView);
	tabView->addTab (scrollview, "Scroll View");

	testView = new PLinesView (tabSize);
	tabView->addTab (testView, "Lines");

	testView = new PRectsView (tabSize);
	tabView->addTab (testView, "Rects");

	testView = new PMiscView (tabSize);
	tabView->addTab (testView, "Misc");

	// the third tab is the old controlsgui view embeded into a container view
	CRect controlsGUISize (0, 0, 420, 210);
	controlsGUISize.offset (5, 5);
	testView = new ControlsGUI (controlsGUISize, frame);

	CViewContainer* controlContainer = new CViewContainer (tabSize, frame);
	controlContainer->setTransparency (true);
	controlContainer->addView (testView);
	
	tabView->addTab (controlContainer, "Controls");

	CColor redColor = {255, 0, 0, 150};
	CColor greenColor = {0, 255, 0, 150};
	CColor blueColor = {0, 0, 255, 150};

	CViewContainer* clipView = new CViewContainer (tabSize, frame);
	clipView->setTransparency (true);
	CRect clipViewSize (0, 0, tabSize.getWidth () / 4, tabSize.getHeight () / 2);
	MyColoredView* cv = new MyColoredView (clipViewSize);
	cv->setBackgroundColor (redColor);
	clipView->addView (cv);
	clipViewSize.offset (clipViewSize.getWidth (), 0);
	cv = new MyColoredView (clipViewSize);
	cv->setBackgroundColor (greenColor);
	clipView->addView (cv);
	clipViewSize.offset (clipViewSize.getWidth (), 0);
	cv = new MyColoredView (clipViewSize);
	cv->setBackgroundColor (blueColor);
	clipView->addView (cv);
	clipViewSize.offset (clipViewSize.getWidth (), 0);
	cv = new MyColoredView (clipViewSize);
	cv->setBackgroundColor (redColor);
	clipView->addView (cv);
	clipViewSize (0, tabSize.getHeight () / 2, tabSize.getWidth () / 4, tabSize.getHeight ());
	cv = new MyColoredView (clipViewSize);
	cv->setBackgroundColor (greenColor);
	clipView->addView (cv);
	clipViewSize.offset (clipViewSize.getWidth (), 0);
	cv = new MyColoredView (clipViewSize);
	cv->setBackgroundColor (blueColor);
	clipView->addView (cv);
	clipViewSize.offset (clipViewSize.getWidth (), 0);
	cv = new MyColoredView (clipViewSize);
	cv->setBackgroundColor (redColor);
	clipView->addView (cv);
	clipViewSize.offset (clipViewSize.getWidth (), 0);
	cv = new MyColoredView (clipViewSize);
	cv->setBackgroundColor (greenColor);
	clipView->addView (cv);
	
	tabView->addTab (clipView, "Clip Test");
	tabView->alignTabs (CTabView::kAlignCenter);

	tabButtonBitmap->forget ();
	frame->setDirty ();
}
开发者ID:DaniM,项目名称:lyngo,代码行数:97,代码来源:pdrawtesteditor.cpp

示例6: addTab

//-----------------------------------------------------------------------------
bool CTabView::addTab (CView* view, CControl* button)
{
	if (!view || !button)
		return false;

	CViewContainer* tabContainer = dynamic_cast<CViewContainer*>(getView (0));
	if (tabContainer == 0)
	{
		int32_t asf = kAutosizeLeft | kAutosizeTop | kAutosizeRight | kAutosizeColumn;
		CRect tsc (0, 0, getViewSize ().getWidth (), tabSize.getHeight () / 2);
		switch (tabPosition)
		{
			case kPositionBottom:
			{
				asf = kAutosizeLeft | kAutosizeBottom | kAutosizeRight | kAutosizeColumn;
				tsc.offset (0, getViewSize ().getHeight () - tabSize.getHeight () / 2);
				break;
			}
			case kPositionLeft:
			{
				asf = kAutosizeLeft | kAutosizeTop | kAutosizeBottom | kAutosizeRow;
				tsc.setWidth (tabSize.getWidth ());
				tsc.setHeight (getViewSize ().getHeight ());
				break;
			}
			case kPositionRight:
			{
				asf = kAutosizeRight | kAutosizeTop | kAutosizeBottom | kAutosizeRow;
				tsc.setWidth (getViewSize ().getWidth ());
				tsc.left = tsc.right - tabSize.getWidth ();
				tsc.setHeight (getViewSize ().getHeight ());
				break;
			}
			case kPositionTop:
			{
				break;
			}
		}
		tabContainer = new CViewContainer (tsc);
		tabContainer->setTransparency (true);
		tabContainer->setAutosizeFlags (asf);
		addView (tabContainer);
	}
	CRect ts (tabSize.left, tabSize.top, tabSize.getWidth (), tabSize.getHeight () / 2);
	switch (tabPosition)
	{
		case kPositionTop:
			ts.offset (tabSize.getWidth () * numberOfChilds, 0); break;
		case kPositionBottom:
			ts.offset (tabSize.getWidth () * numberOfChilds, 0); break;
		case kPositionLeft:
			ts.offset (0, tabSize.getHeight () / 2 * numberOfChilds); break;
		case kPositionRight:
			ts.offset (0, tabSize.getHeight () / 2 * numberOfChilds); break;
	}
	button->setViewSize (ts, false);
	button->setMouseableArea (ts);
	button->setListener (this);
	button->setTag (numberOfChilds + kTabButtonTagStart);
	tabContainer->addView (button);

	CRect tabViewSize;
	getTabViewSize (tabViewSize);
	view->setViewSize (tabViewSize);
	view->setMouseableArea (tabViewSize);

	CTabChildView* v = new CTabChildView (view);
	v->button = button;
	if (lastChild)
	{
		lastChild->next = v;
		v->previous = lastChild;
		lastChild = v;
	}
	else
	{
		firstChild = lastChild = v;
		setCurrentChild (v);
	}
	numberOfChilds++;
	return true;
}
开发者ID:EQ4,项目名称:vstgui,代码行数:83,代码来源:ctabview.cpp


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