CSize NewGUI_Scale(const CSize& rSize, CWnd* pParentWindow) { CSize sNew; sNew.cx = NewGUI_Scale(rSize.cx, pParentWindow); sNew.cy = NewGUI_Scale(rSize.cy, pParentWindow); return sNew; }
void NewGUI_ConfigSideBanner(void *pBanner, void *pParentWnd) { CKCSideBannerWnd *p = (CKCSideBannerWnd *)pBanner; CWnd *pParent = (CWnd *)pParentWnd; ASSERT(pBanner != NULL); if(pBanner == NULL) return; ASSERT(pParentWnd != NULL); if(pParentWnd == NULL) return; p->Attach(pParent, KCSB_ATTACH_TOP); const int nSize = p->GetSize(); const int nNewSize = NewGUI_Scale(nSize, pParent); if(nNewSize != nSize) p->SetSize(nNewSize); const CSize sEdgeOffset = p->GetEdgeOffset(); CSize sNewEdgeOffset = NewGUI_Scale(sEdgeOffset, pParent); if(sNewEdgeOffset != sEdgeOffset) p->SetEdgeOffset(sNewEdgeOffset); const CSize sCaptionOffset = p->GetCaptionOffset(); CSize sNewCaptionOffset = NewGUI_Scale(sCaptionOffset, pParent); if(sNewCaptionOffset != sCaptionOffset) p->SetCaptionOffset(sNewCaptionOffset); p->SetColBkg(m_crBannerStart); p->SetColBkg2(m_crBannerEnd); p->SetColTxtTitle(m_crBannerText); p->SetColTxtCaption(m_crBannerText); p->SetColEdge(RGB(0, 0, 0)); if(m_bBannerFlip) p->SetSwapGradientDirection(true); if(m_pfBannerTitleFont != NULL) p->SetTitleFont(m_pfBannerTitleFont); else { LOGFONT lf; ZeroMemory(&lf, sizeof(LOGFONT)); p->GetTitleFont(&lf); lf.lfWeight = FW_BOLD; m_pfBannerTitleFont = new CFont(); VERIFY(m_pfBannerTitleFont->CreateFontIndirect(&lf)); p->SetTitleFont(m_pfBannerTitleFont); } }
BOOL CWindowGroups::ArrangeWindows(CWnd *pParentWindow) { int i; RECT rect = { 0, 0, 0, 0 }; const DWORD dwYStep = static_cast<DWORD>(NewGUI_Scale(WG_Y_STEP, pParentWindow)); CDWordArray aPos; aPos.RemoveAll(); const DWORD dwXOffset = static_cast<DWORD>(NewGUI_Scale(WG_OFFSET_LEFT, pParentWindow)); const DWORD dwYOffset = static_cast<DWORD>(NewGUI_Scale(WG_OFFSET_TOP, pParentWindow)); for(i = 0; i < m_aWindows.GetSize(); i++) aPos.Add(dwYOffset); for(i = 0; i < m_aWindows.GetSize(); i++) { if((m_aFlags.GetAt(i) & WGF_REPOSITION) == 0) continue; CWnd *p = (CWnd *)m_aWindows.GetAt(i); if(p != NULL) { p->GetWindowRect(&rect); rect.right = rect.right - rect.left; // Coords to sizes rect.bottom = rect.bottom - rect.top; } rect.top = (LONG)aPos.GetAt((int)m_aGroupIDs.GetAt(i)); rect.left = dwXOffset; if(p != NULL) p->MoveWindow(rect.left, rect.top, rect.right, rect.bottom, TRUE); aPos.SetAt((int)m_aGroupIDs.GetAt(i), (DWORD)rect.top + dwYStep); } aPos.RemoveAll(); return TRUE; }