New form
Re: New form
Cool!!!! And new windows will be without open display?
Re: New form
Here is how to create a new window:
QUICK DOC
A tipical window creation:
Code: Select all
Local myWindow = HGui.Window:new(options)
Code: Select all
/******************************************************************************
winObject = HGui.Window:new(options)
Create a new HGui window.
---------------------------------------------------------------------
INPUT
options A table used to override default values.
.title Window's title.
.name Unique window's name, if you omit this argument an
unique name will be assigned to the window for you.
.position Window's position in the host screen.
.x Horizontal position (pixels). Defaults to #CENTER.
.y Vertical position (pixels). Defaults to #CENTER.
.size Window's size
.w Width in pixels. Defaults to 320.
.h Height in pixels. Defaults to 200.
.sizemax Maximum size the window can be resized to. Defaults
to the host screen size.
.w Width in pixels. Defaults to 320.
.h Height in pixels. Defaults to 200.
.sizemin Minimum size the window can be resize to. Defaults to
<size>.
.w Width in pixels. Defaults to 320.
.h Height in pixels. Defaults to 200.
.cacheroot Cache root gadget (True|False)
.bgcolor Background color
.background Image file name used to fill the background
.bgtexture Image file used as tile to fill the background
.bggradient Table used to define a multi-color gradient to fill
the background
.type Gradient type : #LINEAR, #RADIAL, #CONICAL
.angle Gradient angle in degrees
.colors Gradient colors definition, it's atable composed
by pairs [color]-[position]. Color is an RBG color
value and position is a number in the 0-1 range.
Note that the first color must have the position 0
and the last one the position 1.
.flags Window's flags
.resizeable Resizeable window? (True|False)
.closeable Closeable window? (True|False)
.moveable Moveable window? (True|False)
.borderless Borderless window? (True|False)
.modal Modal window? (True|False)
.hideable Hideable window? (True|False)
.autoclose <False> to receive the event but to keep the
window opened, you have to close it in your
callback function.
.events Callback functions
.onclose Called when the window is closed
.onmove Called when the window is move
.onactivate Called when the window get the focus
.ondeactivate Called when the window lost the focus
.onhide Called when the window is hided
.onshow Called when the window is showed
.onsize Called when the window is resized
NEW 27/05/2017
.ondrop Called when the a file is dropped into the window
.dontopen TRUE to create the window without opening
.contextual Contextual menu (same structure as .menu field)
.menu Top menu definition, it's a table of items with the
following record structure:
{ type = <gadget_type>,
params = <gadget_parameters>,
size = <menu_width>,
submenu = <submenu_items>,
callback = <function> }
::: For more details see :menuSet() method ::::::::
OUTPUT
winObject The window object created or FALSE if an error
has occured.
******************************************************************************/
Code: Select all
Local myWindow = HGui.Window:new(
{ title = "Window Title",
position = { x = #CENTER, y = #CENTER },
size = { w = 350, h = 400 }
})
----------------------------
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆
[Allanon] Fabio Falcucci | GitHub for recent works | Support me on Patreon for Hollywood libraries | ☆★ All my links ★☆