void CSliderCtrlPage::OnFixed() { UpdateData(); // Fixes length of slider thumb when set ( ChangeCtrlStyle( TBS_FIXEDLENGTH, m_bFixed ); }
void CSliderCtrlPage::OnNothumb() { UpdateData(); // Removes thumb from slider control when set ChangeCtrlStyle( TBS_NOTHUMB, m_bNothumb ); }
void CSliderCtrlPage::OnNoticks() { UpdateData(); // Removes tick marks when set ChangeCtrlStyle( TBS_NOTICKS, m_bNoticks ); }
void CSliderCtrlPage::OnOrientation() { UpdateData(); // Obtain horz/vert place marker (static control) CWnd* pWnd = GetDlgItem( (0==m_iOrientation)?IDC_SLIDER_HORZPOS:IDC_SLIDER_VERTPOS ); CRect rect; pWnd->GetWindowRect( &rect ); ScreenToClient( &rect ); // Set slider control style ChangeCtrlStyle( TBS_HORZ, (0 == m_iOrientation) ); ChangeCtrlStyle( TBS_VERT, (1 == m_iOrientation) ); // Move control to horz/vert position m_Slider.SetWindowPos( NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER|SWP_SHOWWINDOW ); Invalidate(); }
void CSliderCtrlPage::OnEnablesel() { UpdateData(); ChangeCtrlStyle( TBS_ENABLESELRANGE, m_bEnablesel ); // Enable/disable edit controls GetDlgItem( IDC_SLIDER_SELRANGEFROM )->EnableWindow( m_bEnablesel ); GetDlgItem( IDC_SLIDER_SELRANGETO )->EnableWindow( m_bEnablesel ); if ( m_bEnablesel ) // Set selection range m_Slider.SetSelection( m_uiSelRangeFrom, m_uiSelRangeTo ); // Send TBM_SETSEL else // Clear selection range m_Slider.ClearSel( TRUE ); }
void CSliderCtrlPage::OnAutoticks() { UpdateData(); // Shows tick marks according to increment/frequency when set (default frequency is 1) ChangeCtrlStyle( TBS_AUTOTICKS, m_bAutoticks ); // Enable/disable edit controls GetDlgItem( IDC_SLIDER_TICKFREQ )->EnableWindow( m_bAutoticks ); if ( m_bAutoticks ) // Set tick marks with given frequency (1 = tick at every increment) m_Slider.SetTicFreq( m_uiTickFreq ); // Send TBM_SETTICFREQ - need TBS_AUTOTICKS else // Clear tick marks m_Slider.ClearTics( TRUE ); }
void CSliderCtrlPage::OnPoint() { UpdateData(); switch ( m_iTickpos ) { case 0: ChangeCtrlStyle( TBS_BOTH ); break; case 1: ChangeCtrlStyle( TBS_TOP ); // Same as TBS_LEFT ChangeCtrlStyle( TBS_BOTH, FALSE ); ChangeCtrlStyle( TBS_BOTTOM, FALSE ); break; case 2: ChangeCtrlStyle( TBS_BOTTOM ); // Same as TBS_RIGHT ChangeCtrlStyle( TBS_BOTH, FALSE ); ChangeCtrlStyle( TBS_TOP, FALSE ); break; default: break; } }
void CToolBarCtrlPage::OnAltdrag() { UpdateData(); ChangeCtrlStyle(TBSTYLE_ALTDRAG, m_bAltDrag); }