Progressbar

From IfsoGUIWiki

Jump to: navigation, search

Contents

Progressbar

Type: ifsoGUI_Progressbar
Module: ifsogui.progressbar
Extends: ifsoGUI_Base
Imports: None

General

A progressbar gadget can be used to show a graphic representation of a value. A common use is showing the percentage of an amount of a total.

Events

A progressbar gadget does not emit any events.

Functions

Functions used by the programmer to use the gadgets.

  • Create:ifsoGUI_ProgressBar(iX:Int, iY:Int, iW:Int, iH:Int, strName:String, bHorizontal:Int = True) - Creates and returns an instance of the gadget.

Methods/Properties

These are the methods and properties used by the programmer to use the gadgets.

  • BringToFront() - Brings the gadget to the front of its parents child list.
  • GetAbsoluteXY(iX:Int Var, iY:Int Var, caller:ifsoGUI_Base = Null) - Retrieves the gadgets Absolute x and y position.
  • GetBarReversed:Int() - Gets if the bar is drawn reversed.
  • GetDrawStyle:Int() - Returns the drawstyle.
  • GetFont:TImageFont() - Returns the font the gadget is using.
  • GetGadgetAlpha:Float() - Returns the gadgets alpha value.
  • GetH:Int() - Returns the gadgets height.
  • GetMax:Int() - Returns the maximum value of the progressbar.
  • GetMin:Int() - Returns the minimum value of the progressbar.
  • GetProperty:Object(key:String) - Returns a custom property.
  • GetShowBorder:Int() - Returns whether or not the border is showing.
  • GetTip:String() - Returns the gadgets tip text.
  • GetValue:Int() - Returns the current value of the progressbar.
  • GetVisible:Int() - Returns whether the gadget is visible.
  • GetW:Int() - Returns the gadgets width.
  • GetWH(width:Int Var, height:Int Var) - Retrieves the gadgets width and height.
  • GetXY(iX:Int Var, iY:Int Var) - Retrieves the gadgets x and y positions.
  • SendToBack() - Sends the gadget to the back of its parent child list.
  • SetBarColor(iRed:Int, iGreen:Int, iBlue:Int) - Sets the color of the bar.
  • SetBarReversed(intReversed:Int) - Sets if the bar is drawn reversed.
  • SetBounds(iX:Int, iY:Int, iW:Int, iH:Int) - Sets the x, y, width, and height all in one call.
  • SetDrawStyle(intStyle:Int) - Sets the draw style of the progressbar.
  • SetFont(Font:TImageFont) - Sets the font of the gadget.
  • SetGadgetAlpha(fltAlpha:Float) - Sets the gadgets alpha value.
  • SetGadgetColor(iRed:Int, iGreen:Int, iBlue:Int) - Sets the gadget color of the gadget.
  • SetMax(intMax:Int) - Sets the maximum value of the progressbar.
  • SetMin(intMin:Int) - Sets the minimum value of the progressbar.
  • SetMinMax(intMin:Int, intMax:Int) - Sets the minimum and maximum values of the progressbar in one call.
  • SetProperty(key:String, value:Object) - Set a custom property.
  • SetShowBorder(bShowBorder:Int) - Sets whether or not the border will show.
  • SetTextColor(iRed:Int, iGreen:Int, iBlue:Int) - Sets the text color of the gadget.
  • SetTip(strTip:String) - Sets the gadget tip text.
  • SetValue(intValue:Int) - Sets the current value of the progressbar.
  • SetVisible(bVisible:Int) - Sets whether the gadget is visible.
  • SetWH(width:Int, height:Int) - Sets the gadgets width and height.
  • SetXY(iX:Int, iY:Int) - Sets the gadgets x and y position.

Internal Functions

These function are internal to the gadget. They should only need to be called, if you are creating a gadget.

  • Drawbox(images:TImage[], ws:Int[], hs:Int[], rX:Int, rY:Int, rW:Int, rH:Int, bDrawBorder:Int = True, bTileSides:Int = False, bTileCenter:Int = False) - Draws the standard ifsoGUI image based on 4 corners, 4 sides, and a center background portion.
  • GetDimensions:String(strName:String) - Gets the dimensions from the dimension file for the gadgets graphics.
  • Load9Image(srcpath:String, dimensions:String[], gImage:TImage[] Var, imagew:Int[] Var, imageh:Int[] Var) - Loads the graphics for an image in 9 standard parts.
  • LoadTheme() - Called when a new theme is loaded, so the gadget can load its images for drawing. The base gadget does not have a LoadTheme function, but any gadget than can be created should have one.
  • SystemEvent(id:Int, data:Int) - Called when a system level event occurs that all gadgets should know about, like loading a new theme or changing the default GUI font. The base gadget does not have a SystemEvent function, but any gadget than can be created should have one.

Internal Methods

These methods are called by the GUI itself and should only be used if you are creating your own gadget.

  • Draw(parX:Int, parY:Int, parW:Int, parH:Int) - Draws the gadget and its children.
  • DrawTip(iMouseX:Int, iMouseY:Int) - Draws the gadgets tip.
  • GadgetSystemEvent(id:Int, data:Int) - Gadget Level GUI system event occured.
  • gMouseDown(iButton:Int, iMouseX:Int, iMouseY:Int) - Called when the mouse button is pressed on the gadget.
  • gMouseUp(iButton:Int, iMouseX:Int, iMouseY:Int) - Called when the mouse button is released on the gadget.
  • IsMouseOver:Int(parX:Int, parY:Int, parW:Int, parH:Int, iMouseX:Int, iMouseY:Int) - Returns whether or not the mouse is over the gadget.
  • KeyPress(key:Int) - Called when a key is pressed on the active gadget.
  • MouseOut(iMouseX:Int, iMouseY:Int, gOverGadget:ifsoGUI_Base) - Called when the mouse leaves the gadget.
  • MouseOver(iMouseX:Int, iMouseY:Int, gWasOverGadget:ifsoGUI_Base) - Called when the mouse is over this gadget.
  • MouseStatus:Int(iMouseX:Int, iMouseY:Int) - Called to determine the mouse status from the gadget.
  • Refresh() - Refreshes the gadget.

Skinning

dimensions.txt keyword: progressbar
Filename: progressbar.png
This is a representation of a progressbar, the sides will be stretched or tiled the height of the progressbar, the top and bottom will be stretched or tiled the width of the progressbar, and the center will be stretched or tiled to the length and width of the progressbar. The corners will remain as is and will not be stretched or tiled at all.

Filename: progressbarstretch.png
Filename: progressbartile.png
Lines in the dimensions.txt file are not needed for these two files, the graphics are used in their entirety. The progressbarstretch.png file is stretched to fill the filled portion of the progressbar. The progressbartile.png file is tiled into the filled portion of the progressbar.

Personal tools