Base
From IfsoGUIWiki
Contents |
Base Gadget
Type: ifsoGUI_Base
Module: ifsogui.GUI
Extends: None
Imports: None
General
The base gadget type is part of the main ifsogui.GUI module. All ifsoGUI gadgets are derived from the base gadget, thus all gadgets have these Functions/Methods/Properties. If you wish to create your own gadget, extend the base gadget type.
Events
The base gadget does not generate any events. Gadgets derived from the base gadget should generate events.
Functions
Functions used by the programmer to use the gadgets.
- Create:GadgetType - Creates and returns an instance of the gadget. The base gadget does not have a Create function, but all gadgets that can be created should have a Create function.
Methods/Properties
These are the methods and properties used by the programmer to use the gadgets.
- AddChild(gadget:ifsoGUI_Base) - Adds a child gadget to the gadget.
- AddSound(iSoundEvent:Int, sndSound:TSound) - Add a sound to the event of a gadget.
- BringToFront() - Brings the gadget to the front of its parents child list.
- CanActive:Int() - Returns whether or not this gadget can be the active gadget.
- GetAbsoluteXY(iX:Int Var, iY:Int Var, caller:ifsoGUI_Base = Null) - Retrieves the gadgets Absolute x and y position.
- GetAlwaysOnTop:Int() - Returns whether or not the gadget is always on top.
- GetAutoSize:Int() - Returns whether or not to the gadget will autosize or be manually controlled by the user.
- GetEnabled:Int() - Returns whether the gadget is enabled.
- GetFont:TImageFont() - Returns the font the gadget is using.
- GetGadgetAlpha:Float() - Returns the gadgets alpha value.
- GetH:Int() - Returns the gadgets height.
- GetProperty:Object(key:String) - Returns a custom property.
- GetShowFocus:Int() - Returns whether or not the gadget will show the focus box.
- GetTabOrder:Int() - Returns the gadgets TabOrder.
- GetTip:String() - Returns the gadgets tip text.
- GetTransparent:Int() - Returns whether the gadget is transparent.
- 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.
- LoadSkin(strSkin:String) - Loads a skin for just one instance of a gadget.
- RemoveChild(gadget:ifsoGUI_Base, bDestroy:Int=True) - Removes a child gadget from the gadget.
- SendToBack() - Sends the gadget to the back of its parent child list.
- SetAlwaysOnTop(iOnTop:Int) - Sets the gadget to always be on top of other gadgets.
- SetAutoSize(intAutoSize:Int) - Sets whether or not to the gadget will autosize or be manually controlled by the user.
- SetBounds(iX:Int, iY:Int, iW:Int, iH:Int) - Sets the x, y, width, and height all in one call.
- SetCallBack(func(gadget:ifsoGUI_Base, id:Int, data:Int, iMouseX:Int, iMouseY:Int)) - Sets the event callback function for the gadget.
- SetEnabled(bEnabled:Int = True) - Sets the gadget enabled/disabled.
- SetFocus() - Gives the gadget the focus.
- SetFocusColor(iRed:Int, iGreen:Int, iBlue:Int) - Sets the gadgets focus box color.
- 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.
- SetProperty(key:String, value:Object) - Set a custom property.
- SetShowFocus(intShowFocus:Int) - Sets whether or not to show the focus box for this gadget.
- SetTabOrder(iTabOrder:Int) - Sets the gadgets TabOrder. 0=Do not tab to this gadget -1=Last in the Tab Order
- SetTextColor(iRed:Int, iGreen:Int, iBlue:Int) - Sets the text color of the gadget.
- SetTip(strTip:String) - Sets the gadget tip text.
- SetTransparent(bTransparent:Int) - Sets whether the gadget is transparent.
- 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.
- Drawbox2(images:ifsoGUI_Image, 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, strSkin:String = "") - Loads the graphics for an image in 9 standard parts.
- Load9Image2(srcpath:String, dimensions:String[], gImage:ifsoGUI_Image Var, strSkin:String = "") - Loads the graphics for an image in 9 standard parts (new method).
- 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.
- ChildMoved(gadget:ifsoGUI_Base) - Called when a child gadget is moved.
- Compare:Int(withObject:Object) - Compares two gadgets by TabOrder.
- Draw(parX:Int, parY:Int, parW:Int, parH:Int) - Draws the gadget and its children.
- DrawChildren(parX:Int, parY:Int, parW:Int, parH:Int) - Draws the gadgets children.
- DrawFocus(iX:Int, iY:Int, iW:Int, iH:Int) - Draws the focus box around the gadget.
- DrawTip(iMouseX:Int, iMouseY:Int) - Draws the gadgets tip.
- GadgetSystemEvent(id:Int, data:Int) - Gadget Level GUI system event occured.
- GainFocus(LostFocus:ifsoGUI_Base) - Called when the gadget becomes the active gadget.
- GetChild:ifsoGUI_Base(name:String) - Returns the gadget with the name from the child list.
- 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.
- IsMyChild:Int(gadget:ifsoGUI_Base) - Is the gadget a child or slave of this gadget.
- IsMySlave:Int(gadget:ifsoGUI_Base) - Is the gadget a slave of this gadget.
- KeyPress(key:Int) - Called when a key is pressed on the active gadget.
- LostFocus(GainedFocus:ifsoGUI_Base) - Called when the gadget is no longer 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.
- NextGadget:ifsoGUI_Base(start:ifsoGUI_Base, bForward:Int = True) - Returns the next gadget after start in the child list.
- Refresh() - Refreshes the gadget.
- SendEvent(id:Int, data:Int, iMouseX:Int, iMouseY:Int) - Sends an event from the gadget.
- SlaveEvent(gadget:ifsoGUI_Base, id:Int, data:Int, iMouseX:Int, iMouseY:Int) - Called from a slave gadget.
Skinning
The base gadget does not get skinned.
