XLnt ii User Guide
Contents:
About this Guide
This HTML user guide refers to commands that are in both the shareware and registered release of XLnt II. Therefore, if you have not registered as an XLnt II
User then some of these commands will be missing from your version. To see which commands these are - take a look at the History section, then read the License section for registration info.
Now on with the show........
OverView
Before we get started lets run through a few basic fundamentals.
Firstly, XLnt is a set of additional functions which can be accessed by you the user in your own programs.
This allows you to easily create a user interface (UI) for your programs without having to worry too much
about the behind the scenes technicalities.
When you are developing your code then you must "Include" the XLnt files.
However, when you have finished your program and make an .EXE then the "Include" files are automatically
inserted into the single .EXE file.
XLnt works on the principal of Types and Handles.
All user specified objects (ie Windows, Gadgets, Menus) have a unique Handle (or name) assigned to
them upon creation. This allows the programmer (you!) to access individual objects without having to
worry about conflicts or errors. (hopefully!)
Interfaces built using XLnt can be broken down into 3 separate sections; Windows, Gadgets, and Menus.
Windows
Windows will form the main component of your UI. They provide the backing to which you apply your
Gadgets and Menus.
XLnt allows you to open an unlimited number of Windows, each with its own unique set of
Gadgets and Menus.....thus allowing you to make quite complex UI`s.
Windows can be re sized, minimized, dragged, pushed, pulled, opened, closed, you name it you can do it!
See the Window section for more info.
Gadgets
Gadgets are the tools that allow the user to talk to your program.
XLnt offers a whole range of MS Windows type Gadgets, including Buttons, Text Input Boxes, Pull-Down Selectors etc. These Gadgets are attached to their respective Windows and are accessed using the Gadget Functions.
See the Gadget section for more info.
Menus
Menus can be:
Window Specific - they are attached to a Windows Menu bar.
Quick Menus - not Window specific, but are "floating" Menus called up from anywhere on screen using the right mouse button.
Attached - called when a gadget is clicked with either the Left or Right Mouse Button (user specified).
Menus can contain; normal menu items, grouped Radio Items, click able Item "Switches", separator lines, and spaces.
See the Menus section for more info.
Getting Started
As I said earlier - XLnt is a group of Include files which need to be included into your Blitz Program.
However, you do not need to manually include all of the files yourself - the only file that you need to include is
"XStart.bb". This file contains a list of all the other include files - and will include them on execution. See how kind I am to you :)
Important! Blitz 2D Users Please Read
XLnt is set up to use Blitz3D as the default Blitz language. If you are NOT using Blitz3D then you will need to remove the 3D specific command calls - else there will be problems. but don't panic! Its Easy!
If you are not using Blitz 3D do the following:
- Open the "XStart.bb" Include file
- Comment out [;] the Include "XLnt\X3D.bb" line [ its at the bottom ;) ]
- Save the file
Thats it! XLnt will no longer try to access non-existent Blitz3D commands in Blitz 2D!
Setup Code
Here's how XLnt is included into your own Blitz programs:
;Simple XLnt Example
;Include XLnt stuff first.....
Include "XStart.bb"
;Setup our Graphics Display
Graphics 800,600,32,1
;Setup XLnts internal graphics - see below
GUI_GFXSETUP()
GUI_GFXSETUP() : hmmmm, what does this do eh? Basically, this functions loads in all the internal GUI graphics (mouse pointer, fonts etc) - and needs to be called before you access any other XLnt functions. But once you've called it once thats it - you can forget about it :)
An Example
The easiest way to learn is by example - so here is a simple bit of code that will run through the basics of setting up XLnt, adding some stuff, and entering the loop.
;Simple XLnt Example
;First we include the XLnt files
Include "XStart.bb"
;Now we set up our Graphics Display
Graphics 800,600,32,1
;Now we setup XLnts internal GFX
GUI_GFXSETUP()
;Thats all the setup code complete - now we can start adding GUI elements....
;First we will need a Window - lets call it MyWin
MyWIN=GUI_Window(100,200,300,400,"My First Window")
;Now lets add a button gadget to our window
Quit=GUI_Button(MyWin,10,50,100,"Quit")
;Thats enough for now - so lets tell XLnt that we have finished making this window
GUI_OpenWin(Mywin)
;And lets fall through to our main loop.....
While Finish=False And KeyDown(1)=False
;Sort out the buffers
Setbuffer BackBuffer():Cls
;Update our GUI
GUI()
;Check if we clicked the QUIT gadget....
If EV_Gad_Release(Quit)
Finish=True
Endif
;And check if we clicked MyWin's Title bar Close Button
If EV_Win_Close(MyWin)
Finish=True
Endif
Flip
Wend
End
Now lets go through that one line at a time - because even though it was a very simple program, it contains all the basic functions of XLnt ;)
Include "XStart.bb"
Simply tells Blitz to load in all of XLnts Include Files
Graphics 800,600,32,1
Setup a Graphics Display - but you knew that anyway - right? :P
GUI_GFXSETUP()
An Important line this - it loads in all of XLnts internal GFX and Fonts, so don't forget to include it :)
MyWIN=GUI_Window(100,200,300,400,"My First Window")
This is where it gets a little tricky, and as you'll be using this line quite often lets go through it in more detail...
Firstly, XLnt uses Types to store its data - so every Window (and Gadget) needs a unique Handle (name)
Eg: MyWIN is the Handle and will store the pointer to the rest of the window data.
Now we have 4 different numbers; 100,200,300,400 - what do these do? These are.... X Position, Y Position, Width, and Height. So our window will be at position x:100 y:200 and will be 300x400 in size.
Thats all we need to make a window - a handle variable and X,Y,W,H but in our example we also supply a window title - "My First Window". Try removing this to see what happens....
Quit=GUI_Button(MyWin,10,50,100,"Quit")
This line is very similar to the previous window one - but in this case we want to add a new gadget to a window
Again - we need a Handle, which is used to access the gadget later on, so......
Quit : make an instance of a .gad type and stores it in the variable called Quit.
GUI_Button : tells XLnt that we want to make a click able button gadget - each gadget type has its own GUI_Function()
(MyWin,10,50,100,"Quit") : MyWin tells XLnt that we want to add this gadget to the window called MyWin. The other parameters are simply X,Y,W and Caption$. Easy eh? :P
GUI_OpenWin(Mywin)
Tells XLnt that we have finished making the window called MyWin - gets the window ready for more GUI stuff so don't forget to add this line ;)
Now we enter a pretty standard Blitz loop - so lets skip to the next XLnt bit.....
GUI()
This is the most important line - the bit that does all the work! This function call will update all of the GUI functions, check for mouse clicks/key presses etc. and also DRAW the GUI to the screen. Once again - don't forget to add this line ;)
If EV_Gad_Release(Quit)
Our first bit of interaction - cool!
This is one of the Event Check Functions (there are a few of 'em) - this one will tell you if the user has clicked AND released a specific gadget during the last GUI() update. So here we are checking to see if our previously made "Quit" button gadget has been clicked, and if so setting our Finish flag to True. Piece of cake...
If EV_Win_Close(MyWin)
Another Event Check Function!
This one checks to see if the user has clicked a windows Close button (the X at the top-right corner), and if so set the Finish flag to True.
Thats about it! Now lets go into the various XLnt elements in more detail. Starting with........
Windows
Windows are the basic component of any XLnt program and are created in the following way...
- Use GUI_WINDOW() to create a window
- If the Window contains Menus then add them now
- If the Window contains Tabs then use GUI_WIN_TABAREA() to create a tab area
- Add your gadgets to the Window - Tab gadgets first tho ;)
- When all gadgets have been added, use GUI_OPENWIN() to finish the window creation
Colors
Just a quick note about colors.... all colors passed to XLnt functions are in $RRGGBB format.
Example:
Purple in R,G,B is 255,0,255. To get the $RRGGBB value we do this... col=(R shl 16) or (G shl 8) or B which comes up with $ff00ff
Don't worry if you didn't get that - there is a function in XLnt that returns the $RRGGBB value of a R,G,B color
GUI_Rgb(Red,Green,Blue)
Returns : $RRGGBB format of passed R,G,B color
|
|
Flags
Each window has a set of flags that correspond to various window options. These flags are set using the Flag parameter in GUI_WINDOW() - adding the relative values together will allow you set multiple flags. These values are:
1 : Menu : Setting this flag will create a menu-bar at the top of the window, ready for menus to be added [Default On]
2 : Quit : Window has a Close button at the top right of its title bar [Default On]
4 : Min : Window has a Minimize button at the top right of its title bar [Default On]
8 : Back : Window has a Push-Back button at the top right of its title bar [Default On]
16 : Drag : Window can be Dragged - clicking anywhere that isn't a gadget will allow you to move the window [Default On]
32 : Scale : Window can be scaled - click in the bottom right hand corner [Default On]
64 : Not Used - bugger :P
128 : Gradient : Window has a Gradient fill - the main window area will have color one at the top and color two at the bottom. Looks nice, but may be slow ;) [Default Off]
Example : Flag=51 [1+2+16+32] will make a Window with a Menu bar[1], a Close button[2], Drag able[16], and Scalable[32].
Tabs
A Window can become quite crowded with Gadgets. Therefore, XLnt allows you to group all related gadgets together under their own Tab.
Each Window can have an unlimited number of Tabs, with each Tab having its own gadgets. However, every Window has a special default tab - tab 0. This is the background tab, and any gadgets attached to this tab are displayed at all times, regardless of any other active tabs. This is useful for adding OK Cancel Apply buttons - which can be accessed at anytime.
Before you can add a tabbed gadget tho, you must set the windows tab area. This is a pre-defined box into which all the tabbed gadgets are placed and to which all tab gadgets are attached. So, if your window is going to contain tabbed gadgets you must do the following:
Skins
XLnt ii now includes simple Window background skinning and "Splash Window" style background images. If your window has different tabs then you can also
specify different skins for each seperate tab - nice :) To use skins you do this:
Window Functions
|
Create a Window
Open a Window
Redraw a Window
Get a Windows status
Set a Windows Tab Area
Minimize a Window
Maximize a Window
Hide a Window
Show a Window
Get Windows Open Tab
Get Windows X Position
Get WIndows Y Position
Set Windows Position
Set Windows Title
|
|
Gadgets
Gadget Types
The full release version of XLnt contains 24! different types of gadgets! Yes you read correctly - 24! , and here they all are:
|
Normal Button
On/Off Button
Cycle Button
Image Button
Image On/Off Button
Tick Box
Grouped Check Box
Prop Slider
Value Slider
Integer Spinner
Float Spinner
Text Item List
Tree Item List
Pull-Down Selector
Image Display Box
Gfx Frame
Expandable Gadget Container
Scrollable ToolBar Container
Tab Button
Text Label
Multi-line Text Input
Single-line Text Input
Scrollable Image Box
3D Viewport Box
|
|
Icons
Many gadgets (and lists, menus, and windows) can have a graphical image displayed alongside its text component. These Gfx images are called Icons and have the following features/restrictions:
- Icons have 1 main image, and optional "down" , "over" and "inactive" images
- Icons must have a unique name supplied on creation
- Icons used for gadgets can be any size - but those used for Window titles, Menu items, and List items must be 16x16 pixels in size
- All images within an icon must be the same size
- Icons are drawn using DrawImage and use mask color $ff00ff
Creating an icon: the following function is used to create an icon, which can then be used in any number of gadgets, lists, menus, etc
GUI_GADICON()
|
Create an Icon
|
GUI_GADICON(NAME$,IMG, [IMAGES])
NAME$ : unique icon name
IMG : iconstrip image
IMAGES : optional number of images in strip [Default 1]
This function will create an Icon ready for further use. An iconstrip is used as a template for the icon, with between 1 and 4 images on the strip.
The images go in this order : Off, On, Mouse Over, and InActive. If you want more than 1 image then simply pass the total number of
images (1 to 4) when setting up the icon. The height of each icon will be the height of the icon strip, and the width will be the total width of the strip divided by the number of images that it contains.
Oh.. icons used for gadgets may be any size, but those used for windows, lists or menus must be 16x16!
Example:
;Load some images...
win_IMG=LoadImage("gfx\win_icon.bmp")
disk_IMG=Loadimage("gfx\disk_icon.bmp")
;Now create an icon for our window - with only 1 image
GUI_GADICON("icn_WINDOW",win_IMG)
;And a gadget icon with 4 separate images
GUI_GADICON("icn_DISK",disk_IMG,4)
;Add a window with an icon
MyWIN=GUI_Window(-1,-1,200,200,"Centered Window","icn_WINDOW")
;And an image button...
But1=GUI_ImgButton(MyWin,10,50,"icn_DISK")
;Open the window ready for more stuff...
GUI_OpenWin(MyWin)
|
|
|
Groups
Gadgets that can be clicked Off and On (Radio Boxes, Switch Buttons) can belong to a Group. Only one gadget within each individual group may be on at any one time. To attach a gadget to a group then a group number must be supplied when it is created. This group number must be greater than 0 to have any effect.
Lists
Several XLnt gadgets are used to display lists of selectable items. Lists are treated as separate XLnt entities - and there are 2 kinds; normal 1-dimensional lists, and multi-dimensional tree lists. Lists may contain normal selectable items (with or without icons), tick boxes, grouped check boxes, and sub-directories [nodes] (Tree list only).
One Dimensional : these lists are used in Pull-Down Selector and TextList gadgets. If any nodes are added to the list then they are processed like a normal list item.
Tree List : these are multi-dimensional lists used by the TreeList gadget. These lists may contain nodes which act like sub-directories within the list.
To create a list you must first make a parent list to which you add all of the separate list items.
You then pass this list to any gadget that you want to attach the list to. Thats it!
List Functions
|
Create a List
Add an Item
Add a Sub Node
Add a Tick Box
Add a Grouped Check Box
Add an Integer Gadget
Add a Float Gadget
Add an Input Gadget
Add a separation Line
Add a clickable Icon Item
|
|
Item Selection Groups
New to XLnt ii v1.4 are Item Selection Groups. These allow you to force the user to select a number of list items from within
your own pre-defined selection groups. Useful if you want to add options to a list and you need a certain number of items selected.
There are only 2 functions for selection groups.
|
Create a new Selection Group
Set an items's Selection Group
|
|
3D Stuff
XLnt is now fully compatible with background 3D operations - ie. you can now drag a window around the screen and any 3D scene in the background will not be effected.
To use XLnt over 3D you only need to do one thing - call RenderWorld() before you call GUI(), this will then draw the UI on top of any 3D stuff already rendered.
3D Gadget
XLnt contains only one 3D specific gadget - but its a "dead good" one :P GUI_3DPort() will add a 3D Viewport gadget to a window. This gadget has its own camera and own wireframe setting and is pretty cool!
Important!
Because Blitz only allows you to render a 3D scene to the BackBuffer (Doh!), XLnt has to perform a separate Renderworld + CopyRect to grab the 3D image and display it on a window. This
means that a 3D gadget may be slow on some systems. However, to combat this XLnt does not automatically update any 3D gadgets every time GUI() is called - instead the user must manually update any 3D gadgets when he sees fit. Although this
may seem a little "crap" it allows you much greater control over you FPS - as you choose when the slow Renderworld + CopyRect takes place.
Here's an example of a 3D gadget main loop:
;We already have a window which contains a 3D Viewport gadget call MyGad3D
;So lets drop thru to our main loop......
While Not KeyDown(1)
;Render our 3D gadget every other frame
Frame=1-Frame
If Frame=1
GUI_RENDER3D(MyGad3D)
EndIf
;Render the world
Renderworld()
;Update XLnt
GUI()
Flip
Setbuffer Backbuffer():Cls
Wend
End
3D Functions
|
Create a 3D ViewPort Gadget
Render a 3D gadget
Set a 3D gadgets wireframe mode
Returns a 3D gadgets wireframe mode
Set a 3D gadgets camera
Returns a 3D gadgets camera
|
|
Menus
Menu Types
XLnt allows access to 3 types of menus ; Normal, QMenus, and Attached Menus.
Normal : these are your standard Window menus. Each has a root menu attached to a windows menubar which opens when the user clicks on it with the left mouse button.
QMenus : QMenus is short for Quick Menus - unlike normal menus these are not attached to any window and are called by clicking the right mouse button anywhere on-screen.
Attached : XLnt allows you to attach a menu to a specific gadget - when the gadget is clicked (with a pre-set mouse button) then the menu will appear.
Menu Creation
All menus are created in a very similar way:
- Create a Main Menu - GUI_MENU()
- Create any Sub-Menus - GUI_SUBMENU()
- Add all your Menu Items - the order in which you add them will be the order in which they are displayed
- Update all the Menu GFX - GUI_MENU_REFRESH()
Sub Menus : all menus (and sub menus) may contain sub menus - allowing for quite complex menu systems to be designed. To create a sub menu you must do the following:
Sub Menu Example:
;Make a window
MyWin=GUI_WINDOW(0,0,200,200,"My Window")
;Get the windows menubar menu
WinMenu=GUI_WINMENU(MyWin)
;Make a File root Menu
mnu_File=GUI_MENU(WinMenu,"File")
;Make an Edit root menu
mnu_File=GUI_MENU(WinMenu,"Edit")
;Add an options sub menu to the edit menu
mnu_Opt=GUI_SUBMENU(mnu_Edit)
;And a further sub menu to the options sub menu
mnu_WinOpt=GUI_SUBMENU(mnu_Opt)
;Add a menu pointer to the edit menu
itm_Opt=GUI_MENU_SUB(mnu_Edit,"Options",mnu_Opt)
;And a menu pointer to the options menu
itm_WinOpt=GUI_MENU_SUB(mnu_Opt,"Window Options",mnu_WinOpt)
;Refresh ALL the menus
GUI_MENU_REFRESH(mnu_FILE)
GUI_MENU_REFRESH(mnu_EDIT)
GUI_MENU_REFRESH(mnu_OPT)
GUI_MENU_REFRESH(mnu_WINOPT)
;Open the window
GUI_OPENWIN(MyWin)
It doesn't do much but it shows the order in which you create sub menus and add sub menu pointers to the menus.
Example 1 : Normal Menu
;Make a window
MyWin=GUI_WINDOW(0,0,200,200,"My Window")
;Get the windows menubar menu
WinMenu=GUI_WINMENU(MyWin)
;Make a File Menu
mnu_File=GUI_MENU(WinMenu,"File")
;Add a menu item to it
itm_New=GUI_MENU_ITEM(mnu_File,"New")
;Refresh the menu
GUI_MENU_REFRESH(mnu_FILE)
;Open the window
GUI_OPENWIN(MyWin)
GUI_WINMENU() : what's this for? All Normal menus need a Parent Menu to be passed on creation, but the root menus such as File, Edit, Insert etc have no parent menus. Therefore, this function will return a windows Menubar menu which is used as parent for root menus.
GUI_MENU_REFRESH() : this is used to redraw a menus gfx. So you must call it when you have finished creating a menu or if you add any more items to it after it has been created.
Example 2 : Quick Menu [QMenu]
;Just create a menu
qmnu_Main=GUI_MENU(0,"Quick Menu")
;Add a menu item to it
itm_New=GUI_MENU_ITEM(qmnu_Main,"New")
;Refresh the menu
GUI_MENU_REFRESH(qmnu_Main)
;Turn on QMenus
GUI_QMENU_ACTIVE=True
;And set this menu as the current QMenu
GUI_QMENU=qmnu_Main
As you can see - when creating a QMenu you do not need to call GUI_WinMenu() as a QMenu has no parent menu.
You can also see that 2 variables are used to control QMenu access - GUI_Qmenu_Active is used to turn QMenu access On [True] or Off [False]. GUI_Qmenu is used to hold the currently active QMenu.
Attached Menus are created in exactly the same way as QMenus, but instead of setting GUI_Qmenu_Active and GUI_Qmenu, you call GUI_Menu_Attach()
GUI_Menu_Attach()
|
Attach a Menu to a Gadget
|
GUI_MENU_ATTACH(MENU,GAD,[LMB])
MENU : menu to attach
GAD : gadget to attach menu to
LMB : use left [True] or right [False] mouse button to open menu [Default Right]
Attaches a menu to a gadget.
|
|
|
Interaction and Events
So, we've made some spiffy Windows, Gadgets, and Menus but how do we go about using 'em?
Event Functions
XLnt contains quite a few EVENT functions - these functions will tell you whether a specific gadget has been hit, a window has been moved, a item has been selected from a list etc. These functions
will return a different value every time GUI() is called, so the best time to check for user activity is straight after your GUI() line.
Example:
;We've already made our windows and gadgets, so lets just enter the main loop
While Finish=False And KeyDown(1)=False
;Sort out the buffers
Setbuffer BackBuffer():Cls
;Update our GUI
GUI()
;Check if we clicked the QUIT gadget....
If EV_Gad_Release(Quit)
Finish=True
Endif
;And check if we clicked MyWin's Title bar Close Button
If EV_Win_Close(MyWin)
Finish=True
Endif
Flip
Wend
End
As you can see - the above code segment contains 2 event functions; EV_Gad_Release() and EV_Win_Close(). Both of which access a specific XLnt element and
return True or False depending upon a specific status. There are many event functions, and each XLnt element (Window, Gadget, Menu etc) has its own set of functions. These are:
Window Event Functions
EV_WIN()
Returns : The currently Active window
|
|
EV_WIN_OVER()
Returns : The window that the mouse is currently over
|
|
EV_WIN_CLOSE(WIN)
Returns : True if the passed window has had its Close gadget clicked.
|
|
EV_WIN_SCALE(WIN)
Returns : True if the passed window has been resized
|
|
EV_WIN_DRAG(WIN)
Returns : True if the passed window has been moved
|
|
EV_WIN_MIN(WIN)
Returns : True if the passed window has been minimized
|
|
EV_WIN_MAX(WIN)
Returns : True if the passed window has been maximized
|
|
EV_WIN_FRONT(WIN)
Returns : True if the passed window has been pulled to the front
|
|
Gadget Event Functions
EV_HIT()
Returns : ID (or 0) of any hit gadget
|
|
EV_HOLD()
Returns : ID (or 0) of any gadget being held down
|
|
EV_RELEASE()
Returns : ID (or 0) of any gadget that has been released
|
|
EV_GAD_DOWN(GAD)
Returns : True if the passed gadget is being held down with the LMB
|
|
EV_GAD_RELEASE(GAD)
Returns : True if the passed gadget has been released with the LMB
|
|
EV_GAD_RMBRELEASE(GAD)
Returns : True if the passed gadget has been released with the RMB
|
|
EV_GAD_TOGGLE(GAD)
Returns : True if the passed gadget has been clicked On or Off
|
|
EV_GAD_NEWTEXT(GAD)
Returns : True if the passed gadgets text has been changed
|
|
EV_GAD_NEWVAL(GAD)
Returns : True if the passed gadgets value has changed
|
|
EV_GAD_INPUTGAD(GAD)
Returns : Currently active Input gadget
|
|
Group Event Functions
EV_GROUP_TOGGLE(GROUP)
Returns : True if a gadget in the passed gadget group has been clicked
|
|
EV_GROUP_DOWN(GROUP)
Returns : The ID of the gadget in the passed gadget group that is On or 0
|
|
Menu Event Functions
EV_MENU_HIT()
Returns : The ID (or 0) of ANY menu item that has been clicked
|
|
EV_MENU_SELECT(ITEM)
Returns : True if the passed menu item has been clicked
|
|
EV_MENU_TOGGLE(ITEM)
Returns : True if the passed menu item has be clicked On or Off
|
|
EV_MENU_GROUP(MENU,GROUP)
Returns : The ID of any item in the passed menu group that has been clicked
|
|
List Event Functions
EV_ITEM_SELECT(ITEM)
Returns : True if the passed has been selected
|
|
EV_ITEM_OVER(ITEM)
Returns : True if the mouse is over the passed item
|
|
EV_ITEM_DBLCLICK(ITEM)
Returns : True if the passed has been double clicked with the LMB
|
|
EV_ITEM_RMBCLICK(ITEM)
Returns : True if the item has been clicked with the RMB
|
|
EV_SELECTOR(GAD)
Returns : The ID of any item clicked in a pull down selector gadget
|
|
EV_LIST_OVER(LIST)
Returns : True if the mouse is over the passed list
|
|
EV_LIST_SELECT(LIST)
Returns : The ID of any clicked item in the passed list
|
|
EV_LIST_DBLCLICK(LIST)
Returns : The ID of any item double clicked in the passed list
|
|
EV_LIST_RMBSELECT(LIST)
Returns : The ID of any item that has been clicked with the RMB in the passed list
|
|
Interaction
We now know how do detect User -> XLnt interaction using the Event functions, so now we need to know
how we can access and change the XLnt objects from within the program.
XLnt contains many functions that can be used to read and write data to any specific XLnt object, as well as a few Global
System Variables that you can change to alter certain UI properties. So lets get down to business, starting with the system variables:
System Variables
GUI_Debug
Set : True or False
Will turn Debug Mode on or off [Default Off]
|
|
GUI_GFXDir$
Set : valid Directory
Holds path to XLnt GFX directory. [Default "XLnt/GFX/"]
|
|
GUI_Mouse
Set : valid Image
Holds current mouse pointer image - changes depending upon current UI state
|
|
GUI_Mouse_Draw
Set : True or False
If False then the mouse pointer will not be drawn [Default True]
|
|
GUI_Scroll_Lock
Set : True or False
If True then the arrow keys will not have any effect on key-scrollable gadgets, used to stop your game/app control
messing about with any clicked gadgets [Default False]
|
|
GUI_3DCam
Set : valid 3D Port gadget ID
Holds last clicked (or created) 3D gadget ID - useful for making a multiple 3D viewport based app ;)
|
|
Window Interaction Functions
The following functions are used to read or write specific Window attributes:
|
Minimize a window
Maximize a window
Hide a window
Show a window
Get currently open window tab
Set a window open tab
Get window X position
Get window Y position
Set window position
Set window title text
Delete a window
|
|
Gadget Interaction Functions
Read values:
The following functions are used to read data from a gadget.
|
Is the gadget Active or Inactive
Is the gadget On or Off
Returns the gadgets physical status
Returns the gadgets list
Returns the gadgets Float value
Returns the gadgets Integer value
Returns the gadgets Text
Returns the gadgets Group
Returns On gadget in this gadgets group
Returns gadgets tab
Returns gadgets X position
Returns gadgets Y position
Returns gadgets Width
Returns gadgets Height
Returns gadgets Screen X position
Returns gadgets Screen Y position
Returns relative mouse X position
Returns relative mouse Y position
|
|
Set values:
The following functions are used to set a gadgets data or attributes.
|
Set gadget to Active or Inactive
Set gadget On or Off
Set gadget status
Set gadget list
Set gadget position
Set gadget Float value
Set gadget Integer value
Set gadget text
Set selector gadget current item
Set gadget tooltip text
|
|
Gadget list functions:
The following functions are used to interact with a gadgets list items
|
Returns list items attached gadget
Set list item active or inactive
Set list item text
Set list item colors
Returns list item text
Set list item On or Off
Returns list items parent list
Delete a list item
Delete a list
Return list item INT DATA
Set list item INT DATA
Return list item TEXT DATA
Set list item TEXT DATA
Returns number of items in list/node
Returns item current position in list/node
Set item position in list/node
Move item within list/node
Returns number of selected items
Returns selected item ID
Returns item selected status
Return items On/Off status
Set a selectors current item
Step thru a list/node
Returns Item type
Returns Item's Icon
Sets Item's Icon
|
|
Gadget Control Functions:
The following functions are used to control gadgets.
|
Set gadget Action Group
Set Action Group status
Set Int and Float gadget range
Set Prop and Slider gadget range
Delete a gadget
|
|
Menu Interaction Functions
The following functions are used for menu interaction.
|
Set menu active or inactive
Set menu item active or inactive
Returns menu item On or Off
Set menu item On or Off
Attach a menu to a gadget
Delete a menu
|
|
Text Interaction Functions
The following functions are used to interact with selected Text Blocks and Text Input gadgets:
|
Returns last Input gadget
Returns current Block Selection gadget
Adds a line of text to an Input gadget
Toggles Input gadgets Block selection flag
Returns current Text Block as a string
Deletes current Text Block
Inserts a string into an Input gadget
Replaces current Text Block with a new string
Returns start position of current Text Block
|
|
Functions
General XLnt Functions
GUI_GFXSetup()
|
Loads Internal XLnt GFX
|
Used after your Graphics command to setup all internal XLnt GFX - don't forget to include this line!
<< Back
|
|
|
GUI()
|
Processes XLnt functions
|
GUI( [PROCESS], [MOUSE] )
PROCESS [True/False] : If set to False then XLnt will skip the processing and just draw the UI and mouse [Default True]
MOUSE [True/False] : If set to False then the mouse pointer will not be drawn [Default True]
Processes the GUI and draws the screen and mouse.
<< Back
|
|
|
GUI_Pre_Render()
|
User-Set Pre-Render function
|
Any code in this function will be executed immediately before the GUI is drawn to the screen. For Example: if you
want a background image displayed then simply put the display code in this function
Empty by Default
<< Back
|
|
|
GUI_Post_Render()
|
User-Set Post-Render function
|
Any code in this function will be executed immediately after the GUI is drawn to the screen.
Empty by Default
<< Back
|
|
|
GUI_Set_Focus(Gad)
Sets the passed gadget as the currently active gadget. Use to force text input from user.
<< Back
|
|
GUI_Focus()
Returns : currently focused gadget ID
<< Back
|
|
GUI_DrawMouse()
Draws the mouse pointer Gfx to screen.
<< Back
|
|
Window Functions
GUI_Window()
|
Add a New Window
|
GUI_WINDOW(X,Y,W,H,TITLE$,[ICON$],[FLAG],[MOD],[WIN_COL0],[BAR_COL0],[TITLE_COL],[WIN_COL1],[BAR_COL1])
ICON$ : Window Icon Name [Default ""]
FLAG : Window Flag - see below
MOD : Window Modal - see below [Default Normal]
WIN_COL0 : Main Window Color
BAR_COL0 : Window Title bar Color
TITLE_COL : Window Title bar Text Color
WIN_COL1 : Optional Second Window Color
BAR_COL1 : Optional Second Title bar Color
Returns : INT pointer
Adds a new Window and returns a type.
Flag: the flag value is used to set the windows internal values. This value is made up of several bytes - which may be added together to set multiple flags. These are:
1 : Menu : Window has a Menu bar
2 : Quit : Window has a Close button (must have a title bar!)
4 : Min : Window has a Minimize button
8 : Back : Window has a Push-Back button
16 : Drag : Window can be Dragged
32 : Scale : Window can be scaled
64 : Not Used
128 : Gradient : Window has a Gradient fill
Example : Flag=51 [1+2+16+32] will make a Window with a Menu bar[1], a Close button[2], Drag able[16], and Scalable[32].
Default : Menu+Quit+Min+Back+Drag+Scale
Modal : This value determines how the Window behaves when it isn't the currently active window.
0 : Normal : Window can be pushed behind other windows [Default Value]
1 : OnTop : Window always remains in front of all other windows, but other windows may be interacted with.
2 : Locked : Window is locked in front of all other windows - forces the user to interact with this window
Example:
MyWIN=GUI_Window(100,100,200,200,"My Window")
<< Back
|
|
|
GUI_OpenWin()
|
Open a Window
|
GUI_OpenWin(WIN)
Call when you have finished setting up a window - will "open" a window ready for further access.
Example:
;Add a window
MyWIN=GUI_Window(-1,-1,200,200,"Centered Window")
;Open the window ready for more stuff...
GUI_OpenWin(MyWin)
<< Back
|
|
|
GUI_Refresh()
|
Redraws a Window
|
GUI_REFRESH(WIN)
Redraws a Windows GFX and all of its gadgets - can be called by the user but you shouldn't need it ;)
<< Back
|
|
|
GUI_FreeWin()
|
Deletes a Window
|
GUI_FreeWin(WIN)
Deletes a Window and all of its gadgets.
Example:
;Add a window
MyWIN=GUI_Window(-1,-1,200,200,"Centered Window")
;Open the window ready for more stuff...
GUI_OpenWin(MyWin)
;Now Delete it!
GUI_FreeWin(MyWin)
<< Back
|
|
|
GUI_WinStatus()
|
Windows Current Status
|
GUI_WinStatus(WIN)
Returns:
0 : Window not "opened" use GUI_OpenWin()
1 : Window is open and on-screen.
2 : Window is Minimized.
3 : Window is Hidden.
Returns the current physical status of a Window - Open, Minimized, or Hidden.
<< Back
|
|
|
GUI_Win_TabArea()
|
Set a Windows Tab Panel
|
GUI_WIN_TABAREA(WIN,X,Y,W,H)
X,Y,W,H : Position and dimensions relative to the top-left of the window
Sets the position and dimensions of a windows Tab Panel. Any Tab Gadgets will be attached to this panel - so use this function before you
try and attach any Tab gadgets to a window.
<< Back
|
|
|
GUI_WinMin()
|
Minimize a Window
|
GUI_WINMIN(WIN)
Will minimize an open window - ie. only a portion of the title bar will show.
<< Back
|
|
|
GUI_WinMax()
|
Maximize a Window
|
GUI_WINMAX(WIN)
Will maximize a minimized window
<< Back
|
|
|
GUI_WinHide()
|
Hide a Window
|
GUI_WINHIDE(WIN)
Will hide a window
<< Back
|
|
|
GUI_WinShow()
|
Un-Hide a Window
|
GUI_WINSHOW(WIN,[MAX])
Will show a hidden window - if Max is set as True then the window will be maximized too
<< Back
|
|
|
GUI_WinTab()
|
Windows Current Tab
|
GUI_WINTAB(WIN)
Returns : INT Tab value [Default 0]
Will return the windows current active Tab - or 0 if no tabs exist or no tabs are open.
<< Back
|
|
|
GUI_Skin()
|
Create a new Skin
|
GUI_SKIN(IMG,[SPLASH])
Splash : Tile this Image [False] or resize the Window to the image size [True] [Default False]
Returns : INT skin ID
Will create a new Skin object and return its ID. If Splash is set to True then this image will be used as a spalsh screen - ie. the window will be
resized to fit the image dimensions..
Example:
;Add a window
MyWIN=GUI_Window(-1,-1,200,200,"Centered Window")
;Turn this into a Splash Screen
MySkin=GUI_Skin(Loadimage(SkinImage.BMP"),True)
;Assign the skin to the window
GUI_Skin_Window(Mywin,MySkin)
;Open the window ready for more stuff...
GUI_OpenWin(MyWin)
<< Back
|
|
|
GUI_Skin_Window()
|
Assign a Skin to a Window
|
GUI_SKIN_WINDOW(WIN,SKIN,[TAB])
SKIN : Pre-created skin object.
TAB : use to set skin to different window tabs [Default 0]
Will assign an already created Skin to a window. If Tab is set to any number then this skin will be assigned to that tab number - allows for different images in different window tabs.
Example:
;Add a window
MyWIN=GUI_Window(-1,-1,200,200,"Centered Window")
;Create 3 different skins for 3 tabs - the 2nd one will be a splash screen
Tab_Skin_0=GUI_Skin(Loadimage(Skin_0.BMP"))
Tab_Skin_1=GUI_Skin(Loadimage(Skin_1.BMP"),True)
Tab_Skin_2=GUI_Skin(Loadimage(Skin_2.BMP"))
;Assign the skins to the window tabs - the 2nd one will be a splash screen
GUI_Skin_Window(Mywin,Tab_Skin_0,0)
GUI_Skin_Window(Mywin,Tab_Skin_1,1)
GUI_Skin_Window(Mywin,Tab_Skin_2,2)
;Open the window ready for more stuff...
GUI_OpenWin(MyWin)
<< Back
|
|
|
GUI_WinX()
|
Windows Horizontal Position
|
GUI_WINX(WIN)
Returns : INT X value
Returns a window horizontal screen position
<< Back
|
|
|
GUI_WinY()
|
Windows Vertical Position
|
GUI_WINY(WIN)
Returns : INT Y value
Returns a window vertical screen position
<< Back
|
|
|
GUI_Win_XY()
|
Set a Windows Position
|
GUI_WIN_XY(WIN,X,Y)
Sets a windows screen position to X,Y
<< Back
|
|
|
GUI_Win_Title()
|
Set a Windows Title
|
GUI_WIN_TITLE(WIN,TEXT$)
Set a Windows Title Bar text.
<< Back
|
|
|
GUI_Win_SetTab()
|
Set a Windows Tab
|
GUI_WIN_SETTAB(WIN,Tab_Number)
Set a Windows currently Open Tab.
<< Back
|
|
|
Gadget Functions
Most of the gadget setup functions contain identical parameters - and to avoid too much typing I'll list those here:
WIN : gadgets parent Window
X,Y,W,H : position in Window and dimensions
ICON$ : Icon Name (see Icons) [Default ""]
TAB : gadgets Tab [Default 0]
ACT : gadget active [True] or inactive [False] [Default True]
HELP$ : gadgets ToolTips text [Default ""]
COL0 : gadgets primary color
COL1 : gadgets secondary color [Default Darker Shade of COL0]
TCOL : gadgets Text color [Default Black]
Any parameters passed in [brackets] are optional, and do not need to be passed unless you want to change from the defaults.
GUI_Button()
|
Standard Button Gadget
|
GUI_BUTTON(WIN,X,Y,W,TXT$,[ICON$],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
Returns : INT pointer
Adds a standard click able button gadget to a Window.
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Add a Button
But1=GUI_BUTTON(MyWin,10,50,100,"Button 1")
;Add a Red[$ff0000] Button with White[$ffffff] Text
But2=GUI_BUTTON(MyWin,10,70,100,"Button 2","",0,True,"Help Text",$ff0000,$dd0000,$ffffff)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_Switch()
|
On/Off Type Button
|
GUI_SWITCH(WIN,X,Y,W,TXT$,[GRP],[ICON$],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
GRP : group ID. If greater than 0 gadget belongs to this group. [Default 0]
Returns : INT pointer
Adds a standard On/Off button gadget to a Window. This button can belong to a group. If the passed group number is greater than 0
then this gadget belongs in this group - meaning that only one gadget in this group can be On at any one time.
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Add a non-grouped switch
But1=GUI_SWITCH(MyWin,10,50,100,"Switch 1")
;Add 3 buttons all in group 1
But2=GUI_SWITCH(MyWin,10,70,100,"Switch 2",1)
But3=GUI_SWITCH(MyWin,10,90,100,"Switch 3",1)
But4=GUI_SWITCH(MyWin,10,110,100,"Switch 4",1)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_CYCLE(WIN,X,Y,W,LIST$,[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
LIST : list of options separated by a "|" character. Eg. "One|Two|Three|Four|"
Returns : INT pointer
Adds a cycle button gadget to a Window. Pressing the LMB or RMB will cycle the current item in either direction
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Add a cycle gadget
But1=GUI_CYCLE(MyWin,10,50,100,"Item one|Item two|Item three|Final item|")
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_ImgButton()
|
Standard Image based Button
|
GUI_IMGBUTTON(WIN,X,Y,ICON$,[BORDER],[TAB],[ACT],[HELP$],[STYLE],[COL0],[COL1],[TCOL])
BORDER : border On [True] or Off [False] [Default On]
STYLE : border style [Default 0]
Returns : INT pointer
Adds a simple image button - containing the passed Icon GFX image. The gadget will have the same dimensions as the passed Icon.
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Add an image button gadget
But1=GUI_IMGBUTTON(MyWin,10,50,"Disk_Icon")
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_ImgSwitch()
|
On/Off Type Image Button
|
GUI_IMGSWITCH(WIN,X,Y,ICON$,[GRP],[BORDER],[TAB],[ACT],[HLP$],[STYLE],[COL0],[COL1],[TCOL])
GRP : group ID. If greater than 0 gadget belongs to this group. [Default 0]
BORDER : border On [True] or Off [False] [Default On]
STYLE : border style [Default 0]
Returns : INT pointer
Adds a standard On/Off Image button gadget to a Window. This button can belong to a group. If the passed group number is greater than 0
then this gadget belongs in this group - meaning that only one gadget in this group can be On at any one time.The button will have the same dimensions as the passed Icon, and may be enclosed in a GFX border or not.
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Add an image switch gadget - belonging to group 9, but with no border
But1=GUI_IMGSWITCH(MyWin,10,50,"Disk_Icon",9,False)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_TICK(WIN,X,Y,TEXT$,[ON],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
ON : gadget On [True] or Off [False] [Default Off]
Returns : INT pointer
Adds a standard tick box gadget to a Window. Used for selecting from a list of options.
<< Back
|
|
|
GUI_Radio()
|
Grouped Radio Check Box
|
GUI_RADIO(WIN,X,Y,TEXT$,[GRP],[ON],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
GRP : group ID. If greater than 0 gadget belongs to this group. [Default 0]
ON : gadget On [True] or Off [False] [Default Off]
Returns : INT pointer
Adds a standard radio check box to a Window. This gadget can be grouped - if the passed group parameter is greater than 0 then
this gadget belongs to that group.
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Add a few options - using group 23! oh.. lets set the first 1 on too
opt1=GUI_RADIO(MyWin,10,50,"Option 1",23,True)
opt2=GUI_RADIO(MyWin,10,70,"Option 2",23)
opt3=GUI_RADIO(MyWin,10,90,"Option 3",23)
opt4=GUI_RADIO(MyWin,10,110,"Option 4",23)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_Prop()
|
Proportional Slider
|
GUI_PROP(WIN,X,Y,SIZE,MIN,MAX,[HORZ],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
SIZE : size of gadget
MIN,MAX : minimum and maximum values
HORZ : horizontal [True] or vertical [False] [Default Horizontal]
Returns : INT pointer
Adds a standard proportional slider to a Window.
<< Back
|
|
|
GUI_Slider()
|
Slider Gadget
|
GUI_SLIDER(WIN,X,Y,SIZE,MIN,MAX,[HORZ],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
SIZE : size of gadget
MIN,MAX : minimum and maximum values
HORZ : horizontal [True] or vertical [False] [Default Horizontal]
COL0,COL1 : box gradient fill colors
Returns : INT pointer
Adds a value slider gadget to a Window
<< Back
|
|
|
GUI_Integer()
|
INT Spinner/Input Gadget
|
GUI_INTEGER(WIN,X,Y,VAL,MIN,MAX, [LABEL$], [STEP],[W],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
STEP : gadget increase/decrease step value [Default 1]
Returns : INT pointer
Adds a integer spinner box to a Window - with an optional user defined step value
<< Back
|
|
|
GUI_Float()
|
Float Spinner/Input Gadget
|
GUI_FLOAT(WIN,X,Y,VAL#,MIN#,MAX#, [LABEL$], [STEP#],[W],[DEC],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
STEP# : gadget increase/decrease step value [Default .01]
DEC : number of decimal places to show [Default 2]
Returns : INT pointer
Adds a float spinner box to a Window - with an optional user defined step value, and variable number of decimal places
<< Back
|
|
|
GUI_TxtList()
|
Simple Text List
|
GUI_TXTLIST(WIN,X,Y,W,H,LIST,[MULTI],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
LIST : previously made list
MULTI : number of items that may be selected at any time [Default 1]
Returns : INT pointer
Adds a simple 1-dimensional text list to a Window.
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Make a list
MyList=GUI_List()
;Add some items to it....
Itm1=GUI_LIST_ADDITM(MyList,"Item one")
Itm2=GUI_LIST_ADDITM(MyList,"Item two")
Itm3=GUI_LIST_ADDITM(MyList,"Item three")
Itm4=GUI_LIST_ADDITM(MyList,"Item four")
;Add a text list gadget
TxtLst=GUI_TxtList(MyWin,10,50,100,200,MyList)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_TreeList()
|
Advanced Tree List
|
GUI_TREELIST(WIN,X,Y,W,H,LIST,[MULTI],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
LIST : previously made list
MULTI : number of items that may be selected at any time [Default 1]
Returns : INT pointer
Adds a multi-dimensional treelist to a Window.
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Make a list
MyList=GUI_List()
;Add a node to the list
Node1=GUI_LIST_ADDNODE(MyList,"Node one")
;Add some items to it....
Itm1=GUI_LIST_ADDITM(MyList,"Item one",Node1)
Itm2=GUI_LIST_ADDITM(MyList,"Item two",Node1)
Itm3=GUI_LIST_ADDITM(MyList,"Item three",Node1)
Itm4=GUI_LIST_ADDITM(MyList,"Item four",Node1)
;Add a sub-node to the node :P
Node2=GUI_LIST_ADDNODE(MyList,"Node two",Node1)
;Add an item to the sub node
Itm5=GUI_LIST_ADDITM(MyList,"Item Five",Node2)
;Add a tree list gadget
TreeLst=GUI_TreeList(MyWin,10,50,100,200,MyList)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_Selector()
|
Drop Down Selector Box
|
GUI_SELECTOR(WIN,X,Y,W,LIST,[SIZE],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
LIST : previously made list
SIZE : height of drop-down box in text lines [Default 5]
Returns : INT pointer
Adds a pull-down selector gadget to a Window. The user can set the width and height of the pull down box.
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Make a list
MyList=GUI_List()
;Add some items to it....
Itm1=GUI_LIST_ADDITM(MyList,"Item one")
Itm2=GUI_LIST_ADDITM(MyList,"Item two")
Itm3=GUI_LIST_ADDITM(MyList,"Item three")
Itm4=GUI_LIST_ADDITM(MyList,"Item four")
;Add a combo gadget
Selector=GUI_Selector(MyWin,10,50,100,MyList,6)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_ImgBox()
|
Image Display Box
|
GUI_IMGBOX(WIN,X,Y,W,H,IMAGE,[SCALE],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
IMAGE : previously loaded Image
SCALE : proportionally resize image to fit box [True] or normal resize [False] [Default False]
Returns : INT pointer
Adds an image display box to a Window. Displays an image within a Gfx frame of set dimensions
<< Back
|
|
|
GUI_Frame()
|
Graphical Frame Border
|
GUI_FRAME(WIN,X,Y,W,H,[TEXT$],[TYPE],[TAB],[ACT],[HELP$])
TEXT$ : optional frame label
TYPE : style of frame [0 to 4] [Default 0]
Returns : INT pointer
Adds a Gfx frame to a Window.
<< Back
|
|
|
GUI_Panel()
|
Expandable Gadget Panel
|
GUI_PANEL(WIN,X,Y,W,H,TEXT$,[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
H : height of open panel
Returns : INT pointer
Adds a "3D Max" style expandable panel to a Window. This panel acts as a gadget container - when it is closed then all of its attached gadgets will be hidden, when it is open then all of its gadgets will be visible.
In order to use a panel you must first create all of its contained gadgets and then attach each one to the panel gadget.
Note: when you attach a gadget to a panel the gadgets X and Y position will become relative to the panels position, not the Window.
Also, please make sure that there is enough space within the panel to display all of its gadgets, as panel auto-resizing is not yet available.
Oh....and panels are only for basic gadgets, so if you add another panel or a toolbar to a panel you may get a few problems ;)
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,300,300,"My Window")
;Make a list
MyList=GUI_List()
;Add some items to it....
Itm1=GUI_LIST_ADDITM(MyList,"Item one")
Itm2=GUI_LIST_ADDITM(MyList,"Item two")
Itm3=GUI_LIST_ADDITM(MyList,"Item three")
Itm4=GUI_LIST_ADDITM(MyList,"Item four")
;Add a combo gadget
Selector=GUI_Selector(MyWin,10,10,100,MyList,6)
;Now add a panel gadget
Pan=GUI_PANEL(MyWin,10,50,200,200,"Panel Gad")
;And attach our selector gadget to the panel
GUI_PANEL_ATTACH(Selector,Pan)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_ToolBar()
|
Scrollable ToolBar
|
GUI_TOOLBAR(WIN,X,Y,W,H,[HORZ],[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
HORZ : horizontal [True] or vertical [False] toolbar [Default Horizontal]
Returns : INT pointer
Adds a simple scrolling toolbar to a Window. As with Panels, you must first make all of your gadgets and then attach them to the toolbar. However, unlike panels, the gadgets X and Y positions are ignored
when you add them to a toolbar. Toolbars allow either a single horizontal row or vertical column of gadgets to be added, so any gadgets in a toolbar will have their X and Y positions changed when they are attached.
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Make a list
MyList=GUI_List()
;Add some items to it....
Itm1=GUI_LIST_ADDITM(MyList,"Item one")
Itm2=GUI_LIST_ADDITM(MyList,"Item two")
Itm3=GUI_LIST_ADDITM(MyList,"Item three")
Itm4=GUI_LIST_ADDITM(MyList,"Item four")
;Add a combo gadget
Selector=GUI_Selector(MyWin,10,50,100,MyList,6)
;Now make a Toolbar container
Tool=GUI_TOOLBAR(MyWin,5,40,180,30)
;And attach our selector gadget
GUI_TOOLBAR_ATTACH(Selector,Tool)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_TAB(WIN,W,TABNUMBER,TEXT$,[ICON$],[ALIGN],[BORDER],[ACT],[COL0],[COL1],[TCOL])
TABNUMBER : tab group that this gadget toggles - must be greater than 0
ALIGN : gadget placed at top [False] or bottom [True] of tab area [Default Top]
BORDER : bordered [True] or non-bordered [False] [Default True]
Returns : INT pointer
Adds a Tab gadget to a Windows Tab Area. Before you add a tab gadget you must first set the Windows Tab Area - a defined space within the window where all "tabbed" gadgets will be located. The tab gadget can be aligned to either the top or bottom of the tab area.
Note: to avoid errors it is best to create tabs in this order...
- Create window - GUI_WINDOW()
- Create tab area - GUI_WIN_TABAREA()
- Add all tab gadgets - GUI_TAB()
- Create all other gadgets
Example:
;Make a window
MyWIN=GUI_WINDOW(0,0,200,200,"My Window")
;Set the window tab area - all "tabbed" gadgets will now be located relative to this area
GUI_WIN_TABAREA(MyWin,2,50,150,150)
;Add a tab gadget for tab 1
Tab1=GUI_TAB(MyWin,30,1,"Tab One")
;Now add some buttons to tab 1
but1=GUI_BUTTON(MyWin,10,10,100,"Button 1",1)
but2=GUI_BUTTON(MyWin,10,25,100,"Button 2",1)
;Open the Window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_Label()
|
Simple Text Label
|
GUI_LABEL(WIN,X,Y,W,H,TEXT$,[ALIGN],[TAB],[ACT],[HELP$],[TCOL])
ALIGN : text alignment; 0[Left], 1[Center], or 2[Right] [Default Left]
Returns : INT pointer
Displays text within a pre-defined "box" with set alignment and word wrapping. A newline character [Chr$(13)] or a "¬" character will force a line break.
<< Back
|
|
|
GUI_TextBox()
|
Scrollable Text Box
|
GUI_TEXTBOX(WIN,X,Y,W,H,[TAB],[ACT],[HELP$],[WRAP],[TCOL],[BCOL],[COL0],[COL1])
WRAP : horizontal and vertical scrolling [False] or simple single line word-wrap [True] [Default False]
BCOL : background color [Default White]
Returns : INT pointer
Adds a scrollable text input area to a Window. If wrap is set to True then the text will wrap when it reaches the right hand side of the gadget. If wrap is set to False then the text will not wrap but the gadget will have both horizontal
and vertical scrollbars
<< Back
|
|
|
GUI_INPUT(WIN,X,Y,W,[TEXT$],[PASSWORD],[TAB],[ACT],[HELP$],[TCOL],[BCOL],[COL0],[COL1])
TEXT$ : initial box contents [Default ""]
PASSWORD : password input [True] or normal text [False] [Default False]
BCOL : background color [Default White]
Returns : INT pointer
Adds a single line text input box to a Window. If password is set to true then the text will be hidden and *'s will be displayed instead.
<< Back
|
|
|
GUI_ImgArea()
|
Scrollable Image Display
|
GUI_IMGAREA(WIN,X,Y,W,H,IMAGE,[TAB],[ACT],[HELP$],[COL0],[COL1],[TCOL])
IMAGE : previously loaded Image
Returns : INT pointer
Adds a scrollable image display box to a Window.
<< Back
|
|
|
GUI_GadW(Gad)
Returns : gadget width
<< Back
|
|
GUI_GadH(Gad)
Returns : gadget height
<< Back
|
|
GUI_Gad_ScreenX(Gad)
Returns : gadget on screen X position
<< Back
|
|
GUI_Gad_ScreenY(Gad)
Returns : gadget on screen Y position
<< Back
|
|
GUI_Gad_MouseX(Gad)
Returns : mouse X position relative to ImageBox Image [thanks Kanati]
<< Back
|
|
GUI_Gad_MouseY(Gad)
Returns : mouse Y position relative to ImageBox Image [thanks Kanati]
<< Back
|
|
GUI_GadActive(Gad)
Returns : gadget Active [True] or Inactive [False]
<< Back
|
|
GUI_GadOn(Gad)
Returns : gadget On [True] or Off [False]
<< Back
|
|
GUI_GadStatus(Gad)
Returns : gadget status: 0 [hidden], 1 [normal], 2 [locked]
<< Back
|
|
GUI_SetActive(Gad,True/False)
Set a gadget Active [True] or Inactive [False]
<< Back
|
|
GUI_Selector_Set(Gad,Item)
Set the currently selected item in a pull-down selector to the passed list item
<< Back
|
|
GUI_GadList(Gad)
Returns : gadget list ID or 0
<< Back
|
|
GUI_SetOn(Gad,True/False)
Set a gadget On [True] or Off [False]
<< Back
|
|
GUI_Gad_Status(Gad,Status)
Set a gadget status to 0 [hidden], 1 [normal] or 2 [locked]
<< Back
|
|
GUI_GadFloat(Gad)
Returns : gadget Float value
<< Back
|
|
GUI_GadVal(Gad)
Returns : gadget Integer value
<< Back
|
|
GUI_GadGroup_On(Group)
Returns : gadget ID (or 0) of the ON gadget in the passed group
<< Back
|
|
GUI_GadGroup(Gad)
Returns : gadget group
<< Back
|
|
GUI_GadTab(Gad)
Returns : gadget tab number
<< Back
|
|
GUI_GadX(Gad)
Returns : gadget X position
<< Back
|
|
GUI_GadY(Gad)
Returns : gadget Y position
<< Back
|
|
GUI_ToolTip(Gad,Help$)
Set a gadgets tooltip text to the passed Help$ string. Use a "¬" character to insert a newline ;)
<< Back
|
|
GUI_SetXY(Gad,X,Y)
Set a gadgets position
<< Back
|
|
GUI_SetFloat(Gad,Val#)
Set a gadgets Float value
<< Back
|
|
GUI_SetVal(Gad,Val)
Set a gadgets Integer value
<< Back
|
|
GUI_GadText$(Gad)
Returns : gadgets current text
<< Back
|
|
GUI_SetText(Gad,Text$)
Set a gadgets text
<< Back
|
|
GUI_SetList(Gad,List)
Set a gadgets list
<< Back
|
|
GUI_ActGroup(Group, Gad1,[Gad2],[Gad3],[Gad4],[Gad5])
Add upto 5 gadgets to an action group. Action groups allow you to activate / deactivate multiple
gadgets with just one function call - gadgets may belong to more than one action group too ;)
<< Back
|
|
GUI_Set_ActGroup(Group,True/False)
Set all gadgets in the passed action group to active [True] or inactive [False]
<< Back
|
|
GUI_Range(Gad,Val,Min,Max)
Set a Int or Float gadgets range
<< Back
|
|
GUI_Prop_Range(Gad,Min,Max)
Set a slider or prop gadgets range
<< Back
|
|
GUI_FreeGad(Gad)
Delete a gadget and anything attached to it (lists, images etc)
<< Back
|
|
GUI_Set_Focus(Gad)
Sets focus to passed gadget
<< Back
|
|
GUI_Focus()
Returns : current focused gadget
<< Back
|
|
GUI_Gad_AddLine(Gad,Text$)
Adds a line of text to the end of the passed input gadgets current text
<< Back
|
|
GUI_Block_Active(Gad,Active)
Sets input gadgets Block selection flag. If True then text can be selected in this gadget [Default True]
<< Back
|
|
GUI_Block_Copy$()
Returns : current selected text block
<< Back
|
|
GUI_Block_Delete()
Deletes current text block
<< Back
|
|
GUI_Block_Insert(Gad,Text$,[Pos])
Pos: Position to insert at: Current Cursor Pos [-1], Start of text [0], or any other position [>0] [Default -1]
Inserts a string into an input gadget. You can insert at the current cursor position [Default], at the start of the gadgets text, or at any position in the text.
<< Back
|
|
GUI_Block_Replace(Text$)
Replaces the curently selected text block with the passed string
<< Back
|
|
GUI_Block_CursorPos()
Returns : start position of text block
<< Back
|
|
GUI_Block_Gad()
Returns : ID of text blocks gadget
<< Back
|
|
GUI_Input_Gad()
Returns : ID of current input gadget
<< Back
|
|
List Functions
GUI_LIST()
Returns:INT pointer
Makes a new list and returns its type pointer.
Example:
;Make a list
MyList=GUI_LIST()
;Add a few items to the list
itm1=GUI_LIST_ADDITM(MyList,"Item 1")
itm2=GUI_LIST_ADDITM(MyList,"Item 2")
itm3=GUI_LIST_ADDITM(MyList,"Item 3")
;Add a textlist gadget which contains our list
Lst=GUI_TXTLST(MyWin,10,50,100,100,MyList)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_List_AddItm()
|
Add a List Item
|
GUI_LIST_ADDITM(LIST,TXT$,DIR,[ICON$],[ACT],[VAL_INT],[VAL_TXT$], [REFRESH], [TXT_COL],[COL])
LIST : parent list
TXT$ : items text
DIR : items parent directory - see below
ICON$ : optional icon name
ACT : item active [True] or inactive [False] [Default True]
VAL_INT : optional integer data held by item
VAL_TXT$ : optional string data held by item
TXT_COL : text color [Default Black]
COL : item background color [Default White]
Returns:INT pointer
Add a new list item to a previously made List. Dir is the items parent directory within the list - so pass the node if it is within a sub-node. You can also store an Int and String value in an item - very useful ;)
Example:
;Make a list
MyList=GUI_LIST()
;Add a sub-node to the list
Node1=GUI_LIST_ADDNODE(MyList,"Sub Node")
;Add a few items to the list
;One in the root node
itm1=GUI_LIST_ADDITM(MyList,"Item 1")
;And two in our sub-node
itm2=GUI_LIST_ADDITM(MyList,"Item 2",Node1)
itm3=GUI_LIST_ADDITM(MyList,"Item 3",Node1)
;Add a treelist gadget which contains our list
Lst=GUI_TREELST(MyWin,10,50,100,100,MyList)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_List_AddNode()
|
Add a Sub-Node
|
GUI_LIST_ADDNODE(LIST,TXT$,DIR,[ICON$],[ACT],[VAL_INT],[VAL_TXT$], [REFRESH], [TXT_COL],[COL])
LIST : parent list
TXT$ : items text
DIR : items parent directory - see below
ICON$ : optional icon name
ACT : item active [True] or inactive [False] [Default True]
VAL_INT : optional integer data held by item
VAL_TXT$ : optional string data held by item
TXT_COL : text color [Default Black]
COL : item background color [Default White]
Returns:INT pointer
Add a new sub-node to a previously made List.
Example:
;Make a list
MyList=GUI_LIST()
;Add a sub-node to the list
Node1=GUI_LIST_ADDNODE(MyList,"Sub Node")
;Add one item to the first sub-node
itm1=GUI_LIST_ADDITM(MyList,"Item 1",Node1)
;Now add a further sub-node to the first sub-node (oooh!)
Node2=GUI_LIST_ADDNODE(MyList,"Sub Sub Node",Node1)
;And add a couple of items to it
itm2=GUI_LIST_ADDITM(MyList,"Item 2",Node2)
itm3=GUI_LIST_ADDITM(MyList,"Item 3",Node2)
;Add a treelist gadget which contains our list
Lst=GUI_TREELST(MyWin,10,50,100,100,MyList)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_List_AddTick()
|
Add a Tick Box
|
GUI_LIST_ADDTICK(LIST,TXT$,DIR,[ACT],[VAL_INT],[VAL_TXT$], [REFRESH], [TXT_COL],[COL])
LIST : parent list
TXT$ : items text
DIR : items parent directory - see below
ACT : item active [True] or inactive [False] [Default True]
VAL_INT : optional integer data held by item
VAL_TXT$ : optional string data held by item
TXT_COL : text color [Default Black]
COL : item background color [Default White]
Returns:INT pointer
Add a tick box to a previously made List.
Example:
;Make a list
MyList=GUI_LIST()
;Add a tick box to the list
Option1=GUI_LIST_ADDTICK(MyList,"Option One")
;Add a treelist gadget which contains our list
Lst=GUI_TREELST(MyWin,10,50,100,100,MyList)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_List_AddCheck()
|
Add a Grouped Check Box
|
GUI_LIST_ADDCHECK(LIST,TXT$,DIR,[GRP],[ACT],[VAL_INT],[VAL_TXT$], [REFRESH], [TXT_COL],[COL])
LIST : parent list
TXT$ : items text
DIR : items parent directory - see below
GRP : items group ID - if greater than 0 then this item is in a group [Default 0]
ACT : item active [True] or inactive [False] [Default True]
VAL_INT : optional integer data held by item
VAL_TXT$ : optional string data held by item
TXT_COL : text color [Default Black]
COL : item background color [Default White]
Returns:INT pointer
Add a grouped check box to a previously made List. If the passed group parameter is greater than 0 then this item belongs in that group - meaning that only one item in the group may be on at any one time.
Example:
;Make a list
MyList=GUI_LIST()
;Add a few check boxes to the list
Option1=GUI_LIST_ADDCHECK(MyList,"Option One",1)
Option2=GUI_LIST_ADDCHECK(MyList,"Option Two",1)
Option3=GUI_LIST_ADDCHECK(MyList,"Option Three",1)
;Add a treelist gadget which contains our list
Lst=GUI_TREELST(MyWin,10,50,100,100,MyList)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_List_AddInt()
|
Add an Integer Gadget
|
GUI_LIST_ADDINT(LIST,VAL,MIN,MAX,[TXT$],[DIR],[ICON$],[ACT],[VAL_INT],[VAL_TXT$], [REFRESH], [TXT_COL],[COL])
LIST : parent list
TXT$ : items text
DIR : items parent directory - see below
ACT : item active [True] or inactive [False] [Default True]
VAL_INT : optional integer data held by item
VAL_TXT$ : optional string data held by item
TXT_COL : text color [Default Black]
COL : item background color [Default White]
Returns:INT pointer
Adds an Integer gadget to a list
Example:
;Make a list
MyList=GUI_LIST()
;Add an Integer Gadget to the list
itm_1=GUI_List_AddInt(MyList,50,0,255,"Input:")
;Add a treelist gadget which contains our list
Lst=GUI_TREELST(MyWin,10,50,100,100,MyList)
;Get the int items gadget ID
itm_1_gad=GUI_Item_Gad(itm_1)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_List_AddFloat()
|
Add a Float Gadget
|
GUI_LIST_ADDFLOAT(LIST,VAL#,MIN#,MAX#,[TXT$],[DIR],[ICON$],[STEP#],[DECIMALS],[ACT],[VAL_INT],[VAL_TXT$], [REFRESH], [TXT_COL],[COL])
LIST : parent list
TXT$ : items text
DIR : items parent directory - see below
ACT : item active [True] or inactive [False] [Default True]
VAL_INT : optional integer data held by item
VAL_TXT$ : optional string data held by item
TXT_COL : text color [Default Black]
COL : item background color [Default White]
Returns:INT pointer
Adds a Float gadget to a list
Example:
;Make a list
MyList=GUI_LIST()
;Add an Integer Gadget to the list
itm_1=GUI_List_AddFloat(MyList,50,0,255,"Float:")
;Add a treelist gadget which contains our list
Lst=GUI_TREELST(MyWin,10,50,100,100,MyList)
;Get the int items gadget ID
itm_1_gad=GUI_Item_Gad(itm_1)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_List_AddInput()
|
Add an Input Gadget
|
GUI_LIST_ADDINPUT(LIST,TXT$,[DIR],[ICON$],[ACT],[VAL_INT],[VAL_TXT$], [REFRESH], [TXT_COL],[COL])
LIST : parent list
TXT$ : items text
DIR : items parent directory - see below
ACT : item active [True] or inactive [False] [Default True]
VAL_INT : optional integer data held by item
VAL_TXT$ : optional string data held by item
TXT_COL : text color [Default Black]
COL : item background color [Default White]
Returns:INT pointer
Adds an Input gadget to a list
Example:
;Make a list
MyList=GUI_LIST()
;Add an Integer Gadget to the list
itm_1=GUI_List_AddInput(MyList,"Input:")
;Add a treelist gadget which contains our list
Lst=GUI_TREELST(MyWin,10,50,100,100,MyList)
;Get the int items gadget ID
itm_1_gad=GUI_Item_Gad(itm_1)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_List_AddLine(List,[Dir],[Refresh],[Line Col],[Back Col])
Adds a separation line to a list
<< Back
|
|
GUI_List_AddIcon(List,Text$,Dir,Icon$,[Active],[Val_Int],[Val_Txt$],[Refresh],[Text Col],[Back Col])
Adds a clickable Icon item to a list. Acts like a normal Tick Box Item - but you supply the Icon Gfx.
<< Back
|
|
GUI_List_CountSelected(List)
Returns : number of selected items in a list
<< Back
|
|
GUI_List_Selected(List,[Index])
Returns : ID of first selected list item or the next item after [Index]
Example
;the following code will loop thru a list and return all
;selected items in it
For INDEX=1 To GUI_LIST_NUMITEMS(MYLIST)
Itm=GUI_LIST_SELECTED(MYLIST,INDEX)
Next
<< Back
|
|
GUI_Item_Selected(Item)
Returns : True if the item is currently selected or False if not
<< Back
|
|
GUI_Item_On(Item)
Returns : True if the item is On or False if Off
<< Back
|
|
GUI_List_SetAct(Item,True/False)
Set a list item active [True] or inactive [False]
<< Back
|
|
GUI_List_SetText(Item,Text$)
Set a list items text
<< Back
|
|
GUI_List_SetCol(Item,Text_RGB,Back_RGB)
Set a list items colors
<< Back
|
|
GUI_List_GetText$(Item)
Returns : list item text
<< Back
|
|
GUI_List_ItmList(Item)
Returns : list items parent list ID or 0
<< Back
|
|
GUI_List_Toggle(Item,True/False)
Turn a list item On/Open/Selected [True] or Off/Closed/Free [False]
<< Back
|
|
GUI_List_KillItm(Item)
Delete a list item
<< Back
|
|
GUI_List_Clear(List)
Delete a list
<< Back
|
|
GUI_Item_GetVal(Item)
Returns : list items Integer Data
<< Back
|
|
GUI_Item_GetText$(Item)
Returns : list items Text data
<< Back
|
|
GUI_Item_SetVal(Item,Val)
Set a list items Integer data
<< Back
|
|
GUI_Item_SetText(Item,Text$)
Set a list items Text data
<< Back
|
|
GUI_Item_Gad(Item)
Returns : ID of items attached gadget
Example:
;Make a list
MyList=GUI_LIST()
;Add an Integer Gadget to the list
itm_1=GUI_List_AddInput(MyList,"Input:")
;Add a treelist gadget which contains our list
Lst=GUI_TREELST(MyWin,10,50,100,100,MyList)
;Get the int items gadget ID
itm_1_gad=GUI_Item_Gad(itm_1)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
GUI_List_NumItems(List,Node[0])
Returns : number of list items in a passed node [leave as 0 for root node]
<< Back
|
|
GUI_List_CurPos(Item)
Returns : list item current position from top of its parent node [starts from 0]
<< Back
|
|
GUI_Item_Pos(Item,Pos)
Moves an item to a specific point in its node
<< Back
|
|
GUI_Item_Move(Item,Step Value [+ or -])
Move an item the specified number of steps within its node
<< Back
|
|
GUI_List_NewGroup()
|
Create a new Selection Group
|
GUI_LIST_NEWGROUP(LIST,MAX)
LIST : parent list
MAX : number of selectable items
Returns:INT pointer
Creates a new Item Selection Group to which you can add list items.
Example:
;Make a list
MyList=GUI_List()
;Add a node to the list
Node1=GUI_LIST_ADDNODE(MyList,"Node one")
;Add some items to it....
Itm1=GUI_LIST_ADDTICK(MyList,"Please",Node1)
Itm2=GUI_LIST_ADDTICK(MyList,"Select",Node1)
Itm3=GUI_LIST_ADDTICK(MyList,"Three Items",Node1)
Itm4=GUI_LIST_ADDTICK(MyList,"From this",Node1)
Itm5=GUI_LIST_ADDTICK(MyList,"List...",Node1)
;Add a Selection Group to this Node
MyGroup=GUI_LIST_NEWGROUP(MyList,3)
;And add some items to the new Group
GUI_ITEM_ADDGROUP(Itm1,MyGroup)
GUI_ITEM_ADDGROUP(Itm2,MyGroup)
GUI_ITEM_ADDGROUP(Itm3,MyGroup)
GUI_ITEM_ADDGROUP(Itm4,MyGroup)
GUI_ITEM_ADDGROUP(Itm5,MyGroup)
<< Back
|
|
|
GUI_Item_AddGroup()
|
Add Items to a group
|
GUI_ITEM_ADDGROUP(ITEM,GROUP)
GROUP : selection group ID
Adds an item to a pre-created Selection Group.
Example:
;Make a list
MyList=GUI_List()
;Add a node to the list
Node1=GUI_LIST_ADDNODE(MyList,"Node one")
;Add some items to it....
Itm1=GUI_LIST_ADDTICK(MyList,"Please",Node1)
Itm2=GUI_LIST_ADDTICK(MyList,"Select",Node1)
Itm3=GUI_LIST_ADDTICK(MyList,"Three Items",Node1)
Itm4=GUI_LIST_ADDTICK(MyList,"From this",Node1)
Itm5=GUI_LIST_ADDTICK(MyList,"List...",Node1)
;Add a Selection Group to this Node
MyGroup=GUI_LIST_NEWGROUP(MyList,3)
;And add some items to the new Group
GUI_ITEM_ADDGROUP(Itm1,MyGroup)
GUI_ITEM_ADDGROUP(Itm2,MyGroup)
GUI_ITEM_ADDGROUP(Itm3,MyGroup)
GUI_ITEM_ADDGROUP(Itm4,MyGroup)
GUI_ITEM_ADDGROUP(Itm5,MyGroup)
<< Back
|
|
|
GUI_List_Item()
|
Step thru an List/Node
|
GUI_LIST_ITEM(LIST,[NODE],[POS])
LIST : parent list
NODE : optional Node ID [Default Root-Node 0]
POS : position of item
Returns:INT Item ID
Returns the ID of the Item at position POS in the passed List/Node
Example:
;Make a list
MyList=GUI_List()
;Add a node to the list
Node1=GUI_LIST_ADDNODE(MyList,"Node one")
;Add some items to it....
Itm1=GUI_LIST_ADDTICK(MyList,"Please",Node1)
Itm2=GUI_LIST_ADDTICK(MyList,"Select",Node1)
Itm3=GUI_LIST_ADDTICK(MyList,"Three Items",Node1)
Itm4=GUI_LIST_ADDTICK(MyList,"From this",Node1)
Itm5=GUI_LIST_ADDTICK(MyList,"List...",Node1)
;Add a Selection Group to this Node
MyGroup=GUI_LIST_NEWGROUP(MyList,3)
;And add some items to the new Group
GUI_ITEM_ADDGROUP(Itm1,MyGroup)
GUI_ITEM_ADDGROUP(Itm2,MyGroup)
GUI_ITEM_ADDGROUP(Itm3,MyGroup)
GUI_ITEM_ADDGROUP(Itm4,MyGroup)
GUI_ITEM_ADDGROUP(Itm5,MyGroup)
;Step thru our list and print out the item text and types
For INDEX=1 To GUI_LIST_NUMITEMS(MYLIST,NODE1)
XL_ITM=GUI_LIST_ITEM(MYLIST,NODE1,INDEX)
Text 0,Y,GUI_LIST_GETTEXT(XL_ITM)+" "+GUI_ITEM_TYPE(XL_ITM)
Y=Y+16
Next
<< Back
|
|
|
GUI_Item_Type()
|
Returns Item Type
|
GUI_ITEM_Type(ITEM)
Returns:INT Item TYPE
Returns a value depending on the type of item passed.
Example:
;Make a list
MyList=GUI_List()
;Add a node to the list
Node1=GUI_LIST_ADDNODE(MyList,"Node one")
;Add some items to it....
Itm1=GUI_LIST_ADDTICK(MyList,"Please",Node1)
Itm2=GUI_LIST_ADDTICK(MyList,"Select",Node1)
Itm3=GUI_LIST_ADDTICK(MyList,"Three Items",Node1)
Itm4=GUI_LIST_ADDTICK(MyList,"From this",Node1)
Itm5=GUI_LIST_ADDTICK(MyList,"List...",Node1)
;Add a Selection Group to this Node
MyGroup=GUI_LIST_NEWGROUP(MyList,3)
;And add some items to the new Group
GUI_ITEM_ADDGROUP(Itm1,MyGroup)
GUI_ITEM_ADDGROUP(Itm2,MyGroup)
GUI_ITEM_ADDGROUP(Itm3,MyGroup)
GUI_ITEM_ADDGROUP(Itm4,MyGroup)
GUI_ITEM_ADDGROUP(Itm5,MyGroup)
;Step thru our list and print out the item text and types
For INDEX=1 To GUI_LIST_NUMITEMS(MYLIST,NODE1)
XL_ITM=GUI_LIST_ITEM(MYLIST,NODE1,INDEX)
Text 0,Y,GUI_LIST_GETTEXT(XL_ITM)+" "+GUI_ITEM_TYPE(XL_ITM)
Y=Y+16
Next
<< Back
|
|
|
GUI_Item_Icon()
|
Returns Item's Icon
|
GUI_ITEM_ICON$(ITEM)
Returns:STRING$ Icon Name$
<< Back
|
|
|
GUI_Item_SetIcon()
|
Set an Item's Icon
|
GUI_ITEM_SETICON(ITEM,ICON$)
Sets an Item's Icon to the passed one.
<< Back
|
|
|
Menu Functions
GUI_WinMenu()
|
Get Windows Menu
|
GUI_WINMENU(WIN)
Returns :INT pointer
Returns a Windows menubar Menu. All main "menubar" menus (eg File, Edit, Insert) must have this menu as their parent menu.
Example :
;Make a window
MyWin=GUI_WINDOW(0,0,200,200,"My Window")
;Get the windows menubar menu
WinMenu=GUI_WINMENU(MyWin)
;Make a File Menu
mnu_File=GUI_MENU(WinMenu,"File")
;Add a menu item to it
itm_New=GUI_MENU_ITEM(mnu_File,"New")
;Refresh the menu
GUI_MENU_REFRESH(mnu_FILE)
;Open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_Menu_Refresh()
|
Update a Menu
|
GUI_MENU_REFRESH(MENU)
Use when you have finished creating or updating a menu so that all of the menus Gfx may be redrawn.
Example :
;Make a menu
mnu_File=GUI_MENU(GUI_WINMENU(MyWin),"File")
;Add an item to it
itm_New=GUI_MENU_ITEM(mnu_File,"New")
;We have finished making the menu - so we need to update its gfx
GUI_MENU_REFRESH(mnu_File)
<< Back
|
|
|
GUI_MENU(PARENT,TEXT$,[ACTIVE],[COL])
PARENT : menus parent menu
TEXT$ : menus title
ACTIVE : menu active [Default True]
COL : menu background color
Returns :INT pointer
Creates a new main menu and returns a pointer. Parent should contain this menus' parent menu or 0 if it has no parent. To add a root menu to a windows' menubar then
you must use GUI_WinMenu() to find the menus' parent.
Example :
;Make a Window
MyWin=GUI_WINDOW(-1,-1,300,200,"Window...")
;Find out the window menubars menu
mnu_bar=GUI_WINMENU(MyWin)
;Add a File menu to the menubar
mnu_File=GUI_MENU(mnu_Bar,"File")
;Add a couple of items to it...
itm_New=GUI_MENU_ITEM(mnu_File,"New")
itm_Load=GUI_MENU_ITEM(mnu_File,"Load")
itm_Save=GUI_MENU_ITEM(mnu_File,"Save")
;Add a menu line
GUI_MENU_LINE(mnu_File)
;And a final item
itm_Quit=GUI_MENU_ITEM(mnu_File,"Quit")
;Now refresh the menu
GUI_MENU_REFRESH(mnu_File)
;And open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_SubMenu()
|
Create a Sub Menu
|
GUI_SUBMENU(MENU)
MENU : sub-menus parent menu
Returns :INT pointer
Creates a new sub-menu attached to the passed parent menu. Don't forget to call GUI_Menu_Refresh() to draw this menu too ;)
Example :
;Make a Window
MyWin=GUI_WINDOW(-1,-1,300,200,"Window...")
;Find out the window menubars menu
mnu_bar=GUI_WINMENU(MyWin)
;Add a File menu to the menubar
mnu_File=GUI_MENU(mnu_Bar,"File")
;Add a sub menu to the File menu
mnu_New=GUI_SUBMENU(mnu_File)
;Add a couple of items to it...
itm_NewPro=GUI_MENU_ITEM(mnu_New,"Project")
itm_NewPage=GUI_MENU_ITEM(mnu_New,"Page")
itm_NewWin=GUI_MENU_ITEM(mnu_New,"Window")
;Add a pointer to the sub menu in the File menu
itm_New=GUI_MENU_SUB(mnu_File,"New..",mnu_New)
;Add a menu line
GUI_MENU_LINE(mnu_File)
;And a final item
itm_Quit=GUI_MENU_ITEM(mnu_File,"Quit")
;Now refresh the menus
GUI_MENU_REFRESH(mnu_File)
GUI_MENU_REFRESH(mnu_New)
;And open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_Menu_Item()
|
Add a Menu Item
|
GUI_MENU_ITEM(MENU,TEXT$,[ACTIVE],[ICON$],[COL])
MENU : items menu
TEXT$ : items text
ACTIVE : item active [True] or inactive [False] [Default True]
ICON$ : optional Icon to display next to items text
COL : text color [Default Black]
Returns :INT pointer
Adds a standard menu item to a menu.
<< Back
|
|
|
GUI_Menu_Sub()
|
Add a Menu Pointer
|
GUI_MENU_SUB(MENU,TEXT$,SUB_MENU,[ACTIVE],[ICON$],[COL])
MENU : sub-menus parent menu
TEXT$ : items text
SUB_MENU : menu which this item will open
ACTIVE : active [True] or inactive [False] [Default True]
ICON$ : optional icon
COL : text color [Default Black]
Returns :INT pointer
Adds a sub-menu item to a menu. When the mouse is over this item then the passed sub-menu will open.
Example :
;Make a Window
MyWin=GUI_WINDOW(-1,-1,300,200,"Window...")
;Find out the window menubars menu
mnu_bar=GUI_WINMENU(MyWin)
;Add a File menu to the menubar
mnu_File=GUI_MENU(mnu_Bar,"File")
;Add a sub menu to the File menu
mnu_New=GUI_SUBMENU(mnu_File)
;Add a couple of items to it...
itm_NewPro=GUI_MENU_ITEM(mnu_New,"Project")
itm_NewPage=GUI_MENU_ITEM(mnu_New,"Page")
itm_NewWin=GUI_MENU_ITEM(mnu_New,"Window")
;Add a pointer to the sub menu in the File menu
itm_New=GUI_MENU_SUB(mnu_File,"New..",mnu_New)
;Add a menu line
GUI_MENU_LINE(mnu_File)
;And a final item
itm_Quit=GUI_MENU_ITEM(mnu_File,"Quit")
;Now refresh the menus
GUI_MENU_REFRESH(mnu_File)
GUI_MENU_REFRESH(mnu_New)
;And open the window
GUI_OPENWIN(MyWin)
<< Back
|
|
|
GUI_Menu_Tick()
|
Add a Menu Check Item
|
GUI_MENU_TICK(MENU,TEXT$,[ON],[ACTIVE],[COL])
MENU : items menu
TEXT$ : items text
ON : item On [True] or Off [False] [Default Off]
ACTIVE : item active [True] or inactive [False] [Default True]
COL : text color [Default Black]
Returns :INT pointer
Adds a standard check box menu item to a menu.
<< Back
|
|
|
GUI_Menu_Radio()
|
Add a Grouped Menu Check Item
|
GUI_MENU_RADIO(MENU,TEXT$,GROUP,[ACTIVE],[COL])
MENU : items menu
TEXT$ : items text
GROUP : items Group number
ACTIVE : item active [True] or inactive [False] [Default True]
COL : text color [Default Black]
Returns :INT pointer
Adds a grouped check box menu item to a menu. Only one item in a group may be on at any one time.
<< Back
|
|
|
GUI_Menu_Line()
|
Add a Divider Line
|
GUI_MENU_LINE(MENU)
MENU : items menu
Adds a divider line to a menu.
<< Back
|
|
|
GUI_Menu_Space()
|
Add a Divider Space
|
GUI_MENU_SPACE(MENU)
MENU : items menu
Adds a divider space to a menu.
<< Back
|
|
|
GUI_Menu_Act(Menu,True/False)
Activate [True] or Deactivate [False] a whole menu
<< Back
|
|
GUI_Menu_ItmAct(Item,True/False)
Activate [True] or Deactivate [False] a menu item
<< Back
|
|
GUI_Menu_GetOn(Item)
Returns : menu item On [True] or Off [False]
<< Back
|
|
GUI_Menu_SetOn(Item,True/False)
Set a menu item On [True] or Off [False]
<< Back
|
|
GUI_FreeMenu(Menu)
Delete a menu
<< Back
|
|
3D Functions
GUI_3DPort()
|
Add a 3D ViewPort Gadget
|
GUI_3DPORT(WIN,X,Y,W,H,TEXT$,[CAM],[WIRE],[TAB])
TEXT$ : 3D ports label
CAM : optional camera
WIRE : camera wire mode [Default False]
Returns :INT pointer
Adds a 3D viewport to a window. Any camera attached to this gadget will have a viewport of W and H. If no camera is passed then a new camera is created.
<< Back
|
|
|
GUI_Render3D()
|
Renders a 3D Viewport
|
GUI_RENDER3D(PORT,[TWEEN])
PORT : 3D port gadget
TWEEN : optional Renderworld() tween
Renders a 3D ports' camera onto its window.
<< Back
|
|
|
GUI_SetWire()
|
Sets WireFrame mode
|
GUI_SETWIRE(PORT,WIRE)
PORT : 3D port gadget
WIRE : wireframe On [True] or Off [False]
Sets a 3D Ports wireframe mode
<< Back
|
|
|
GUI_Gadwire(Port)
Returns : 3D ports wireframe mode: On [True] or Off [False]
<< Back
|
|
GUI_GetCam(Port)
Returns : 3D ports camera
<< Back
|
|
GUI_SetCam(Gad,Camera,[Free_Old_Camera])
Set a 3D ports camera. Camera Viewport will be resized to fit gadget dimensions. If Free_Old_Camera is set to True then the previous
camera will be deleted.
<< Back
|
|
License Info
XLnt ii General EULA
- The author retains the copyright on the original XLnt II source files, the functions contained within them, help files and all other files included in the distribution pack.
With the sole exception of the XPlugin.bb include file
- The author of XLnt II accepts no liability for any program coded using XLnt II
- The author accepts no responsibility for any damage to/or loss of property or data caused through the use or miss use of this program
- XLnt II may not be distributed by any means without the authors consent
- Future features, content, price, and licenses may change
Non-Registered License
-
Users who have not registered are limited in their use of the XLnt ii GUI library. They may not release ANY software created using, or containing, XLnt ii code.
This restriction applies to all programs and source code - FreeWare, Public Domain, ShareWare, or Commercial Software.
- Non-registered users may make feature/update requests but registered users' requests will always take precedence.
- Only registered users will have access to the most current features and updates.
By reading the above statements or by using Xlnt II you have agreed to the above terms/conditions
Registered License
Users who register have no restrictions placed upon them - they may release any code created with XLnt ii, including full commercial releases! The author of XLnt will claim
no ownership of said releases. Registered users will also be entitled to free upgrades, plugins etc so it pays to register!
To register visit XLnt Homepage - the price is only $15 US - its a bargain!!!
Greets
Hello and thanks to....
Robin, Snarty, xMystik, Ben G, John H, Kefir, and everyone at #blitzbasic and #blitzcoder!!!
Contact me..
XLnt Email :Stew Yapp
XLnt WebSite :Register and Info
Xlnt Forum :Please drop in
History
Release Type : Public
A Long awaited updated. Bug fixes, text input re-write, and a few new features.
- New Stuff
- Window Skins - simple window skinning added
- TitleBar Min/Max - double clicking on the title bar will Min/Max a window
- Line Wrap - put back in text boxes [still a little quirky tho]
- EV_Gad_InputGad() - returns currently active Input gadget
- EV_Gad_ClearText() - clear input gadget text
- GUI_Gad_MouseX() - returns mouse X.position in an imagebox [thanks Kanati]
- GUI_Gad_MouseY() - returns mouse Y.position in an imagebox [thanks Kanati]
- Item Toggle - manually selecting an item will now open all its parent nodes
- Selection Groups - force selection of 1 or more list items
- GUI_List_CountSelected() - returns number of selected items in a list/node
- GUI_List_Item() - step thru a node's items
- GUI_Item_Type() - return an item's type
- BUG: ToolTip - fixed
- BUG: GUI_List_Toggle() - fixed
- BUG: Input/Tabs - fixed
|
|
|
Release Type : registered users only
Added loads of new features - the main one being Text Block Copy & Paste. Also fixed a few bugs.
- New Stuff
- GUI_Gad_Screenx() and GUI_Gad_Screeny() used to return actual onscreen gadget locations.
- GUI() - now contains optional draw mouse flag
- GUI_DrawMouse() - draw mouse image function
- GUI_Set_Focus() - set current focused gadget
- GUI_Focus() - returns current focused gadget
- GUI_List_AddIcon() - New List Item. Same as a Tick Box but you supply the icon
- GUI_Gad_Resize() - resize a gadget
- GUI_Input_Gad() - returns current input gad
- GUI_Gad_AddLine() - adds a new line of text to a text gadget
- GUI_Block_Gad() - returns gad that contains selected text block
- GUI_Block_Active() - toggle a gadgets text block selection abilities
- GUI_Block_Copy() - returns currently selected text block
- GUI_Block_Delete() - deletes currently selected text block
- GUI_Block_Insert() - insert a text block at any point in a gadget
- GUI_Block_Replace() - replace current text block with a new string
- GUI_Block_CursorPos() - returns start position of text block in a gadget
- GUI_InvCol - New Variable. Contains color of Inverted Text Block
|
|
|
Release Type : registered users only
Added quite a few new things - mostly to do with lists, and fixed a load of stupid bugs [thanks Ben].
- New Stuff
- Window resize tab - click the little triangle to resize [cheers Wendell]
- GUI_List_AddInt() - add an integer gadget to a list
- GUI_List_AddFloat() - add a float gadget to a list
- GUI_List_AddInput() - add text input gadget to a list
- GUI_Item_Gad() - get a list items gadget
- GUI_Item_Icon() - get an items icon
- GUI_Item_SetIcon() - set an items icon
- GUI_Icon_Mask() - set icons mask color
- Added [Max] flag to GUI_ShowWin()
|
|
|
Release Type : Public
Public release of v1.1 - contains a few bug fixes [thanks Ben] and the window resize tab.
|
|
|
Release Type : registered users only
First update - contains new features and bug fixes.
- Bug Fixes
- "Object does not exist" when clicking on the minimize button
- "Font does not exist" never had this error, but was reported by one user
- Holding down a gadget and moving mouse over resize area - doesn't force window resize anymore
- EV_GAD_HIT() was one step behind clicks - fixed
- New stuff
- GUI_GadW() : returns gadget width
- GUI_GadH() : returns gadget height
- GUI_List_AddLine() : adds a separation line to a list
- GUI_List_CountSelected() : returns number of selected items in a list
- GUI_List_Selected() : returns selected item in a list
- GUI_Item_Selected() : returns if the passed item is selected
- GUI_Item_On() : returns if the passed item is On or Off
|
|
|
Release Type : Public
Initial public release of XLnt ii
|
|
|