void CResizableGrip::UpdateGripPos() { // size-grip goes bottom right in the client area // (any right-to-left adjustment should go here) RECT rect; ::GetClientRect(m_hParent,&rect); rect.left = rect.right - m_sizeGrip.cx; rect.top = rect.bottom - m_sizeGrip.cy; // must stay below other children ::SetWindowPos(m_wndGrip,HWND_BOTTOM, rect.left, rect.top, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOREPOSITION); if ( ::IsZoomed(m_hParent) ) { ::EnableWindow(m_wndGrip, FALSE); ShowSizeGrip(FALSE); } else { ::EnableWindow(m_wndGrip, TRUE); ShowSizeGrip(TRUE); } }
void CDlgResizer::UpdateGripPos() { RECT rect; ::GetClientRect(m_hDlg, &rect); rect.left = rect.right - m_sizeGrip.cx; rect.top = rect.bottom - m_sizeGrip.cy; // must stay below other children ::SetWindowPos(m_wndGrip,HWND_BOTTOM, rect.left, rect.top, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOREPOSITION); // maximized windows cannot be resized if (::IsZoomed(m_hDlg)) { ::EnableWindow(m_wndGrip, FALSE); ShowSizeGrip(false); } else { ::EnableWindow(m_wndGrip, TRUE); ShowSizeGrip(true); } }
void CPaletteDefinitionDialog::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); ShowSizeGrip(FALSE); DDX_Control(pDX, IDC_CHOOSECOLORSTATIC, m_wndStaticColors); m_wndStaticColors.SetCallback(this); DDX_Control(pDX, IDC_PALETTECOLORS, m_wndStaticPalette); m_wndStaticPalette.SetCallback(this); // The tab control: DDX_Control(pDX, IDC_PALETTETAB, m_wndTab); for (int i = 0; i < 4; i++) { TCHAR szBuf[4]; StringCchPrintf(szBuf, ARRAYSIZE(szBuf), TEXT("%d"), i); m_wndTab.InsertItem(i, szBuf); } m_wndTab.SetCurSel(0); // Set first one active DDX_Control(pDX, IDC_CHECK1, m_wndCheck); DDX_Control(pDX, IDC_CHECK2, m_wndPreview); m_wndCheck.SetCheck(g_fChecked); m_wndPreview.SetCheck(g_fPreview); if (g_fPreview && _pCallbackWeak) { _pCallbackWeak->OnSomethingChanged(g_fChecked, _palette, _iCurPalette); } // Visuals DDX_Control(pDX, IDC_BUTTONADVANCED, m_wndAdvanced); DDX_Control(pDX, IDOK, m_wndOK); DDX_Control(pDX, IDCANCEL, m_wndCancel); }
void CResizableDialog::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW) return; // arrangement not needed if ((m_bShowGrip)||(!IsDwmCompositionEnabled())) { if (nType == SIZE_MAXIMIZED) HideSizeGrip(&m_dwGripTempState); else ShowSizeGrip(&m_dwGripTempState); // update grip and layout UpdateSizeGrip(); } if (IsDwmCompositionEnabled()) HideGrip(); ArrangeLayout(); // on Vista, the redrawing doesn't work right, so we have to work // around this by invalidating the whole dialog so the DWM recognizes // that it has to update the application window. Invalidate(); }
BOOL MBMessageBoxImpl::InitGrip() { CRect rect(0 , 0, m_sizeGrip.cx, m_sizeGrip.cy); BOOL bRet = m_wndGrip.Create(WS_CHILD | WS_CLIPSIBLINGS | SBS_SIZEGRIP, rect, this, 0); if (bRet) { // set a triangular window region CRgn rgnGrip, rgn; rgn.CreateRectRgn(0,0,1,1); rgnGrip.CreateRectRgnIndirect(&rect); for (int y=0; y<m_sizeGrip.cy; y++) { rgn.SetRectRgn(0, y, m_sizeGrip.cx-y, y+1); rgnGrip.CombineRgn(&rgnGrip, &rgn, RGN_DIFF); } m_wndGrip.SetWindowRgn((HRGN)rgnGrip.Detach(), FALSE); // subclass control ::SetProp(m_wndGrip, RSZ_GRIP_OBJ, (HANDLE)::GetWindowLong(m_wndGrip, GWL_WNDPROC)); ::SetWindowLong(m_wndGrip, GWL_WNDPROC, (LONG)GripWindowProc); // update pos UpdateGripPos(); ShowSizeGrip(); } return bRet; }
void CResizableFormView::OnSize(UINT nType, int cx, int cy) { CFormView::OnSize(nType, cx, cy); const CWnd* pParent = GetParentFrame(); // hide size grip when parent is maximized if (pParent->IsZoomed()) HideSizeGrip(&m_dwGripTempState, GHR_MAXIMIZED); else ShowSizeGrip(&m_dwGripTempState, GHR_MAXIMIZED); // hide size grip when there are scrollbars const CSize size = GetTotalSize(); if ((cx < size.cx || cy < size.cy) && (m_nMapMode >= 0)) HideSizeGrip(&m_dwGripTempState, GHR_SCROLLBAR); else ShowSizeGrip(&m_dwGripTempState, GHR_SCROLLBAR); // hide size grip when the parent frame window is not resizable // or the form is not bottom-right aligned (e.g. there's a statusbar) const DWORD dwStyle = pParent->GetStyle(); CRect rect, rectChild; GetWindowRect(rect); BOOL bCanResize = TRUE; // whether the grip can size the frame for (HWND hWndChild = ::GetWindow(m_hWnd, GW_HWNDFIRST); hWndChild != NULL; hWndChild = ::GetNextWindow(hWndChild, GW_HWNDNEXT)) { ::GetWindowRect(hWndChild, rectChild); //! @todo check RTL layouts! if (rectChild.right > rect.right || rectChild.bottom > rect.bottom) { bCanResize = FALSE; break; } } if ((dwStyle & WS_THICKFRAME) && bCanResize) ShowSizeGrip(&m_dwGripTempState, GHR_ALIGNMENT); else HideSizeGrip(&m_dwGripTempState, GHR_ALIGNMENT); // update grip and layout UpdateSizeGrip(); ArrangeLayout(); }
BOOL CChildDialog::OnInitDialog() { CResizableDialog::OnInitDialog(); ShowSizeGrip(FALSE); return TRUE; // return TRUE unless you set the focus to a control }
BOOL COFSNcDlg::OnInitDialog() { CResizableDialog::OnInitDialog(); ShowSizeGrip(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL PicCommandDialogBar::OnInitDialog() { BOOL fRet = __super::OnInitDialog(); // Set up anchoring for resize AddAnchor(IDC_LISTCOMMANDS, CPoint(0, 0), CPoint(100, 100)); // Hide the sizing grip ShowSizeGrip(FALSE); return fRet; }
BOOL CNewCompileDialog::OnInitDialog() { BOOL fRet = __super::OnInitDialog(); ShowSizeGrip(FALSE); _tables.Load(); // REVIEW: clean up theApp.GetResourceMap().GetAllScripts(_scripts); // Set the range of the progress control. m_wndProgress.SetRange32(0, (int)_scripts.size()); _nScript = 0; PostMessage(UWM_STARTCOMPILE, 0, 0); return fRet; }
void CNewScriptDialog::DoDataExchange(CDataExchange* pDX) { __super::DoDataExchange(pDX); ShowSizeGrip(FALSE); // Visuals DDX_Control(pDX, IDOK, m_wndOk); DDX_Control(pDX, IDCANCEL, m_wndCancel); _AttachControls(pDX); _PrepareDialog(); }
void CChildFormView::OnInitialUpdate() { CFormView::OnInitialUpdate(); ShowSizeGrip(FALSE); m_SpinPosition.SetRange(0,20); m_chkHideTextOnDisabledPanes.SetCheck(0); OnHideTextOnDisabledPanes(); m_bInitComplete = true; m_wndRadioText.SetCheck( TRUE ); CheckControls(); }
void CResizableFormView::OnSize(UINT nType, int cx, int cy) { CFormView::OnSize(nType, cx, cy); CWnd* pParent = GetParent(); // hide zise grip when parent is maximized if (pParent->IsZoomed()) HideSizeGrip(&m_dwGripTempState, GHR_MAXIMIZED); else ShowSizeGrip(&m_dwGripTempState, GHR_MAXIMIZED); // hide size grip when there are scrollbars CSize size = GetTotalSize(); if (cx < size.cx || cy < size.cy) HideSizeGrip(&m_dwGripTempState, GHR_SCROLLBAR); else ShowSizeGrip(&m_dwGripTempState, GHR_SCROLLBAR); // hide size grip when the parent window is not resizable // or the form is not bottom-right aligned (e.g. there's a statusbar) DWORD dwStyle = pParent->GetStyle(); CRect rectParent, rectChild; GetWindowRect(rectChild); ::MapWindowPoints(NULL, pParent->GetSafeHwnd(), (LPPOINT)&rectChild, 2); pParent->GetClientRect(rectParent); if (!(dwStyle & WS_THICKFRAME) || (rectChild.BottomRight() != rectParent.BottomRight())) HideSizeGrip(&m_dwGripTempState, GHR_ALIGNMENT); else ShowSizeGrip(&m_dwGripTempState, GHR_ALIGNMENT); // update grip and layout UpdateSizeGrip(); ArrangeLayout(); }
void CVocabAutoCompleteDialog::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); if (!_fInited) { _fInited = true; ShowSizeGrip(FALSE); DDX_Control(pDX, IDC_WORD, m_wndEditWord); m_wndEditWord.SetWindowText(_strWord); DDX_Control(pDX, IDC_EDITAC, m_wndEdit); HWND hwndEdit = m_wndEdit.GetSafeHwnd(); if (SUCCEEDED(_hrCoCreate)) { IAutoComplete *pac; if (SUCCEEDED(CoCreateInstance(CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, IID_IAutoComplete, (void**)&pac))) { IUnknown *pSource; if (SUCCEEDED(CWordEnumString_CreateInstance(IID_IUnknown, (void**)&pSource))) { if (SUCCEEDED(pac->Init(hwndEdit, pSource, NULL, NULL))) { IAutoComplete2 *pAC2; if (SUCCEEDED(pac->QueryInterface(IID_IAutoComplete2, (void**)&pAC2))) { if (appState->_fUseAutoSuggest) { pAC2->SetOptions(ACO_AUTOSUGGEST); } pAC2->Release(); } } pSource->Release(); } pac->Release(); } } // Visuals DDX_Control(pDX, IDOK, m_wndOk); DDX_Control(pDX, IDCANCEL, m_wndCancel); DDX_Control(pDX, IDC_STATIC1, m_wndStatic1); DDX_Control(pDX, IDC_STATIC2, m_wndStatic2); } }
BOOL CResizableGrip::InitGrip(HWND hParent) { m_hParent = hParent; RECT rect = { 0 , 0, m_sizeGrip.cx, m_sizeGrip.cy }; m_wndGrip = ::CreateWindowEx(0, _T("SCROLLBAR"), (LPTSTR)NULL, WS_CHILD | WS_CLIPSIBLINGS | SBS_SIZEGRIP, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, hParent, (HMENU)0, NULL, NULL); if (m_wndGrip) { // set a triangular window region HRGN rgnGrip, rgn; rgn = ::CreateRectRgn(0,0,1,1); rgnGrip = ::CreateRectRgnIndirect(&rect); for (int y=0; y<m_sizeGrip.cy; y++) { ::SetRectRgn(rgn, 0, y, m_sizeGrip.cx-y, y+1); ::CombineRgn(rgnGrip, rgnGrip, rgn, RGN_DIFF); } ::SetWindowRgn(m_wndGrip, rgnGrip, FALSE); // subclass control ::SetProp(m_wndGrip, RSZ_GRIP_OBJ, (HANDLE)::GetWindowLong(m_wndGrip, GWL_WNDPROC)); ::SetWindowLong(m_wndGrip, GWL_WNDPROC, (LONG)GripWindowProc); // force dialog styles (RESIZABLE BORDER, NO FLICKERING) ::SetWindowLong(hParent, GWL_STYLE, ::GetWindowLong(hParent, GWL_STYLE) | WS_THICKFRAME | WS_CLIPCHILDREN); // update pos UpdateGripPos(); ShowSizeGrip(); } return m_wndGrip!=NULL; }
void CResizableDialog::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW) return; // arrangement not needed if (nType == SIZE_MAXIMIZED) HideSizeGrip(&m_dwGripTempState); else ShowSizeGrip(&m_dwGripTempState); // update grip and layout UpdateSizeGrip(); ArrangeLayout(); }
void CPreferencesDialog::DoDataExchange(CDataExchange* pDX) { __super::DoDataExchange(pDX); ShowSizeGrip(FALSE); DDX_Check(pDX, IDC_DRAWGRIDLINES, theApp._fGridLines); DDX_Check(pDX, IDC_SCALETRACINGIMAGES, theApp._fScaleTracingImages); DDX_Check(pDX, IDC_CHECKAUTOSUGGEST, theApp._fUseAutoSuggest); DDX_Check(pDX, IDC_CHECKAUTOLOADGAME, theApp._fAutoLoadGame); DDX_Check(pDX, IDC_CHECKDUPENEWCELS, theApp._fDupeNewCels); DDX_Check(pDX, IDC_CHECKUSEBOXEGO, theApp._fUseBoxEgo); DDX_Check(pDX, IDC_CHECKSCI01, theApp._fSCI01); DDX_Check(pDX, IDC_BROWSEINFO, theApp._fBrowseInfo); DDX_Check(pDX, IDC_PARAMINFO, theApp._fParamInfo); DDX_Check(pDX, IDC_CODECOMPLETION, theApp._fCodeCompletion); DDX_Check(pDX, IDC_HOVERTIPS, theApp._fHoverTips); DDX_Check(pDX, IDC_COMPILEERRORSOUND, theApp._fPlayCompileErrorSound); DDX_Text(pDX, IDC_FAKEEGOX, theApp._cxFakeEgo); DDV_MinMaxInt(pDX, theApp._cxFakeEgo, 10, 80); DDX_Text(pDX, IDC_FAKEEGOY, theApp._cyFakeEgo); DDV_MinMaxInt(pDX, theApp._cyFakeEgo, 10, 80); DDX_Control(pDX, IDC_COMBO_MIDIDEVICE, m_wndMIDIDevices); // Visuals DDX_Control(pDX, IDC_BROWSEINFO, m_wndBrowserInfo); DDX_Control(pDX, IDC_CODECOMPLETION, m_wndCodeCompletion); DDX_Control(pDX, IDC_PARAMINFO, m_wndParamInfo); DDX_Control(pDX, IDC_HOVERTIPS, m_wndHoverTips); DDX_Control(pDX, IDC_GROUP1, m_wndGroup1); DDX_Control(pDX, IDC_SCALETRACINGIMAGES, m_wndCheck1); DDX_Control(pDX, IDC_DRAWGRIDLINES, m_wndCheck2); DDX_Control(pDX, IDC_CHECKAUTOSUGGEST, m_wndCheck3); DDX_Control(pDX, IDC_CHECKAUTOLOADGAME, m_wndCheck4); DDX_Control(pDX, IDC_CHECKDUPENEWCELS, m_wndCheck5); DDX_Control(pDX, IDC_CHECKUSEBOXEGO, m_wndCheck6); DDX_Control(pDX, IDC_CHECKSCI01, m_wndCheck7); DDX_Control(pDX, IDC_COMPILEERRORSOUND, m_wndCheck8); DDX_Control(pDX, IDOK, m_wndOk); DDX_Control(pDX, IDCANCEL, m_wndCancel); DDX_Control(pDX, IDC_STATIC1, m_wndStatic1); _SyncBrowseInfo(); }
BOOL CFileAndFolder::OnInitDialog() { // m_Tree.SubclassDlgItem(IDC_TREE, this); CDialog::OnInitDialog(); m_Tree.SetImageList(&m_SystemImageList.GetImageList(), TVSIL_NORMAL); ReadCachedDrives(); OnViewCachedDrives(); ShowDefault(); InitGrip(); ShowSizeGrip(TRUE); m_Msg.SetWindowText(m_msg); SetWindowText(m_title); m_sSelections.RemoveAll(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CFileDescriptioDlg::OnInitDialog() { CResizableDialog::OnInitDialog(); m_ctrlDescription.SetReadOnly(m_bReadOnlyMode); if(m_bReadOnlyMode) { m_btnSend.SetWindowText(GetString(IDS_CLOSE_BTN_NAME)); } ShowSizeGrip(TRUE); // m_Close.SetAutoPressed(TRUE); // m_Close.SetCanStayPressed(FALSE); // m_Ok.SetAutoPressed(TRUE); // m_Ok.SetCanStayPressed(FALSE); // m_FileName.SetTextColor(0xffffff); // m_FileName.SetTransparent(TRUE); // CRect winRect; // GetClientRect(&winRect); // m_FileName.SetWindowPos(NULL,18,43,winRect.Width()-36,16,SWP_NOZORDER|SWP_NOACTIVATE); // LoadSkin(); AddAnchor(m_FileName.GetSafeHwnd(), CSize(0, 0), CSize(100, 0)); AddAnchor(m_ctrlDescription.GetSafeHwnd(), CSize(0, 0), CSize(100, 100)); AddAnchor(m_btnSend.GetSafeHwnd(), CSize(100, 100), CSize(100, 100)); CString strRect = GetOptionString(IDS_OFSMESSENGER, IDS_FILE_DESCRIPTION, _T("")); if(!strRect.IsEmpty()) { CRect rWindow = StringToRect(strRect); FitRectToWindow(rWindow); SetWindowPos(NULL,rWindow.left,rWindow.top,rWindow.Width(),rWindow.Height(),SWP_NOZORDER|SWP_NOACTIVATE); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CDlgResizer::Init(HWND hWndDlg) { m_hDlg = hWndDlg; GetClientRect(hWndDlg, &m_dlgRect); GetWindowRect(hWndDlg, &m_dlgRectScreen); OffsetRect(&m_dlgRectScreen, -m_dlgRectScreen.left, -m_dlgRectScreen.top); m_sizeGrip.cx = GetSystemMetrics(SM_CXVSCROLL); m_sizeGrip.cy = GetSystemMetrics(SM_CYHSCROLL); RECT rect = { 0 , 0, m_sizeGrip.cx, m_sizeGrip.cy }; m_wndGrip = ::CreateWindowEx(0, _T("SCROLLBAR"), (LPCTSTR)NULL, WS_CHILD | WS_CLIPSIBLINGS | SBS_SIZEGRIP, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, m_hDlg, (HMENU)0, NULL, NULL); if (m_wndGrip) { // set a triangular window region HRGN rgnGrip, rgn; rgn = ::CreateRectRgn(0,0,1,1); rgnGrip = ::CreateRectRgnIndirect(&rect); for (int y=0; y<m_sizeGrip.cy; y++) { ::SetRectRgn(rgn, 0, y, m_sizeGrip.cx-y, y+1); ::CombineRgn(rgnGrip, rgnGrip, rgn, RGN_DIFF); } ::SetWindowRgn(m_wndGrip, rgnGrip, FALSE); // update pos UpdateGripPos(); ShowSizeGrip(); } }
void CResizableSheetEx::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW) return; // arrangement not needed if (nType == SIZE_MAXIMIZED) HideSizeGrip(&m_dwGripTempState); else ShowSizeGrip(&m_dwGripTempState); // update grip and layout UpdateSizeGrip(); ArrangeLayout(); if (IsWizard97()) { // refresh header area CRect rect; GetHeaderRect(rect); InvalidateRect(rect, FALSE); } }
BOOL CFileExplore::OnInitDialog() { CResizableDialog::OnInitDialog(); //m_CheckHeader.Create(IDB_TRAYSTATUS_BITMAP,16,0,0xFF00FF); //m_FileList.GetHeaderCtrl()->SetImageList(&m_CheckHeader); m_SortHeader.SubclassWindow(m_FileList.GetHeaderCtrl()->GetSafeHwnd()); m_iSortingMode = GetOptionInt(IDS_OFSMESSENGER,IDS_FILEL,1); m_hSplitter = AfxGetApp()->LoadCursor(IDC_SPLITH); ShowSizeGrip(FALSE); //m_FileList.SetExtendedStyle (m_FileList.GetExtendedStyle ()|LVS_EX_FULLROWSELECT); m_FileList.SetImageList(CImageList::FromHandle(GetSystemImageList(TRUE)),LVSIL_SMALL); CString strSection = GetString(IDS_OFSMESSENGER); CString strEntry = GetString(IDS_COLUMN_WIDTH); m_FileList.InsertColumn(0,GetString(IDS_FILENAME_NAME),LVCFMT_LEFT,AfxGetApp()->GetProfileInt(strSection, strEntry+_T("30"), 150)); m_FileList.InsertColumn(1,GetString(IDS_FILESIZE_NAME),LVCFMT_RIGHT,AfxGetApp()->GetProfileInt(strSection, strEntry+_T("33"), 80),3); m_FileList.InsertColumn(2,GetString(IDS_FILETYPE_NAME),LVCFMT_LEFT,AfxGetApp()->GetProfileInt(strSection, strEntry+_T("32"), 130),2); m_FileList.InsertColumn(3,GetString(IDS_FILEMODIFIED_NAME),LVCFMT_LEFT,AfxGetApp()->GetProfileInt(strSection, strEntry+_T("31"), 125),1); m_DirTree.SetImageList(CImageList::FromHandle(GetSystemImageList(TRUE)),TVSIL_NORMAL); //m_hRoot = CreateTreeItem(TVI_ROOT,GetString(IDS_MYDOCUMENTS)); //LoadTreeByPath(m_hRoot,m_strStartFolder); //m_DirTree.Expand(m_hRoot,TVE_EXPAND); /* CString strDefaultPath = GetDefaultPath(); CString strPathAddon = GetStartFolder(); while(!strDefaultPath.IsEmpty()) { int Pos = strDefaultPath.Find(_T('\\')); if(Pos==-1) { strPathAddon += _T('\\')+strDefaultPath; } else { strPathAddon += _T('\\')+strDefaultPath.Left(Pos); strDefaultPath = strDefaultPath.Mid(Pos+1); } LoadTreeByPath(m_hRoot,m_strStartFolder); }*/ AddAnchor(&m_DirTree,CSize(0,0),CSize(0,100)); AddAnchor(&m_VSplitter,CSize(0,0),CSize(0,100)); AddAnchor(&m_FileList,CSize(0,0),CSize(100,100)); HANDLE hHanle1 = GetProp(m_FileList.GetSafeHwnd(),(LPCTSTR)(DWORD)0xC01C); m_OleFileListDropTarget.Register(&m_FileList); m_OleDirTreeDropTarget.Register(&m_DirTree); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL MBMessageBoxImpl::OnInitDialog() { CDialog::OnInitDialog(); if (m_tabStop) { m_MessageBox.SetTabStops(m_tabStop); m_MessageBox2.SetTabStops(m_tabStop); } m_MessageBox.ShowWindow(SW_HIDE); m_MessageBox2.ShowWindow(SW_HIDE); CString title = MUZIKBROWZER; title += " " + m_title; SetWindowText(title); CString msg; msg = m_info; if (m_log) { logger.log(m_info); // msg += "\r\n\r\nThis message recorded in\r\n"; // msg += logger.location(); } m_MessageBox.SetWindowText(msg); m_MessageBox2.SetWindowText(msg); CRect maxrect; if (thePlayer && thePlayer->pconfig()) { LPLOGFONT lplf = thePlayer->config().getTitlesFont(); lplf->lfPitchAndFamily = FIXED_PITCH; // lplf->lfWeight = FW_LIGHT; // strcpy(lplf->lfFaceName,""); mfont.CreateFontIndirect(lplf); maxrect = thePlayer->getWindowRect(); } else { mfont.CreateFont( /* height */ 16, /* width */ 0, /* escapement */ 0, /* orientation */ 0, /* weight */ FW_LIGHT, /* italic */ FALSE, /* underline */ FALSE, /* strikeout */ 0, /* charset */ ANSI_CHARSET, /* outprecision */ OUT_CHARACTER_PRECIS, /* clipprecision */ CLIP_CHARACTER_PRECIS, /* quality */ DEFAULT_QUALITY, /* pitch and family */ FIXED_PITCH, /* facename */ 0 ); maxrect = CRect(0,0,640,480); } m_MessageBox.SetFont(&mfont); m_MessageBox2.SetFont(&mfont); CRect wrect,crect; GetClientRect(crect); GetWindowRect(wrect); m_MinWidth = wrect.Width(); m_MinHeight = wrect.Height(); resizeControls(); CRect cmrect,mbrect; CalcMsgRect(cmrect); if (m_MessageBoxPtr) { m_MessageBoxPtr->GetClientRect(mbrect); } int dw,dh; dw = wrect.Width() - mbrect.Width(); dh = wrect.Height() - mbrect.Height(); dw += 10; dh += 10; wrect.right = wrect.left + cmrect.Width() + dw; wrect.bottom = wrect.top + cmrect.Height() + dh; if (wrect.Width() > maxrect.Width()) wrect.right = wrect.left + (maxrect.Width() - 100); if (wrect.Height() > maxrect.Height()) wrect.bottom = wrect.top + (maxrect.Height() - 100); if (wrect.Width() < m_MinWidth ) { wrect.right = wrect.left + m_MinWidth ; } if (wrect.Height() < m_MinHeight) { wrect.bottom = wrect.top + m_MinHeight; } MoveWindow(wrect); resizeControls(); *m_Control = m_MessageBoxPtr; CWnd * ctrl = GetDlgItem(IDC_MESSAGEBOX_CANCEL); ctrl->EnableWindow(m_EnableCancel); if (!m_EnableCancel) ctrl->ShowWindow(SW_HIDE); InitGrip(); ShowSizeGrip(TRUE); return FALSE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CDemoDlg::OnRadio2() { ShowSizeGrip(&m_dwGripTempState); UpdateSizeGrip(); }
void MResizable::EnableResize(BOOL bEnableResize) { ShowSizeGrip(bEnableResize); ModifyParentStyle(bEnableResize); m_bResizeEnabled = bEnableResize; }