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


C++ TextEdit::SetFont方法代码示例

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


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

示例1: GetWindow


//.........这里部分代码省略.........
            str->ReadResRef( CursorResRef );
            str->ReadWord( &CurCycle );
            str->ReadWord( &CurFrame );
            str->ReadWord( &PosX );
            str->ReadWord( &PosY );
            str->Seek( 4, GEM_CURRENT_POS );
            str->ReadResRef( FontResRef );
            str->Seek( 34, GEM_CURRENT_POS );
            str->ReadWord( &maxInput );
            Font* fnt = core->GetFont( FontResRef );

            AnimationFactory* bam = ( AnimationFactory* )
                                    gamedata->GetFactoryResource( CursorResRef,
                                            IE_BAM_CLASS_ID,
                                            IE_NORMAL );
            Sprite2D *cursor = NULL;
            if (bam) {
                cursor = bam->GetFrame( CurCycle, CurFrame );
            }

            ResourceHolder<ImageMgr> mos(BGMos);
            Sprite2D *img = NULL;
            if(mos) {
                img = mos->GetSprite2D();
            }

            TextEdit* te = new TextEdit( maxInput, PosX, PosY );
            te->ControlID = ControlID;
            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 );
        }
开发者ID:NickDaly,项目名称:GemRB-MultipleConfigs,代码行数:67,代码来源:CHUImporter.cpp

示例2: GetWindow


//.........这里部分代码省略.........
				str->ReadWord( &PosX );
				str->ReadWord( &PosY );
				//FIXME: I still don't know what to do with this point
				//Contrary to forum posts, it is definitely not a scrollbar ID
				str->ReadWord( &Pos2X );
				str->ReadWord( &Pos2Y );
				str->ReadResRef( FontResRef );
				//this field is still unknown or unused
				str->Seek( 2, GEM_CURRENT_POS );
				//This is really a text field, but apparently the original engine
				//always writes it over, and never uses it
				str->Read( Initial, 32 );
				Initial[32]=0;
				str->ReadWord( &maxInput );
				Font* fnt = core->GetFont( FontResRef );

				AnimationFactory* bam = ( AnimationFactory* )
					gamedata->GetFactoryResource( CursorResRef,
							IE_BAM_CLASS_ID,
							IE_NORMAL );
				Sprite2D *cursor = NULL;
				if (bam) {
					cursor = bam->GetFrame( CurCycle, CurFrame );
				}

				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:
开发者ID:OldSnapo,项目名称:gemrb,代码行数:67,代码来源:CHUImporter.cpp


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