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


C++ TextArea::SetFonts方法代码示例

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


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

示例1: GetWindow


//.........这里部分代码省略.........
            te->XPos = XPos;
            te->YPos = YPos;
            te->Width = Width;
            te->Height = Height;
            te->ControlType = ControlType;
            te->SetFont( fnt );
            te->SetCursor( cursor );
            te->SetBackGround( img );
            win->AddControl( te );
        }
        break;

        case IE_GUI_TEXTAREA:
        {
            //Text Area
            ieResRef FontResRef, InitResRef;
            Color fore, init, back;
            ieWord SBID;
            str->ReadResRef( FontResRef );
            str->ReadResRef( InitResRef );
            Font* fnt = core->GetFont( FontResRef );
            Font* ini = core->GetFont( InitResRef );
            str->Read( &fore, 4 );
            str->Read( &init, 4 );
            str->Read( &back, 4 );
            str->ReadWord( &SBID );
            TextArea* ta = new TextArea( fore, init, back );
            ta->ControlID = ControlID;
            ta->XPos = XPos;
            ta->YPos = YPos;
            ta->Width = Width;
            ta->Height = Height;
            ta->ControlType = ControlType;
            ta->SetFonts( ini, fnt );
            win->AddControl( ta );
            if (SBID != 0xffff)
                win->Link( SBID, ( unsigned short ) ControlID );
        }
        break;

        case IE_GUI_LABEL:
        {
            //Label
            ieResRef FontResRef;
            ieStrRef StrRef;
            RevColor fore, back;
            ieWord alignment;
            str->ReadDword( &StrRef );
            str->ReadResRef( FontResRef );
            Font* fnt = core->GetFont( FontResRef );
            str->Read( &fore, 4 );
            str->Read( &back, 4 );
            str->ReadWord( &alignment );
            Label* lab = new Label( fnt );
            lab->ControlID = ControlID;
            lab->XPos = XPos;
            lab->YPos = YPos;
            lab->Width = Width;
            lab->Height = Height;
            lab->ControlType = ControlType;
            char* str = core->GetString( StrRef );
            lab->SetText( str );
            core->FreeString( str );
            if (alignment & 1) {
                lab->useRGB = true;
                Color f, b;
开发者ID:NickDaly,项目名称:GemRB-MultipleConfigs,代码行数:67,代码来源:CHUImporter.cpp

示例2: GetWindow


//.........这里部分代码省略.........
				ResourceHolder<ImageMgr> mos(BGMos);
				Sprite2D *img = NULL;
				if(mos) {
					img = mos->GetSprite2D();
				}

				TextEdit* te = new TextEdit( ctrlFrame, maxInput, PosX, PosY );
				te->ControlID = ControlID;
				te->SetFont( fnt );
				te->SetCursor( cursor );
				te->SetBackGround( img );
				//The original engine always seems to ignore this textfield
				//te->SetText (Initial );
				win->AddControl( te );
			}
			break;

			case IE_GUI_TEXTAREA:
			{
				//Text Area
				ieResRef FontResRef, InitResRef;
				Color fore, init, back;
				ieWord SBID;
				str->ReadResRef( FontResRef );
				str->ReadResRef( InitResRef );
				Font* fnt = core->GetFont( FontResRef );
				Font* ini = core->GetFont( InitResRef );
				str->Read( &fore, 4 );
				str->Read( &init, 4 );
				str->Read( &back, 4 );
				str->ReadWord( &SBID );
				TextArea* ta = new TextArea( ctrlFrame, fore, init, back );
				ta->ControlID = ControlID;
				ta->SetFonts( ini, fnt );
				win->AddControl( ta );
				if (SBID != 0xffff)
					win->Link( SBID, ( unsigned short ) ControlID );
			}
			break;

			case IE_GUI_LABEL:
			{
				//Label
				ieResRef FontResRef;
				ieStrRef StrRef;
				RevColor fore, back;
				ieWord alignment;
				str->ReadDword( &StrRef );
				str->ReadResRef( FontResRef );
				Font* fnt = core->GetFont( FontResRef );
				str->Read( &fore, 4 );
				str->Read( &back, 4 );
				str->ReadWord( &alignment );
				char* str = core->GetString( StrRef );
				Label* lab = new Label( ctrlFrame, fnt, str );
				core->FreeString( str );
				lab->ControlID = ControlID;

				if (alignment & 1) {
					lab->useRGB = true;
					Color f, b;
					f.r = fore.b;
					f.g = fore.g;
					f.b = fore.r;
					f.a = 0;
					b.r = back.b;
开发者ID:OldSnapo,项目名称:gemrb,代码行数:67,代码来源:CHUImporter.cpp


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