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


C++ TextView::pos方法代码示例

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


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

示例1: main

int main(int argc, char ** argv){
	
	GLV top(drawCB);
	
	Window win(600, 400, "Example: Widgets", &top);

	sl1HS.interval(1,-1);
	sl1VS.interval(1,-1);
	sliders1.interval(1,-1);
	sg3.interval(20,-20);
	sl2.interval(20,-20);
	slRH.interval(2,-2);
	
	glv::Style::standard().color.set(StyleColor::BlackOnWhite);
//	glv::Style::standard().color.set(StyleColor::WhiteOnBlack);
//	glv::Style::standard().color.set(StyleColor::Gray);
//	glv::Style::standard().color.hsv(0.5,0.5,0.2);
	
	for(int i=0; i<pages; ++i){
		top << groups[i].disable(Visible | HitTest).stretch(1,1);
	}
	
	fg.tension(1.);

	table	<< new Label("col span") << new Label("row span", true)
			<< new Label("top-left") << new Label("top-center") << new Label("top-right") 
			<< new Label("center-left") << new Label("center-center") << new Label("center-right")
			<< new Label("bottom-left") << new Label("bottom-center") << new Label("bottom-right");
	table.arrange();
	//table.enable(DrawBorder);

	plotXY.data().resize(Data::FLOAT, 2, 64);
	const float ffreq = 2*M_PI/(plotXY.data().size(1)-1);
	for(int i=0; i<plotXY.data().size(1); ++i){
		float phs = i*ffreq;
		float sigX = (cos(phs) + 0.5*cos(2*phs))/(1+0.5);
		float sigY = (sin(phs) + 0.5*sin(2*phs))/(1+0.5);
		plotXY.data().assign(sigX, 0,i);
		plotXY.data().assign(sigY, 1,i);
	}
	plotXY.numbering(true);
	plotY.data() = plotXY.data().slice(0).shape(1,1,64).stride(2);
	plotX.data() = plotXY.data().slice(1).shape(1,64,1).stride(2);
	plotY.major(8,1).range(0, plotXY.data().size(1), 1);
	plotX.major(8,0).range(0, plotXY.data().size(1), 0);

	plotX.disable(glv::Controllable);

	// Produce matrix of values
	{
		dplot.data().resize(Data::FLOAT, 1,32,32);
		Data& data = dplot.data();
		for(int j=0; j<data.size(2); ++j){
			for(int i=0; i<data.size(1); ++i){
				double y = double(j)/data.size(2)*2-1;
				double x = double(i)/data.size(1)*2-1;
				double r = (sin(hypot(x,y)*8));
				data.assign(r, 0, i,j);
			}
		}
	}

	v3D << v3D2.pos(Place::BR).anchor(Place::BR);

//btsLED.enable(Momentary);
	int i=-1;
	groups[++i]<< bt1.pos(Place::BL).anchor(Place::CC)(Event::MouseDrag, Behavior::mouseResize);
	groups[  i]<< bt2.pos(Place::BR, -4,0).anchor(Place::CC)(Event::MouseDrag, Behavior::mouseResize);
	groups[  i]<< (btl.pos(Place::TR, -4, 4).anchor(Place::CC) << new Label("OK", Place::CC, 0,0));
	groups[++i]<< bts14.pos(Place::BR, -4,0).anchor(Place::CC);
	groups[  i]<< bts41.pos(Place::TL, 0, 4).anchor(Place::CC);
	groups[  i]<< bts44.pos(Place::BL).anchor(Place::CC);
	groups[  i]<< btsLED.padding(3).pos(Place::BL, bts44.w+4,0).anchor(Place::CC).enable(SelectOnDrag).disable(DrawGrid);
	groups[++i]<< fg.pos(Place::BL).anchor(Place::CC);
//	groups[++i]<< fontView.stretch(1,1);
	groups[++i]<< (new Label("Horizontal"))->pos(Place::BL).anchor(Place::CC);
	groups[  i]<< (new Label("Vertical", true))->pos(Place::BR,-16,0).anchor(Place::CC);
	groups[++i]<< nd1.pos(Place::BL).anchor(Place::CC);
	groups[  i]<< nd2.showSign(false).pos(Place::TL, 0, 4).anchor(Place::CC);
	groups[++i]<< sl1H.pos(Place::BL).anchor(Place::CC);
	groups[  i]<< sl1V.pos(Place::BR, -4,0).anchor(Place::CC);
	groups[  i]<< sl1HS.pos(Place::BL).anchor(Place::CC); sl1HS.top(sl1H.bottom()+4);
	groups[  i]<< sl1VS.pos(Place::BR, -4,0).anchor(Place::CC); sl1VS.right(sl1V.left()-4);
	groups[++i]<< sl2.pos(Place::BL).anchor(Place::CC);
	groups[++i]<< sg3.pos(Place::BL).anchor(Place::CC);
	groups[  i]<< sg4.pos(Place::TL, 0, 4).anchor(Place::CC);
	groups[++i]<< slRH.pos(Place::BL).anchor(Place::CC);
	groups[  i]<< slRV.pos(Place::BR, -4,0).anchor(Place::CC);
	groups[++i]<< sliders1.pos(Place::BR).anchor(Place::CC); 
	groups[  i]<< sliders2.pos(Place::BL, 4,0).anchor(Place::CC);
	groups[++i]<< table.pos(Place::BC).anchor(Place::CC);
	groups[++i]<< plotXY.pos(Place::BL).anchor(Place::CC);
	groups[  i]<< plotX.pos(Place::TL, 0,4).anchor(Place::CC);
	groups[  i]<< plotY.pos(Place::BR,-4,0).anchor(Place::CC);
	groups[++i]<< dplot.pos(Place::CC).anchor(Place::CC);
	groups[++i]<< tv1.pos(Place::CC, 0,0).anchor(Place::CC);
	groups[++i]<< v3D.pos(Place::CC, 0,0).anchor(Place::CC);

	float y = 1./(tabs.size()*2), dy=2*y;
	tabs << (new Label("Button"			))->anchor(0.5, y).pos(Place::CC); y+=dy;
//.........这里部分代码省略.........
开发者ID:alexesDev,项目名称:glv,代码行数:101,代码来源:widgets.cpp


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