Module AdjustableContainer

-- The Geyser Layout Manager by guy -- Adjustable Container by Edru -- --

Adjustable Container

Functions

Adjustable.Container:setTitle (text, color) function to give your adjustable container a new title
Adjustable.Container:connectToBorder (border) connect your container to a border
Adjustable.Container:addConnectMenu () adds elements to connect containers to borders into the right click menu
Adjustable.Container:disconnect () disconnects your container from a border
Adjustable.Container:setBorderMargin (margin) gives your MainWindow borders a margin
Adjustable.Container:attachToBorder (border) attaches your container to the given border attach is only possible if the container is located near the border
Adjustable.Container:detach () detaches the given container this means the mudlet main window border will be reseted
Adjustable.Container:lockContainer (lockNr, lockStyle) locks your adjustable container lock means that your container is no longer moveable/resizable by mouse.
Adjustable.Container:unlockContainer () unlocks your previous locked container what means that the container is moveable/resizable by mouse again
Adjustable.Container:setPadding (padding) sets the padding of your container changes how far the the container is positioned from the border of the container padding behaviour also depends on your lockStyle
Adjustable.Container:minimize () minimizes the container hides everything beside the title
Adjustable.Container:restore () restores the container after it was minimized
Adjustable.Container:changeMenuStyle (mode) function to change the right click menu style there are 2 styles: dark and light
Adjustable.Container:save (slot, dir) saves your container settings like position/size and some other variables in your Mudlet Profile Dir/ AdjustableContainer to be reliable it is important that the Adjustable.Container has an unique 'name'
Adjustable.Container:load (slot, dir) restores/loads the before saved settings
Adjustable.Container:reposition () overridden reposition function to raise an event of the Adjustable.Container changing position/size event name: "AdjustableContainerReposition" passed values (name, width, height, x, y) it also calls the shrink_title function
Adjustable.Container:deleteSaveFile (dir) deletes the file where your saved settings are stored
Adjustable.Container:saveAll (slot, dir) saves all your adjustable containers at once
Adjustable.Container:loadAll (slot, dir) loads all your adjustable containers at once
Adjustable.Container:showAll () shows all your adjustable containers
Adjustable.Container:doAll (myfunc) executes the function myfunc which affects all your containers
Adjustable.Container:setAbsolute (size_as_absolute, position_as_absolute) changes the values of your container to absolute values (standard settings are set values to percentages)
Adjustable.Container:setPercent (size_as_percent, position_as_percent) changes the values of your container to be percentage values only needed if values where set to absolute before
Adjustable.Container:newLockStyle (name, func) creates a new Lockstyle
Adjustable.Container:newCustomItem (name, func) creates a new custom menu item
Adjustable.Container:enableAutoSave () enablesAutoSave normally only used internally only useful if autoSave was set to false before
Adjustable.Container:disableAutoSave () disableAutoSave function to disable a before enabled autoSave
Adjustable.Container:new (cons, container) constructor for the Adjustable Container
Adjustable.Container:oldnew (cons, container) Overriden constructor to use the old add if someone really wants to use the old add for Adjustable Container use this function (not recommended) or just create elements inside the Adjustable Container with the cons useAdd2 = false


Functions

Adjustable.Container:setTitle (text, color)
function to give your adjustable container a new title

Parameters:

  • text new title text
  • color title text color
Adjustable.Container:connectToBorder (border)
connect your container to a border

Parameters:

  • border main border ("top", "bottom", "left", "right")
Adjustable.Container:addConnectMenu ()
adds elements to connect containers to borders into the right click menu
Adjustable.Container:disconnect ()
disconnects your container from a border
Adjustable.Container:setBorderMargin (margin)
gives your MainWindow borders a margin

Parameters:

  • margin in pixel
Adjustable.Container:attachToBorder (border)
attaches your container to the given border attach is only possible if the container is located near the border

Parameters:

  • border possible border values are "top", "bottom", "right", "left"
Adjustable.Container:detach ()
detaches the given container this means the mudlet main window border will be reseted
Adjustable.Container:lockContainer (lockNr, lockStyle)
locks your adjustable container lock means that your container is no longer moveable/resizable by mouse. You can also choose different lockStyles which changes the border or container style. if no lockStyle is added "standard" style will be used the lockStyle is the behaviour/mode of the locked state. integrated lockStyles are "standard", "border", "full" and "light" (default "standard") standard: This is the default lockstyle, with a small margin on top to keep the right click menu usable. light: Only hides the min/restore and close labels. Borders and margin are not affected. full: The container gets fully locked without any margin left for the right click menu. border: Keeps the borders of the container visible while locked.

Parameters:

  • lockNr the number of the lockStyle [optional]
  • lockStyle the lockstyle used to lock the container,
Adjustable.Container:unlockContainer ()
unlocks your previous locked container what means that the container is moveable/resizable by mouse again
Adjustable.Container:setPadding (padding)
sets the padding of your container changes how far the the container is positioned from the border of the container padding behaviour also depends on your lockStyle

Parameters:

  • padding the padding value (standard is 10)
Adjustable.Container:minimize ()
minimizes the container hides everything beside the title
Adjustable.Container:restore ()
restores the container after it was minimized
Adjustable.Container:changeMenuStyle (mode)
function to change the right click menu style there are 2 styles: dark and light

Parameters:

  • mode the style mode (dark or light)
Adjustable.Container:save (slot, dir)
saves your container settings like position/size and some other variables in your Mudlet Profile Dir/ AdjustableContainer to be reliable it is important that the Adjustable.Container has an unique 'name'

Parameters:

  • slot defines a save slot for example a number (1,2,3..) or a string "backup" [optional]
  • dir defines save directory [optional]

See also:

Adjustable.Container:load (slot, dir)
restores/loads the before saved settings

Parameters:

  • slot defines a load slot for example a number (1,2,3..) or a string "backup" [optional]
  • dir defines load directory [optional]

See also:

Adjustable.Container:reposition ()
overridden reposition function to raise an event of the Adjustable.Container changing position/size event name: "AdjustableContainerReposition" passed values (name, width, height, x, y) it also calls the shrink_title function
Adjustable.Container:deleteSaveFile (dir)
deletes the file where your saved settings are stored

Parameters:

  • dir defines directory where the saved file is in [optional]

See also:

Adjustable.Container:saveAll (slot, dir)
saves all your adjustable containers at once

Parameters:

  • slot defines a save slot for example a number (1,2,3..) or a string "backup" [optional]
  • dir defines save directory [optional]

See also:

Adjustable.Container:loadAll (slot, dir)
loads all your adjustable containers at once

Parameters:

  • slot defines a load slot for example a number (1,2,3..) or a string "backup" [optional]
  • dir defines load directory [optional]

See also:

Adjustable.Container:showAll ()
shows all your adjustable containers

See also:

Adjustable.Container:doAll (myfunc)
executes the function myfunc which affects all your containers

Parameters:

  • myfunc function which will be executed at all your containers
Adjustable.Container:setAbsolute (size_as_absolute, position_as_absolute)
changes the values of your container to absolute values (standard settings are set values to percentages)

Parameters:

  • size_as_absolute bool true to have the size as absolute values
  • position_as_absolute bool true to have the position as absolute values
Adjustable.Container:setPercent (size_as_percent, position_as_percent)
changes the values of your container to be percentage values only needed if values where set to absolute before

Parameters:

  • size_as_percent bool true to have the size as percentage values
  • position_as_percent bool true to have the position as percentage values
Adjustable.Container:newLockStyle (name, func)
creates a new Lockstyle

Parameters:

  • name Name of the menu item/lockstyle
  • func function of the new lockstyle
Adjustable.Container:newCustomItem (name, func)
creates a new custom menu item

Parameters:

  • name Name of the new menu iten
  • func function of the new custom menu item
Adjustable.Container:enableAutoSave ()
enablesAutoSave normally only used internally only useful if autoSave was set to false before
Adjustable.Container:disableAutoSave ()
disableAutoSave function to disable a before enabled autoSave
Adjustable.Container:new (cons, container)
constructor for the Adjustable Container

Parameters:

  • cons besides standard Geyser.Container parameters there are also:
    • defaultDir default dir where settings are loaded/saved to/from (default "getMudletHomeDir().."/AdjustableContainer/"" )
    • ParentMenuWidth menu width of the main right click menu (default "102" )
    • ChildMenuWidth menu width of the children in the right click menu (for attached, lockstyles and custom items) (default "82")
    • MenuHeight height of a single menu item (default "22")
    • MenuFontSize font size of the menu items (default "8")
    • buttonsize size of the minimize and close buttons (default "15")
    • buttonFontSize font size of the minimize and close buttons (default "8")
    • padding how far is the inside element placed from the corner (depends also on the lockstyle setting) (default "10")
    • attachedMargin margin for the MainWindow border if an adjustable container is attached (default "5")
    • adjLabelstyle style of the main Label where all elements are in
    • menustyle menu items style
    • buttonstyle close and minimize buttons style
    • minimized minimized at creation? (default false)
    • locked locked at creation? (default false)
    • attached attached to a border at creation? possible borders are ("top", "bottom", "left", "right") (default false)
    • lockLabel.txt text of the "lock" menu item
    • minLabel.txt text of the "min/restore" menu item
    • saveLabel.txt text of the "save" menu item
    • loadLabel.txt text of the "load" menu item
    • attLabel.txt text of the "attached menu" item
    • lockStylesLabel.txt text of the "lockstyle menu" item
    • customItemsLabel.txt text of the "custom menu" item
    • titleTxtColor color of the title text (default "green")
    • titleText title text
    • lockStyle choose lockstyle at creation. possible integrated lockstyle are: "standard", "border", "light" and "full" (default "standard")
    • noLimit there is a minimum size limit if this constraint is set to false. (default false)
    • raiseOnClick raise your container if you click on it with your left mouse button (default true)
    • autoSave saves your container settings on exit (sysExitEvent). If set to false it won't autoSave (default true)
    • autoLoad loads the container settings (if there are some to load) at creation of the container. If set to false it won't load the settings at creation (default true)
  • container
Adjustable.Container:oldnew (cons, container)
Overriden constructor to use the old add if someone really wants to use the old add for Adjustable Container use this function (not recommended) or just create elements inside the Adjustable Container with the cons useAdd2 = false

Parameters:

  • cons
  • container
generated by LDoc 1.4.6 Last updated 2021-01-15 01:07:24