Пример #1
0
void CSliderCtrlPage::OnFixed()
{
	UpdateData();

	// Fixes length of slider thumb when set (
	ChangeCtrlStyle( TBS_FIXEDLENGTH, m_bFixed );
}
Пример #2
0
void CSliderCtrlPage::OnNothumb()
{
	UpdateData();

	// Removes thumb from slider control when set
	ChangeCtrlStyle( TBS_NOTHUMB, m_bNothumb );
}
Пример #3
0
void CSliderCtrlPage::OnNoticks()
{
	UpdateData();

	// Removes tick marks when set
	ChangeCtrlStyle( TBS_NOTICKS, m_bNoticks );
}
Пример #4
0
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();
}
Пример #5
0
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 );
}
Пример #6
0
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 );
}
Пример #7
0
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;
	}
}
Пример #8
0
void CToolBarCtrlPage::OnAltdrag()
{
	UpdateData();
	ChangeCtrlStyle(TBSTYLE_ALTDRAG, m_bAltDrag);
}