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; };
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; };
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; };
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; };
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; };
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; };
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; };
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; };
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; };
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; }
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; }
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; }