Navigation:  Reference > Form Objects >

TGauge

Print this Topic Previous pageReturn to chapter overviewNext page

This object can give the user a visible idea of how close a process is to completion the object is like the TProgressBar.  The icon for this object is on the Enhanced page. The aditional feature this object has is a % of completion can change displayed colors with backcolor and for color properties.

 

PALETTE ICON & EXAMPLE

 

 

PROPERTIES

The following are the properties that apply to this object.  Some are defined in Common Properties and are linked to their appropriate page.

 

Appearance

 

Cursor

 

Behavior

 

Enabled

TabOrder

TabStop

Visible

 

Font

 

Font

ParentFont

 

Hint

 

Hint

ParentShowHint

ShowHint

 

Misc

 

HelpContext

Name

PopupMenu

Tag

 

Other

 

Anchors

BackColorSpecifies the background color of the gauge.
ForeColorSpecifies the foreground color of the gauge.

BorderWidth

Constraints

MaxWhen you setup this object you need to specify the beginning and end point for the image to be displayed to the user.  The default for Max is 100, as in 100%.  If you are reading through a file and know the number of records you have to read, you can set this property to the number of records and each time you read a record increment the Position property.  This property can be modified during runtime.

 

MinThe starting point for the image to be displayed.  Generally this will be set to 0 but it can be set to any value you wish as long as it's less than the Max property.  This property can be modified during runtime.

 

OrientationDoes the image progress from left to right (pbHorizontal - default value) or bottom to top (pbVertical).

 

       NOTE:  The position of the progress bar on the form will NOT change when you change this value.  Only the direction of the internal bar during your program operation will change.  This means you must change the size of the bar yourself to tall and narrow from short and wide before saving the form.

 

PositionNOTE:  This property doesn't exist on the property editor.  However, it is used by you during your program to move the progress bar during the process.  You would increment this value during each loop or when a record is read, etc.  Each time the Position value exceeds the next Step (see below) the progress bar will display a little longer (or taller depending on the Orientation property).  This property can only be changed at runtime.

 

SmoothIf this property is checked (set to .True.) then the progress bar will be a single smooth line of color.  The default value is not checked (.False.) and the progress bar will increment in block form.

 

StepThis is the change in the Position property that must occur before the progress bar changes.  The default value is 10 which means the Position property must change by a value of 10 before the progress bar increases in size.  This default setting in is keeping with the Min/Max properties of 0 and 100 (or 0% and 100%) in which case this could be considered 10%.  You should set this value to some logical portion of the difference between Min and Max.  If it's too small the blocks in the progress bar will be very small.  This property can be modified during runtime.

Position

 

Align

Height

Left

Top

Width

 

EVENTS

There are no events for this object.

 

Sample 1

//use this is an sql or a while loop using a counter.

define rec_cntr,cntr type I

'@Gage1.max' = rec_cnt                  

while dummy_l = .t.

    '@Gage1.position' = cntr

      inc cntr

      //find next record till done

endw

 

Sample 2

// Use this if your checking a file/Table no need to set the max

'@Gage1.position' = 0

scan @myfile_hndl key @0 while this_field = that_field

  '@Gage11.position' = REC_PERCENTAGE(myfile_hndl)

     save @myfile_hndl nocnf

ends

 

NOTE: you could also use the SET_OBJECT to do this and there could be other ways to do this as well Just some code to look at here.

 

 

 


Page url: http://www.cassoftware.com/tas/manual/tgauge.htm