quickstart    sgxDoc    sgxDocFull

sgx.pbi

Included Files:
Included in:

Overview


Description

sgx is a screen-gadget library for PureBasic programmers to create and manage simple GUI-elements in a fullscreen or windowed screen.

it's available as sourcecode to be included in your projects. it's currently only available for Windows Operating Systems (though the code is pretty straight PB code). there are two versions: a single-file version that only contains the necessary files to just use sgx and a multi-file version in case you want to make changes to the sgx code, including the gimp files for the image files and some tools to build a single-file version from that.

with this library you can create simple GUI objects statically or dynamically of different type and appearance, modify them, display them easily, examine user actions and process events. sgx elements are accessed by ID (index-like, starting with index 1). the appearance is defined by designs, whereas you can create own designs with sets of images (there is also an instant design "lowbudget" which does not need any image files). currently there is no event queue, you will recognize events by checking for fields of your sgx elements.

currently available gadget types:
- sgxCursor
- sgxButton (including toggle buttons and buttons with a user sprite)
- sgxText
- sgxCheckbox
- sgxCombo
- sgxScrollbar
- sgxTrackbar
- sgxEdit
- sgxWin
- sgxTable
- sgxSpriteGadget
- sgxArea
- option gadgets / radio buttons are available through grouping


the documentation includes
- a quick start (sgxDoc\sgx.html)
- a full reference (sgxDoc\sgxDocFull.html)
- a smaller reference (sgxDoc\sgxDoc.html) without sgx internals (some links to sgx internals may not work in that document thought!)
- examples in the directory 'sgxDoc\'
- _README.TXT contains further informations

the references are rather technical, so use the quickstart and the examples to get the basic mechanics of sgx.


all global identifiers start with "sgx.." or "*sgx.." or "#sgx.."
globals, functions, macros, constants (#..) and pointer (*..) starting with "sgx_.." (with an underscore) as are basically used internally.
structures (sgxS_..) are also basically used internally but the documentation of sgxS_GADGET for example might be usefull nonetheless.
constants are only documented by the documentation of the functions etc. whith which they are to be used.
sgx uses implicit integer type definitions, so don't change the default type before including sgx.
if you used DisableDebugger before including sgx you should repeat it after the include statement because the debugger will be enabled.


thanks to the PureBasic team and the community / the forums.

[this document was blithely generated with jaPBdoc :) ]

Top, Back


Constants
#sgxTypeButton
#sgxTypeButtonToggle
#sgxTypeCursor
#sgxTypeCheckbox
#sgxTypeScrollbarVer
#sgxTypeScrollbarHor
#sgxTypeScrollbar
#sgxTypeTrackbarVer
#sgxTypeTrackbarHor
#sgxTypeTrackbar
#sgxTypeEdit
#sgxTypeWin
#sgxTypeSpriteGadget
#sgxTypeCombo
#sgxTypeTable
#sgxTypeText
#sgxTypeArea
#sgxAlignCheckboxTextRight
#sgxAlignCheckboxTextLeft
#sgxAlignTextLeft
#sgxAlignTextRight
#sgxAlignTextCenter
#sgxAlignTextJustifySpaces
#sgxAlignTextJustifyCharacters
#sgx_DesignBackgroundNormal
#sgx_DesignBackgroundHover
#sgx_DesignCloseGadgetNormal
#sgx_DesignCloseGadgetHover
#sgx_DesignCheckboxChecked
#sgx_DesignBorderNormalCorner1
#sgx_DesignBorderNormalCorner2
#sgx_DesignBorderNormalCorner3
#sgx_DesignBorderNormalCorner4
#sgx_DesignBorderHoverCorner1
#sgx_DesignBorderHoverCorner2
#sgx_DesignBorderHoverCorner3
#sgx_DesignBorderHoverCorner4
#sgx_DesignBorderPushedCorner1
#sgx_DesignBorderPushedCorner2
#sgx_DesignBorderPushedCorner3
#sgx_DesignBorderPushedCorner4
#sgx_DesignBorderNormalHor1
#sgx_DesignBorderNormalHor2
#sgx_DesignBorderNormalVer1
#sgx_DesignBorderNormalVer2
#sgx_DesignBorderHoverHor1
#sgx_DesignBorderHoverHor2
#sgx_DesignBorderHoverVer1
#sgx_DesignBorderHoverVer2
#sgx_DesignBorderPushedHor1
#sgx_DesignBorderPushedHor2
#sgx_DesignBorderPushedVer1
#sgx_DesignBorderPushedVer2
#sgx_DesignMouseCursor
#sgx_refreshNormalWithTip
#sgx_refreshOnlyTip
#sgx_refreshNormalWithChildsOfTables
#sgx_refreshSkipTableCheckboxRedraw
#sgx_refreshEditMouseclickCursor
#sgx_refreshEditMousewheelScroll
#sgx_GadgetSprTip
#sgx_GadgetSprNormal
#sgx_GadgetSprHover
#sgx_GadgetSprPushed
#sgx_GadgetSprNormal2
#sgx_GadgetSprHover2
#sgx_GadgetSprHoverPushed
#sgx_GadgetSprResize
#sgxStyleThin
#sgxStyleHover
#sgxStyleHoverThin
#sgxStyleGridV
#sgxStyleGridH
#sgxStyleGrid
#sgxStyleFitCellW
#sgxStyleFitCellH
#sgxStyleNoBG
#sgxStyleReverse
#sgxStyleResizable
#sgx_AutoW
#sgx_AutoH
#sgx_AutoNL
#sgxRightclickUnsetNone
#sgxRightclickUnsetNoGroup
#sgxRightclickUnsetAll
#sgxStateNone
#sgxStateOff
#sgxStateOn
#sgx_AppearanceNormal
#sgx_AppearancePushed
#sgx_AppearanceHover
#sgx_SideTopOrLeft
#sgx_SideBottomOrRight
#sgxWinStateNormal
#sgxWinStateMinimizing
#sgxWinStateMinimized
#sgxWinStateRestoring
#sgxWinStateClosing
#sgxWinStatePresenting
#sgxTextcursorTypeIBeam
#sgxTextcursorTypeTeeth
#sgxTextcursorTypeLine
#sgxTextcursorTypeLine2
#sgxTextcursorTypeLine3
#sgxTextcursorTypeCaret
#sgxAnimFade
#sgxAnimSizeW
#sgxAnimSizeH
#sgxAnimSize
#sgxAnimRoll
#sgxAnimZoom
#sgxDrawNone
#sgxDrawDesign
#sgxDrawText
#sgxDrawTextNoOffset
#sgxKeyLayQwerty
#sgxKeyLayQwertz
#sgxMaxStaticGagdets
the numbers of sgx element you can create with static IDs (maximum ID). dynamic IDs start from there on. you can set this constant before including sgx, or use the default 500.

Top, Back


Structures and Interfaces
sgx_llS_elem
type of the elements in an sgx_llS_list.
sgx_llS_list
the list structure of the (tree) list implementation.
sgx_llS_IteratorStack
a list wrapper structure.
sgx_S_Point
stores a x/y position
sgx_S_Size
type of variable sgx_dimensions wich stores the screen diemsions
sgx_S_Image
type of the array elements of field 'img' in the design structure sgxS_Design
sgxS_Design
the basic structure of an sgx design.
sgx_S_Box
type of the field 'sys0' of the structure sgxS_GADGET to store the coordinates of the close gadget of windows; used in sgx_MousehoverClosebutton
sgx_S_metrics
stores temporary element metrics; used in sgxRefresh for refresh of childs of tables to avoid unnecessary refresh of child
sgxS_Mouse
type of variable sgx_m to store various mouse states
sgxS_groupElem
data stored as elements of list sgxGroups; associates sgx element IDs to group IDs via sgxSetGroup
sgxS_pendingEvents
temporary event data stored as elements of list sgx_pendingEvents to trigger the according event with the next call of sgxExamine
sgxS_Tip
allocated in sgxTip when a tooltip is added to an sgx element and is stored in field '*tip' of the structure sgxS_GADGET
sgxS_Animation
animation data temporarily used during window animations and stored as elements of map sgx_animations; is being populated in sgx_addAnimation
sgxS_ListWrapper
just a linked list wrapped in a structure to use it as optional function parameter via pointer in sgxSetState (used by sgxExamine)
sgxS_Table
will be allocated by sgx table elements and stored in field '*table' of the structure sgxS_GADGET
sgxS_GADGET
the basic structure of an sgx element.
sgx_S_key
used per key in an keyboard layout (sgx_S_keyboardLayout)
sgx_S_keyboardLayout
a keyboard layout consisting of key definitions for all the supported keys

Top, Back


Global Variables
sgx_llStackOfIteratorStacks.sgx_llS_IteratorStack()
a stack of stacks of type sgx_llS_IteratorStack used by sgx_llIteratorRecursive.
sgx_llStackOfIteratorStacks()\iteratorStack() is a list (stack) of sgx_llS_elem elements which get pushed and popped during a recursive iteration.
sgx_llStackOfIteratorStacks() itself is a wrapper stack for the latter and gets pushed and popped with the beginning and end of each such a recursive iteration block (for example in case within the block a function gets called which uses a recursive iterator itself).
see sgx_llS_elem for an overview of the tree list.
sgx_LIMIT_STATIC_GADGETS = #sgxMaxStaticGagdets
static IDs can range from 1 to sgx_LIMIT_STATIC_GADGETS. see also the notes on #sgxMaxStaticGagdets.
sgx_CURRENT_MAX_STATIC_GADGETS = 0
highest static ID that has ever been used for element creation. used to shorten traversal through the elements array. note that this doesn't tell anything about validity of this ID or of lower IDs.
sgx_CURRENT_MAX_DYNAMIC_GADGETS = sgx_LIMIT_STATIC_GADGETS
same as sgx_CURRENT_MAX_STATIC_GADGETS but for dynamic IDs instead of static ones.
*sgxID.sgxS_GADGET(sgx_CURRENT_MAX_DYNAMIC_GADGETS)
the actual array of pointers to all sgx elements (sgxS_GADGET). the element IDs are used as indices here. this array is accessed via macro sgx() which includes some error checking when debugger is used.
sgx.sgxS_GADGET(0)
empty dummy array only to support autocompletion for fields of the sgx element structure sgxS_GADGET. the PB-IDE uses this for autocompletion of fields, but sgx(id) is actually a macro and not an array. no other use of this one and it could also be commented out. also remember that when using this the debugger the tooltip in the editor will say 'index out of bounds' if you mark 'sgx(id)' in the IDE because it does not evaluate the macro.
sgxCell.sgxS_GADGET(0, 0, 0)
empty dummy array only to support autocompletion for macro sgxCell(). see documentation of the dummy array sgx().
*sgxLayeredView.sgx_llnew
the root parent node. basically a list of top the level list elements (the sgx element id is part of the list element structure). the root node of the element tree. this an sgx_llS_list, not an sgx element and it is analog to the child list \treeElem\node of an sgx element. sgx_llnew is the list constructor macro
sgxGroups.sgxS_groupElem()
list of radio group elements
sgxDesign.sgxS_Design()
list of loaded designs
sgx_m.sgxS_Mouse
stores various mouse states like position, buttons and also the current sgxCursor element id.
sgx_vec.sgx_S_Point
stores the position the mouse has inside the titlebar for proper positioning while moving windows. also being used in a similar way while resizing elements with the mouse.
sgx_textCursorClippingOffset.sgx_S_Point
stores the current clipping offset applied to the textcursor sprite of sgxEdit elements for proper textcursor positioning.
sgx_dimensions.sgx_S_Size
w\h values defining the screen size. can be set via sgxSetDimensions.
sgx_focusCatchedBy = -1
-1 if no element has currently catched the focused, otherwise an element ID. focus is catched on leftclick and released with a leftup, so that down/hold events and knob dragging etc. can be directed to the according element even if the mouse is not hovering it as well as preventing other elements from receiving events during that time.
sgxActiveWin = -1
the currently active (foreground) window id or -1 if no window is active.
sgx_resizing = -1
ID of the element currently being resized with the mouse or -1 if no element is currently being resized.
sgx_moving = -1
ID of the (window) element currently being moved manually via mouse or -1 if no element is currently being moved manually.
sgx_editing = -1
ID of the edit element currently being active for text editing or -1 if no edit element is active.
sgx_resizeGadgetSize = 15
size of the resize handle at the bottom right corner of resizable elements. must be at least 1 because it's also used as minimum size during manual resize (via mouse).
sgxStdFont = LoadFont(#PB_Any, "Arial", 8)
font used for caption of minimized windows and as a default for the current font.
sgx_fontMonoSmall = LoadFont(#PB_Any, "Courier", 8)
font used by 'sgx_debugInfos' for example.
sgx_CurrentFontID = FontID(sgxStdFont)
the font being assign during element creation. can be set via sgxSetFont
*sgx_CurrentDesign.sgxS_Design
can be set via sgxSetDesign and is also set by sgxLoadDesign
sgx_CurrentParent = -1
the sgx element id of the current parent, or -1 if there is no current parent.
*sgx_CurrentParent.sgx_llS_list = *sgxLayeredView
the current parent node. basically a list of list elements (the sgx element id is part of the list element structure). this an sgx_llS_list, not an sgx element. if an element becomes the current parent, this points to the element's \treeElem\node, which might still be 0 if it doesn't have any childs.
sgx_defaultAlpha = 255
can be set via sgxSetAlpha
sgx_xMinimizedWins = 2
the x-position for the possibly next coming taskbar button in pixels.
sgx_debugInfos = 0
0 per default. you can set it to 1 to display debug informations about sgx elements and also display current mouse position. set it to 2 to display frames for all elements. for simplicity this uses a StartDrawing()/StopDrawing() block and is very slow, especially if value is 2 (one drawing block per element).
sgxTopID = -1
ID of the element currently under the mouse or -1 if no element is there.
sgx_ems
holds the current value of EllapsedMilliseconds(), or as set via sgxSetEmsContainer. used for animations, intervals etc.
sgx_mouseWheelDelta
gets sum up in sgx_windowCallback and used and reset in sgxExamine.
*sgx_emsContainer.Integer
can be set via sgxSetEmsContainer.
sgxTipDelay = 500
delay for tip popup in milliseconds
sgxHoldDelay = 400
delay for first hold event in milliseconds
sgxHoldInterval = 30
interval of hold events in milliseconds
sgxRightclickUnset = #sgxRightclickUnsetAll
per default (#sgxRightclickUnsetAll) rightclick on checkboxes and togglebuttons changes their state to unchecked / not pushed. if set to #sgxRightclickUnsetNoGroup then this will only be applied to elements that are not part of a radiogroup. #sgxRightclickUnsetNone completely disables this behaviour.
sgxAnimTime = 400
duration of window animations in milliseconds. you can set this to 0 to effectively disable animations.
sgx_animations.sgxS_Animation()
this map contains animation data objects temporarily created and used while animating windows.
sgxWinCloseEnabled = 1
(bool) adjusts if windows can be closed by rightclick
sgx_BuildRefresh = 1
usually set to 1 to refresh elements after finishing creation/building. set to 0 while creating elements should not refresh them but only initialize them. temporarily deactivated (0) by tables to avoid double refreshes of table childs.
sgx_BuildRefreshStack()
used to push/pop values for sgx_BuildRefresh
sgx_pendingEvents.sgxS_pendingEvents()
list of pending events that will be triggered with the next call of sgxExamine
sgxNumberOfElements = 0
number of currently existing and valid sgx elements
sgx_animStyle_minimizing
the animation styles used for minimizing windows
sgx_animStyle_restoring
the animation styles used for restoring windows
sgx_animStyle_closing
the animation styles used for closing windows
sgx_animStyle_presenting
the animation styles used for presenting windows
sgx_textcursorType = #sgxTextcursorTypeLine
text cursor type used by sgxEdit elements. can be set via sgxSetTextcursorType.
sgx_lowbudgetDistortion.f = 0.2
distortion applied to backgrounds of design "lowbudget", a float value in the range 0..1 (both inclusive)
sgx_lowbudgetDistortColors = #True
#True if variable sgx_lowbudgetDistorstion should be applied to brightness as well as color component distribution. #False to only distort brightness.
sgx_disabledColor1 = RGBA(255, 255, 255, 5)
the first color applied to the final gadget sprites if the element is disabled (a thin white for desaturation).
sgx_disabledColor2 = RGBA(50, 50, 50, 80)
the second color applied to the final gadget sprites if the element is disabled (a thin black for darkening).
sgx_drawTextLF_EndX
x-position where the last call of sgx_drawTextLF has finished (right edge of drawn text).
sgx_drawTextLF_EndY
y-position where the last call of sgx_drawTextLF has finished (top edge of drawn text).
sgx_keyLay.sgx_S_keyboardLayout(1)
array of keyboard layouts
sgx_keyLayout = 0
currently used keyboard layout. can be set via sgxSetKeyboardLayout
sgx_keystrokeDelay_1 = 280
the keystroke delay after a first key-push. can be set via sgxSetKeyboardLayout
sgx_keystrokeDelay_2 = 40
the keystroke delay for continuous key-push. can be set via sgxSetKeyboardLayout
sgx_keyboardEdit_lastTextPos
see sgx_keyboardEdit
sgx_keyboardEdit_TextModified
see sgx_keyboardEdit

Top, Back


Functions and Macros
sgx_llnew
constructor macro for creation of sgx_llS_list lists.
sgx_llIterator(it, List )
flat iterator macro (without recursion) to iterate over all list elements.
sgx_llNext(it)
the 'Next' command for an sgx_llIterator block.
sgx_llIteratorReverse(it, List )
flat reverse iterator macro (without recursion) to iterate over all list elements backwards.
sgx_llPrev(it)
the 'Next' (previous) command for an sgx_llIteratorReverse block.
sgx_llIteratorRecursive(it, List )
recusrive iterator macro to iterate over all list elements including the elements child nodes.
sgx_llNextRecursive(it, skipNode = #False)
the 'Next' command for an sgx_llIteratorRecursive block.
sgx_llNextRecursive_proc(*it.sgx_llS_elem, skipNode = #False)
used by the sgx_llNextRecursive macro for recursion.
sgx_llAdd(*list.sgx_llS_list, id)
creates a new element at the end of the list and sets its data field to 'id'.
sgx_llClearList(*list.sgx_llS_list)
removes all elements from the list which will remove sublevels too.
sgx_llDelElem(*elem.sgx_llS_elem, returnNode = #False)
remove the element from its list and free it and its childs.
sgx_llReplaceElemNode(*elem.sgx_llS_elem, *newNode.sgx_llS_list)
remove and replace the node (list of childs) of a list element.
sgx_llMoveEnd(*elem.sgx_llS_elem)
move the element to the end of its list.
sgx_llDebug(*list.sgx_llS_list)
prints the list/tree hierarchy recursively to the debug output window (directly, not return a string).
sgx_cb(index)
wrapper used in the macro sgx if compiled with debugger.
sgx(index)
use this macro to access the structure of your sgx elements.
sgx_err(_message_)
used to throw sgx errors when compiled with debugger.
sgxNew(id)
create a new sgx object.
sgx_isInElement(id, x, y)
checks if the specified absolute screen position is within the element's dimensions.
sgx_MousehoverClosebutton(id)
checks if the mouse position is within the dimensions of the element's close button (windows only).
sgx_MousehoverResize(id)
checks if the mouse position is within the dimensions of the element's resize button in hte bottom right corner.
sgx_FreeImageChecked(img)
frees the image with the passed number if it's a valid PB image.
sgx_FreeSpriteChecked(spr)
frees the sprite with the passed number if it's a valid PB sprite.
sgx_SkipUnused(iterator)
skips the gap of irrelevant IDs between the currently highest used static ID and the first dynamic one.
sgxInBounds(index)
returns #True if 'index' is within bounds of the basic sgx element array, otherwise it returns #False.
sgx_SetParentList(id)
used in sgxSetCurrentParent to keep *sgx_CurrentParent (the current parent tree node) in sync with sgx_CurrentParent (the current parent ID).
sgxSetCurrentParent(id)
set the parent for coming creations of new sgx elements.
sgxSetParent(id, parent)
sets or changes the parent of an sgx element.
sgxEach(it)
use this macro to iterate through the elements.
sgxMoveOnTop(id)
make an sgx window (#sgxTypeWin) active and foreground or move an element above its siblings.
sgx_PushBuildRefresh(state)
temporarily changes the value of sgx_BuildRefresh.
sgx_PopBuildRefresh()
restores sgx_BuildRefresh to the previous value.
sgxGetElementAt(x, y)
returns the ID of the topmost sgx element at the given position on screen, or -1 if no sgx element is found there.
sgxGetTopLevel(id)
returns the ID of the topmost parent.
sgxMove(id, x, y, relative = #True)
change the position of an sgx element.
sgx_updateToParentPos(id)
updates the element's to-parent-position if it's absolute screen position has been modified.
sgxSetDisabled(id, disabled = #True)
disable or enable an sgx element.
sgxResize(id, w, h)
change the size of an sgx element.
sgx_MoveChildsOf(id)
updates the position of child elements if their parent element has moved, keeping their to-parent-position.
sgx_GetGadgetX(id)
returns (and is used to update) the elements absolute position on screen (x, y) together with sgx_GetGadgetY by summarizing all to-parent-positions up the parent hierarchy.
sgx_GetGadgetY(id)
returns (and is used to update) the elements absolute position on screen (x, y) together with sgx_GetGadgetX by summarizing all to-parent-positions up the parent hierarchy.
sgxCloseLevel(closeAllLevels = #False)
call this function when you finished the creation of a window or table and it's childs.
sgx_IsParentage(parent, child)
returns #True if 'parent' is found anywhere up the parent hierarchy of 'child', otherwise returns #False.
sgx_getTypeString.s(id)
returns a string informing about the type of an sgx element for debugging purposes.
sgxDebugElem.s(id, multiline = #False)
returns a string with information about the element's attributes.
sgxDebugTree.s(id = -1)
returns a string with information about the elements attributes and their hierarchy.
sgxSetFont(font)
set the font for coming creations of new sgx elements.
sgxSetGroup(id, groupID)
add an sgx element to a radio group.
sgxGetGroup(id)
returns the groupID of an sgx element, or -1 if the element does not belong to a radio group.
sgxSetDimensions(width, height)
tell sgx about the screen dimensions you use.
sgxFree(id)
free / delete an sgx element, including childs.
sgxFreeChildsOf(parent)
free / delete all childs of an sgx element, including their own childs.
sgx_HideChildsOf(parent, show = #False, ignoreWindows = #True)
hides or shows all childs of an element (but not the element itself) recursively but ignores child windows (per default).
sgxSetShow(id, show, recursively = #True, ignoreWindows = #True)
shows or hides an element.
sgx_addAnimation(id, animationType)
add an animation data object to the animation list.
sgxMinimizeWin(id)
initializes minimizing of window.
sgxRestoreWin(id)
initializes restoring of window.
sgxCloseWin(id)
initializes closing of a window and it's child windows.
sgxPresentWin(id)
initializes presenting of a window and it's child windows.
sgx_RefreshWinBar()
determines visible minimized windows and repositions them as buttons in the taskbar.
sgx_animate(id, *animation.sgxS_Animation)
animate an element, that is to say, update its attributes according to the currently reach animation progress.
sgxSetWinAnimStyle(winState, winAnimStyle)
configures window animations.
sgxSetTextcursorType(textcursorType)
changes the type of the textcursor used by sgxEdit elements.
sgxSetText(id, text.s)
changes the text of an sgx element and refreshes it.
sgxSetResizable(id, resizable = #True)
make an element resizeable via the mouse.
sgxSetMinSize(id, minWidth, minHeight)
set the minimum size allowed for manually resizing elements via mouse.
sgxSetScrollMax(id, max)
change the range of a scrollbar/trackbar.
sgx_SetScrollPos(id, scrollpos)
translates a pixel position on scrollbar/trackbar into its state and updates the knob position and the 'state' and 'changed' fields (directly without using pending events, so it should only be called during sgxExamine).
sgxSetState(id, state, handleRadioGroups = #True, *changed.sgxS_ListWrapper = 0)
changes the state of an sgx element and refreshes it if necessary.
sgx_setParentWindowHovered(id)
sgxSetEmsContainer(*emsContainer.Integer)
tell sgx about your 'ems' variable.
sgxSetDesign(*design.sgxS_Design, id = -1)
set the design for coming creations of new sgx elements, or change the design of an sgx element.
sgxSetAlpha(alpha, id = -1, recursive = #False)
set the alpha value for coming creations of new sgx elements (default alpha is 255, no transparency), or change the alpha value of an sgx element.
sgxCell(table, i, k)
use this macro to access the structure of your sgx elements if they are cells of a table and you want to access them via their position in the table.
sgxCellId(table, i, k)
returns the ID of a table-cell, or 0 for empty cells or if it fails, which happens if table is not a valid sgx table element or if the coordinates are out of the table's dimensions.
sgxCellAssign(i, k, id, table = -1)
assigns an sgx element to a cell of a table or removes it.
sgx_ArrangeTable(id)
scans the cells of a table to calculate size of columns, rows as well as the final table's size and may overwrite cell element positions and sizes according to the table style but does not refresh elements.
sgx_textWidthLF(text.s)
returns the width of the longest line in the text, that is to say the width of the complete textblock.
sgx_drawTextLF(x, y, text.s, color, xWrapTo = -1, lineSeperator$ = #LF$, textAlign = #sgxAlignTextLeft)
draws multiline text to the current drawing output.
sgx_max(a, b)
returns 'a' if its greater that 'b', otherwise returns 'b'.
sgx_fade(color, fade)
returns a new color with different brightness derived from 'color' according to the value of 'fade'.
sgxSetKeyboardLayout(layout = #sgxKeyLayQwerty, keystrokeDelay_1 = 280, keystrokeDelay_2 = 40)
configure keyboard layout and keystroke delay used by sgxEdit elements (via sgx_keyboardEdit).
sgx_keyboardEdit.s(text.s, textpos = -1, maxLines = -1)
defines string operations on keyboard data.
sgx_RemakeDesignImage(_img, _w, _h)
frees an design image (in case it is a valid one) and recreates it with the specified dimensions
sgx_MakePalette(*design.sgxS_Design, basecolor)
creates a color pallete for the design derived from a basecolor.
sgxLoadDesign(design.s = "lowbudget", basecolor = -1)
loads a design.
sgxRefreshDesign(*design.sgxS_Design)
refresh the design.
sgx_PassStandardValues()
macro to initalize element property default for most element type during creation.
sgx_infoTail()
used to add debug information to the text of sgx elements (must be activated in the code)
sgxCursor(id)
creates an sgx cursor element and returns it's ID.
sgxButton(id, x, y, w, h, text.s, toggle = #sgxStateNone, sprNr = -1, x2 = 5, y2 = 5)
creates an sgx button element and returns it's ID.
sgxCheckbox(id, x, y, w, h, checked = #sgxStateOff, text.s = "", align = #sgxAlignCheckboxTextRight)
creates an sgx checkbox element and returns it's ID.
sgxScrollbar(id, x, y, w, h, w2, h2, max, state = 0, style = 0)
creates an sgx scrollbar element and returns it's ID.
sgxTrackbar(id, x, y, w, h, w2, h2, max, state = 0, style = #sgxStyleGrid)
creates an sgx trackbar element and returns it's ID.
sgxEdit(id, x, y, w, h, text.s = "", maxLines = -1)
creates an sgx edit element and returns it's ID.
sgxWin(id, x, y, w, h, text.s = "", style = 0)
creates an sgx window element and returns it's ID.
sgxSpriteGadget(id, x, y, sprNr)
creates an sgx sprite container and returns it's ID.
sgxArea(id, x, y, w, h)
creates an sgx area container and returns it's ID.
sgxTip(id, text.s)
creates a tooltip for an sgx element.
sgxCombo(id, x, y, w, h, text.s = "")
creates an sgx combo element and returns it's ID.
sgxText(id, x, y, w = -1, h = -1, text.s = "", style = 0, margin = 3, textalign = #sgxAlignTextLeft, wordwrap = #False)
creates an sgx text element and returns it's ID.
sgxTable(id, x, y, columns, lines, margin, style = #sgxStyleGrid)
creates an sgx table element and returns it's ID.
sgx_prepareSprite(spr, w, h, id)
creates an element sprite it not done yet or frees and recreates the sprite if the size is different.
sgxRefreshAll()
refresh all existing sgx elements, if you modified the design for instance.
sgxRefresh(id, mode = #sgx_refreshNormalWithTip)
refresh an sgx element.
sgx_Fill(*design.sgxS_Design, x, y, w, h, appearance)
draws a background to the current drawing output using the design's background image (will be tiled to fill specified area).
sgx_BorderLine(*design.sgxS_Design, x, y, V, appearance, side)
draws a straight part (a line, as opposed to some corner part) of a border to the current drawing output using the design's border images.
sgx_Borderbox(*design.sgxS_Design, x, y, w, h, appearance)
draws a box to the current drawing output using the design's border images.
sgx_CopyImageToSprite(imgNr, onBeginDraw.sgx_onBeginDraw = 0, onEndDraw.sgx_onEndDraw = 0, id = 0, sprType = 0)
creates and returns a sprite duplicated from an image (for example the mouse sprite from a loaded mouse design image, or the window's close buttons).
sgx_DrawCursor(id, sprType)
redraws a particular state sprite of an sgxCursor element (called by sgxRefresh).
sgx_DrawButton(id, sprType)
redraws a particular state sprite of an sgxButton element (called by sgxRefresh).
sgx_DrawCheckbox(id, sprType)
redraws a particular state sprite of an sgxCheckbox element (called by sgxRefresh).
sgx_DrawScrollbar(id, sprType)
redraws a particular state sprite of an sgxScrollbar/sgxTrackbar element (called by sgxRefresh).
sgx_DrawEdit(id, sprType, updateMetricsOnly = #False, moveTextpos = #False, scrollToCursor = #True)
redraws a particular state sprite of an sgxEdit element (called by sgxRefresh).
sgx_DrawWin(id, sprType)
redraws a particular state sprite of an sgxWin/sgxTable element (called by sgxRefresh).
sgx_DrawTip(id)
redraws the tooltip sprite of an sgx element (called by sgxRefresh).
sgx_DrawResizeGadget(id)
creates the resize gadget sprite of an sgxWin element if it does not exist yet.
sgx_DrawCombo(id, sprType)
redraws a particular state sprite of an sgxCombo element (called by sgxRefresh).
sgx_DrawText(id, sprType)
redraws a particular state sprite of an sgxText element (called by sgxRefresh).
sgx_DrawDisabled(id, sprType)
modifies a particular state sprite of an sgx element to visually represent a 'disabled' state (called by sgxRefresh).
sgxExamine(mousex = -1, mousey = -1)
process actions / events and update the field data of all sgx element.
sgxDisplay()
display all sgx element on screen.
sgxDisplayCursor()
display the sgx mouse cursor on screen.
sgxDisplayID(id)
display an sgx element on screen.

Top, Back


sgx_llS_elem

type of the elements in an sgx_llS_list. used for a basic tree list to represent the sgx element hierarchy.
type of the field '*treeElem' of the structure sgxS_GADGET.
this type allows the use of lists as a tree, since it has a list it belongs to and a child list (branch) as well.
lists are created via constructor macro sgx_llnew.
elements are added to a list via sgx_llAdd and removed from a list via sgx_llDelElem.
a list can be cleared via sgx_llClearList.
an element can be moved to the end of its list via sgx_llMoveEnd.
you can print a tree via sgx_llDebug.
a list element can be removed from one list and be recreated in another list using sgx_llDelElem in combination with sgx_llReplaceElemNode.

there are several iterator macros to traverse a list/tree:
be carefull with Static iterator variables in recursively called functions (even with the flat iterators) or better use Protected for your iterator variable.
also do not use Break or Continue in such loops!
flat iteration
 sgx_llIterator(Define *it, *sgxLayeredView) 
Debug sgx(*it\id)\text
sgx_llNext(*it)
flat reverse iteration (from last to first element)
 sgx_llIteratorReverse(Define *it, *sgxLayeredView) 
Debug sgx(*it\id)\text
sgx_llPrev(*it)
recursive iteration (here we use protected - imagine we are inside a function - and we start at a window's child node instead of the sgx root node)
 sgx_llIteratorRecursive(Protected *it, sgx(window)\treeElem\node) 
Debug sgx(*it\id)\text
sgx_llNextRecursive(*it)

Elements:

*list.sgx_llS_list
pointer to the list the element belongs to
*next.sgx_llS_elem
pointer to the element's successor or 0 if the element is the last in its list
*prev.sgx_llS_elem
pointer to the element's predecessor or 0 if the element is the first in its list
*node.sgx_llS_list
pointer to the element's list of childs
id.i
the actual data of the element, an sgx element ID in our case

Top, Back


sgx_llS_list

the list structure of the (tree) list implementation.
lists of this type are created via constructor macro sgx_llnew.
type of variables '*sgxLayeredView' and '*sgx_CurrentParent'.

see sgx_llS_elem for an overview of the tree list.

Elements:

*curr.sgx_llS_elem
pointer to the current element of the list or 0 if list is empty
*first.sgx_llS_elem
pointer to the first element in the list or 0 if list is empty
*last.sgx_llS_elem
pointer to the last element in the list or 0 if list is empty

Top, Back


sgx_llS_IteratorStack

a list wrapper structure. type of 'sgx_llStackOfIteratorStacks'.

see sgx_llS_elem for an overview of the tree list.

Elements:

List *iteratorStack.sgx_llS_elem()

Top, Back


sgx_S_Point

stores a x/y position
type of field 'textcursor' of the structure sgxS_GADGET
type of variable sgx_vec
type of variable sgx_textCursorClippingOffset

Elements:

x.i
x-position
y.i
y-position

Top, Back


sgx_S_Size

type of variable sgx_dimensions wich stores the screen diemsions

Elements:

w.i
h.i

Top, Back


sgx_S_Image

type of the array elements of field 'img' in the design structure sgxS_Design

Elements:

nr.i
the PB image number
w.i
width of the image
h.i
height of the image

Top, Back


sgxS_Design

the basic structure of an sgx design.
stored in field '*design' of the structure sgxS_GADGET.
returned by sgxLoadDesign if the loading succeeds.
type of list sgxDesign().
type of variable *sgx_CurrentDesign and can be passed to sgxSetDesign.

the fields onBeginDraw and onEndDraw are of the following type:
 Prototype sgx_onBeginDraw(id, sprType, w, h, disabled=#False) 
Prototype sgx_onEndDraw (id, sprType, w, h, disabled=#False)
you can assign function pointers directly to these fields if you have defined a function that should be called during the drawing proccess of an sgx element. they will be called inside a StartDrawing/StopDrawing block and the current drawing output will already have been cleared with transparent black when onBeginDraw() is called. the parameters passed to the callbacks include the ID of the sgx element and the type of the sprite (#sgx_GadgetSpr..) that is currently being redrawn as well as the width and height of the current drawing output and if the sprite should visualize a disabled state, in which case the sprite will not have been cleared but instead contains the appearance of the enabled state of that sprite type which can be modified to make it look disabled (or cleared and redrawn if you wish).
make sure you use a drawing mode with alpha channel and use colors that include alpha information, otherwise your drawing will stay invisible.

onBeginDraw() can be used to replace steps in the redraw process.
with the return value you can define what sgx should draw after the call of your callback:
onEndDraw() can be used to just add or overdraw something after sgx has finished it's drawing operations. it works just like onBeginDraw() except you don't have to return anything.

the sprite types #sgx_GadgetSprChecked and #sgx_GadgetSprTextCursor have the same value as #sgx_GadgetSprPushed, so checking for these two would make it necessary to check the element type also (checkbox or edit).
all element types might also be called with a sprite type of #sgx_GadgetSprTip, to redraw the tooltip of the element.
other sprite types can differ depending on the element type

here is an example in form of an onBeginDraw() custom callback that shows how you could handle the different cases.
it could be also much simpler though, for example by handling only the tooltip case and return the default in all other cases
 Procedure myOnBeginDraw(id, sprType, w, h, disabled=#False) 
Static retval

; our default returnvalue (sgx should draw everthing as usual after this function has finished)
retval = #sgxDrawDesign | #sgxDrawText

If sprType = #sgx_GadgetSprTip
; the element's tooltip sprite is currently redrawn.
; you might want to handle this as a generel case, independent from element type.

ElseIf sprType = #sgx_GadgetSprResize
; the element's resize gadget is currently being redrawn.
; you might want to handle this as a generel case, independent from element type.
Else

; the other sprite types are element type dependent

If disabled
; the drawing output already contains the visuals for that sprite type and should be
; modified (or redrawn completely) to visualize a disabled state. you could also return
; the default returnvalue and do the modification in an onEndDraw callback.
EndIf

Select sgx(id)\type

Case #sgxTypeCursor
; sprType:
; #sgx_GadgetSprNormal

Case #sgxTypeButton, #sgxTypeButtonToggle
; sprType:
; #sgx_GadgetSprNormal
; #sgx_GadgetSprHover
; #sgx_GadgetSprPushed
; #sgx_GadgetSprHoverPushed
Case #sgxTypeCheckbox
; sprType:
; #sgx_GadgetSprNormal
; #sgx_GadgetSprHover
; #sgx_GadgetSprChecked
Case #sgxTypeScrollbarVer, #sgxTypeScrollbarHor, #sgxTypeTrackbarVer, #sgxTypeTrackbarHor
; sprType:
; #sgx_GadgetSprNormal ; - bar
; #sgx_GadgetSprHover ; /
; #sgx_GadgetSprNormal2 ; - knob
; #sgx_GadgetSprHover2 ; /
Case #sgxTypeEdit
; sprType:
; #sgx_GadgetSprNormal
; #sgx_GadgetSprHover
; #sgx_GadgetSprTextCursor
Case #sgxTypeWin
; sprType:
; #sgx_GadgetSprNormal
; #sgx_GadgetSprHover
; #sgx_GadgetSprPushed ; displayed if the window is foreground or catched focus (i.e. when moving the window manually)
; #sgx_GadgetSprNormal2 ; - close gadget
; #sgx_GadgetSprHover2 ; /
Case #sgxTypeTable
; sprType:
; #sgx_GadgetSprNormal
; #sgx_GadgetSprHover
Case #sgxTypeCombo
; sprType:
; #sgx_GadgetSprNormal
; #sgx_GadgetSprHover
; #sgx_GadgetSprPushed ; the opened combo
; #sgx_GadgetSprHover2 ; open combo hover effect
Case #sgxTypeText
; sprType:
; #sgx_GadgetSprNormal
; #sgx_GadgetSprHover
EndSelect
EndIf

; if you have actually drawn something in one of the branches above then your returnvalue
; should not include the flag #sgxDrawDesign, otherwise sgx will paint over your content.
ProcedureReturn retval
EndProcedure

Elements:

name.s
name or path of the design like "lowbudget" or "..\sgxDesigns\blue" for example
basecolor.i
basecolor of the design as specified at sgxLoadDesign or as defined in the design's 'parts' image file
c.i[20]
the design pallete (populated in sgx_MakePalette)
img.sgx_S_Image[30]
array of the design images of type sgx_S_Image that will be drawn on the sgx element sprites during a refresh like the parts of the border or the background for example; accessed with #sgx_Design.. constants as indices
onBeginDraw.sgx_onBeginDraw
optional custom draw callback called at the beginning of element redraw (see structure description)
onEndDraw.sgx_onEndDraW
optional custom draw callback called at the end of element redraw (see structure description)

Top, Back


sgx_S_Box

type of the field 'sys0' of the structure sgxS_GADGET to store the coordinates of the close gadget of windows; used in sgx_MousehoverClosebutton

Elements:

x1.i
x-position of close the gadgets left edge relative to the element's x-position
y1.i
y-position of close the gadgets top edge relative to the element's y-position
x2.i
x-position of close the gadgets right edge relative to the element's x-position
y2.i
y-position of close the gadgets bottom edge relative to the element's y-position

Top, Back


sgx_S_metrics

stores temporary element metrics; used in sgxRefresh for refresh of childs of tables to avoid unnecessary refresh of child

Elements:

id.i
ID of the sgx element
w.i
width
h.i
height
w2.i
secondary width (type dependent)
h2.i
secondary height (type dependent)

Top, Back


sgxS_Mouse

type of variable sgx_m to store various mouse states

Elements:

x.i
x-position of mouse on screen
y.i
y-position of mouse on screen
dx.i
delta x of the mouse position
dy.i
delta y of the mouse position
dlimit.i
the x/y delta of the mouse position that must occure to make an currently shown sgx tooltip disappear again
leftclick.i
1 if the left mouse button has been pushed and was not pushed previously, otherwise 0
leftdown.i
1 if the left mouse button is currently pushed, otherwise 0
leftup.i
1 if the left mouse button has been released, otherwise 0
rightclick.i
1 if the right mouse button has been pushed and was not pushed previously, otherwise 0
rightdown.i
1 if the right mouse button is currently pushed, otherwise 0
rightup.i
1 if the right mouse button has been released, otherwise 0
leftdown_prev.i
1 if the left mouse button was pushed previously, otherwise 0
rightdown_prev.i
1 if the right mouse button was pushed previously, otherwise 0
wheel.i
the amount of steps the mousewheel has ben rotated
wheelSign.i
1 if 'wheel' is positive or 0 (scrolling 'up' or not scrolling), -1 if 'wheel' is negative (scrolling 'down')
cursor.i
ID of the current sgx cursor element used as the mouse cursor or -1 if no mouse cursor is set (if none has been created or if it has been freed). will be set by sgxCursor.

Top, Back


sgxS_groupElem

data stored as elements of list sgxGroups; associates sgx element IDs to group IDs via sgxSetGroup

Elements:

id.i
groupID.i

Top, Back


sgxS_pendingEvents

temporary event data stored as elements of list sgx_pendingEvents to trigger the according event with the next call of sgxExamine

Elements:

id.i
ID of the sgx element whose event field should be set
changed.i
the value that should be set for the 'changed' field
resized.i
the value that should be set for the 'resized' field (0 or 1)
refreshed.i
the value that should be set for the 'refreshed' field

Top, Back


sgxS_Tip

allocated in sgxTip when a tooltip is added to an sgx element and is stored in field '*tip' of the structure sgxS_GADGET

Elements:

spr.i
the PB sprite that is displayed as the tooltip
w.i
width of the tooltip
h.i
height of the tooltip
text.s
the text of the tooltip
timer.i
a timer for the popup delay
show.i
0=sleeping ; 1=show ; -1=hide (which means do not popup again before element mouseout. will be reset to 0 on 'no hover')

Top, Back


sgxS_Animation

animation data temporarily used during window animations and stored as elements of map sgx_animations; is being populated in sgx_addAnimation

Elements:

startTime.i
startX.i
startY.i
startW.i
startH.i
startAlpha.i
endX.i
endY.i
endW.i
endH.i
endAlpha.i

Top, Back


sgxS_ListWrapper

just a linked list wrapped in a structure to use it as optional function parameter via pointer in sgxSetState (used by sgxExamine)

Elements:

Listlist_.i()

Top, Back


sgxS_Table

will be allocated by sgx table elements and stored in field '*table' of the structure sgxS_GADGET

Elements:

w.i
number of columns
h.i
number of lines
*cells
memory block to store cell ids
*gridx
memory block to store x-positions of vertical grid lines
*gridy
memory block to store y-positions of horizontal grid lines

Top, Back


sgxS_GADGET

the basic structure of an sgx element.

some fields are used differently depending on the element type:

x2, y2, w2 and h2 are set to x, y, w and h as a default during element creation in sgx_PassStandardValues() and are used as follows:
- sgxButton x2,y2: offset for optional button sprite.
- sgxScrollbar/Trackbar x2,y2,w2,h2: position and size of knob.
- sgxCombo h2: height of open hover frame (same as h actually). while combo is open, h is temporarily stored in h2 and becomes the expanded height itself.
- sgxEdit x2,y2,w2,h2: 'client area' or text clipping area (area inside the element where text appears).
- sgxCheckbox x2,y2,w2,h2: overall size and knob-relative position (see the notes on sgxCheckbox).
- sgxWin: x2,y2,w2,h2: hold the original position and size while minimized.

width:
- the height of the knob of a vertical scrollbar/trackbar and the width of the knob of a horizontal scrollbar/trackbar. used for scrollpos calculation and knob positioning.
- sxgWin: the height of the titlebar. often checked as a bool value to know if a titlebar exists (but its usually not 1, so don't compare it to #True).

max:
- sgxScrollbar/sgxTrackbar: the maximum value (minimum is 0)
- sgxEdit: the maximum number of lines allowed
- sgxCombo: 0 if the combo is closed. 1 if it's opened ('maximized')

state (see also sgxSetState):
- sgxSpriteGadget: the PB Sprite number or 0.
- sgxCombo: the currently selected entry number in the range of 1 to the number of entries (both inclusive). default is 1.
- sgxWin: one of the #sgxWinState.. values
- toggle buttons: 1 if the button is toggled/pushed, otherwise 0.
- sgxCheckbox: 1 if the checkbox is checked, otherwise 0.
- sgxScrollbar/sgxTrackbar: the current value in the range of 0..max (both inclusive)
never compare the state field to the #sgxState.. values because these are used only during element creation.

Elements:

xToParent.i
x-position relative to parent position
yToParent.i
y-position relative to parent position
x.i
x-position on screen (absolute)
y.i
y-position on screen (absolute)
w.i
width of the element
h.i
height of the element
type.i
type of the element (#sgxType...)
parent.i
parent element ID or -1 for top-level elements
hasChilds.i
(bool) true if the element has childs
x2.i
type dependent. see structure description.
y2.i
type dependent. see structure description.
w2.i
type dependent. see structure description.
h2.i
type dependent. see structure description.
auto.i
auto adaptation flags (combination of #sgx_Auto.. constants)
*treeElem.sgx_llS_elem
element in the tree list. treeElem\node (list of childs) will 0 if the element does not have childs.
*design.sgxS_Design
the design used by the sgx element
text.s
window title / button caption / text of sgxText or sgxEdit / checkbox label / etc. if you need the text unmodifed by automatic word wrap see 'origText'.
width.i
type dependent. see structure description.
textw.i
width of the element's text. for sgxText elements this is the text width of the longest line in case of multiline text.
texth.i
height of the element's text. line height in case of multiline text.
textpos.i
used by sgxEdit elements as current cursor position in characters including linebreaks where 0 means at the beginning of text / before the first character.
textcursor.sgx_S_Point
position (in pixel) of textcursor of sgxEdit elements inside the text clipping area (as defined by x2,y2,w2 and h2)
textalign.i
like #sgxAlign.. for sgxCheckbox and sgxText elements. also used by sgxEdit elements for horizontal text scrolling.
textfontID.i
the PB font ID used for drawing text during element refresh. set to sgx_CurrentFontID on element creation.
origText.s
original text i.e. as specified at creation as opposed to field 'text' which might be modified due to automatic word wrap etc.
origW.i
original width as specified at creation as opposed to field 'w' (real resulting width). used for example to store the -1 that might have been used for automatic sizing.
origH.i
original height as specified at creation as opposed to field 'h' (real resulting height). used for example to store the -1 that might have been used for automatic sizing.
*tip.sgxS_Tip
tooltip data (will be allocated only if needed).
*table.sgxS_Table
will be allocated for tables only (#sgxTypeTable)
scrollpos.i
used for knob positioning by scrollbars/trackbars and for vertical text scrolling by sgxEdit elements.
spr.i[8]
the sprites used for displaying
alpha.i
transparency. can be set via sgxSetAlpha
alpha2.i
original transparency stored during animations
sys0.sgx_S_Box
some box coordinates relative to the elements origin/position defining the close button area of windows to detect mouse events there.
hover.i
1 if the mouse is hovering the element. 0 if it doesn't. an element might not get the hover event if some element (an sgxEdit element or an sgxScrollbar for example) has catched the focus.
state.i
type dependent. see structure description.
max.i
type dependent. see structure description.
changed.i
fired once if the elements state changed. for scrollbars and trackbars: the value by that the state changed. fired also for sgxEdit element if the text or the cursor position has changed.
resizable.i
1 if the element can be resized with the mouse. otherwise 0. can be set via sgxSetResizeable.
minWidth.i
the smallest width allowed for manually resizing elements via mouse. can be set via sgxSetMinSize.
minHeight.i
the smallest height allowed for manually resizing elements via mouse. can be set via sgxSetMinSize.
resized.i
fired once if the elements size has been changed by sgxResize.
refreshed.i
fired once if the element has been refreshed. this may include partial refresh like updating only the tooltip of an element and does not necessarily mean that the element has been redrawn but on the other hand any redraw will tigger this event.
show.i
if #True then the element will be displayed and receives events, otherwise #False to hide the element. should be changed via sgxSetShow.
show2.i
original visibility stored during animations
style.i
type dependent. see documentation of the compose functions that support it like sgxText or sgxCheckbox.
passive.i
0 by default. if set to 1 the element won't catch events or move in front. usefull for background sprite gadgets.
disabled.i
0 by default. if set to 1 the element won't catch events or move in front and will be displayed dimmed. can be set via sgxSetDisabled
margin.i
space in pixels between the elements boundary and it's content. used by sgxText and sgxTable elements. also used by sprite buttons to store the sprite offset for displaying when pushed.
leftclick.i
(bool) fired once with first left mouse button down

Top, Back


sgx_S_key

used per key in an keyboard layout (sgx_S_keyboardLayout)

Elements:

pbid.i
a PB key like #PB_Key_Up or #PB_Key_Escape
chr.s[3]
the characters that should result from the key per key combination: 0 = normal, 1 = shift, 2 = alt-gr
timer.i
individual timer per key for keystroke delays
delaySwitch.i
a switch between first keystroke delay and continuous keypush interval

Top, Back


sgx_S_keyboardLayout

a keyboard layout consisting of key definitions for all the supported keys

Elements:

key.sgx_S_key[101]
array of key definitions

Top, Back


sgx_llnew

constructor macro for creation of sgx_llS_list lists.
for example:
 Global *myList.sgx_llnew 
will be expande to this:
 Global *myList.sgx_llS_list = AllocateMemory(SizeOf(sgx_llS_list)) 
see sgx_llS_elem for an overview of the tree list.

Top, Back


sgx_llIterator(it, List )

flat iterator macro (without recursion) to iterate over all list elements.
use sgx_llNext to close such an iteration block.
do not use Break or Continue in such loops!

see sgx_llS_elem for an overview of the tree list.

Parameters:

it

Top, Back


sgx_llNext(it)

the 'Next' command for an sgx_llIterator block.

see sgx_llS_elem for an overview of the tree list.

Parameters:

it

Top, Back


sgx_llIteratorReverse(it, List )

flat reverse iterator macro (without recursion) to iterate over all list elements backwards.
use sgx_llPrev to close such an iteration block.
do not use Break or Continue in such loops!

see sgx_llS_elem for an overview of the tree list.

Parameters:

it

Top, Back


sgx_llPrev(it)

the 'Next' (previous) command for an sgx_llIteratorReverse block.

see sgx_llS_elem for an overview of the tree list.

Parameters:

it

Top, Back


sgx_llIteratorRecursive(it, List )

recusrive iterator macro to iterate over all list elements including the elements child nodes.
use sgx_llNextRecursive to close such an iteration block.
do not use Break or Continue in such loops!

see sgx_llS_elem for an overview of the tree list.

Parameters:

it

Top, Back


sgx_llNextRecursive(it, skipNode = #False)

the 'Next' command for an sgx_llIteratorRecursive block.
with the parameter 'skipNode' the recursion can be controlled during the loop conditionally. used for example to constrain recursion to non-window sgx childs.

see sgx_llS_elem for an overview of the tree list.

Parameters:

it
skipNode

Top, Back


sgx_llNextRecursive_proc(*it.sgx_llS_elem, skipNode = #False)

used by the sgx_llNextRecursive macro for recursion.

see sgx_llS_elem for an overview of the tree list.

Parameters:

*it
skipNode

Top, Back


sgx_llAdd(*list.sgx_llS_list, id)

creates a new element at the end of the list and sets its data field to 'id'.

see sgx_llS_elem for an overview of the tree list.

Parameters:

*list
id

Top, Back


sgx_llClearList(*list.sgx_llS_list)

removes all elements from the list which will remove sublevels too. the list will still remain a valid but empty list.
see sgx_llS_elem for an overview of the tree list.

Parameters:

*list

Top, Back


sgx_llDelElem(*elem.sgx_llS_elem, returnNode = #False)

remove the element from its list and free it and its childs.
if 'returnNode' is #True, the subtree is preserved and returned. you can thus create a new element in another list and use the node with sgx_llReplaceElemNode, basically moving the element to another list. but remember to also transfer the data field 'id' which is not preserved. sgxSetParent makes use of this.

see sgx_llS_elem for an overview of the tree list.

Parameters:

*elem
returnNode

Top, Back


sgx_llReplaceElemNode(*elem.sgx_llS_elem, *newNode.sgx_llS_list)

remove and replace the node (list of childs) of a list element. used in sgxSetParent for example.

see sgx_llS_elem for an overview of the tree list.

Parameters:

*elem
*newNode

Top, Back


sgx_llMoveEnd(*elem.sgx_llS_elem)

move the element to the end of its list. used in sgxMoveOnTop for example.

see sgx_llS_elem for an overview of the tree list.

Parameters:

*elem

Top, Back


sgx_llDebug(*list.sgx_llS_list)

prints the list/tree hierarchy recursively to the debug output window (directly, not return a string).

see sgx_llS_elem for an overview of the tree list.

Parameters:

*list

Top, Back


sgx_cb(index)

wrapper used in the macro sgx if compiled with debugger. will through an error on invalid indices.

Parameters:

index

Top, Back


sgx(index)

use this macro to access the structure of your sgx elements.

if you try to access invalid sgx objects you might get one of the following errors:
(use Menu > Debugger > Callstack to find out where the error might have been caused)
 ; this will cause an error: 
;Debug sgx(-123)\text ; "[ERROR] sgx array index out of bounds: sgx(-123)"

; this will cause an error if we did not create an element with this ID:
;Debug sgx(345)\text ; "[ERROR] Pointer is null."

; this will NOT cause an error since the index is ok and we check if that element exists:
If sgx(345)
; but we might not get here
Debug sgx(345)\text
EndIf
 

Parameters:

index
ID of a valid and existing sgx element (if structure fields will be accessed), where index can be in the range of 1 .. sgx_CURRENT_MAX_DYNAMIC_GADGETS. you can check if the ID is valid by a nonzero value of 'sgx(index)' (without structure field access).

Top, Back


sgx_err(_message_)

used to throw sgx errors when compiled with debugger.

Parameters:

_message_

Top, Back


sgxNew(id)

create a new sgx object.
returns the ID of that newly created object, or 0 if creation failed.
you should use the compose functions like sgxButton etc. to create actual sgx elements.

Parameters:

id
the ID to be used for the new object, where id can be in the range of 1 .. sgx_LIMIT_STATIC_GADGETS, or -1 to dynamically generate an ID.
if the ID is already in use, the according element is freed (including childs) and replaced.

Top, Back


sgx_isInElement(id, x, y)

checks if the specified absolute screen position is within the element's dimensions.

Parameters:

id
x
y

Top, Back


sgx_MousehoverClosebutton(id)

checks if the mouse position is within the dimensions of the element's close button (windows only).

Parameters:

id

Top, Back


sgx_MousehoverResize(id)

checks if the mouse position is within the dimensions of the element's resize button in hte bottom right corner.

Parameters:

id

Top, Back


sgx_FreeImageChecked(img)

frees the image with the passed number if it's a valid PB image. used for easy recreation of images.
images with id 0 will not be freed even if they are valid images, because sgx uses #PB_Any and interprets 0 as uninitialized.

Parameters:

img
a variable containing the PB image number. the variable will be set to -1 after freeing the image, so you cannot use this macro with constants for example.

Top, Back


sgx_FreeSpriteChecked(spr)

frees the sprite with the passed number if it's a valid PB sprite. used for easy recreation of sprites.
sprites with id 0 will not be freed even if they are valid sprites, because sgx uses #PB_Any and interprets 0 as uninitialized.

Parameters:

spr
a variable containing the PB sprite number. the variable will be set to -1 after freeing the sprite, so you cannot use this macro with constants for example.

Top, Back


sgx_SkipUnused(iterator)

skips the gap of irrelevant IDs between the currently highest used static ID and the first dynamic one. used for more efficient element traversal for example in sgxEACH.

Parameters:

iterator
the identifier used as ID in the loop.

Top, Back


sgxInBounds(index)

returns #True if 'index' is within bounds of the basic sgx element array, otherwise it returns #False.
a return value of '#True' does not say anything about the existence or validity of a possible element at that position.

Parameters:

index
the index that is to be checked.

Top, Back


sgx_SetParentList(id)

used in sgxSetCurrentParent to keep *sgx_CurrentParent (the current parent tree node) in sync with sgx_CurrentParent (the current parent ID).

Parameters:

id

Top, Back


sgxSetCurrentParent(id)

set the parent for coming creations of new sgx elements.
needed if you want to add childs later. calls of this function in combination with sgxCloseLevel should not be nested.

Parameters:

id
ID of the element to become the current parent

Top, Back


sgxSetParent(id, parent)

sets or changes the parent of an sgx element.
used at element creation and also in sgxCellAssign.
the child is not automatically repositioned, use sgxMove if necessary.

Parameters:

id
ID of the child element which parent is to be changed.
parent
ID of the element to become the new parent

Top, Back


sgxEach(it)

use this macro to iterate through the elements. the order in which the elements are iterated is undefined.
usage example:
 ;Define id  ; needed if EnableExplicit is used 

For sgxEach(id)
Debug sgx(id)\text
Next

Parameters:

it
choose your iterator variable here that will contain the ID of the sgx elements. this variable is used in the for/next loop as is and must have been declared previously if EnableExplicit is used.

Top, Back


sgxMoveOnTop(id)

make an sgx window (#sgxTypeWin) active and foreground or move an element above its siblings. if the element is not a window then the parent window will be activated additionally.

Parameters:

id
the ID of the sgx element

Top, Back


sgx_PushBuildRefresh(state)

temporarily changes the value of sgx_BuildRefresh.

Parameters:

state

Top, Back


sgx_PopBuildRefresh()

restores sgx_BuildRefresh to the previous value.

Top, Back


sgxGetElementAt(x, y)

returns the ID of the topmost sgx element at the given position on screen, or -1 if no sgx element is found there. passive elements are ignored.

Parameters:

x
x-position on screen in pixels
y
y-position on screen in pixels

Top, Back


sgxGetTopLevel(id)

returns the ID of the topmost parent.

Parameters:

id
ID of child element. if this element does not have parents, it is the top level itself and thus returned.

Top, Back


sgxMove(id, x, y, relative = #True)

change the position of an sgx element.
the positioning is either in absolute screen coordinates or in absolute toParent coordinates.
if you want to position the element relative to its own current position (by offset) you would calculate the offset as follows (both methods would have the same effect):
 ; moves the element 10 pixels to the right as well as down by specifiying toParent coordinates. 
sgxMove(id, sgx(id)\xToParent+10, sgx(id)\yToParent+10);

; moves the element 10 pixels to the right as well as down, using absolute screen coordinates. it's toParent-position will be updated accordingly.
sgxMove(id, sgx(id)\x+10, sgx(id)\y+10, #False);

Parameters:

id
ID of the sgx element to be moved
x
new x-position relative to parent element
y
new y-position relative to parent element
relative
by default (#True) the element will be positioned relative to it's parent. specify #False if x/y are absolute screen coordinates.

Top, Back


sgx_updateToParentPos(id)

updates the element's to-parent-position if it's absolute screen position has been modified.

Parameters:

id
ID of the sgx element.

Top, Back


sgxSetDisabled(id, disabled = #True)

disable or enable an sgx element.
if the disabled/enabled state changes then the element will be refreshed.

Parameters:

id
ID of the sgx element to be disabled or enabled
disabled
#True (default) to disable the element or #False to enable it.

Top, Back


sgxResize(id, w, h)

change the size of an sgx element.
sgxTable elements determine their size by their childs and cannot be resized directly. sgxCheckbox elements resize only their knob (w,h) but their overall size (w2,h2) might be influenced by this too.

Parameters:

id
ID of the sgx element to be resized
w
the new width. one of these values:
- a positive value > 0 for an explicit width.
- a value of -2 to ignore that parameter and not change the width or to use the automatic size adjustment as specified at creation for elements which support it.
- a value of -1 to explicitly use automatic size adjustment for elements which support it.
h
the new height. one of these values:
- a positive value > 0 for an explicit height.
- a value of -2 to ignore that parameter and not change the height or to use the automatic size adjustment as specified at creation for elements which support it.
- a value of -1 to explicitly use automatic size adjustment for elements which support it.

Top, Back


sgx_MoveChildsOf(id)

updates the position of child elements if their parent element has moved, keeping their to-parent-position.
child windows are not moved if their parent window moves, but instead their to-parent-position is updated accordingly.
called in sgxMove And recursively whithin itself.

Parameters:

id
ID of the sgx element which childs are to be repositioned.

Top, Back


sgx_GetGadgetX(id)

returns (and is used to update) the elements absolute position on screen (x, y) together with sgx_GetGadgetY by summarizing all to-parent-positions up the parent hierarchy.

Parameters:

id
ID of the sgx element.

Top, Back


sgx_GetGadgetY(id)

returns (and is used to update) the elements absolute position on screen (x, y) together with sgx_GetGadgetX by summarizing all to-parent-positions up the parent hierarchy.

Parameters:

id
ID of the sgx element.

Top, Back


sgxCloseLevel(closeAllLevels = #False)

call this function when you finished the creation of a window or table and it's childs.
note that this function will always set the current parent to its own parent and NOT necessarily to the value it had before a call of sgxSetCurrentParent.

Parameters:

closeAllLevels
if set to #True, there will be no current parent after the call and new creations will be global.
if set to #False (default), the above parent level will be the new current parent.

Top, Back


sgx_IsParentage(parent, child)

returns #True if 'parent' is found anywhere up the parent hierarchy of 'child', otherwise returns #False.
used to highlight parent windows as hovered if one of their child windows is the active window.

Parameters:

parent
the parent elements ID to be searched for.
child
the child elements ID.

Top, Back


sgx_getTypeString.s(id)

returns a string informing about the type of an sgx element for debugging purposes.

Parameters:

id
ID of the sgx element.

Top, Back


sgxDebugElem.s(id, multiline = #False)

returns a string with information about the element's attributes.

Parameters:

id
ID of the sgx element.
multiline
#False (default) to return a single line. #True to format with newlines (#LF$ / Chr(10)).

Top, Back


sgxDebugTree.s(id = -1)

returns a string with information about the elements attributes and their hierarchy.

Parameters:

id
-1 (default) to debug the whole element hierarchy. specify an element ID to only debug that element and its childs recursively.

Top, Back


sgxSetFont(font)

set the font for coming creations of new sgx elements.

Parameters:

font
a valid PB #Font. if you pass sgxStdFont or an invalid font then the current font will be reset to the default.

Top, Back


sgxSetGroup(id, groupID)

add an sgx element to a radio group.
checkboxes and/or toggle buttons can be grouped using this function so that if one element gets checked/pushed, all others will be unchecked/untoggled.
those elements can still be unchecked via righclick per default setting of variable sgxRightclickUnset, so that no element in that group would be checked/pushed.
see also sgxGetGroup.

Parameters:

id
ID of the sgx element to be added
groupID
any number. use same numbers for elements you want to group

Top, Back


sgxGetGroup(id)

returns the groupID of an sgx element, or -1 if the element does not belong to a radio group.
see also sgxSetGroup.

Parameters:

id
ID of the sgx element to be inquired

Top, Back


sgxSetDimensions(width, height)

tell sgx about the screen dimensions you use.
this isn't necessary if a screen has been opened before the first call of sgxLoadDesign.

Parameters:

width
screenwidth
height
screenheight

Top, Back


sgxFree(id)

free / delete an sgx element, including childs. the ID of the element and all its child element IDs will become invalid.

Parameters:

id
ID of the sgx element to be freed

Top, Back


sgxFreeChildsOf(parent)

free / delete all childs of an sgx element, including their own childs.

Parameters:

parent
ID of the sgx element whose childs are to be freed. this parent will remain valid, the IDs of all child elements will become invald.

Top, Back


sgx_HideChildsOf(parent, show = #False, ignoreWindows = #True)

hides or shows all childs of an element (but not the element itself) recursively but ignores child windows (per default).

Parameters:

parent
ID of the element whose childs are to be hidden/shown.
show
#False (default) to hide the childs, #True to make them visible.
ignoreWindows
#True (default) to not modify child windows. #False if you want to hide/show also child windows (if 'parent' is a window).

Top, Back


sgxSetShow(id, show, recursively = #True, ignoreWindows = #True)

shows or hides an element.
if you hide a window including its childs and later show it again then previously hidden childs will be all visible and not restored to their actual previous visibility.

Parameters:

id
ID of the sgx element.
show
#True to show the element, or #False to hide it.
recursively
#True (default) to show/hide child elements too recursively. #False to only show/hide the element itself.
ignoreWindows
if parameter 'recursively' is #True then recursion will not traverse into child windows per default (#True). set it to #False for complete recursion including child windows.

Top, Back


sgx_addAnimation(id, animationType)

add an animation data object to the animation list.
used by sgxMinimizeWin, sgxRestoreWin, sgxCloseWin and sgxPresentWin

Parameters:

id
ID of the element that should be animated.
animationType
#sgxWinStateMinimizing, #sgxWinStateRestoring, #sgxWinStateClosing or #sgxWinStatePresenting.

Top, Back


sgxMinimizeWin(id)

initializes minimizing of window.
the animation might finish immediately.

Parameters:

id

Top, Back


sgxRestoreWin(id)

initializes restoring of window.
the window's 'resized' event will be triggered when the animation has finished which can be received after the next call of sgxExamine.
the animation might finish immediately.

Parameters:

id

Top, Back


sgxCloseWin(id)

initializes closing of a window and it's child windows.
the animation might finish immediately in wich case the element and its childs will have been deleted and their IDs become invalid. in that case the returnvalue is 1, otherwise 0.

Parameters:

id

Top, Back


sgxPresentWin(id)

initializes presenting of a window and it's child windows.
the window's 'resized' event will be triggered when the animation has finished which can be received after the next call of sgxExamine.
the animation might finish immediately.

Parameters:

id

Top, Back


sgx_RefreshWinBar()

determines visible minimized windows and repositions them as buttons in the taskbar.
used after a window's state or its visibility has changed for example.

Top, Back


sgx_animate(id, *animation.sgxS_Animation)

animate an element, that is to say, update its attributes according to the currently reach animation progress.
returns 1 if the element has been destroyed due to a finished closing animation.

Parameters:

id
ID of the element to be animated
*animation
an animtaion data object from the animation map 'sgx_animations'

Top, Back


sgxSetWinAnimStyle(winState, winAnimStyle)

configures window animations.
animation of size will make a window hide its childs during the animation. animations 'zoom' and 'roll' only work for minimizing and restoring of windows.

Parameters:

winState
the type of animation you want to configure: #sgxWinStateMinimizing, #sgxWinStateRestoring, #sgxWinStateClosing or #sgxWinStatePresenting
winAnimStyle
combination of animation styles (you can combine them with '|' (bitwise OR)):
#sgxAnimFade : animate the elements alpha value (transparency)
#sgxAnimSizeW : collapse / expand the width
#sgxAnimSizeH : collapse / expand the height
#sgxAnimSize : collapse / expand width and height
#sgxAnimZoom : zoom windows into / out of the taskbar
#sgxAnimRoll : roll windows down to / up from the taskbar

Top, Back


sgxSetTextcursorType(textcursorType)

changes the type of the textcursor used by sgxEdit elements. call this function before creating sgxEdit elements, otherwise the change takes effect with next element refresh.

Parameters:

textcursorType
one of these values:
#sgxTextcursorTypeIBeam (I-Beam type cursor)
#sgxTextcursorTypeTeeth (something like an open I-Beam cursor)
#sgxTextcursorTypeLine (vertical line)
#sgxTextcursorTypeLine2 (thicker vertical line/bar)
#sgxTextcursorTypeLine3 (vertical line/bar with some alpha blending)
#sgxTextcursorTypeCaret (caret type cursor)

Top, Back


sgxSetText(id, text.s)

changes the text of an sgx element and refreshes it.
this function may trigger the 'changed' event for sgxEdit elements which can be received after the next call of sgxExamine.

Parameters:

id
ID of the sgx element whose text is to be changed.
text
new text.

Top, Back


sgxSetResizable(id, resizable = #True)

make an element resizeable via the mouse.
sgxTable elements determine their size by their childs and cannot be resized directly.
sgxCheckbox elements resize only their knob (w,h) but their overall size (w2,h2) might be influenced by this too.
scrollbars/trackbars will resize only their bar and not their knob.
use sgxSetMinSize to ensure a minimum size.
the element's 'resized' field will be triggered every time the size changes.

Parameters:

id
ID of the sgx element.
resizable
#True (default) to make the element resizable. #False to disable resizing via mouse.

Top, Back


sgxSetMinSize(id, minWidth, minHeight)

set the minimum size allowed for manually resizing elements via mouse.
the default minimum size (if you don't call this function) is the size of the resize gadget.

Parameters:

id
ID of the sgx element.
minWidth
the smallest width allowed for resizing. must be greater 0.
minHeight
the smallest height allowed for resizing. must be greater 0.

Top, Back


sgxSetScrollMax(id, max)

change the range of a scrollbar/trackbar.
this will update the element's state if the new maximum is lower than its current state and updates the knob position. the element's 'changed' event might be triggered if the state changes.

Parameters:

id
ID of the sgx scrollbar/trackbar element.
max
new maximum possible scroll state (minimum is 0). this must be greater than 0 and will be corrected to 1 automatically if necessary.

Top, Back


sgx_SetScrollPos(id, scrollpos)

translates a pixel position on scrollbar/trackbar into its state and updates the knob position and the 'state' and 'changed' fields (directly without using pending events, so it should only be called during sgxExamine).

Parameters:

id
ID of the sgx element.
scrollpos
pixel position on the bar. will be automatically clipped into the valid range.

Top, Back


sgxSetState(id, state, handleRadioGroups = #True, *changed.sgxS_ListWrapper = 0)

changes the state of an sgx element and refreshes it if necessary.
this function may trigger the 'changed' event for the element (or for other elements in a radiogroup) which can be received after the next call of sgxExamine.

Parameters:

id
ID of the sgx element whose state is to be changed.
state
the new state (don't ever use #sgxState.. values here because these are used only during element creation.).
for scrollbars and trackbars the state will not be changed if it's lower than 0 or greater than the maximum.
for toggle buttons and checkboxes specify a state of 1 for toggled/checked or 0 for not toggled/checked.
for combos the state must be in the range of 1 to the number of entries (both inclusive) otherwise the state will not be changed.
for sprite gadgets the parameter 'state' must be a valid PB sprite number or 0 to detach the current sprite. this will also update the element's size according to the size of the sprite. if you specify 0 as the sprite then the element size will be zero and you won't receive any mouse events!
to change the state of a window use sgxPresentWin, sgxMinimizeWin, sgxRestoreWin and sgxCloseWin.

handleRadioGroups
#True (default) to also handle other element's state in a possibly assigned radiogroup accordingly.
*changed
used internally by sgxExamine to correctly set the 'changed' flag for the other radiogroup members.

Top, Back


sgx_setParentWindowHovered(id)

Parameters:

id

Top, Back


sgxSetEmsContainer(*emsContainer.Integer)

tell sgx about your 'ems' variable. since it's likely that you've got already a variable holding some 'ElapsedMilliseconds()'-like value,
you can let sgx access that data. usefull if you have better timing resolution. otherwise if you don't call this procedure then sgx will inquire PB's ElapsedMilliseconds() by itself (default).
you need to call that procedure once only.

Parameters:

*emsContainer
a pointer to your long-variable (use @).

Top, Back


sgxSetDesign(*design.sgxS_Design, id = -1)

set the design for coming creations of new sgx elements, or change the design of an sgx element.

Parameters:

*design
pointer to a loaded design (return value of sgxLoadDesign or one of the sgxDesign() list elements).
id
per default (-1), the from now on used design is set to *design. if an ID is passed, only the design of the sgx element is changed wich takes effect with the next element refresh which is not done automatically.

Top, Back


sgxSetAlpha(alpha, id = -1, recursive = #False)

set the alpha value for coming creations of new sgx elements (default alpha is 255, no transparency), or change the alpha value of an sgx element.

Parameters:

alpha
alpha value in the range of 0 (invisible) to 255 (fully opaque / no tranparency)
id
if ignored (default/-1), the from now on used default value is set to alpha. if an ID is passed, only the alpha value of the sgx element is changed. no refresh of that element is necessary, since the value is only used for display.
recursive
#False per default. if set to #True, the alpha value of the childs of the element will also be changed unless they are windows.

Top, Back


sgxCell(table, i, k)

use this macro to access the structure of your sgx elements if they are cells of a table and you want to access them via their position in the table. you can also access them the normal way via sgx though.

Parameters:

table
ID of an sgx table element (#sgxTypeTable)
i
column (starting with 0)
k
line (starting with 0)

Top, Back


sgxCellId(table, i, k)

returns the ID of a table-cell, or 0 for empty cells or if it fails, which happens if table is not a valid sgx table element or if the coordinates are out of the table's dimensions.

Parameters:

table
ID of an sgx table element (#sgxTypeTable)
i
column (starting with 0)
k
line (starting with 0)

Top, Back


sgxCellAssign(i, k, id, table = -1)

assigns an sgx element to a cell of a table or removes it. that table must either be the current parent or must be specified by parameter. the element will be removed from its current parent's child list and becomes a child of the table. it returns the same ID as passed, or 0 if assignment failed. it fails if the table is not a valid sgx table element, or if i/k are out of the bounds of the table's columns/lines.
it's recommended to create and assign the table's child elements between the table creation with sgxTable and it's associated call of sgxCloseLevel. since table cells and their assigned elements can influence each other's dimensions, they are all refreshed once with the call of sgxCloseLevel. but it's generally possible to create the childs before or after and only assign them during the creation of the table or later, though there might happen redundant double refreshing of elements.
if an id of 0 is specified, the cell will be cleared and becomes empty. in any case a possibly already assigned element at that position will be removed and freed.

sgxCellAssign should be used in one of the following ways:

table creation -> child creation and assignment -> parent level closing:
 t=sgxTable(-1, 10,10, 4,4, 6) 
b=sgxButton(-1, 4,4, 100,20, "button")
sgxCellAssign(0,0, b)
sgxCloseLevel()
or if you need to create childs later then like this..
table creation and parent level closing -> child creation and assignment with table parameter -> table refresh
 t=sgxTable(-1, 10,10, 4,4, 6) 
sgxCloseLevel()
b=sgxButton(-1, 4,4, 100,20, "button")
sgxCellAssign(0,0, b, t) ; <- table parameter specified
sgxRefresh(t)
..or like this..
table creation and parent level closing -> child creation -> setting the current parent -> cell assignment -> parent level closing
 t=sgxTable(-1, 10,10, 4,4, 6) 
sgxCloseLevel()
b=sgxButton(-1, 4,4, 100,20, "button")
sgxSetCurrentParent(t)
sgxCellAssign(0,0, b)
sgxCloseLevel()

Parameters:

i
column. (starting with 0)
k
line (starting with 0)
id
ID of a valid and existing sgx element or 0 if you want to clear the cell. the x/y-position of that element will be overwritten according to the position in table. the w/h dimensions of the element might be overwritten according to the table style.
table
-1 (default) if the current parent should be used as the table. otherwise specify the id of the table you want to assign to.

Top, Back


sgx_ArrangeTable(id)

scans the cells of a table to calculate size of columns, rows as well as the final table's size and may overwrite cell element positions and sizes according to the table style but does not refresh elements.

Parameters:

id
a valid sgx table element id.

Top, Back


sgx_textWidthLF(text.s)

returns the width of the longest line in the text, that is to say the width of the complete textblock.
must be called inside a StartDrawing()/StopDrawing() block.

Parameters:

text
(multiline) text. use #LF$ / Chr(10) for linebreaks.

Top, Back


sgx_drawTextLF(x, y, text.s, color, xWrapTo = -1, lineSeperator$ = #LF$, textAlign = #sgxAlignTextLeft)

draws multiline text to the current drawing output.
the variables sgx_drawTextLF_EndX and sgx_drawTextLF_EndY can be used to get the position where the drawing finished in case you want to continue drawing some text later.

Parameters:

x
starting x-position.
y
starting y-position.
text
(multiline) text to be drawn.
color
textcolor.
xWrapTo
x-position of further drawing after occurrence of linebreaks. per default (-1) the specified 'x' parameter is used for this.
lineSeperator$
the string that is used in 'text' as line seperator (default value is #LF$ / Chr(10))
textAlign
one of these values (aligments that need a width will use the longest line for that):
#sgxAlignTextLeft
#sgxAlignTextRight
#sgxAlignTextCenter
#sgxAlignTextJustifySpaces
#sgxAlignTextJustifyCharacters

Top, Back


sgx_max(a, b)

returns 'a' if its greater that 'b', otherwise returns 'b'.

Parameters:

a
an integer value
b
an integer value

Top, Back


sgx_fade(color, fade)

returns a new color with different brightness derived from 'color' according to the value of 'fade'. the alpha will not change.

Parameters:

color
some RGBA value
fade
0: no change
negative value: darken (value -1000 = black)
positive value: brighten (value 1000 = white)

Top, Back


sgxSetKeyboardLayout(layout = #sgxKeyLayQwerty, keystrokeDelay_1 = 280, keystrokeDelay_2 = 40)

configure keyboard layout and keystroke delay used by sgxEdit elements (via sgx_keyboardEdit).
when using qwerty layout the characters '<', '>' (angle brackets) and '|' (pipe) can be accessed via 'alt-gr' + ',' / '.' / '-' (comma, dot and hyphen).

Parameters:

layout
#sgxKeyLayQwerty (default) for qwerty / US keyboard layout. #sgxKeyLayQwertz for qwertz / DE
keystrokeDelay_1
the keystroke delay after a first key-push in milliseconds (default 280)
keystrokeDelay_2
the keystroke delay for continuous key-push in milliseconds (default 40)

Top, Back


sgx_keyboardEdit.s(text.s, textpos = -1, maxLines = -1)

defines string operations on keyboard data. (text editing)
basic usage:
 sgxSetKeyboardLayout() 
Repeat
ExamineKeyboard()
text = sgx_keyboardEdit(text, textpos)
textpos = keyboardEdit_lastTextPos
if sgx_keyboardEdit_TextModified
; text or textpos changed
;...
if after a call of this function 'sgx_keyboardEdit_TextModified' is #True then the text or the textpos has changed. it will be #False if no change occured.
the possibly changed text is returned and 'sgx_keyboardEdit_lastTextPos' will be set to the current textpos.
you can configure keyboard layout and keystroke delay via sgxSetKeyboardLayout

Parameters:

text
the text to be edited.
textpos
the initial cursor position in characters including linebreaks. -1 (default) means beginning of text. the position might change during the call i.e. if cursor keys have been used ot text has been entered. use sgx_keyboardEdit_lastTextPos to get the updated value after a call.
maxLines
the maximum lines allowed. -1 (default) means no limit.

Top, Back


sgx_RemakeDesignImage(_img, _w, _h)

frees an design image (in case it is a valid one) and recreates it with the specified dimensions

Parameters:

_img
index for the *design\img[] array
_w
new height
_h

Top, Back


sgx_MakePalette(*design.sgxS_Design, basecolor)

creates a color pallete for the design derived from a basecolor.
basically an array of some colors derived from a base color and to be used as text color when hovered or for thin borders of text elements etc.
called by sgxRefreshDesign

Parameters:

*design
the design to create the pallete for
basecolor
the base color to derive the pallete from

Top, Back


sgxLoadDesign(design.s = "lowbudget", basecolor = -1)

loads a design.
returns the loaded design or 0 if loading fails.
you don't necessarily need the return value, but you can store it for later use with sgxSetDesign in which case an integer variable is sufficient.
if you want to access structure fields of the design you should use a pointer of type sgxS_Design as variable.
if you call this procedure before you opened a screen, make use of sgxSetDimensions.

Parameters:

design
the path / directory that contains the design images, or "lowbudget" (default) for an instant design
basecolor
basecolor to be used for the design, or -1 (default) to use the color as found in the image data. 'lowbudget' will be fully colored. file-designs only support this for color of text and thin borders.

Top, Back


sgxRefreshDesign(*design.sgxS_Design)

refresh the design. i.e. after you changed the basecolor of the design. the images will be regenerated / reloaded from disk.

Parameters:

*design
pointer to a valid design

Top, Back


sgx_PassStandardValues()

macro to initalize element property default for most element type during creation. used by the compose functions like sgxButton etc.

Top, Back


sgx_infoTail()

used to add debug information to the text of sgx elements (must be activated in the code)

Top, Back


sgxCursor(id)

creates an sgx cursor element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.

Parameters:

id
ID for the new sgx element.

Top, Back


sgxButton(id, x, y, w, h, text.s, toggle = #sgxStateNone, sprNr = -1, x2 = 5, y2 = 5)

creates an sgx button element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
if a sprite is specified then you are responsible for the sprites lifetime, sgxFree will not free the sprite. also you should not free the sprite before you have freed the sgxButton, otherwise the sprite simply won't be displayed, but doesn't generate an error.
a togglebutton's state will change when leftclicked, or will be set to pushed if it is part of a radiogroup. rightclick behaviour can be configured via variable sgxRightclickUnset.
you can use sgxSetState with toggle buttons.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
w
width
h
height
text
caption. use #LF$ / Chr(10) for line breaks
toggle
one of these values:
#sgxStateNone (default) for a standard button
#sgxStateOff for a toggle button
#sgxStateOn for a toggle button initialized as 'pushed'
sprNr
an optional PB #sprite to be displayed on the button. you can then also use -1 for the w/h-parameters to adjust the button to the size of the sprite.
x2
x-offset for the additional sprite
y2
y-offset for the additional sprite

Top, Back


sgxCheckbox(id, x, y, w, h, checked = #sgxStateOff, text.s = "", align = #sgxAlignCheckboxTextRight)

creates an sgx checkbox element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.

the specified position and size will define the knob. the overall size including the label will be stored in the fields w2 and h2. the fields x2 and y2 store the display position of the elements sprite (the visual size including the label) relative to the knob position. with #sgxAlignCheckboxTextLeft for example the label will start on screen at (x+x2),(y+y2) where x2 will be negative and y2 will be negative if the text is larger than the knob height.

a checkbox's state will change when leftclicked, or will be set to checked if it is part of a radiogroup. rightclick behaviour can be configured via variable sgxRightclickUnset.
you can use sgxSetState with this element.

Parameters:

id
ID for the new sgx element.
x
knob x-position relative to parent element
y
knob y-position relative to parent element
w
knob width
h
knob height
checked
#sgxStateOff (default) for unchecked or #sgxStateOn for checked
text
label
align
can be #sgxAlignCheckboxTextRight to have the label on the right (default), or #sgxAlignCheckboxTextLeft to have it on the left.

Top, Back


sgxScrollbar(id, x, y, w, h, w2, h2, max, state = 0, style = 0)

creates an sgx scrollbar element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
if height is greater than width, the scrollbar will be vertical, otherwise horizontal.
you can use sgxSetState and sgxSetScrollMax with this element.
note that for example for a scrollbar length of 10 pixel and a max state value of 100 you will only be able to receive every 10th state.
likewise for a scrollbar length of 100 pixel and a max state value of 10 you will only receive state changes every 10th pixel.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
w
width (bar)
h
height (bar)
w2
width (knob)
h2
height (knob)
max
maximum possible scroll state (minimum is 0). this must be greater than 0 and will be corrected to 1 automatically if necessary.
state
initial state (default is 0)
style
possible values (you can combine flags with '|' (bitwise OR)):
0 (scrollbar default)
#sgxStyleGrid: draws a pseudo-grid.
#sgxStyleReverse : the state 0 will be at the left for horizontal and at the top for vertical scrollbars per default. by specifying the reverse flag the 0 state will be at the other end of the scrollbar.

Top, Back


sgxTrackbar(id, x, y, w, h, w2, h2, max, state = 0, style = #sgxStyleGrid)

creates an sgx trackbar element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
if height is greater than width, the trackbar will be vertical, otherwise horizontal.
you can use sgxSetState and sgxSetScrollMax with this element.
note that for example for a trackbar length of 10 pixel and a max state value of 100 you will only be able to receive every 10th state.
likewise for a trackbar length of 100 pixel and a max state value of 10 you will only receive state changes every 10th pixel.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
w
width (bar)
h
height (bar)
w2
width (knob)
h2
height (knob)
max
maximum possible scroll state (minimum is 0). this must be greater than 0 and will be corrected to 1 automatically if necessary.
state
initial state (default is 0)
style
possible values (you can combine flags with '|' (bitwise OR)):
0
#sgxStyleGrid: draws a pseudo-grid (trackbar default)
#sgxStyleReverse : the state 0 will be at the left for horizontal and at the bottom for vertical trackbars per default. by specifying the reverse flag the 0 state will be at the other end of the trackbar.

Top, Back


sgxEdit(id, x, y, w, h, text.s = "", maxLines = -1)

creates an sgx edit element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
this is for user editable text only. for static labels use sgxText.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
w
width
h
height
text
inital text. use #LF$ / Chr(10) for line breaks
maxLines
you can limit the amount of lines that can be entered by the user. use -1 (default) to not limit the amount of lines.

Top, Back


sgxWin(id, x, y, w, h, text.s = "", style = 0)

creates an sgx window element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
this element will be the parent for new sgx elements until you call sgxCloseLevel or until you create another parent element.

a window's state can be changed via the functions sgxPresentWin, sgxMinimizeWin, sgxRestoreWin, sgxCloseWin and can be inquired by checking the 'state' field for #sgxWinState.. values.
a closed window does not exists anymore and thus has no state. use the macro sgx() without structure field access to test the vailidty in that case.

you can use sgxPresentWin directly after sgxCloseLevel to present the window instead of showing it immeditately.
if you want the window to be created hidden, use sgxSetShow (see notes about child visibility) to hide the window after you finished the creation with sgxCloseLevel. you can then use sgxPresentWin later to show the window.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
w
width
h
height
text
caption in titlebar. no text will cause the window to have no titlebar. use a space for an empty titlebar.
style
0 (default)
#sgxStyleResizable to make the window resizable via mouse.

Top, Back


sgxSpriteGadget(id, x, y, sprNr)

creates an sgx sprite container and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
you are responsible for the sprites lifetime, sgxFree will not free the sprite. also you should not free the sprite before you have freed the sgxSpriteGadget, otherwise the sprite simply won't be displayed, but doesn't generate an error.
you can use sgxSetState with this element.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
sprNr
a valid PB Sprite number, or 0. you can change the sprite via sgxSetState.

Top, Back


sgxArea(id, x, y, w, h)

creates an sgx area container and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
use sgx area elements to get mouse events without using any visuals.
areas dont't move up in z-order when clicked as other types do but other elements may move in front of an area. you can use sgxMoveOnTop to move it up manually if needed.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
w
width
h
height

Top, Back


sgxTip(id, text.s)

creates a tooltip for an sgx element.

Parameters:

id
ID of a valid and existing sgx element
text
inital text of the tooltip. use #LF$ / Chr(10) for line breaks

Top, Back


sgxCombo(id, x, y, w, h, text.s = "")

creates an sgx combo element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
you can use sgxSetState with this element.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
w
width
h
height
text
the possible entries separated by #LF$ / Chr(10)

Top, Back


sgxText(id, x, y, w = -1, h = -1, text.s = "", style = 0, margin = 3, textalign = #sgxAlignTextLeft, wordwrap = #False)

creates an sgx text element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
this is for static labels only. for user editable text use sgxEdit.
take in consideration that changing the text via sgxSetText will cause an element refresh, including drawing of design images as well as drawing of text onto the element's sprites, possibly also recreation of sprites if the size changes too. this will have an impact on performance, so don't take it lightly by changing it's text every frame for example.

Parameters:

id
ID for the new sgx element.
x
x-position relative to parent element
y
y-position relative to parent element
w
width. -1 (default) will adjust width to textwidth
h
height. -1 (default) will adjust height to textheigt
text
inital text. use #LF$ / Chr(10) for line breaks
style
with #sgxStyleThin the element will have a frame. #sgxStyleHover will cause it to have a mouseover effect. you can combine flags with '|' (bitwise OR), or use #sgxStyleHoverThin.
margin
space between text and border
textalign
one of these values:
#sgxAlignTextLeft (Default)
#sgxAlignTextRight
#sgxAlignTextCenter
#sgxAlignTextJustifySpaces (text justified per word)
#sgxAlignTextJustifyCharacters (text justified per character)
wordwrap
#False (Default), #True for automatic word wrap. works only if width (parameter w) is not set to -1.

Top, Back


sgxTable(id, x, y, columns, lines, margin, style = #sgxStyleGrid)

creates an sgx table element and returns it's ID.
the notes on sgxNew apply to return value and parameter 'id'.
this element will be the parent for new sgx elements until you call sgxCloseLevel or until you create another parent element.
use sgxCellAssign to place elements in the table, sgxCellId and sgxCell to access the cell elements.
each column will be as wide as the widest element in it.
each line will be as high as the highest element in it.
the size of the table will adapt to the sum of column widths / line heights. child elements of the table might not be completely refreshed until table creation is finished with sgxCloseLevel.

the parameters 'columns' and 'lines' specify the amount, so cell indices will range from 0 to amount-1. it does not necessarily hurt to oversize these dimensions if you're not shure how big you need the table to be later. each cell will need 4 bytes of memory, no matter if assigned or left empty and each colum as well as each lines needs additional 4 bytes of memory.

big tables with a lot of elements, possibly also subtables and especially in combination with #sgxStyleFitCellW and/or #sgxStyleFitCellH can impact performance if cell elements need to be refreshed often since this could cause refresh of other cell elements and the table itself. using #sgxStyleNoBG will also make a table refresh faster.
tables are desinged to be a quick way for simple layouts and in some cases it might be better to position, resize and refesh elements on you own without using a table.

Parameters:

id
ID for the new sgx table element.
x
x-position relative to parent element
y
y-position relative to parent element
columns
amount of maximum columns (see notes above)
lines
amount of maximum lines (see notes above)
margin
space between cells
style
possible values (you can combine flags with '|' (bitwise OR)):
0
#sgxStyleGridV : draw vertical grid lines
#sgxStyleGridH : draw horizontal grid lines
#sgxStyleGrid (default) : draw vertical and horizontal grid lines
#sgxStyleFitCellW : width of cell elements will be overwritten according to column width except for vertical scrollbars/trackbars, checkboxes and sgxText elements with automatic width adjustment.
#sgxStyleFitCellH : height of cell elements will be overwritten according to line height except for horizontal scrollbars/trackbars, checkboxes and sgxText elements with automatic height adjustment.
#sgxStyleNoBG : no background / only cells will be visible. (this will disable the grid flags)

Top, Back


sgx_prepareSprite(spr, w, h, id)

creates an element sprite it not done yet or frees and recreates the sprite if the size is different.

Parameters:

spr
variable that contains the pb sprite number.
w
new width
h
new height
id
ID of the sgx element that is shown in a debugger error if the sprite creation fails.

Top, Back


sgxRefreshAll()

refresh all existing sgx elements, if you modified the design for instance.

Top, Back


sgxRefresh(id, mode = #sgx_refreshNormalWithTip)

refresh an sgx element.

Parameters:

id
ID of the sgx element to be refreshed.
mode
#sgx_refreshNormalWithTip : normal refresh (including sgx-tip).
#sgx_refreshOnlyTip : only the sgx-tip will be refreshed.
#sgx_refreshNormalWithChildsOfTables: normal refresh, but includes childs of tables.
#sgx_refreshSkipTableCheckboxRedraw : skip redraw for checkboxes created in tables.
#sgx_refreshEditMouseclickCursor : for edit elements: update the character textpos from the current cursor pixel position (as opposed to other way round). used when positioning cursor by mouseclick.
#sgx_refreshEditMousewheelScroll : for edit elements: disable the correction of textalign/scrollpos if cursor is outside clientarea. used when scrolling by mousewheel.

Top, Back


sgx_Fill(*design.sgxS_Design, x, y, w, h, appearance)

draws a background to the current drawing output using the design's background image (will be tiled to fill specified area).

Parameters:

*design
the design you want to use for the drawing.
x
x-position to begin drawing
y
y-position to begin drawing
w
width of background to be drawn
h
height of background to be drawn
appearance
a value like #sgx_AppearanceNormal, #sgx_AppearanceHover or #sgx_AppearancePushed etc.

Top, Back


sgx_BorderLine(*design.sgxS_Design, x, y, V, appearance, side)

draws a straight part (a line, as opposed to some corner part) of a border to the current drawing output using the design's border images.
used by sgx_Borderbox.

Parameters:

*design
the design you want to use for the drawing.
x
x-position to begin drawing
y
y-position to begin drawing
V
length of the line to be drawn. a positive value for horizontal lines and negative value for vertical lines.
appearance
a value like #sgx_AppearanceNormal, #sgx_AppearanceHover or #sgx_AppearancePushed etc.
side
the side of the border to be drawn:
#sgx_SideTopOrLeft draws the top edge border (for horizontal) or left edge border (for vertical) respectively.
#sgx_SideBottomOrRight draws the bottom edge border (for horizontal) or right edge border (for vertical) respectively.

Top, Back


sgx_Borderbox(*design.sgxS_Design, x, y, w, h, appearance)

draws a box to the current drawing output using the design's border images.

Parameters:

*design
the design you want to use for the drawing.
x
x-position to begin drawing
y
y-position to begin drawing
w
width of box to be drawn
h
height of box to be drawn
appearance
a value like #sgx_AppearanceNormal, #sgx_AppearanceHover or #sgx_AppearancePushed etc.

Top, Back


sgx_CopyImageToSprite(imgNr, onBeginDraw.sgx_onBeginDraw = 0, onEndDraw.sgx_onEndDraw = 0, id = 0, sprType = 0)

creates and returns a sprite duplicated from an image (for example the mouse sprite from a loaded mouse design image, or the window's close buttons).
the optional parameters will be specified by the element drawing routines to let this function also handle the custom drawing callbacks.

Parameters:

imgNr
a PB image number.
onBeginDraw
callback that should be called before drawing the image content to newly created sprite.
onEndDraw
callback that should be called after drawing the image content to newly created sprite.
id
id that should be passed to the callbacks.
sprType
sprType that should be passed to the callbacks.

Top, Back


sgx_DrawCursor(id, sprType)

redraws a particular state sprite of an sgxCursor element (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be redrawn (not all elements use every state): #sgx_GadgetSprNormal or #sgx_GadgetSprHover etc.

Top, Back


sgx_DrawButton(id, sprType)

redraws a particular state sprite of an sgxButton element (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be redrawn (not all elements use every state): #sgx_GadgetSprNormal or #sgx_GadgetSprHover etc.

Top, Back


sgx_DrawCheckbox(id, sprType)

redraws a particular state sprite of an sgxCheckbox element (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be redrawn (not all elements use every state): #sgx_GadgetSprNormal or #sgx_GadgetSprHover etc.

Top, Back


sgx_DrawScrollbar(id, sprType)

redraws a particular state sprite of an sgxScrollbar/sgxTrackbar element (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be redrawn (not all elements use every state): #sgx_GadgetSprNormal or #sgx_GadgetSprHover etc.

Top, Back


sgx_DrawEdit(id, sprType, updateMetricsOnly = #False, moveTextpos = #False, scrollToCursor = #True)

redraws a particular state sprite of an sgxEdit element (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be redrawn (not all elements use every state): #sgx_GadgetSprNormal or #sgx_GadgetSprHover etc.
updateMetricsOnly
#True to update only metrics (calculate text offset and cursor position) and skip the actual drawing. #False (default) to also redraw.
moveTextpos
#False (default) to use current char pos (while typing / cursor keys). #True to move the character position to the current textcursor pixel position (while cursor positioning by mouse click)
scrollToCursor
#True (default) to scroll to current character/cursor position. #False while scrolling via mouse wheel.

Top, Back


sgx_DrawWin(id, sprType)

redraws a particular state sprite of an sgxWin/sgxTable element (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be redrawn (not all elements use every state): #sgx_GadgetSprNormal or #sgx_GadgetSprHover etc.

Top, Back


sgx_DrawTip(id)

redraws the tooltip sprite of an sgx element (called by sgxRefresh).

Parameters:

id
ID of the sgx element

Top, Back


sgx_DrawResizeGadget(id)

creates the resize gadget sprite of an sgxWin element if it does not exist yet. (called by sgxRefresh).

Parameters:

id
ID of the sgx element

Top, Back


sgx_DrawCombo(id, sprType)

redraws a particular state sprite of an sgxCombo element (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be redrawn (not all elements use every state): #sgx_GadgetSprNormal or #sgx_GadgetSprHover etc.

Top, Back


sgx_DrawText(id, sprType)

redraws a particular state sprite of an sgxText element (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be redrawn (not all elements use every state): #sgx_GadgetSprNormal or #sgx_GadgetSprHover etc.

Top, Back


sgx_DrawDisabled(id, sprType)

modifies a particular state sprite of an sgx element to visually represent a 'disabled' state (called by sgxRefresh).

Parameters:

id
ID of the sgx element
sprType
the state / sprite type that should be modified (not all states are modified to 'disabled'): #sgx_GadgetSprNormal or #sgx_GadgetSprPushed etc.

Top, Back


sgxExamine(mousex = -1, mousey = -1)

process actions / events and update the field data of all sgx element.
it returns the ID of the sgx element that is hovered by the mouse, or -1 if the mouse isn't hovering an element.
you can pass mouse coordinates if needed (for instance if you have self-calculated accelerated mouse movement). otherwise sgx will simply inquire the PB mouse library commands.

Parameters:

mousex
(optional)
mousey
(optional)

Top, Back


sgxDisplay()

display all sgx element on screen. only DisplayTransparentSprite() is used.

Top, Back


sgxDisplayCursor()

display the sgx mouse cursor on screen. under normal circumstances you don't have to call this function.
usefull if you want to overdraw/display something after you called sgxDisplay() but still want the mouse cursor to be visible, so you can redraw the cursor with this function after your drawing operations.

Top, Back


sgxDisplayID(id)

display an sgx element on screen. only DisplayTransparentSprite() is used.

Parameters:

id
ID of the sgx element to be displayed

Top, Back