FileSelect
From IfsoGUIWiki
Contents |
FileSelect
Type: ifsoGUI_FileSelect
Module: ifsogui.fileselect
Extends: ifsoGUI_Window
Imports: ifsogui.button, ifsogui.label, ifsogui.listbox, ifsogui.textbox
General
A File Select gadget allows the user to select a file/directory. The File Select gadget is modal; no other gadgets will receive events while the File Select gadget is visible.
Events
- ifsoGUI_EVENT_CLICK – Occurs when the user makes a selection or cancels the file selection. Data will be ifsoGUI_FILESELECT_CANCELED or ifsoGUI_FILESELECT_SELECTED.
- ifsoGUI_EVENT_RESIZE – Gadget has been resized by the user. Data, iMouseX and iMouseY will all be 0.
- ifsoGUI_EVENT_MOUSE_ENTER – Mouse has moved over the gadget. Data will be 0.
- ifsoGUI_EVENT_MOUSE_EXIT – Mouse has moved away from the gadget. Data will be 0.
- ifsoGUI_EVENT_GAIN_FOCUS – Gadget has gained the focus. Data, iMouseX and iMouseY will all be 0.
- ifsoGUI_EVENT_LOST_FOCUS – Gadget has lost the focus. Data, iMouseX and iMouseY will all be 0.
Functions
Functions used by the programmer to use the gadgets.
- Create:ifsoGUI_FileSelect(iX:Int, iY:Int, iW:Int, iH:Int, strName:String) - Creates and returns an instance of the gadget.
Methods/Properties
These are the methods and properties used by the programmer to use the gadgets.
- 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.
- GetCaption:String() - Returns the caption text.
- GetClientHeight:Int() - Returns client height of the gadget.
- GetClientWidth:Int() - Returns client width of the gadget.
- GetDir:String() - Returns the current directory of the gadget.
- GetDragable:Int() - Returns whether or not the gadget can be dragged with the mouse.
- GetDragTop:Int() - Returns whether or not the window is dragable only by the caption area.
- 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.
- GetMinWH(width:Int Var, height:Int Var) - Retrieves the minimum width and height of the gadget.
- GetProperty:Object(key:String) - Returns a custom property.
- GetResizable:Int() - Returns whether or not the gadget can be resized.
- GetScrollbars:Int() - Return whether or not scrollbars will show.
- GetScrollBarWidth:Int() - Returns the width of the scrollbars.
- GetSelection:String() - Returns the user selection. Full directory and file/dir name.
- GetShowBorder:Int() - Returns whether or not the border is showing.
- GetShowFocus:Int() - Returns whether or not the gadget will show the focus box.
- GetSmallTitleBar:Int() - Returns whether smalltitlebar is on or off.
- GetStyle:Int() - Returns the style of the File Select gadget.
- 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.
- 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.
- 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.
- SetCaption(strCaption:String) - Sets the caption text.
- SetDir(strDir:String) - Sets the current directory of the File Select gadget.
- SetDragable(bDragable:Int) - Sets whether or not the gadget can be dragged with the mouse.
- SetDragTop(bDragTop:Int) - Sets whether or not the window is dragable only by the caption area.
- 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.
- SetMinWH(width:Int, height:Int) - Sets the minimum width and height of the gadget.
- SetProperty(key:String, value:Object) - Set a custom property.
- SetResizable(bResize:Int) - Sets whether the gadget can be resized using the mouse.
- SetScrollbars(bScrollbars:Int) - Sets whether or not the Scrollbars will show.
- SetScrollBarWidth(iWidth:Int) - Sets the width of the scrollbars.
- SetShowBorder(bShowBorder:Int) - Sets whether or not the border will show.
- SetShowFocus(intShowFocus:Int) - Sets whether or not to show the focus box for this gadget.
- SetSmallTitleBar(bSmall:Int) - Sets the caption bar to a minimum size.
- SetStyle(iStyle:Int) - Sets the style of the File Select 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.
- Show() - Shows the gadget.
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.
- 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
None.
The File Select gadget is built using other gadgets: Window, Button, Label, Listbox, and Textbox. If you wish to use a File Select gadget, you must include the graphics for those other gadgets.
