BOOL CBCGPControlRenderer::SmoothResize (double dblScale)
{
    if (dblScale <= 1. || !m_Bitmap.SmoothResize (dblScale))
    {
        return FALSE;
    }

    ResizeRect (m_Params.m_rectImage, dblScale);
    ResizeRect (m_Params.m_rectInter, dblScale);

    m_bIsScaled = TRUE;
    return TRUE;
}
예제 #2
0
void CLogiTextGate::Serialize(CArchive& ar)
   {
   ASSERT_VALID(this);

   CLogiGate::Serialize(ar);

   if (ar.IsStoring())
      {
      ar << m_iStyle;
      ar << m_csFileName;
      ar << m_pTextText;
      }
   else
      {
      ar >> m_iStyle;
      ar >> m_csFileName;
      ar >> m_pTextText;

      SetContacts();
      }

   //   CLogiGate::Serialize(ar);

   if (!ar.IsStoring())
      {
      ResizeRect();
      }
   }
void GUIEditMultiString::CalcCursorXY()
{
	InvalidateCursor();

	if(!GUIInputText::textBuffer)				return;

	if(!strCount)	
	{
		SetStartCursorPos();
		return;
	}

	if(isResizeable)
		ResizeRect();

	int32 symbolPos			=	currentPos;

	ParsedString *ps		=	(ParsedString *)(*parsedStrings.Begin());
	VList::Iterator iStr	=	parsedStrings.Begin();
	for(int32 yPos = 0; yPos < strCount; ++iStr, ++yPos)
	{
		ps				=	(ParsedString *)(*iStr);
		if(symbolPos	<	ps->count)
		{
			break;
		}
		else if(symbolPos == ps->count)
		{
			VList::Iterator usedStr	=	iStr;
			++usedStr, ++yPos;

			if(		yPos < strCount 
				&&	usedStr != parsedStrings.End() 
				&& isKeyDown )
			{
				ps				=	(ParsedString *)(*usedStr);
				symbolPos	=	0;
			}

			break;
		}
		symbolPos		-=	ps->count;
	}

	int32 strWidth		=	pFont->GetStringWidth(ps->pStr, ps->count);
	int32 width			=	pFont->GetStringWidth(ps->pStr, symbolPos);
	
	if(align & Font::EAP_RIGHT)
	{
		cursorX		=	ps->x - strWidth + width;
	}
	else if(align & Font::EAP_HCENTER)
	{
		cursorX		=	ps->x - (strWidth >> 1) + width;
	}
예제 #4
0
void CLogiTextGate::MoveTo(const CRect& position, CLogiView* pView)
   {

   CLogiObj::MoveTo(position, pView);

   SetContacts();
   ResizeRect();

   CLogiGate::MoveTo(position, pView);

   }
예제 #5
0
void CLogiTextGate::Animate(CLogiView* pView)
   {

   // Draw Device in its current state (BitMap ID held in GateID)

   if (m_iStyle == 1)
      {
      pView->InvalObj(this);
      ResizeRect();
      pView->InvalObj(this);
      }
   }
예제 #6
0
void CLogiTextGate::OnOpen(CLogiView* pView)
   {
   ASSERT_VALID(this);

   CTextDlg dlg;

   dlg.m_pTextText = m_pTextText;
   dlg.m_csFileName = m_csFileName;
   dlg.m_iStyle = m_iStyle;
   dlg.m_csPathName = pView->GetDocument()->GetPathName();

   if (dlg.DoModal() != IDOK) return;

   pView->GetDocument()->BeginManualEdit(this); // for undo system

   if (m_iStyle != dlg.m_iStyle)
      {
      for (int i=0;i<Contacts;i++)
         {
         if (Node[i] != m_pDocument->m_pAnodeNULL)
            {
            pView->MessageBox(L"Device cannot be connected when changing number of inputs", L"Error");
            return;
            }
         }

      for (int i=0;i<4;i++) Node[i] = m_pDocument->m_pAnodeNULL;
      }

   m_pTextText = dlg.m_pTextText;
   m_csFileName = dlg.m_csFileName;
   m_iStyle = dlg.m_iStyle;

   if (m_iStyle == 1)
      {
      Inputs = 4;
      }
   else
      {
      Inputs = 0;
      }

   Contacts = Outputs + Inputs;

   Invalidate();
   ResizeRect();
   Invalidate();

   SetContacts();
   m_pDocument->SetModifiedFlag();
   }
예제 #7
0
void CLogiTextGate::Initialize(CLogiView* pView, UINT iMode)
   {
   if (m_iStyle == 1)
      {
      m_bLoaded = FALSE;

      pView->InvalObj(this);
      ResizeRect();
      pView->InvalObj(this);

      for (int i=0;i<16;i++) m_pTextArray[i].Empty();

      CLogiGate::Initialize(pView, iMode);
      pView->GetDocument()->EventQueue.AddTail(this);
      }
   }
void GUIEditMultiString::SetText(const char16 * _pText)
{
	if(!_pText)	return;

	int32 strSize				=	Utils::WStrLen(_pText);

	FASSERT(strSize < GUIMultiString::bufferSize);

	Utils::WStrCpy(GUIMultiString::textBuffer, _pText);
	GUIMultiString::textSize	=	strSize;
	
	GUIInputText::SetText(GUIMultiString::textBuffer, GUIMultiString::textSize, GUIMultiString::bufferSize);
		
	yOffset						=	0;
	
	reparse = true;

	if(isResizeable)
		ResizeRect();


// 	if(!strCount && isResizeable)
// 	{
// 		int32 marginHeight = marginTop + marginBottom;
// 		int32 viewSize = marginHeight;
// 		ControlRect cr = GetControlRect();
// 
// 		int32 minHeight = marginHeight	+ pFont->GetHeight();
// 
// 		if(viewSize < minHeight)
// 			viewSize = minHeight;
// 
// 		if(cr.minDy != viewSize)
// 		{
// 			ResizeRect();
// 		}
// 	}
}