BOOL CCtrlGeneral::OnInitDialog() //------------------------------- { const CModSpecifications specs = m_sndFile.GetModSpecifications(); CModControlDlg::OnInitDialog(); // Song Title m_EditTitle.SetLimitText(specs.modNameLengthMax); m_SpinGlobalVol.SetRange(0, (short)(256 / GetGlobalVolumeFactor())); m_SpinSamplePA.SetRange(0, 2000); m_SpinVSTiVol.SetRange(0, 2000); m_SpinRestartPos.SetRange(0, 255); m_SliderGlobalVol.SetRange(0, MAX_SLIDER_GLOBAL_VOL); m_SliderVSTiVol.SetRange(0, MAX_SLIDER_VSTI_VOL); m_SliderSamplePreAmp.SetRange(0, MAX_SLIDER_SAMPLE_VOL); m_SpinTempo.SetRange(-10, 10); m_SliderTempo.SetLineSize(1); m_SliderTempo.SetPageSize(10); m_EditTempo.SubclassDlgItem(IDC_EDIT_TEMPO, this); m_EditTempo.AllowNegative(false); m_bEditsLocked = false; UpdateView(GeneralHint().ModType()); OnActivatePage(0); m_bInitialized = TRUE; return FALSE; }
//*************************************************************************************** void CBCGPToolBox::AdjustLayout () { CBCGPDockingControlBar::AdjustLayout (); CRect rectClient; GetClientRect (rectClient); m_wndOutlook.SetWindowPos (NULL, -1, -1, rectClient.Width (), rectClient.Height (), SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); int nActivePage = GetActivePage (); if (nActivePage >= 0) { OnActivatePage (nActivePage); } }
//**************************************************************************************** BOOL CBCGPToolBox::AddToolsPage (LPCTSTR lpszPageName, UINT uiBmpResID, int nImageWidth, const CStringList& lstLabels, CRuntimeClass* pPageClass, CRuntimeClass* pButtonClass) { ASSERT_VALID (this); ASSERT (GetSafeHwnd () != NULL); ASSERT (pPageClass != NULL); ASSERT (pPageClass->IsDerivedFrom (RUNTIME_CLASS (CBCGPToolBoxPage))); ASSERT (pButtonClass != NULL); ASSERT (pButtonClass->IsDerivedFrom (RUNTIME_CLASS (CBCGPToolBoxButton))); ASSERT (lpszPageName != NULL); CBCGPToolBoxPage* pPage = DYNAMIC_DOWNCAST ( CBCGPToolBoxPage, pPageClass->CreateObject ()); if (pPage == NULL) { ASSERT (FALSE); return FALSE; } CRect rectDummy (0, 0, 0, 0); pPage->Create (NULL, WS_VISIBLE | WS_CHILD, rectDummy, this, 0); pPage->SetWindowText (lpszPageName); if (!pPage->InitPage (uiBmpResID, nImageWidth, lstLabels, pButtonClass)) { delete pPage; return FALSE; } m_wndOutlook.AddTab (pPage, TRUE, TRUE, FALSE); pPage->m_pToolBox = this; OnActivatePage (m_wndOutlook.GetTabsNum () - 1); CBCGPGestureConfig gestureConfig; gestureConfig.EnablePan(TRUE, BCGP_GC_PAN_WITH_SINGLE_FINGER_VERTICALLY | BCGP_GC_PAN_WITH_GUTTER | BCGP_GC_PAN_WITH_INERTIA); bcgpGestureManager.SetGestureConfig(pPage->GetSafeHwnd(), gestureConfig); return TRUE; }
void CTabCtrlSSL::OnSelChange (NMHDR* pNMHDR, LRESULT* pResult) { int nIndex = GetCurSel (); if (nIndex == -1) return; // Show the new page. TabDelete tabDelete = m_tabs[nIndex]; CTabPageSSL* pDialog = tabDelete.pTabPage; if (pDialog != NULL) { ::SetFocus (m_hFocusWnd[nIndex]); CRect rect; GetClientRect (&rect); ResizeDialog (nIndex, rect.Width (), rect.Height ()); pDialog->ShowWindow (SW_SHOW); } // Notify derived classes that the selection has changed. OnActivatePage (nIndex, m_nPageIDs[nIndex]); *pResult = 0; }