Page 1 of 1

TrackBarGadget - Variable steps or ticks

Posted: Wed Jan 02, 2013 2:25 am
by IdeasVacuum
Currently, tick markers (if flagged), are placed at every step. This is often not very useful because they are too close together. It would be great if the number of tick marks displayed could be defined by a simple var, e.g. TotalTicks = 10.

Re: TrackBarGadget - Variable steps or ticks

Posted: Sun Apr 21, 2013 7:55 pm
by Joris
+1

Re: TrackBarGadget - Variable steps or ticks

Posted: Mon Apr 22, 2013 1:10 am
by buddymatkona
+1
Or with a new argument:

Code: Select all

TicStep = (BarMax - BarMin) / 5
Result = TrackBarGadget(#Gadget, x, y, Width, Height, BarMin, BarMax, TicStep [, Flags])

Re: TrackBarGadget - Variable steps or ticks

Posted: Mon Apr 22, 2013 1:05 pm
by MachineCode
IdeasVacuum wrote:Currently, tick markers (if flagged), are placed at every step.
Isn't that a Windows feature? I for one like to use arrow keys to advance back or forth every tick... it's counter-intuitive to move what you think is one single tick but it's really ten! No thanks.

Re: TrackBarGadget - Variable steps or ticks

Posted: Mon Apr 22, 2013 1:17 pm
by Joris
In the mean time (for windows only) :

Code: Select all

If OpenWindow(0,0,0,320,200,"CheckBoxGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
    h = TrackBarGadget(#PB_Any,270, 10, 20,170,0,1000,#PB_TrackBar_Vertical)  
   SetGadgetState(h, 800)   
   For a=50 To 1000 Step 50
      SendMessage_(GadgetID(h), #TBM_SETTIC, 0, a)
   Next
   
   ; SetWindowLong_(h, #GWL_STYLE, GetWindowLong_(h, #GWL_STYLE) | #TBS_LEFT)   
   
   h = TrackBarGadget(#PB_Any,20, 10, 200,27,0,1000)  
   SetGadgetState(h, 800)  
   For a=50 To 1000 Step 50
      SendMessage_(GadgetID(h), #TBM_SETTIC, 0, a)
   Next
   
   Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf

Re: TrackBarGadget - Variable steps or ticks

Posted: Wed Aug 15, 2018 8:13 pm
by Lebostein
Yeah. These every step ticks are very annoying...