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


C++ CFont::GetWidth方法代码示例

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


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

示例1: DrawHelpText

void cAmp::DrawHelpText()									//  help  //
{
	CFont* cf = cfont[view.cfH];
	int Fy = cf->Fy;
	int y = /*(yBpt+100 > view.ySize) ? yBpl :*/ yB_pt+Fy,
		x1,x2, xt, t = 20;
	cf->Fs[' '] = cf->Fs['0']/2;
	cf->dir = 1;

	#define  sc(a)		cf->StrCopy(a)
	#define  wr(x,y)	cf->Write(x,y)
	#define  wR(x,y)	cf->Write(x,y);  cf->Write(x,y)
	#define  clr(r,g,b)  cf->Fclr = D3DXCOLOR(r,g,b,1)
	#define  X(a1,a2)  x1 = a1;  xt = x1+t;  x2 = x1 + a2;
	#pragma warning(disable: 4305)  // clr(0.7f

	clr(0.7,0.7,0.7);    sc("Keyboard help");  wr(20,y);  //y+=Fy;
	clr(0.8,0.8,0.9);    cf->Format("Page: %s %d/%d %s", hlpPg==0?"  ":"<", hlpPg+1,HelpPages, hlpPg==HelpPages-1?"  ":">");
	wr(view.xSize-110,y);  y+=Fy*3/2;	clr(1,1,1);
	
	sc(HPnames[hlpPg]);  int o=cf->GetWidth(); //center
	wr(view.xSize/2-o/2,y);  y = yB_pt+5*Fy;
	#define dark()  clr(0.75,0.85,0.95)
	
	switch (hlpPg)
	{
	case 0:  X(20,35);		//  Player basic
		clr(0.3,0.7,0.7);
		sc("Enter, RMB    Play from cursor  |>");	wR(x1,y);  y+=Fy*4/2;  clr(0.7,0.95,1);
		sc("Z");	wr(x1,y);  sc("Play     |>");	wr(x2,y);  y+=Fy;
		sc("X");	wr(x1,y);  sc("Pause   ||");	wr(x2,y);  y+=Fy;
		sc("C");	wr(x1,y);  sc("Stop    []");	wr(x2,y);  y+=Fy*3/2;  clr(0.95,1,1);
		
		sc("A");	wr(x1,y);  sc("Previous  |<");	wr(x2,y);  y+=Fy;
		sc("S");	wr(x1,y);  sc("Next        >|");	wr(x2,y);  y+=Fy;	dark();
			sc("alt- dec/inc playing track rating");	wr(xt,y);  y+=Fy;
			sc("ctrl- play prev/next playlist");		wr(xt,y);  y+=Fy*5/2;  clr(0.9,0.95,1);

		X(20,80,40);
		sc("Left   Q");		wr(x1,y);  sc("Backward  <<");	wr(x2,y);  y+=Fy;
		sc("Right  W");		wr(x1,y);  sc("Forward    >>");	wr(x2,y);  y+=Fy;    dark();
			sc("shift- small  ctrl- big");					wr(xt,y);  y+=Fy*2;  clr(0.8,0.8,1);
		X(20,100,40);
		sc("alt-Left   Q");	wr(x1,y);  sc("Volume Down  v");wr(x2,y);  y+=Fy;
		sc("alt-Right  W");	wr(x1,y);  sc("Volume Up  ^");	wr(x2,y);  y+=Fy*5/2;  clr(0.95,0.8,1.0);
		
		X(20,35,40);
		sc("R");	wr(x1,y);  sc("Repeat All    @A");		wr(x2,y);  y+=Fy;
		sc("1 T");	wr(x1,y);  sc("Repeat One  @1");		wr(x2,y);  y+=Fy*5/2;  clr(0.6,0.8,1.0);

		sc("F1");	wr(x1,y);  sc("show/hide Help");		wr(x2,y);  y+=Fy*2/2;
		x2=x1+60;	clr(0.3,0.6,0.8);
		sc("ctrl-F1");	wR(x1,y);  sc("Global Keys config");	wR(x2,y);  y+=Fy;
		sc("ctrl-F2");	wR(x1,y);  sc("Player Settings");		wR(x2,y);  y+=Fy;
		break;

	case 1:  t=15; X(20,50);		//  Mouse
		clr(0.4,0.8,0.8);
		sc("Left");									wR(x1,y);  y+=Fy;  clr(1,1,1);
		sc("at player-  change track position (seek)");	wr(xt,y);  y+=Fy*3/2;
		sc("at tabs-  change Tab");					wr(xt,y);  y+=Fy;
			sc("alt-  move Tab");					wr(xt+t,y);  y+=Fy*2/2;  dark();
			sc("dn/up buttons - change offset");	wr(xt+t,y);  y+=Fy;
			sc("ctrl- tab rows  shift- tab cols");	wr(xt+t,y);  y+=Fy*2;  clr(1,1,1);

		sc("at playlist-  pick track (cursor)");	wr(xt,y);  y+=Fy;  dark();
			sc("ctrl-  select/unselect one");		wr(xt+t,y);  y+=Fy;  clr(0.6,0.8,1.0);
			sc("shift-  select range");				wr(xt+t,y);  y+=Fy;
			sc("shift-ctrl-  unselect range");		wr(xt+t,y);  y+=Fy*2/2;  clr(1,0.9,0.8);
			sc("alt-  Move track/selection");		wr(xt+t,y);  y+=Fy*4/2;  clr(0.4,0.7,1.0);
			//  slider pls |

		sc("Right");								wR(x1,y);  y+=Fy;  clr(1,1,1);
		sc("at playlist-  Play track  |>");			wr(xt,y);  y+=Fy;  dark();
		sc("at player-   change rating");			wr(xt,y);  y+=Fy*3/2;  clr(0.4,0.6,1);
			sc("shift-         Move Window +");		wR(xt,y);  y+=Fy;
			sc("shift-ctrl-  Resize Window []");	wR(xt,y);  y+=Fy*5/2;  clr(0.7,0.6,1.0);
		
		sc("Wheel");								wR(x1,y);  y+=Fy;    clr(0.8,0.8,1);
		sc("at player-  change volume  ^v");		wr(xt,y);  y+=Fy;
		sc("at playlist-  scroll");					wr(xt,y);  y+=Fy;    dark();
			sc("shift- less  ctrl- more");			wr(xt+t,y);  y+=Fy*2;  clr(0.7,0.5,0.5);

		sc("Middle");								wR(x1,y);			 //clr(1,0.9,0.8);
		sc("joy scroll list");						wR(x2,y);  y+=Fy;    clr(0.9,0.8,1);
			sc("shift- change Visualization height");	wr(xt,y);  y+=Fy*2;  clr(0.35,0.5,0.8);
		break;

	case 2:  X(20,80);		//  Playlist basic
		sc("Up,Down");		wr(x1,y);
		sc("move cursor,  ctrl- x8");			wr(x2,y);  y+=Fy;	dark();
			sc("alt- move 1 track up/dn");		wr(xt,y);  y+=Fy;
			sc("alt-shift- to Top  alt-ctrl- to End");	wr(xt,y);  y+=Fy*3/2;	clr(1,1,1);
	
		sc("PgUp,PgDn");	wr(x1,y);
		sc("move page/4,  ctrl- page");						wr(x2,y);  y+=Fy;		dark();
			sc("alt- offset page  alt-ctrl- offset x8");	wr(xt,y);  y+=Fy*3/2;	clr(1,1,1);
		
		sc("Home,End");		wr(x1,y);
		sc("prev/next dir");						wr(x2,y);  y+=Fy;		dark();
//.........这里部分代码省略.........
开发者ID:cryham,项目名称:cAmp,代码行数:101,代码来源:Help.cpp


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