BaH.GTKMaxGUI: Functions Types Modinfo Source  

MaxGUI Linux GTK Driver

This modules provides a Linux GTK driver for MAXGUI.

Functions

Function GetScreenPointerPos(x:Int Var, y:Int Var)
DescriptionReturns pointer coordinates relative to the screen.

Function GetWindowPointerPos(window:TGadget, x:Int Var, y:Int Var)
DescriptionReturns pointer coordinates relative to window.

Function SetAppIcon(pix:TPixmap)
DescriptionSets the application icon.
InformationNote: Until BRL add app icon functionality, consider this function API volatile.

Function SetButtonPixmap(gadget:TGadget, pixmap:TPixmap)
DescriptionSets the button image using the specified pixmap.
InformationNote: Until BRL add button image functionality, consider this function API volatile.

Function SetGadgetToolTip(gadget:TGadget, tip:String)
DescriptionSets the tooltip text for the gadget.
InformationNote: Until BRL add gadget tooltip functionality, consider this function API volatile.

Parameters:

  • gadget : the gadget to apply the tooltip
  • tip : the tooltip text or Null to clear


Types

Type TGTKButton Extends TGTKGadget
DescriptionBase type for button gadgets.
Method GetText:String()
DescriptionReturns the button text.
Method SetHotKey(keycode:Int, modifier:Int)
DescriptionSets a hot key for the button.
Method SetText(text:String)
DescriptionSets the button text.
Method SetTextColor(r:Int, g:Int, b:Int)
DescriptionSets the button text color.
Function OnButtonClicked(widget:Byte Ptr, obj:Object)
DescriptionCallback for button click.

Type TGTKButtonCheckbox Extends TGTKToggleButton
DescriptionA checkbox button.

Type TGTKButtonPush Extends TGTKButton
DescriptionA push button.

Type TGTKButtonRadio Extends TGTKToggleButton
DescriptionA radio button.

Type TGTKCanvas Extends TGTKGadget
DescriptionA canvas.
Function OnMouseMove:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse movement.

Type TGTKComboBox Extends TGTKList
DescriptionA combo box.
Function OnSelectionChanged(widget:Byte Ptr, obj:Object)
DescriptionCallback for selection change.

Type TGTKContainer Extends TGTKGadget
DescriptionThis type handles "internal" widget containers for "Container" gadgets.

Type TGTKDesktop Extends TGTKGadget
DescriptionThe Desktop.
Method ClientHeight:Int()
DescriptionReturns the desktop height.
Method ClientWidth:Int()
DescriptionReturns the desktop width.

Type TGTKEditable Extends TGTKGadget
DescriptionBase type for editable gadgets (textfield / textarea).

Type TGTKGadget Extends TGadget
DescriptionThe base for all TGTK gadgets.
Method Activate(cmd:Int)
DescriptionPerform an activation command on the gadget.
Method ClientHeight:Int()
DescriptionReturn the gadget's client height.
Method ClientWidth:Int()
DescriptionReturn the gadget's client width.
Method GetGadgetVisual:Byte Ptr()
DescriptionReturns the pointer to the largest encompasing part of the gadget, usually the handle.
Method SetColor(r:Int, g:Int, b:Int)
DescriptionSets the gadget color.
Method SetEnabled(bool:Int)
DescriptionEnable or disable the gadget.
Method SetFont(font:TGuiFont)
DescriptionSets the gadget font.
Method SetShow(truefalse:Int)
DescriptionShow or hide the gadget.
Method SetTextColor(r:Int, g:Int, b:Int)
DescriptionSets the gadget text color.
Method setToolTip(tip:String)
DescriptionSet the gadget tooltip.
Method State:Int()
DescriptionReturn the gadget state.
Function OnFocusLost:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for focus lost.

Type TGTKHTMLView Extends TGTKGadget
DescriptionA base type for html view gadgets.
InformationImplementations are in seperate modules.
See bah.gtkwebmozilla and bah.gtkwebgtkhtml mods.

Type TGTKLabel Extends TGTKGadget
DescriptionA label.
Method SetShow(truefalse:Int)
DescriptionShow or Hide the label.
Method SetTextColor(r:Int, g:Int, b:Int)
DescriptionSets the label text color.
Function OnMouseDown:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse button press.

Type TGTKList Extends TGTKGadget
DescriptionA base for list gadgets.

Type TGTKListbox Extends TGTKListWithScrollWindow
DescriptionList box.
Method RemoveListItem(index:Int)
DescriptionRemoves an item from the list at the given index.
Function OnRowActivated(widget:Byte Ptr, treePath:Byte Ptr, treeviewColumn:Byte Ptr, obj:Object)
DescriptionCallback for listbox activation (double-click).

Type TGTKListWithScrollWindow Extends TGTKList
DescriptionA scrollable list.

Type TGTKMenuItem Extends TGTKGadget
DescriptionA menu item.
Method GetText:String()
DescriptionReturns the menu text.
Method SetText(label:String)
DescriptionSets the menu text.
Method State:Int()
DescriptionReturns menu state - checked or unchecked.

Type TGTKPanel Extends TGTKContainer
DescriptionA Panel.
Method SetColor(r:Int, g:Int, b:Int)
DescriptionSet the panel color.
Method SetPixmap(pixmap:TPixmap, flags:Int)
DescriptionSet the panel pixmap.
Method SetShow(truefalse:Int)
DescriptionShows or hides a panel.
Method SetText(text:String)
DescriptionSets the text of a group panel.
Function OnKeyDown:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for key down.
Function OnKeyUp:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for key up.
Function OnMouseDown:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse button press.
Function OnMouseEnter:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse enter.
Function OnMouseLeave:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse leave.
Function OnMouseMove:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse movement.
Function OnMouseUp:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse button release.
Function OnScroll(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse scroll wheel.

Type TGTKProgressBar Extends TGTKGadget
DescriptionA progress bar.
InformationInterestingly, although we can find out the current value, MaxGUI doesn't support it...
Method GetValue:Float()
DescriptionGet the current value of the progress bar.
Method SetValue(value:Float)
DescriptionSet the value of the progress bar.

Type TGTKRange Extends TGTKGadget
DescriptionA base-type for handling slider / range gadgets - ScrollBar and TrackBar.
Method GetProp:Int()
DescriptionReturns the current slider value.
Method SetProp(value:Int)
DescriptionSets the value on the slider.
InformationSeem to have to add 1 to the value for some reason...
Method SetRange(visible:Int, total:Int)
DescriptionSets the slider range.
Function OnChangeValue:Int(widget:Byte Ptr, scrolltype:Int, value:Double, obj:Object)
DescriptionCallback for user changing of a slider.
InformationTries to keep the value within the desired range.

Type TGTKScrollBar Extends TGTKRange
DescriptionA scrollbar.
Method SetRange(visible:Int, total:Int)
DescriptionOverrides the default...
Informationinstead of this being the actual range, the min is always 0 and total defines the max. visible defines the step size.

Type TGTKStepper Extends TGTKRange
Descriptiona Stepper.

Type TGTKTabber Extends TGTKContainer
DescriptionA tabber.
Method InsertListItem(index:Int, text:String, tip:String, icon:Int, tag:Object)
DescriptionInserts a a new tab.

Type TGTKTextArea Extends TGTKEditable
DescriptionA text area.
Method AddText(text:String)
DescriptionAdds text to the end of the text.
Method AreaLen:Int(units:Int)
DescriptionReturns either the number of characters or number of rows.
Method AreaText:String(pos:Int, length:Int, units:Int)
DescriptionReturns the text for the specified location.
Method GetCursorPos:Int(units:Int)
DescriptionReturns the current cursor position value, in characters or lines.
Method GetSelectionLength:Int(units:Int)
DescriptionReturns the size of the current selection, in characters or lines.
Method LockText()
DescriptionLocks the text area.
Method setFastUpdate(bool:Int)
DescriptionEnable to allow *fast* formatting.
InformationWhen enabled, highlighting will not be removed before being applied, and since tags are ordered, some highlight may not appear on top of others.
Method SetFont(font:TGuiFont)
DescriptionSet the text area font.
Method SetSelection(pos:Int, length:Int, units:Int)
DescriptionSet the text area selection.
Method SetShow(truefalse:Int)
DescriptionSet the text area visibility.
Method SetStyle(r:Int, g:Int, b:Int, flags:Int, pos:Int, length:Int, units:Int)
DescriptionSets the style of part of the text area.
Informationflags are any mix of TEXTFORMAT_BOLD, TEXTFORMAT_ITALIC, TEXTFORMAT_UNDERLINE and TEXTFORMAT_STRIKETHROUGH.
We utilise the buffers' tag table to cache tags that we reuse - based on the attributes. This way we only create one for each different style we actually use in the buffer.
Note: "fastUpdate" flag enables or disables the use of gtk_text_buffer_remove_all_tags which strips old tags from the area before applying the new one.
Ideally, you would first remove tags before applying new ones, but since removal is slow, the following method can work well :
setFastUpdate(false)
SetStyle on whole intended area to "normal" style
setFastUpdate(true)
iterate thru tokens applying styles..
Method SetTabs(tabs:Int)
Method SetText(text:String)
DescriptionSets the text buffer text.
Method UnlockText()
DescriptionUnlocks the text area.
Function OnCursorMoved(widget:Byte Ptr, _Step:Int, count:Int, extend_selection:Int, obj:Object)
DescriptionCallback for text-cursor movement.
Function OnMouseDown:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse button press.
Function OnMouseUp:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse button release.
Function OnTextChanged(widget:Byte Ptr, obj:Object)
DescriptionCallback for text change.

Type TGTKTextField Extends TGTKEditable
DescriptionA Text field.
Method GetText:String()
DescriptionReturns the textfield text.
Method SetText(txt:String)
DescriptionSets the textfield text.

Type TGTKToggleButton Extends TGTKButton
DescriptionA button which has a toggle-type usage (radio / checkbox)
Function OnButtonClicked(widget:Byte Ptr, obj:Object)
DescriptionCallback for button click.

Type TGTKToolbar Extends TGTKGadget
DescriptionA Toolbar.
Method InsertListItem(index:Int, text:String, tip:String, icon:Int, extra:Object)
DescriptionInserts an item at the specified index.

Type TGTKTrackBar Extends TGTKRange
DescriptionA trackbar.

Type TGTKTreeView Extends TGTKTreeViewNode
DescriptionA tree view.
Function OnMouseDown:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for mouse right-click.
Function OnRowActivated(widget:Byte Ptr, treePath:Byte Ptr, treeviewColumn:Byte Ptr, obj:Object)
DescriptionCallback for tree-view node activation (double-click).
Function OnRowCollapsed(widget:Byte Ptr, treeIter:Byte Ptr, treePath:Byte Ptr, obj:Object)
DescriptionCallback for tree-view node collapse.
Function OnRowExpanded(widget:Byte Ptr, treeIter:Byte Ptr, treePath:Byte Ptr, obj:Object)
DescriptionCallback for tree-view node expand.

Type TGTKTreeViewNode Extends TGTKListWithScrollWindow
DescriptionA node in the tree view.
Method CountKids:Int()
DescriptionReturns the number of child nodes.
Method GetText:String()
DescriptionReturns the text for this node.
Method InsertNode:TGadget(index:Int, text:String, icon:Int)
DescriptionInserts a new node as a child at the specified index.
Method ModifyNode(text:String, icon:Int)
DescriptionChanges the tree node text and icon.
Method RootNode:TGadget()
DescriptionReturns the root node for this tree.
Method SelectedNode:TGadget()
DescriptionReturns the currently selected tree node or null if none selected.
Method SetText(text:String)
DescriptionSets the text for this node.

Type TGTKWindow Extends TGTKContainer
DescriptionA Window.
Method PopupMenu(menu:TGadget,extra:Object=Null)
DescriptionPop up a popup menu.
Method setIcon(pix:TPixmap)
DescriptionSets the window icon with the specified pixmap.
Method SetStatus(text:String)
DescriptionSet the window status text.
Method State:Int()
DescriptionReturns the window state.
Function OnWindowActivate(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for window activate.
Function OnWindowClose:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for window close.
Function OnWindowDeactivate:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for window deactivate.
InformationNot used, but might come in handy at some point...
Function OnWindowMoveSize(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for window size / move.
Function OnWindowSize(widget:Byte Ptr, obj:Object)
DescriptionCallback for window size.
InformationThis event doesn't actually trigger a max size event, but we use it to adjust the client size.
Function OnWindowStateChange:Int(widget:Byte Ptr, event:Byte Ptr, obj:Object)
DescriptionCallback for window state change.

Module Information

Version1.18
AuthorBruce A Henderson
LicenseBlitz Shared Source Code
Copyright2006, 2007 Bruce A Henderson
ModserverBRL
History1.18
HistoryFixed generation of GADGETSELECT on TreeView creation.
HistoryFixed loss of next text change event after setting empty text field to empty.
History1.17
HistoryAdded FormatTextAreaBackground support.
History1.16
HistoryAdded visible field to TGTKGadget to control generation of events.
History1.15
HistoryUTF-8 fix for RequestFile filters and RequestDir path.
HistoryAdded text attribute with GetText and SetText methods to TreeNode.
History1.14
HistoryFixed non-resizable window resizing problem with menus and statusbar changes.
HistoryFixed ComboBox not clearing items.
HistoryRewrite of UTF-8 handling... *sigh*
HistoryFixed UTF-8 issues with Notify, Confirm, Proceed, RequestFile and RequestDir.
History1.13
HistoryNew popupmenu functionality.
HistoryAdded EVENT_MOUSEWHEEL events for canvas and active panels.
HistoryAdded EVENT_KEYDOWN and EVENT_KEYUP events for active panels.
HistoryAdded EVENT_KEYCHAR events for canvas and active panels.
HistoryAdded EVENT_KEYREPEAT for Canvas and active panels.
HistoryFixed canvas mouse up not reporting button data.
HistoryFixed canvas generating double ACTIVATE_REDRAWs.
HistoryFixed some key mappings.
HistoryFixed PANELPIXMAP_TILE not resetting to 0,0.
HistoryFixed panel redraw event handling.
History1.12
HistoryAdded mouse Down/Menu events for label.
HistoryAdded Enter/Leave events for buttons.
HistoryRemoved requester leaks. Code clean-up.
HistoryAdded SetButtonPixmap function.
HistoryPanel now raises GADGETPAINT event when repaint required.
HistoryGadget ACTIVATE_REDRAW now raises GADGETPAINT event.
History1.11
HistoryFixed listbox generating selection event on initialisation.
History1.10
HistoryFixes ActiveGadget crash if no active widget on a window.
HistoryAdded Enter/Leave events for labels.
HistoryFixed text color setting for labels and buttons.
HistoryAdded GTK_USE_STOCK_ITEMS global int. Enabled by default. Set it to False to disable on-the-fly conversion of gadgets showing stock-items (image/text/shortcut)
HistoryFixed statusbar disappearing with no text.
History1.09
Historyi18n enhancement - GTKTextArea.areaText and gadgets GetText now return ISO8859 strings.
History1.08
HistorySplit out HTML views into separate modules - see bah.gtkwebgtkhtml and bah.gtkwebmozilla.
HistoryFixed double-ampersand text displaying.
HistoryImproved WINDOW_CLIENTCOORDS handling.
HistoryImproved gadget positioning - no negative coords!.
HistoryEVENT_MOUSEMOVE on panel/canvas now contain button-pressed value.
HistoryImproved gadgeted freeing.
History1.07
HistoryFixed framed panel height. Was too high.
HistoryHTMLView now uses gtkmozembed.
History1.06
HistoryRemoved statusbar handle - theme issues.
HistoryImproved button state handling.
HistoryOpenURL now calls native-driver openurl.
HistoryAdded panel pixmap TILE support.
HistoryPanel pixmaps can now be cleared.
HistoryRemoved libgnomecanvas dependency.
HistoryStepper now uses pixbuf to draw onto buttons.
HistoryAdded menu (EVENT_GADGETMENU) support to buttons and textfield.
History1.05
HistoryFixed radiobutton problem with groups of more than two buttons.
HistorySetHotKey now working for buttons.
HistoryWindow statusbar text now supports three positions based on tabs.
History1.04
History*Engine Rewrite* - Now uses GtkLayout instead of gnomecanvas. Fixes a LOT of rendering anomolies. Should also be faster.
HistoryChanged tabber redrawing back.
HistoryFixed check-menu issues with mnemonics and checking a menu initially with UncheckMenu.
HistoryFixed group panel not setting text on create.
History1.03
HistoryFixed textfield SetText raising event.
HistoryAdded mnemonic functionality for buttons.
HistoryTweaked window client width/height to work on certain window types. Also takes into account status/menu heights on initial client height testing.
HistoryFixed crash on app end after freeing canvas.
HistoryFixed label SetText visuals.
History1.02
HistoryAdded panel pixmaps : currently only FIT, STRETCH and CENTER are working.
HistoryFixed some issues with SetGadgetShape on a window. Now attempts to ignore SetShape-driven events.
History1.01
HistoryEnabled child/parent window relationships with WINDOW_CHILD.
HistoryFixed listbox left-click to raise SELECT event. Added listbox double-click ACTION event.
HistoryAdded list/tree right-click MENU events.
HistoryFixed tabber redrawing frenzy - hopefully.
HistoryMore panel layout tweaking.
History1.00
HistoryAdded label, textarea, progressbar tooltip support.
HistoryAdded progressbar GetValue().
HistoryChanged combobox to extend TGTKList. Added combobox icon support.
HistoryFixed combobox missing 'extra' data.
HistoryFixed treeview Free() crash.
HistoryTweaked menu SetSelected to work in a more 'Max' way...
HistoryKeymapping improvements.
HistoryImplemented ACTIVATE_REDRAW, SelectTreeViewNode().
HistoryDefault F10 accel remapped to alt-F10 if app requires F10 hot key.
HistoryModified window/panel layout code based on source from Simon Armstrong.
HistoryAdded TEXTFORMAT_UNDERLINE and TEXTFORMAT_STRIKETHROUGH.
HistoryAdded lost-focus handling - only enabled for textfield and textarea for now.
HistoryAdded SetText, GetText methods.
HistoryImplemented UTF8/unicode string handling.
HistoryAdded working stepper. It works, but it ain't nice...
History0.99
HistoryImproved textarea SetStyle speed - added setFastUpdate() method.
HistoryHTMLView fixes. NONAVIGATE now *correctly* raises event on link-click.
HistoryAdded Window maximize/minimize state awareness, and Window restore.
HistoryAdded WINDOW_TOOL functionality.
HistoryAdded window setIcon() method.
HistoryEnabled EVENT_WINDOWACTIVATE. Added x,y,w,h to window size / move events. Enabled ActivateWindow().
HistoryAdded SetGadgetToolTip() function.
HistoryFixed Tabber visual issues. Added Tabber icon support.
History0.98
HistoryFixed Panel position bug.
HistoryFixed menu SetText issue.
HistoryChanged window sizing/positioning *again*. Still not entirely happy with it.
History0.97
HistoryTabber now supports tooltips. Tabber will show scroller if too many tabs.
HistoryTextField (pressing return) can now activate Default Gadget.
HistoryAdded SetPointer().
HistoryFixed excessive window SIZE events.
HistoryFixed List missing 'extra' data.
HistoryFixed some Gadget freeing issues.
History0.96
HistoryChanged order of generated textarea change events - SELECT before ACTION.
History0.95
HistoryAdded key-filtering.
History0.94
HistoryTGTKButtonCheckBox now extends TGTKToggleButton like it was meant to. SetSelected now works for it :-p
HistoryTextarea background color now setable. Textarea SetStyle now creates tags on the fly - rather than caching them - dunno if this will be a memory issue.
History0.93
HistoryFixed textarea clipboard actions. Fixed textarea setText. Fixed RequestFile save button text. Fixed font size issues. Fixed Tab sizing.
History0.92
HistoryAdded Canvas. Canvas key-down is repeating for now. Fixed some gadget Free() stuff.
History0.91
HistoryAdded radio buttons, popup menus, textarea improvements, tree node expand / collapse... etc
History0.90
HistoryVery Alpha preview... Lots of things work, lots of things don't!