diff --git a/Documentation.md b/Documentation.md index 454620b..772d07e 100644 --- a/Documentation.md +++ b/Documentation.md @@ -115,10 +115,13 @@ Return the bounds of the current window's content region. Return `true` if the current window is focused, and `false` otherwise. #### collapsed = ui:windowIsCollapsed(name) -Return 'true' if the given window is collapsed, and `false` otherwise. +Return `true` if the given window is collapsed, and `false` otherwise. + +#### closed = ui:windowIsClosed(name) +Return `true` if the given window was closed using `ui:windowClose`, and `false` otherwise. #### hidden = ui:windowIsHidden(name) -Return 'true' if the given window is hidden, and `false` otherwise. +Return `true` if the given window is hidden, and `false` otherwise. #### active = ui:windowIsActive(name) Return `true` if the given window is active, and `false` otherwise. @@ -228,6 +231,28 @@ Specify the width of the next widget in a row layout started with `ui:layoutRowB #### ui:layoutRowEnd() Call after `ui:layoutRowBegin` in order to properly end the row layout. +#### ui:layoutTemplateBegin(height) +Start a template layout with the given `height`. Make all of your `ui:layoutTemplatePush` and `ui:layoutTemplateEnd` calls before the widgets to be laid out. Template layouts repeat row-by-row until another layout is instituted. + +#### ui:layoutTemplatePush('dynamic') +#### ui:layoutTemplatePush('variable'/'static', width) +Pushes a column onto a template layout. If the column is `'dynamic'`, it grows to fit space and shrinks to zero width when there is no room. If the column is `'variable'`, it grows to fit space and shrinks to a minimum of `width` pixels when there is no room. If the column is `'static'`, it stays at a constant `width` pixels. Remember to push all of your template columns and then call `ui:layoutTemplatEnd` before creating your widgets. + +#### ui:layoutTemplateEnd() +End a template layout declaration. Remember to call this before creating your widgets. + +Example: +```lua +ui:layoutTemplateBegin(100) +ui:layoutTemplatePush('static', 25) +ui:layoutTemplatePush('dynamic') +ui:layoutTemplatePush('variable', 25) +ui:layoutTemplateEnd() +ui:button(nil, '#ff0000') -- This button will always be 25 pixels wide. +ui:button(nil, '#00ff00') -- This button will grow to fit space and shrink to zero without space. +ui:button(nil, '#0000ff') -- This button will grow to fit space and shrink to a minimum of 25 pixels without space. +``` + #### ui:layoutSpaceBegin('dynamic'/'static', height, widgetCount) Start a space layout with the given height and widget count. Call `ui:layoutSpacePush` before each proceeding widget and `ui:layoutSpaceEnd` after the layout is finished. @@ -447,6 +472,12 @@ If given a number `current`, return the new `current`. If given a table with a n #### state, changed = ui:edit('simple'/'field'/'box', valueTable) Add an editable text field widget. The first argument defines the type of editor to use: single line 'simple' and 'field', or multi-line 'box'. The `valueTable` should be a table with a string field named `value`. The field gets updated and the function returns the edit state (one of 'commited'/'activated'/'deactivated'/'active'/'inactive') followed by `true` if the text changed or `false` if the text remained the same. +#### editFocus() +Manually focus the following `ui:edit` widget. + +#### editUnfocus() +Manually unfocus the following `ui:edit` widget. + #### index = ui:combobox(index, items) #### index = ui:combobox(index, items, itemHeight) #### index = ui:combobox(index, items, itemHeight, width)