IFACEMETHODIMP CanvasTextFormat::put_FontWeight(ABI::Windows::UI::Text::FontWeight value) { return PropertyPut( value, &m_fontWeight, ThrowIfInvalidFontWeight); }
IFACEMETHODIMP CanvasTextFormat::put_FontSize(float value) { return PropertyPut( value, &m_fontSize, ThrowIfNegativeOrNan); }
IFACEMETHODIMP CanvasTextFormat::put_FontStyle(ABI::Windows::UI::Text::FontStyle value) { return PropertyPut( value, &m_fontStyle, ThrowIfInvalid<ABI::Windows::UI::Text::FontStyle>); }
IFACEMETHODIMP CanvasTextFormat::put_IncrementalTabStop(float value) { return PropertyPut( value, &m_incrementalTabStop, ThrowIfNegativeOrNan, &CanvasTextFormat::RealizeIncrementalTabStop); }
IFACEMETHODIMP CanvasTextFormat::put_FlowDirection(CanvasTextDirection value) { return PropertyPut( value, &m_flowDirection, ThrowIfInvalid<CanvasTextDirection>, &CanvasTextFormat::RealizeFlowDirection); }
IFACEMETHODIMP CanvasTextFormat::put_WordWrapping(CanvasWordWrapping value) { return PropertyPut( value, &m_wordWrapping, ThrowIfInvalid<CanvasWordWrapping>, &CanvasTextFormat::RealizeWordWrapping); }
IFACEMETHODIMP CanvasTextFormat::put_TrimmingDelimiter(HSTRING value) { return PropertyPut( value, &m_trimmingDelimiter, ThrowIfInvalidTrimmingDelimiter, &CanvasTextFormat::RealizeTrimming); }
IFACEMETHODIMP CanvasTextFormat::put_TrimmingDelimiterCount(int32_t value) { return PropertyPut( value, &m_trimmingDelimiterCount, ThrowIfNegative<int32_t>, &CanvasTextFormat::RealizeTrimming); }
IFACEMETHODIMP CanvasTextFormat::put_TrimmingGranularity(CanvasTextTrimmingGranularity value) { return PropertyPut( value, &m_trimmingGranularity, ThrowIfInvalid<CanvasTextTrimmingGranularity>, &CanvasTextFormat::RealizeTrimming); }
IFACEMETHODIMP CanvasTextFormat::put_ParagraphAlignment(ABI::Windows::UI::Text::ParagraphAlignment value) { return PropertyPut( value, &m_paragraphAlignment, ThrowIfInvalid<ABI::Windows::UI::Text::ParagraphAlignment>, &CanvasTextFormat::RealizeTextAlignment); }
IFACEMETHODIMP CanvasTextFormat::put_VerticalAlignment(CanvasVerticalAlignment value) { return PropertyPut( value, &m_verticalAlignment, ThrowIfInvalid<CanvasVerticalAlignment>, &CanvasTextFormat::RealizeParagraphAlignment); }
IFACEMETHODIMP CanvasTextFormat::put_LineSpacingMethod(CanvasLineSpacingMethod value) { return PropertyPut( value, &m_lineSpacingMethod, ThrowIfInvalid<CanvasLineSpacingMethod>, &CanvasTextFormat::RealizeLineSpacing); }
IFACEMETHODIMP CanvasTextFormat::put_LineSpacingBaseline(float value) { return PropertyPut( value, &m_lineSpacingBaseline, ThrowIfNan, &CanvasTextFormat::RealizeLineSpacing); }
IFACEMETHODIMP CanvasTextFormat::put_FontFamily(HSTRING value) { return PropertyPut( value, &m_fontFamilyName); }
IFACEMETHODIMP CanvasTextFormat::put_LocaleName(HSTRING value) { return PropertyPut( value, &m_localeName); }
HRESULT __declspec(nothrow) CanvasTextFormat::PropertyPut(T value, TT* dest, void(CanvasTextFormat::*realizer)()) { return PropertyPut(value, dest, [](T){}, realizer); }
STDMETHODIMP CBar::Attach(OLE_HANDLE hWndParentIn) { if (m_bStartedToolBars) return NOERROR; HWND hWndParent = (HWND)hWndParentIn; if (!IsWindow(hWndParent)) hWndParent = GetDockWindow(); else { m_fInPlaceActive = TRUE; m_bUserMode = 1; m_hWndDock = m_hWndParent = hWndParent; // Create an ActiveBar Window CRect rc; GetClientRect(hWndParent, &rc); m_Size = rc.Size(); if (NULL == m_hWnd) CreateInPlaceWindow(0, 0, FALSE); else SetWindowPos(m_hWnd, NULL, rc.left, rc.top, rc.Width(), rc.Height(), SWP_SHOWWINDOW|SWP_NOACTIVATE); } if (!hWndParent) return E_FAIL; if (AmbientUserMode() && IsWindow(hWndParent)) DragAcceptFiles(hWndParent, TRUE); if (GetAmbientProperty(DISPID_AMBIENT_BACKCOLOR, VT_I4, &m_ocAmbientBackColor)) OleTranslateColor(m_ocAmbientBackColor, NULL, &m_crAmbientBackColor); void* pPrevBar; HWND hWndMdi; TCHAR szBuffer[_MAX_PATH]; DWORD dwResult = GetModuleFileName(NULL, szBuffer, 255); if (dwResult > 0 && lstrlen(szBuffer) > 12 && 0 == lstrcmpi(szBuffer + lstrlen(szBuffer) - 12, _T("iexplore.exe"))) m_bIE = TRUE; const int nLen = 15; TCHAR szClassName[nLen]; if (AmbientUserMode()) { hWndMdi = ::GetWindow(hWndParent, GW_CHILD); if (hWndMdi) { MAKE_TCHARPTR_FROMWIDE(szWindowClass, m_bstrWindowClass); GetClassName(hWndMdi, szClassName, nLen); if (0 == lstrcmpi(szClassName, szWindowClass)) { // // Hook into the MDIClient Form // m_eAppType = eMDIForm; m_hWndMDIClient = hWndMdi; IOleControlSite* pControlSite; HRESULT hResult = m_pClientSite->QueryInterface(IID_IOleControlSite, (void**)&pControlSite); if (SUCCEEDED(hResult)) { LPDISPATCH pDispatch; hResult = pControlSite->GetExtendedControl(&pDispatch); pControlSite->Release(); if (SUCCEEDED(hResult)) { VARIANT vWidth; vWidth.vt = VT_I4; vWidth.lVal = 0; hResult = PropertyPut(pDispatch, L"Width", vWidth); pDispatch->Release(); } } if (AmbientUserMode()) DragAcceptFiles(m_hWndMDIClient, TRUE); if (GetGlobals().m_pmapBar->Lookup((LPVOID)m_hWndMDIClient, pPrevBar)) { TRACE2(1, _T("Window handle already entered Bar: %X hWnd: %X\n"), this, m_hWndMDIClient); return NOERROR; } GetGlobals().m_pmapBar->SetAt((LPVOID)m_hWndMDIClient,(LPVOID)this); m_pMDIClientProc = (WNDPROC)GetWindowLong(m_hWndMDIClient, GWL_WNDPROC); SetWindowLong(m_hWndMDIClient, GWL_WNDPROC, (LONG)MDIClientWindowProc); CacheSmButtonSize(); CRect rcWin; ::GetWindowRect(m_hWndMDIClient, &rcWin); m_nNewCustomizedFloatBandCounter = 0; m_ptNewCustomizedFloatBandPos.x = rcWin.left + 16; m_ptNewCustomizedFloatBandPos.y = rcWin.top + 16; } } } else { // // If we are in design mode check if we are on an MDI Form or not // GetClassName(hWndParent, szClassName, nLen); if (0 == lstrcmpi(szClassName, _T("ThunderMDIForm"))) m_eAppType = eMDIForm; } if (eMDIForm == m_eAppType) { // // Check if two activebars are present // if (GetGlobals().m_pmapBar->Lookup((LPVOID)hWndParent, pPrevBar)) { TRACE2(1, _T("Window handle already entered Bar: %X hWnd: %X\n"), this, hWndParent); return NOERROR; } // // Set the map and subclass the window procedure // GetGlobals().m_pmapBar->SetAt((LPVOID)hWndParent,(LPVOID)this); TRACE2(1, _T("Window handle entered Bar: %X hWnd: %X\n"), this, hWndParent); m_pMainProc = (WNDPROC)GetWindowLong(hWndParent, GWL_WNDPROC); SetWindowLong (hWndParent, GWL_WNDPROC, (LONG)FrameWindowProc); } else { if (VARIANT_TRUE == bpV1.m_vbAlignToForm) { m_eAppType = eSDIForm; // // Check if two activebars are present // if (GetGlobals().m_pmapBar->Lookup((LPVOID)hWndParent, pPrevBar)) { TRACE2(1, _T("Window handle already entered Bar: %X hWnd: %X\n"), this, hWndParent); return NOERROR; } // // Set the map and subclass the window procedure // GetGlobals().m_pmapBar->SetAt((LPVOID)hWndParent,(LPVOID)this); TRACE2(1, _T("Window handle entered Bar: %X hWnd: %X\n"), this, hWndParent); m_pMainProc = (WNDPROC)GetWindowLong(hWndParent, GWL_WNDPROC); SetWindowLong (hWndParent, GWL_WNDPROC, (LONG)FormWindowProc); CRect rcClient; if (GetClientRect(hWndParent, &rcClient) && m_pInPlaceSite) m_pInPlaceSite->OnPosRectChange(&rcClient); } else m_eAppType = eClientArea; CRect rcWin; GetWindowRect(hWndParent, &rcWin); m_nNewCustomizedFloatBandCounter = 0; m_ptNewCustomizedFloatBandPos.x = rcWin.left + 64; m_ptNewCustomizedFloatBandPos.y = rcWin.top + 64; } LPVOID pTmp; if (!GetGlobals().m_pmapAccelator->Lookup((LPVOID)hWndParent, (void*&)pTmp)) GetGlobals().m_pmapAccelator->SetAt(hWndParent, (LPVOID)this); m_bStartedToolBars = TRUE; return NOERROR; }