int MakeControlScrollbar ( int iControlID, int iStyle, int iExtendedStyle, int iX, int iY, int iWidth, int iHeight ) { // Assign the style DWORD dwExtendedStyle = GetExtendedStyle ( iExtendedStyle ); DWORD dwSelectStyle = SBS_VERT; switch ( iStyle ) { case 1 : dwSelectStyle = SBS_HORZ; break; case 2 : dwSelectStyle = SBS_VERT; break; } // Create control MaintainGlobalHWND(); if ( !CreateControl ( iControlID, g_pGlob->hWnd, "SCROLLBAR", dwExtendedStyle, dwSelectStyle, "", iX, iY, iWidth, iHeight ) ) return 0; // Subclass to get access to all control messages directly g_pControls [ iControlID ].lOriginalWinProc = SetWindowLong ( g_pControls [ iControlID ].hWnd, GWL_WNDPROC, (LONG)SubClassControlWinProc ); // Setup control SetScrollBarRange ( iControlID, 0, 0 ); SetScrollBarPosition ( iControlID, 0 ); // Update safe rects after new addition UpdateSafeRectsArray(); // Success return 1; }
//=========================================================================== void __fastcall CChart::SetChartTime(double aTimeScale) { fChartTime = aTimeScale * 10.0; SetScrollBarPosition(0); // ------------ SetStorageParam(fCanals); }
void SetControlPosition ( int iControlID, int iPosition ) { switch ( g_pControls[iControlID].sType ) { case WINCONTROL_PROGRESS : SetProgressPosition ( iControlID, iPosition ); break; case WINCONTROL_SLIDER : SetSliderPosition ( iControlID, iPosition ); break; case WINCONTROL_SCROLLBAR : SetScrollBarPosition ( iControlID, iPosition ); break; } }