예제 #1
0
cMsgBox::cMsgBox()
{
	m_type = WT_MSGBOX;
	m_nMBType = MBT_NOBTN;
	m_pMsg = NULL;
	m_pButton[0] = NULL;
	m_pButton[1] = NULL;
	m_dwMsgColor = 0x00ffffff;
	m_nDefaultBtn = -1;
	m_dwParam = 0;
	m_dwVisibleTime = 0;
	SetWH(
		200,
		115);
}
예제 #2
0
void C_Bitmap::SetImage(long ID)
{
	SetReady(0);
	if(Image_ == NULL)
	{
		Image_=new O_Output;
		Image_->SetOwner(this);
	}

	Image_->SetFlags(GetFlags());
	Image_->SetImage(ID);

	SetWH(Image_->GetW(),Image_->GetH());
	SetReady(1);
}
예제 #3
0
void C_Bitmap::SetImage(IMAGE_RSC *tmp)
{
	if(tmp == NULL)
		return;

	if(Image_ == NULL)
	{
		Image_=new O_Output;
		Image_->SetOwner(this);
	}

	Image_->SetFlags(GetFlags());
	Image_->SetImage(tmp);

	SetWH(Image_->GetW(),Image_->GetH());
	SetReady(1);
}
예제 #4
0
void C_Anim::SetAnim(long ID)
{
	SetReady(0);
	if(Anim_ == NULL)
	{
		Anim_=new O_Output;
		Anim_->SetOwner(this);
	}

	Anim_->SetFlags(GetFlags());
	Anim_->SetAnim(ID);

	if(Anim_->Ready())
	{
		SetWH(Anim_->GetW(),Anim_->GetH());
		SetReady(1);
	}
}
예제 #5
0
void O_Output::WordWrap()
{
	int idx=0, len=0,fontheight=0, linew=0, maxw=0;
	short count=0,lenstr=0;

	F4CSECTIONHANDLE *Leave=NULL;

	if(Owner_ && Owner_->Parent_)
		Leave=UI_Enter(Owner_->Parent_);

	if(Label_[0]) // pre-calc wordwrapping - 2 pass, 1st to figure out how many lines, 2nd to actually do it
	{
		idx=0;
		count=0;
		lenstr=(short)_tcsclen(Label_);//! 

		len=FitString(idx); 
		while((idx+len) < lenstr)
		{
			count++;
			idx += len;
			while(Label_[idx] == ' ' || Label_[idx] == '\n') // 2002-02-24 MODIFIED BY S.G. Skip '\n' as well since these will 'terminate' word wrapped line (like they should) and need to be skipped for the next one
				idx++;
			len=FitString(idx);
			linew=gFontList->StrWidth(Font_,&Label_[idx],len);  
			if(linew > maxw)
				maxw=linew;
		}
		if(count)
		{
			count++;
			if(WWCount_ && WWCount_ != count)
			{
				WWCount_=0;
				if(Wrap_)
					delete Wrap_;
				Wrap_=NULL;
			}
			WWCount_=count;
			if(!Wrap_)
				Wrap_=new WORDWRAP[WWCount_];

			fontheight=gFontList->GetHeight(Font_);
			idx=0;
			count=0;
			len=FitString(idx);
			linew=gFontList->StrWidth(Font_,&Label_[idx],len); 
			if(linew > maxw)
				maxw=linew;
			while((idx+len) < lenstr)
			{
				Wrap_[count].Index=(short)idx;				//! 
				Wrap_[count].Length=(short)len;				//! 
				Wrap_[count].y=(short)(count * fontheight);	//! 

				count++;
				idx+=len;
				while(Label_[idx] == ' ')
					idx++;
				len=FitString(idx);
				linew=gFontList->StrWidth(Font_,&Label_[idx],len);
				if(linew > maxw)
					maxw=linew;
			}
			Wrap_[count].Index	= (short)idx;					//! 
			Wrap_[count].Length	= (short)len;					//! 
			Wrap_[count].y		= (short)(count * fontheight);	//! 
		}
		else
		{
			WWCount_=0;
			if(Wrap_)
				delete Wrap_;
			Wrap_=NULL;
			count=0;
			maxw=gFontList->StrWidth(Font_,Label_);
		}
	}
	SetWH(maxw,(count+1)*gFontList->GetHeight(Font_));
	UI_Leave(Leave);
}