Edit Widgets

Select

Description

The Select Widget is a simple widget version of an HTML drop down selection box. The widget is used for making a selection from a predefined list of items. Many built-in dropdown widgets in TACTIC extend from the Select Widget.

Info

Name

Select Widget

Class

SelectWdg

TACTIC Version Support

2.5.0 +

Required database columns

None, but typically this is attached to a data column
Usage

Usage of the Select Widget is straightforward. Simply click on the Select Widget button to open the drop down selection box. Then, select one of the menu items. Sometimes items are grouped and separated by a group label represented as << label >>. In that case, selecting the group label will trigger a warning pop-up. To unset a value, you can usually select the empty value with the label '-- Select --'.

Implementation

The select is often setup in the Edit Column definition -> Edit Tab. It is edited for the state for column data where the user should only be able to choose from a list of predefined values.

Options

values

A list of data values separated by the pipe character '|', e.g. model|anim|lighting

labels

A list of display labels separated by the pipe character '|', e.g. Model|Anim|LGT

empty

When set to true, the Select Widget will contain an empty option.

values_expr

This serves the same purpose as values but in the form of an expression. The input item of the expression has to exist for this to function properly.(ie @GET(vfx/sequence.code) ). If it is used in the menu of an item in insert mode, you should set mode_expr to 'absolute'

labels_expr

This serves the same purpose as labels but in the form of an expression. The input item of the expression has to exist for this to function properly (ie @GET(vfx/sequence.name) ). If it is used in the menu of an item in insert mode, you should set mode_expr to 'absolute'

mode_expr

If left unset, the default is to use the current item in the expression defined in values_expr and labels_expr. If set to 'absolute', the input item for the expression will be an empty list.

query

In the form of <search_type>|<value>|<label>, you can instruct the widget to retrieve the values and labels from the a particular sType. For example, to get all the asset codes from the sType 'vfx/asset', you can use 'vfx/asset|code|code'. To change the label to display asset's name instead, you can use 'vfx/asset|code|name'.
Advanced

The following example uses the query option to get the code of a parent shot item but, display the name value in the list. This query option is older. The values_expr and labels_expr option are preferred.

<element name="parent_code">
  <display class="SelectWdg">
    <query>prod/shot|code|name</query>
  </display>
</element>

The following gets the same result but, uses expressions. This allows for more robust queries for values and labels.

<element name="parent_code">
  <display class="SelectWdg">
    <mode_expr>absolute</mode_expr>
    <values_expr>@GET(prod/shot.code)</values_expr>
    <labels_expr>@GET(prod/shot.name)</labels_expr>
  </display>
</element>

The following sets a hard coded list of values and labels for the SelectWdg.

<element name="status">
  <display class="SelectWdg">
    <values>waiting|in_progress|complete</values>
    <labels>Waiting|In Progress|Complete</labels>
  </display>
</element>

Text Input

Description

The TextWdg is a basic form element in which a single line of text can be entered. (To enter multiple lines, use the TextAreaWdg instead.) It maps directly to the HTML text input. It can be used independently or as an edit element in the TableLayoutWdg or EditWdg.

Info

Name

Text Input

Class

pyasm.widget.TextWdg

TACTIC Version Support

2.5.0 +

Required database columns

none
Implementation

Basic example of a typical usage of a TextWdg

Options

size

Determine the width of the text widget. Default is "50".

read_only

true|false - determines whether the widget can have its text contents altered.
Advanced

Simple example which displays text widget that is fully editable:

<element name='first_name'>
  <display class='pyasm.widget.TextWdg'/>
</element>

A text widget that only allows integer input. The size is reduced to 5.

<element name='age'>
  <display class='pyasm.widget.TextWdg'>
    <size>5</size>
  </display>
</element>

A simple example of the TextWdg in Python:

from pyasm.widget import TextWdg

div = DivWdg()
text_wdg = TextWdg("age")
text_wdg.set_option("size", "20")
div.add(text_wdg)

Text Area

Description

The TextAreaWdg is a simple text widget which is used for editing full-text. The widget supports using the ENTER key for adding new lines (the ENTER key is often not supported on text entry widgets where CTRL+ENTER is used.) This widget can also be configured to display a larger canvas to work on.

Info

Name

TextAreaWdg

Class

pyasm.widget.TextAreaWdg

TACTIC Version Support

2.5.0 +

Required database columns

requires a database column for storing the text data.
Implementation

The TextAreaWdg is used in Edit scenarios where full text input is required. There is control for the columns (characters across) and rows (characters down).

Options

cols

The number of character columns in the TextArea

rows

The number of character rows in the TextArea
Advanced

The following example is a default implementation. The default number of cols is 50 and the default number of rows is 3.

<element name="subject">
  <display class="TextAreaWdg"/>
</element>

The following example creates a large text area which could be used for writing large amounts of full-text.

<element name="summary">
  <display class="TextAreaWdg">
    <cols>100</cols>
    <rows>30</rows>
  </display>
</element>

Calendar Input Widget

Description

The CalendarInputWdg displays a navigable calendar where dates can be selected. It is an input widget that conforms to the BaseInputWdg interface and is used for inline editing or as one of the items in the EditWdg layout.

Info

Name

Calendar Input

Class

tactic.ui.widget.CalendarInputWdg

Category

Input widget

Supported Interfaces

EditWdg, TableLayoutWdg (edit view)

TACTIC Version Support

2.5.0 +

Required database columns

none unless editing a specific date column
Implementation

The simple implementation does not require any options. It displays a non-editable text box with a value that represents a date. Clicking on the cell opens up the calendar widget.

Options

first_day_of_week

Integer representing first day of the week (0=Sunday, 6=Saturday)

read_only

Sets the widget to be read only. In read-only mode, clicking on the cell does not bring up the calendar for input. Only a text box with the date value is displayed.
Advanced

The simplest and most common usage is the default implementation.

<element name='start_date'>
  <display class='tactic.ui.widget.CalendarInputWdg'/>
</element>

To set the work week to start on a different day than Sunday, change the first_day_of_week . This option is an integer which represents the days of the week where 0=Sunday and 6=Saturday.

<element name='start_date'>
  <display class='tactic.ui.widget.CalendarInputWdg'>
    <first_day_of_week>6</first_day_of_week>
  </display>
</element>