TrackBarGadget - Variable steps or ticks

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

TrackBarGadget - Variable steps or ticks

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: TrackBarGadget - Variable steps or ticks

Post by Joris »

+1
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
buddymatkona
Enthusiast
Enthusiast
Posts: 252
Joined: Mon Aug 16, 2010 4:29 am

Re: TrackBarGadget - Variable steps or ticks

Post 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])
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: TrackBarGadget - Variable steps or ticks

Post 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.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Joris
Addict
Addict
Posts: 885
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: TrackBarGadget - Variable steps or ticks

Post 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
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Re: TrackBarGadget - Variable steps or ticks

Post by Lebostein »

Yeah. These every step ticks are very annoying...
Post Reply