User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.50 is out since Jan 1st 2022


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

built_in:seekbars

This is an old revision of the document!


Seekbars

(Information and examples taken from the DroidScript documentation)

Description

Create SeekBars using the CreateSeekBar method of the app object:

skb = app.CreateSeekBar( width, height );

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 'value' parameter in your callback function to get the position value of the SeekBar

Example

function OnStart()
{
  lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
 
  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 );
}

Methods

Some controls use the same methods.
For examples of the same methods look here.

Method Description
SeekBar.Destroy()
SeekBar.GetAbsHeight()
SeekBar.GetAbsWidth()
SeekBar.GetHeight()
SeekBar.GetPosition()
SeekBar.GetType()
SeekBar.GetValue()
SeekBar.GetVisibility()
SeekBar.GetWidth()
SeekBar.Release()
SeekBar.SetBackColor( color )
SeekBar.SetBackGradient( color1,color2,color3,p4,p5,p6,p7 )
SeekBar.SetBackGradientRadial( x,y,r,color1,color2,color3,p7 )
SeekBar.SetBackground( imagefile,options )
SeekBar.SetMargins( left,top,right,bottom )
SeekBar.SetMaxRate( ms )
SeekBar.SetOnTouch( callback )
SeekBar.SetPadding( width,height,top,bottom )
SeekBar.SetPosition( left,top,width,height )
SeekBar.SetRange( range )
SeekBar.SetScale( x,y )
SeekBar.SetSize( width,height )
SeekBar.SetValue( value )
SeekBar.SetVisibility( HideShow )

Sample

built_in/seekbars.1425811104.txt.gz · Last modified: 2015/03/08 18:38 (external edit)