Example #1
0
STDMETHODIMP CPDLayer::put_name(BSTR newVal)
{
	if (wcscmp(m_name, newVal))
	{
		m_name = newVal;
		FireOnChanged(NOTIFY_MODIFY, GetUnknown(), DISPID_UNKNOWN);
	}

	return S_OK;
}
Example #2
0
STDMETHODIMP CPDObjectSymbolInstance::setxy(double x, double y)
{
    m_x = x;
    m_y = y;

    CalculateBounds();

    FireOnChanged(NOTIFY_MODIFY, GetUnknown(), DISPID_UNKNOWN);

    return S_OK;
}
Example #3
0
STDMETHODIMP CPDLayer::put_color(OLE_COLOR newVal)
{
	if (m_color != newVal)
	{
		m_color = newVal;
		FireOnChanged(NOTIFY_MODIFY, GetUnknown(), DISPID_UNKNOWN);
//		if (m_pDocument) m_pDocument->Fire_LayerOptionsChanged(this);
	}

	return S_OK;
}
Example #4
0
STDMETHODIMP CPDPath::removeSubPaths()
{
	for (int i = m_subPaths.GetSize()-1; i >= 0; i--)
	{
		m_subPaths[i]->Unadvise(this);
		m_subPaths[i]->Release();
		m_subPaths.RemoveAt(i);
	}

	FireOnChanged(NOTIFY_MODIFY, GetUnknown(), DISPID_UNKNOWN);

	return S_OK;
}
Example #5
0
STDMETHODIMP CPDPath::insertPointAfter(long index, double x, double y, double x1, double y1, double x2, double y2)
{
	for (int nsubpath = 0; nsubpath < m_subPaths.GetSize(); nsubpath++)
	{
		long npoints = m_subPaths[nsubpath]->m_points.GetSize();
		if (index-npoints < 0) break;

		index -= npoints;
	}

	m_subPaths[nsubpath]->m_points.InsertAt(index+1, CBezierPoint(x, y, x1, y1, x2, y2));

	FireOnChanged(NOTIFY_MODIFY, m_subPaths[nsubpath]->GetUnknown(), DISPID_UNKNOWN);

	return S_OK;
}
Example #6
0
STDMETHODIMP TChaiXImpl::set_Scaled(VARIANT_BOOL Value)
{
  try
  {
    const DISPID dispid = 9;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->Scaled = Value;
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IActiveFormX);
  }
  return S_OK;
};
Example #7
0
STDMETHODIMP TGuideImpl::set_PixelsPerInch(long Value)
{
  try
  {
    const DISPID dispid = 7;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->PixelsPerInch = (int)(Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IGuide);
  }
  return S_OK;
};
Example #8
0
STDMETHODIMP TGuideImpl::set_HelpFile(BSTR Value)
{
  try
  {
    const DISPID dispid = 12;
    if (FireOnRequestEdit(dispid) == S_FALSE)
      return S_FALSE;
    m_VclCtl->HelpFile = AnsiString(Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IGuide);
  }
  return S_OK;
};
Example #9
0
STDMETHODIMP TGuideImpl::set_Visible(VARIANT_BOOL Value)
{
  try
  {
    const DISPID dispid = 1;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->Visible = Value;
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IGuide);
  }
  return S_OK;
};
Example #10
0
STDMETHODIMP TGuideImpl::set_Color(::OLE_COLOR Value)
{
  try
  {
    const DISPID dispid = -501;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->Color = (TColor)(Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IGuide);
  }
  return S_OK;
};
Example #11
0
STDMETHODIMP TGuideImpl::set_Font(IFontDisp* Value)
{
  try
  {
    const DISPID dispid = -512;
    if (FireOnRequestEdit(dispid) == S_FALSE)
      return S_FALSE;
    SetVclCtlProp(m_VclCtl->Font, Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IGuide);
  }
  return S_OK;
};
Example #12
0
STDMETHODIMP TGuideImpl::set_PrintScale(TxPrintScale Value)
{
  try
  {
    const DISPID dispid = 8;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->PrintScale = (TPrintScale)(Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IGuide);
  }
  return S_OK;
};
Example #13
0
STDMETHODIMP TGuideImpl::set_AxBorderStyle(TxActiveFormBorderStyle Value)
{
  try
  {
    const DISPID dispid = 4;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->AxBorderStyle = (TActiveFormBorderStyle)(Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IGuide);
  }
  return S_OK;
};
Example #14
0
STDMETHODIMP TChaiXImpl::set_Caption(BSTR Value)
{
  try
  {
    const DISPID dispid = -518;
    if (FireOnRequestEdit(dispid) == S_FALSE)
      return S_FALSE;
    m_VclCtl->Caption = AnsiString(Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IActiveFormX);
  }
  return S_OK;
};
Example #15
0
STDMETHODIMP TChaiXImpl::set_BorderWidth(long Value)
{
  try
  {
    const DISPID dispid = 5;
    if (FireOnRequestEdit(dispid) == S_FALSE)
     return S_FALSE;
    m_VclCtl->BorderWidth = (int)(Value);
    FireOnChanged(dispid);
  }
  catch(Exception &e)
  {
    return Error(e.Message.c_str(), IID_IActiveFormX);
  }
  return S_OK;
};
STDMETHODIMP CMyControl::put_MyTitle(BSTR newVal)
{
   // the DISPID for MyTitle in this example is 4
   DISPID dispID = 4;

   // make sure we can change the property
   if (FireOnRequestEdit(dispID) == S_FALSE)
      return S_FALSE;

   // store newVal in CComBstr member
   m_bstrMyTitle = newVal;

   // signal that the property has been changed
   FireOnChanged(dispID);

   return S_OK;
}
Example #17
0
STDMETHODIMP CPDPath::setPoint(long index, BezierPoint *point)
{
	if (point == NULL) return E_POINTER;

	for (int nsubpath = 0; nsubpath < m_subPaths.GetSize(); nsubpath++)
	{
		long npoints = m_subPaths[nsubpath]->m_points.GetSize();
		if (index-npoints < 0) break;

		index -= npoints;
	}

	m_subPaths[nsubpath]->m_points[index] = *point;

	FireOnChanged(NOTIFY_MODIFY, m_subPaths[nsubpath]->GetUnknown(), DISPID_UNKNOWN);

	return S_OK;
}
Example #18
0
STDMETHODIMP CPDPath::removeSubPathByIndex(long index, IPDSubPath **pVal)
{
	if (pVal == NULL) return E_POINTER;

	if (index >= 0 && index < m_subPaths.GetSize())
	{
		m_subPaths[index]->Unadvise(this);

		*pVal = m_subPaths[index];
		m_subPaths[index]->m_pOwnerPath = NULL;
		m_subPaths.RemoveAt(index);

		FireOnChanged(NOTIFY_REMOVE, *pVal, DISPID_UNKNOWN);
	}
	else
		*pVal = NULL;

	return S_OK;
}
Example #19
0
STDMETHODIMP CPDPath::transformPoints(IPDMatrix *matrix)
{
	if (matrix == NULL) return E_INVALIDARG;

	if (m_subPaths.GetSize() > 0)
	{
		for (int nsubpath = 0; nsubpath < m_subPaths.GetSize(); nsubpath++)
		{
			CPDSubPath* pSubPath = m_subPaths[nsubpath];
			int npoints = pSubPath->m_points.GetSize();

			for (int i = 0; i < npoints; i++)
			{
				matrix->transformBezierPoint(&pSubPath->m_points[i], &pSubPath->m_points[i]);
			}
		}

		FireOnChanged(NOTIFY_MODIFY, GetUnknown(), DISPID_UNKNOWN);
	}

	return S_OK;
}
Example #20
0
STDMETHODIMP CLabel::put_BitmapDigitFormat(enumBitmapDigitFormat newVal)
{
	m_digitFormat = newVal;

    if (m_digitFormat == Alphabets)
    {
        m_nLetterWidth = 5;
        m_nLetterHeight = 6;    
    }
    else
    {
        // 9 x 12
        m_nLetterWidth = 9;
        m_nLetterHeight = 12;  
    }
    
    LoadTextBitmap();

    if (m_bBooting == false)
    {
        put_Caption(m_strCaption);

        if (!m_nFreezeEvents)
        {
            if (FireOnRequestEdit(DISPID_DIGITFORMAT) == S_FALSE)
                return S_FALSE;
        }

        m_bRequiresSave = TRUE;         // Set dirty flag

        if (!m_nFreezeEvents)
            FireOnChanged(DISPID_DIGITFORMAT); // Notify container of change

        SendOnDataChange(NULL);         // Notify advise sinks of change
    }

	return S_OK;
}
Example #21
0
STDMETHODIMP CPDObjectFrame::removeObject(/*[in]*/ IPDObjectUnknown* object)
{
	if (object == m_content)
	{
		ATLASSERT(m_children->m_items.GetSize() == 1);
		ATLASSERT(object == m_children->m_items[0]);

		{
			CPDObjectImpl<IPDObject>* pObject = static_cast<CPDObjectImpl<IPDObject>*>(object);
			pObject->m_parent = NULL;
			pObject->detachFromSpread();
		}

		object->Release();

		m_content = NULL;
		m_children->m_items.RemoveAll();

		FireOnChanged(NOTIFY_REMOVE, object, DISPID_UNKNOWN);
	}

	return S_OK;
}
Example #22
0
STDMETHODIMP CPageDesignerApp::put_strokeOrFill(long newVal)
{
	m_strokeOrFill = newVal;
	FireOnChanged(NOTIFY_MODIFY, GetUnknown(), DISPID_UNKNOWN);
	return S_OK;
}
Example #23
0
STDMETHODIMP CLabel::put_Caption(BSTR newVal)
{
    if (m_hdcText == NULL)
	    LoadTextBitmap();

    m_strCaption = newVal;
    
    m_nLetterCount = m_strCaption.Length();
    
     // Notify property change
    if (!m_nFreezeEvents)
    {
        FireOnRequestEdit(DISPID_LABCAPTION);
    }

    m_bRequiresSave = TRUE;         // Set dirty flag

    if (!m_nFreezeEvents)
        FireOnChanged(DISPID_LABCAPTION); // Notify container of change

    SendOnDataChange(NULL);         // Notify advise sinks of change
    // ---------------

    if (m_nLetterCount == 0)
        return S_OK;
    
    FillRect(m_hdcMem, &m_rcPos, (HBRUSH) (COLOR_BTNFACE+1));

    for (int i=0;i<m_nLetterCount;i++)
    {
        WCHAR szChar[2] = {m_strCaption.m_str[i], '\0'};
        
        int iLetterIndex = 0;

        if (m_digitFormat == Numbers)
        {
            if (szChar[0] == ':')
                iLetterIndex = 11;
            else
            {
                iLetterIndex = szChar[0] - 48;

                if (_wtoi(szChar) == 0)
                {
                    iLetterIndex = 0;
                }
            }
        }
        else
        {
            if (islower(szChar[0]))
                iLetterIndex = szChar[0] - 97;
            else
                iLetterIndex = szChar[0] - 65;

            if (_wtoi(szChar) != 0)
            {
                iLetterIndex = 27;
            }
        }

        RECT rcLetter = GetLetterRect(iLetterIndex);

        // Draw letter onto the memory DC
        BitBlt(m_hdcMem, i * m_nLetterWidth, 0,
               m_nLetterWidth,
               m_nLetterHeight,
			   m_hdcText, 
               rcLetter.left,
               0,
               SRCCOPY);
    }
    
    if (IsWindow())
    {
        RedrawWindow();
//        FireViewChange();
    }

	return S_OK;
}
Example #24
0
STDMETHODIMP CPDPath::splitOnAnchor(long index, long* pRotateVal)
{
	long npoints;
	for (int nsubpath = 0; nsubpath < m_subPaths.GetSize(); nsubpath++)
	{
		npoints = m_subPaths[nsubpath]->m_points.GetSize();
		if (index-npoints < 0) break;

		index -= npoints;
	}

	if (m_subPaths[nsubpath]->m_closed)
	{
		m_subPaths[nsubpath]->m_points.RemoveAt(index);
		npoints--;

		for (int npt = index; npt < npoints; npt++)
		{
			CBezierPoint bpt = m_subPaths[nsubpath]->m_points[npoints-1];
			m_subPaths[nsubpath]->m_points.InsertAt(0, bpt);
			m_subPaths[nsubpath]->m_points.RemoveAt(npoints);
		}

		m_subPaths[nsubpath]->m_closed = VARIANT_FALSE;

		if (pRotateVal)
			*pRotateVal = npoints-index;
	}
	else
	{
		if (index+1 < npoints)
		{
			CComObject<CPDSubPath>* pSubPath;
			CComObject<CPDSubPath>::CreateInstance(&pSubPath);
			if (pSubPath)
			{
				for (int npt = index+1; npt < npoints; npt++)
				{
					CBezierPoint bpt = m_subPaths[nsubpath]->m_points[npt];
					pSubPath->m_points.Add(bpt);
				}

				insertSubPath(nsubpath+1, pSubPath);
			}
			else
				return E_FAIL;
		}

		m_subPaths[nsubpath]->m_points.SetSize(index);

		if (pRotateVal)
			*pRotateVal = 0;
	}

	if (m_subPaths[nsubpath]->m_points.GetSize() > 0)
	{
		FireOnChanged(NOTIFY_MODIFY, m_subPaths[nsubpath]->GetUnknown(), DISPID_UNKNOWN);
	}
	else
	{
		CComPtr<IPDSubPath> p;
		removeSubPathByIndex(nsubpath, &p);
	}

	return S_OK;
}