GAB Code Editor v4 Functions

From GAB Help
Revision as of 17:23, 3 March 2020 by Jdombrowski (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

< Back to main GAB Code Editor v4 Page

This information may be out of date. Please use Intellisense, or the GAB Command Explorer (if available) tool to see up to date information.

This page outlines new functions, properties, etc, as well as any modified pre-existing ones. Optional parameters are shown inside [square brackets].

Contents

New Functions and Properties

General

   Function.Intrinsic.UI.UsePixels

If this appears anywhere in your code, all size and position values will be interpreted as Pixels and not Twips.


   Program.External.Include.File(FileName as String, IsEmbedded as Boolean)
   Program.External.Include.Library(FileName as String, IsEmbedded as Boolean)

These two functions are identical, except that Library refers to .lib files, and File refers to all other types. In general, this is managed by the Included Files tab.

FileName - The name of the file.
IsEmbedded - When true, OCTSRS will look for the file as a part of the G2P Package. Otherwise, it will search in the execution directory.

Form

   Gui.[Form]..AccentColor(ColorCode as v.Enum.AccentColorCodes!)
   Gui.[Form]..AccentColor(ColorCode as {0,1,2,3,4,5})
ColorCode - As Integer: 0-UseDefault, 1-Red, 2-Blue, 3-Green, 4-Yellow, 5-Orange

Sets the accent color of the form, if you don't want it to auto-color itself from the menu.

   Gui.[Form]..ContextMenuRemoveItem(MenuName as String, ItemName as string)

Dashboard Form Only

Bar Help Button/Menu
   Gui.[Form]..BarHelpButton(Visible as Boolean, ProgramName as String, ProgramDescription as String, 
       [HelpUrl as String = Nothing], [CannyID as String = Nothing], [Version as String = 1.0.0.0], 
       [BuildDate as Date = Nothing])

Shows or hides the "Help" button and UI from the Dashboard Form menu bar.

HelpUrl - The URL of the Global Shop Help page for the program.
Canny ID - The part of the URL after the last slash.
Version - The version of the program. Should be formatted as "[Major].[Minor].[Revision].[Build]". All 4 must be included, and should be integers. Example: "1.2.3.0"


Bar Save Button/Menu
   Gui.[Form]..BarSaveButton(Visible as Boolean, [ShowSaveAllButton as Boolean = False])


Bar Search Box
   Gui.[Form]..BarSearchBox(Visible as Boolean)


Bar Share Button/Menu
   Gui.[Form]..BarShareButton(Visible as Boolean, ShowEmailButton as Boolean, ShowChatButton as Boolean, 
       ShowImageButton as Boolean, ShowPrintButton as Boolean)


Bar Undo System
   Gui.[Form]..BarUndoButtons(Visible as Boolean, [HasUndo as Boolean = True], [HasRedo as Boolean = True], [HasReset as Boolean = True])

Shows or hides the undo buttons. See Dashboard Form for more info on the undo system.


   Gui.[Form]..ClearUndo()
   Gui.[Form]..ClearUndo(ClearUndo as Boolean, ClearRedo as Boolean)

Clears the undo states. Optional parameters allow you to clear only undo or only redo states.

Bar GAB Scripts Buttons

These aren't new controls, but it's an important note. If you have an Accordion Control with item(s) that have a Hook number, and their "Show In Bar" property set to True, this item will also appear in a GAB Script menu in the bar, and clicking the option will act just like clicking the link on the Accordion Control.

What's New Overlay
   Gui.[Form]..AddWhatsNew(WhatsNewItem as String)

Adds a line to the "What's New" overlay (on the About Overlay, accessed from the help menu). As of now, this is not part of our standards.


   Gui.[Form]..ClearWhatsNew()

Removes all items from the "What's New" overlay.

Dialog Form Only

Dialog Style

Sets the form icon, image in the prompt area, and the buttons displayed (besides custom buttons). Specified using the MsgBoxStyle Enum.

Prompt

Sets the text displayed in the prompt area at the top of the form.

HasPrompt

Gets or sets whether the prompt area at the top of the form is displayed.

CloseOnSelection

When true, as soon as the user clicks one of the result buttons (OK, Cancel, Abort, Retry, Yes, No, or Save), the form closes, and raises an event for the result.

Dashboard and Dialog Forms

Bar User Custom Items
   Gui.[Form]..BarAddButton(ButtonName as String, [Caption as String = Nothing], [SvgImage as v.Enum.Image! = Nothing], 
       [ParentMenuName as String = Nothing], [BeginsGroup as Boolean = False])

Adds a custom button to the main menu bar.

ButtonName - The control name that you will refer to the button as. Must be unique per form.
Caption - The text displayed for the button if there is no image, or the tooltip if there is an image.
SvgImage - The icon to use as a button. Set via v.Enum.Image!.
ParentMenuName - The name of the parent button. If set, this button will appear as a dropdown menu option on the ParentMenuButton
BeginsGroup - When true, there's a divider line between this item and the previous one.


   Gui.[Form]..BarAddTextBox(TextBoxName as String, Caption as String, Width as Long, [EmptyText as String = ""], [BeginsGroup as Boolean = False])

Adds a custom text box to the main menu bar.

TextBoxName - The control name that you will refer to the text box as. Must be unique per form.
Caption - The tooltip text for the textbox.
Width - The width of the textbox in the menu bar.
EmptyText - The text displayed in the textbox when empty.
BeginsGroup - When true, there's a divider line between this item and the previous one.
   Gui.[Form]..BarAddComboBox(ComboBoxName as String, Caption as String, Width as Long, [InitialValue as String = ""], [DisableEditor as Boolean = False], [BeginsGroup as Boolean = False])

Adds a custom text box to the main menu bar.

ComboBoxName - The control name that you will refer to the combo box as. Must be unique per form.
Caption - The tooltip text for the textbox.
Width - The width of the textbox in the menu bar.
InitialValue - The text displayed in the combobox when first created.
DisableEditor - When true, the user can't type in the box, and can only select items from the dropdown list.
BeginsGroup - When true, there's a divider line between this item and the previous one.
   Gui.[Form]..BarAddComboBoxItem(ComboBoxName as String, ItemName as String, Width as Long, DisplayValue as String, [DataValue as String=""])
ComboBoxName - The name of the combobox to add the item to.
ItemName - The name of the item, must be unique per form.
DisplayValue - The value displayed in the combobox dropdown
DataValue - The value returned in the selection changed event as the data value.
   Gui.[Form]..BarAddComboBoxItems(ComboBoxName as String, "Dictionary", DictionaryName as String)
   Gui.[Form]..BarAddComboBoxItems(ComboBoxName as String, "DataTable", DataTableName as String, KeyColumn as string, ValueColumn as String)
   Gui.[Form]..BarAddComboBoxItems(ComboBoxName as String, "DataView", DataTableName as String, DataViewName as String, KeyColumn as String, ValueColumn as String)
ComboBoxName - The name of the combobox to add the items to.
[Parameter 2] - The type of data colleciton. "Dictionary", "DataTable", or "DataView"
DictionaryName - The name of the dictionary data collection
DataTableName - The name of the DataTable
DataViewName - The name of the DataView
KeyColumn - The display column in the DataTable or DataView
ValueColumn - The data column in the DataTable or DataView
   Gui.[Form]..BarRemoveButton(ButtonName as String)

Removes the button with the specified name.


   Gui.[Form]..BarRemoveTextbox(TextBoxName as String)

Removes the textbox with the specified name.

   Gui.[Form]..BarRemoveCombobox(ComboBoxName as String)

Removes the combobox with the specified name.

   Gui.[Form]..BarRemoveComboBoxItem(ComboBoxName as String, ItemOrdinal as Long)

Removes the item from the combobox at the specified index/ordinal.

Controls

All or Many Types

   Gui.[Form].[Control].ExcludeFromUndo(Exclude as Boolean)

This control will not be monitored by the undo/redo system. Supported by all controls that are tracked by the system (see the designer properties for support).


   Gui.[Form].[Control].Dock(DockStyle as v.Enum.DockStyle!)
   Gui.[Form].[Control].Dock(DockStyle as {0,1,2,3,4,5})
DockStyle - As Integer: 0-None, 1-Top, 2-Bottom, 3-Left, 4-Right, 5-Fill


   Gui.[Form].[Control].InvokeWait(Detail as String, [Title as String = "Please Wait"], [HasBorder as Boolean = False])

Shows a Progress Panel in place of a control while the control is set up.

Detail - The small text on the progress panel
Title - The big text on the progress panel
HasBorder - Whether a border is shown. In most cases this should be False.


   Gui.[Form].[Control].UpdateWait(Detail as String, [Title as String = "Please Wait"])
Detail - The small text on the progress panel
Title - The big text on the progress panel


   Gui.[Form].[Control].HideWait()


   Gui.[Form].[Control].SvgPicture(SvgPicture as V.Enum.Image!, [Width as Long = 16], [Height as Long = 16])
SvgPicture - The picture name or V.Enum.Image! code to show.
Width/Height - The size of the picture. May not supported on all controls.


   Gui.[Form].[Control].SvgPictureSize(Width as Long, Height as Long)


   Gui.[Form].[Control].UseLayout(UseLayout as Boolean)

Converts the control to use layout. This in general should ONLY be used by the designer, as it will auto-arrange all your controls, and not in a pretty way.


   Gui.[Form].[Control].UpdateLayout(FileName as String)

Replaces the default layout of a control with UseLayout set to True. Supports a FQN, or a FileName of a file that's packaged in the G2P Package or in the execution directory. Use a blank string (or nothing) to revert the control back to its default layout.


   Gui.[Form].[Control].FontName(FontName as String)

Sets the font for the control.

Hyperlink

   Gui.[Form].[Hyperlink].Create(HyperLink)
   Gui.[Form].[Hyperlink].Create(HyperLink, Text as String, Visible as Boolean, Width as Long, 
       Height as Long, NOT_USED, Left as Long, Top as Long, Enabled as Boolean, FontName as String, FontSize as Double)

Navigation Frame

   Gui.[Form].[NavigationFrame].AnimationLengthInMS(Duration as Long)

The length of the animation in milliseconds when navigating between pages.


   Gui.[Form].[NavigationFrame].UseAnimations(UseAnimations as Boolean)

Sets whether the frame uses slide/fade animations on transition, or immediately shows the next page.


   Gui.[Form].[NavigationFrame].SelectedIndex(PageIndex as Long)

Sets the page shown in the frame.


Progress Bar

   Gui.[Form].[ProgressBar].Scrolling(IsScrolling as Boolean)

Sets if the bar is marquee/scrolling (does not show a specific value, True) or shows a specific value (False)


Progress Panel

   Gui.[Form].[ProgressPanel].Create(ProgressPanel)
   Gui.[Form].[ProgressPanel].Create(ProgressPanel, Title as String, Detail as String, Offset as Long, 
       BorderStyle as {0,1}, Visible as Boolean, Width as Long, Height as Long, Left as Long, Top As Long, Enabled as Boolean)
Title - The main text on the progress panel.
Detail - The small text on the progress panel.
Offset - The distance between the edge of the control and the loading wheel.
BorderStyle - 0 for no border, 1 for has border.


   Gui.[Form].[ProgressPanel].Detail(DetailString as String)

Sets the Detail (small) text on a progress panel.


   Gui.[Form].[ProgressPanel].DetailInternationalID(ID as Long)

Sets the International ID for the detail text on a progress panel.

Split Container

   Gui.[Form].[SplitContainer].Create(SplitContainer)


   Gui.[Form].[SplitContainer].Collapsed(IsCollapsed as Boolean)


   Gui.[Form].[SplitContainer].CollapsiblePanel(PanelIndex as {0,1,-1})
PanelIndex - Sets which panel is collapsible. 0 - Panel1, 1 - Panel2, Any other value - None


   Gui.[Form].[SplitContainer].FixedPanel(PanelIndex as {0,1,-1})
PanelIndex - Sets which panel is fixed on resize. 0 - Panel1, 1 - Panel2, Any other value - None


   Gui.[Form].[SplitContainer].Orientation(Orientation as v.Enum.Orientation!)
   Gui.[Form].[SplitContainer].Orientation(Orientation as {0,1})
Orientations - 0 = Horizontal, 1 = Vertical


   Gui.[Form].[SplitContainer].SplitterPosition(Position as Long)

New Events

New Dashboard Form Events

BarShareButton Events

ShareButtonClick

Occurs when the Share button is clicked to open the share menu.


ShareEmailClick

Occurs when the Email button in the Share Menu is clicked.


ShareChatClick

Occurs when the Chat button in the Share Menu is clicked. (Currently, live chat isn't supported)


ShareImageClick

Occurs when the Image button in the Share Menu is clicked. This is used to copy a screenshot.


SharePrintClick

Occurs when the Printer button in the Share Menu is clicked.


BarHelpButton Events

HelpButtonClick

Occurs when the Help button is clicked to open the help menu. All functions within the help menu are handled by OCTSRS.


BarSaveButton Events

SaveButtonClick

Occurs when the Save button is clicked.


SaveAllButtonClick

Occurs when the Save All button is clicked.


BarSearchBox Events

PerformSearch

Occurs when the value of the searchbox is changed (user hits enter or clicks button).

Arument - Query: The string value from the search box.


BarUndoButton Events

UndoButtonClick

Occurs when the Undo button is clicked. OCTSRS handles the actual Undo operation.


RedoButtonClick

Occurs when the Redo button is clicked. OCTSRS handles the actual Redo operation.


ResetButtonClick

Occurs when the Reset button is clicked. OCTSRS handles the actual Reset operation.


Bar Custom Button Events

UserButtonClicked

Occurs when any custom button in the main bar is clicked.

Argument - Button: The name of the button that was clicked.


Bar Custom Textbox Events

UserTextBoxEditValueChanged

Occurs when any custom text box's edit value in the main bar is changed.

Argument - TextBox: The name of the text box that was clicked.
Argument - Text: The string value of the text entered in the box.

New Dialog Form Events

SelectionMade

Occurs when the user clicks a button, setting the dialog's result.

Argument - Result The numeric result value, specified by the MsgBoxResult Enum.
Argument - ResultString The string result value, specified by the names of the MsgBoxResult Enum.

New Control Events

NavigationFrame

PageAdded

Occurs when a Navigation Page is added to a Navigation Frame.

Argument - Page: The (string) name of the page that was added


PageRemoved

Occurs when a Navigation Page is removed from a Navigation Frame.

Argument - Page: The (string) name of the page that was removed


SelectedPageChanging

Occurs when the selected page on a Navigation Frame is about to change.

Argument - PAGE: The page that will be navigated to.
Argument - OLDPAGE: The current page.


SelectedPageChanged

Occurs after the selected page on a Navigation Frame has changed.

Argument - PAGE: The current page.
Argument - OLDPAGE: The selected page before the navigation.


SplitContainer

Panel1Click

Occurs when Panel1 on a split container is clicked. This is the left or top panel.

Argument - Panel: The panel (1 or 2) that was clicked
Argument - Clicks: The number of clicks


Panel2Click

Occurs when Panel2 on a split container is clicked. This is the right or bottom panel.

Argument - Panel: The panel (1 or 2) that was clicked
Argument - Clicks: The number of clicks


Panel1DblClick/Panel1DoubleClick

Occurs when Panel1 on a split container is double clicked. This is the left or top panel.

Argument - Panel: The panel (1 or 2) that was clicked
Argument - Clicks: The number of clicks


Panel2DblClick/Panel2DoubleClick

Occurs when Panel2 on a split container is double clicked. This is the right or bottom panel.

Argument - Panel: The panel (1 or 2) that was clicked
Argument - Clicks: The number of clicks

Changed Functions

   Gui.[Form]..Create([FormType as V.Enum.FormTypes!])

An optional parameter for the FormType was added.


   Gui.[Form]..FontSize(Size as Float)

The type of Size was changed from "Long" to "Float".


   Gui.[Form].[Control].BorderStyle(Style as {0,1})

Changed border style to remove 3D effects. It's either on or off now.