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 }
int CResizableDialog::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDialog::OnCreate(lpCreateStruct) == -1) return -1; // keep client area CRect rect; GetClientRect(&rect); // set resizable style ModifyStyle(DS_MODALFRAME, WS_POPUP | WS_THICKFRAME); // adjust size to reflect new style ::AdjustWindowRectEx(&rect, GetStyle(), ::IsMenu(GetMenu()->GetSafeHmenu()), GetExStyle()); SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), SWP_FRAMECHANGED| SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREPOSITION); if (!InitGrip()) return -1; return 0; }
void S9xInitInputDevices () { if (Settings.JoystickEnabled) { #ifdef GRIP_SUPPORT InitGrip (); if (grip_initialised) num_sidewinders = 0; else #endif #ifdef SIDEWINDER_SUPPORT { #ifdef GRIP_SUPPORT usleep (20000); #endif InitSidewinders (); } #else { /* empty */ } #endif #ifdef JOYSTICK_SUPPORT if (joystick_has_four_buttons) joy_type = JOY_TYPE_4BUTTON; else if (joystick_has_six_buttons) joy_type = JOY_TYPE_6BUTTON; else if (joystick_has_eight_buttons) joy_type = JOY_TYPE_8BUTTON; else joy_type = JOY_TYPE_2PADS; if (num_sidewinders == 0 && !grip_initialised) initialise_joystick (); #endif } }
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 }