ScrollBar for return value can not convert in v4.0[Resolved]

Just starting out? Need help? Post your questions and find answers here.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Something like this ?

Code: Select all

Procedure RealTimeScrollEvent(GadgetID,Pos) 
  ; Your stuff here, for each Scrollbar 
  Select GadgetID 
    
    Case GadgetID(1) ; Scrollbar 1 
      SetGadgetText(2,Str(Pos)) 
      
    Case GadgetID(3) ; Scrollbar 2 
      SetGadgetText(4,Str(Pos)) 
      
  EndSelect 
EndProcedure 

Procedure ScrollCallback(hwnd,msg,wParam,lParam) 
  ; dont change this procedure 
  Shared DK_OldScrollCallback 
  If ((msg = #WM_HSCROLL) Or (msg = #WM_VSCROLL)) And (wParam & $FFFF) = #SB_THUMBTRACK 
    RealTimeScrollEvent(lParam,(wParam >> 16) & $FFFF) 
  EndIf 
  If DK_OldScrollCallback 
    ProcedureReturn CallWindowProc_(DK_OldScrollCallback,hwnd,msg,wParam,lParam) 
  Else 
    ProcedureReturn 0 
  EndIf 
EndProcedure 

OpenWindow(0,200,200,200,200,"ScrollIt!",#PB_Window_SystemMenu) 
CreateGadgetList(WindowID(0)) 

ScrollBarGadget(1,20,20,15,160,1,1000,100,#PB_ScrollBar_Vertical) 
TextGadget(2,0,0,100,20,"1") 
ScrollBarGadget(3,40,20,100,15,1,8000,1) 
TextGadget(4,100,0,100,20,"1") 

DK_OldScrollCallback = SetWindowLong_(WindowID(0),#GWL_WNDPROC,@ScrollCallback()) 

Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

GNOZAL !!!

My hero :D

Like "A rideeeeeer goes out of the niiiiiiiiiight" (Un cavalieeeeeeeeeeeeer qui s'en va hors de la nuuuuuuuuuuuuit, ........)

A thousand thanks to you 8)
I love you :D

I wish you a very very good day.
ImageThe happiness is a road...
Not a destination
Post Reply