This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
built_in:seekbars [2014/09/17 18:48] stevegarman created |
built_in:seekbars [2016/09/18 17:47] 99.238.18.153 [Table] Added descriptions to SeekBar.SetScale and SeekBar.SetValue |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Seekbars ====== | ====== Seekbars ====== | ||
- | ===== Create | + | |
- | Create SeekBars using the CreateSeekBar method of the app object: | + | // |
+ | |||
+ | ===== Description | ||
+ | Create SeekBars using the **CreateSeekBar** method of the **[[built_in: | ||
< | < | ||
- | The SetRange method of the SeekBar object to sets the value range of the SeekBar and the SetValue method sets the current value. | + | The **SetRange** method of the SeekBar object to sets the value range of the SeekBar and the **SetValue** method sets the current value. |
+ | |||
+ | Use the **SetOnTouch** method of the SeekBar object to set the name of a function you want to be called when the SeekBar is touched. You can read the ' | ||
+ | |||
+ | ====Example==== | ||
+ | <code javascript> | ||
+ | function OnStart() | ||
+ | { | ||
+ | lay = app.CreateLayout( " | ||
+ | |||
+ | skb = app.CreateSeekBar( 0.8 ); | ||
+ | skb.SetRange( 1.0 ); | ||
+ | skb.SetValue( 0.5 ); | ||
+ | skb.SetOnTouch( skb_OnTouch ); | ||
+ | lay.AddChild( skb ); | ||
+ | |||
+ | app.AddLayout( lay ); | ||
+ | } | ||
+ | |||
+ | function skb_OnTouch( value ) | ||
+ | { | ||
+ | app.ShowPopup( "Value = " + value ); | ||
+ | } | ||
+ | </ | ||
- | Use the SetOnTouch method of the SeekBar object to set the name of a function you want to be called when the SeekBar is touched. You can read the ' | ||
===== Methods ===== | ===== Methods ===== | ||
- | ^Method ^Description ^ | + | Some controls use the same methods.\\ |
- | |skb.GetHeight| | | + | For examples of the **[[same methods]]** look here. |
- | |skb.GetValue| | | + | ^ Method |
- | |skb.GetVisibility| | | + | | SeekBar.Destroy() |
- | |skb.GetWidth| | | + | | SeekBar.GetAbsHeight() |
- | |skb.Release| | | + | | SeekBar.GetAbsWidth() |
- | |skb.SetBackColor| | | + | | SeekBar.GetHeight() | | |
- | |skb.SetBackGradient| | | + | | SeekBar.GetPosition() |
- | |skb.SetBackGradientRadial| |! | + | | SeekBar.GetType() |
- | |skb.SetBackground| | | + | | SeekBar.GetValue() |
- | |skb.SetMargins| | | + | | SeekBar.GetVisibility() | | |
- | |skb.SetMaxRate| | | + | | SeekBar.GetWidth() |
- | |skb.SetOnTouch| | | + | | SeekBar.Release() | | |
- | |skb.SetPadding| | | + | | SeekBar.SetBackColor( color ) | | |
- | |skb.SetPosition| | | + | | SeekBar.SetBackGradient( color1, |
- | |skb.SetRange| | | + | | SeekBar.SetBackGradientRadial( x, |
- | |skb.SetSize| | | + | | SeekBar.SetBackground( imagefile, |
- | |skb.SetValue| | | + | | SeekBar.SetMargins( left, |
- | |skb.SetVisibility | | | + | | SeekBar.SetMaxRate( ms ) |
+ | | SeekBar.SetOnTouch( callback ) | ||
+ | | SeekBar.SetPadding( width, | ||
+ | | SeekBar.SetPosition( left, | ||
+ | | SeekBar.SetRange( range ) | | | ||
+ | | SeekBar.SetScale( x,y ) | Multiplies the horizontal and vertical size of the seekbar by x and y respectively. | ||
+ | | SeekBar.SetSize( width, | ||
+ | | SeekBar.SetValue( value ) | Sets the value of the seekbar to the given value. If the given value is outside the seekbar' | ||
+ | | SeekBar.SetVisibility( HideShow ) | | | ||
+ | |||
+ | =====Sample===== | ||
+ | [[tips_tricks: |