You are currently viewing the new Beta Editor Docs.
Switch to the Classic Editor Docs
You are currently viewing the Classic Editor Docs.
Switch to the Beta Editor Docs

anvil Module

Classes

AppEnvironment


AppEnvironment Attributes

name - string

The name of the current environment

tags - list

tags associated with the current environment


AppInfo


AppInfo Attributes

branch - string

The Git branch from which the current app is being run.

This is ‘master’ for development apps or apps without a published version, and ‘published’ if this app is being run from its published version.

environment - anvil.AppEnvironment instance

The environment in which the current app is being run.

id - string

A unique identifier for the current app

theme_colors - mapping

Theme colors for this app as a readonly dict.


BlobMedia

Create a Media object with the specified content_type (a string such as ‘text/plain’) and content (a binary string). Optionally specify a filename as well.


Base class: anvil.Media

Constructor

BlobMedia(content_type, content, [name=None])

    Button (more info)

    Create a new ‘Button’ object


    Base class: anvil.Component

    Constructor

    Button([width=], [spacing_above=], [spacing_below=], [enabled=], [text=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [background=], [foreground=], [border=], [visible=], [role=], [icon=], [icon_align=], [tag=], [tooltip=])

      Button Properties

      align - string

      The position of this button in the available space.

      background - color

      The background colour of this component.

      bold - boolean

      Display this component’s text in bold

      border - string

      The border of this component. Can take any valid CSS border value.

      enabled - boolean

      True if this component should allow user interaction.

      font - string

      The font to use for this component.

      font_size - number

      The height of text displayed on this component in pixels

      foreground - color

      The foreground colour of this component.

      icon - icon

      The icon to display on this component. Either a URL, or a FontAwesome Icon, e.g. ‘fa:user’.

      icon_align - string

      The alignment of the icon on this component. Set to ‘top’ for a centred icon on a component with no text.

      italic - boolean

      Display this component’s text in italics

      parent

      role - themeRole

      Choose how this component can appear, based on your app’s visual theme.

      spacing_above - string

      The vertical space above this component.

      spacing_below - string

      The vertical space below this component.

      tag - object

      Use this property to store any extra information about this component

      text - string

      The text displayed on this component

      tooltip - string

      Text to display when you hover the mouse over this component

      underline - boolean

      Display this component’s text underlined

      visible - boolean

      Should this component be displayed?

      width - string

      The width of this Button, or “default” to have the width set by the container.


      Button Events

      click(keys)

      When the button is clicked

      • keys - A dictionary of keys including 'shift', 'alt', 'ctrl', 'meta'. Each key's value is a boolean indicating if it was pressed during the click event. The meta key on a mac is the Command key

      show()

      When the Button is shown on the screen

      hide()

      When the Button is removed from the screen


      Canvas (more info)

      Create a new ‘Canvas’ object


      Base class: anvil.Component

      Constructor

      Canvas([width=], [spacing_above=], [spacing_below=], [height=], [background=], [foreground=], [border=], [visible=], [role=], [tag=], [tooltip=])

        Canvas Methods

        arc(x, y, radius, start_angle=0, end_angle=PI*2, anticlockwise=False)

        Adds an arc to the end of the current path with specified center and radius.

          begin_path()

          Begin a path on the canvas.

          bezier_curve_to(cp1x, cp1y, cp2x, cp2y, x, y)

          Adds a Bezier curve at the end of the current path to (x,y) with control points (cp1x,cp1y) and (cp2x,cp2y).

            clear_rect(x, y, width, height)

            Clear the specified rectangle with the background color of the canvas.

              clip()

              Turn the current path into the clipping region of the canvas.

              close_path()

              Close the current path with a straight line back to the start point.

              create_linear_gradient(x0, y0, x1, y1)

              Returns a gradient object representing a linear gradient from (x0,y0) to (x1,y1).

                create_radial_gradient(x0, y0, x1, y1)

                Returns a gradient object representing a radial gradient from (x0,y0) with radius r0 to (x1,y1) with radius r1.

                  draw_image(media, [x], [y], [width], [height])

                  Draw an image (from a Media object) onto the canvas at the specified coordinates (optionally scaling to the specified width and height)

                    draw_image_part(media, sx, sy, s_width, s_height, dx, dy, d_width, d_height)

                    Draw a subset of an image (from a Media object) onto the canvas.

                    sx, sy, s_width and s_height specify which pixels within the source image of the source image to draw. dx and dy (and optionally d_width and d_height) specify where (and optionally what dimensions) on the canvas to draw the image.

                      fill()

                      Fill the current path with the current fill style of the canvas.

                      fill_rect(x, y, width, height)

                      Fill the specified rectangle with the current fill style of the canvas.

                        fill_text(text, x, y)

                        Draw the specified text at the required position.

                          get_height()

                          Get the pixel height of this canvas.

                          get_image()

                          Take a snapshot of the canvas and return an image as a Media object.

                          get_width()

                          Get the pixel width of this canvas.

                          line_to(x, y)

                          Adds a straight line segment at the end of the current path to the specified position.

                            measure_text(text)

                            Get the size of the specified text in the current font.

                              move_to(x, y)

                              Moves the current path position to the specified point without drawing.

                                quadratic_curve_to(cpx, cpy, x, y)

                                Adds a quadratic curve at the end of the current path to (x,y) with control point (cpx, cpy).

                                  reset_context()

                                  Reset the drawing context for this canvas. Called automatically after a window resize.

                                  reset_transform()

                                  Reset the current transform to the identity matrix.

                                  restore()

                                  Restores a drawing transform saved by the ‘save()’ function

                                  rotate(angle)

                                  Rotate all subsequent drawing by ‘angle’ radians.

                                    save()

                                    Saves the current drawing transform, which can be restored by calling ‘restore()’

                                    scale(x, y)

                                    Scale all subsequent drawing operations by ‘x’ horizontally and ‘y’ vertically.

                                      set_transform()

                                      Set the current transform matrix to the specified values.

                                      stroke()

                                      Draw the current path with the current stroke style of the canvas.

                                      stroke_rect(x, y, width, height)

                                      Outline the specified rectangle with the current stroke style of the canvas.

                                        stroke_text(text, x, y)

                                        Draw the outline of the specified text at the required position.

                                          transform(a, b, c, d, e, f)

                                          Multiply the current transform matrix by the specified matrix.

                                            translate(x, y)

                                            Translate all subsequent drawing by ‘x’ pixels across and ‘y’ pixels down.


                                              Canvas Properties

                                              background - color

                                              The background colour of this component.

                                              border - string

                                              The border of this component. Can take any valid CSS border value.

                                              fill_style - string

                                              The color or gradient to use when filling shapes and paths.

                                              font - string

                                              The font to use when drawing text on this canvas.

                                              foreground - color

                                              The foreground colour of this component.

                                              global_alpha - number

                                              The global opacity to draw with, in the range 0-1.

                                              global_composite_operation - string

                                              The global composite operation to draw with. Defaults to ‘source-over’

                                              height - string

                                              The height of this component.

                                              line_cap - string

                                              The line cap to use when drawing lines on this canvas.

                                              line_join - string

                                              The line join to use when connecting lines on this canvas.

                                              line_width - number

                                              The width of lines drawn on this canvas.

                                              miter_limit - number

                                              The limit of line join miters, in pixels.

                                              parent

                                              role - themeRole

                                              Choose how this component can appear, based on your app’s visual theme.

                                              shadow_blur - number

                                              The required shadow blur, in pixels.

                                              shadow_color - string

                                              The color to use for shadows.

                                              shadow_offset_x - number

                                              The horizontal shadow offset, in pixels.

                                              shadow_offset_y - number

                                              The vertical shadow offset, in pixels.

                                              spacing_above - string

                                              The vertical space above this component.

                                              spacing_below - string

                                              The vertical space below this component.

                                              stroke_style - string

                                              The color or gradient to use when drawing outlines.

                                              tag - object

                                              Use this property to store any extra information about this component

                                              text_align - string

                                              Text alignment, relative to the drawing point.

                                              text_baseline - string

                                              Text baseline, relative to the drawing point.

                                              tooltip - string

                                              Text to display when you hover the mouse over this component

                                              visible - boolean

                                              Should this component be displayed?

                                              width - string

                                              The width of this Canvas, or “default” to have the width set by the container.


                                              Canvas Events

                                              reset()

                                              When the canvas is reset and cleared, such as when the window resizes, or the canvas is added to a form.

                                              show()

                                              When the Canvas is shown on the screen

                                              hide()

                                              When the Canvas is removed from the screen

                                              mouse_enter(x, y)

                                              When the mouse cursor enters this component

                                              • x - The x coordinate of the mouse pointer, within this component
                                              • y - The y coordinate of the mouse pointer, within this component

                                              mouse_leave(x, y)

                                              When the mouse cursor leaves this component

                                              • x - The x coordinate of the mouse pointer relative to this component
                                              • y - The y coordinate of the mouse pointer relative to this component

                                              mouse_move(x, y)

                                              When the mouse cursor moves over this component

                                              • x - The x coordinate of the mouse pointer within this component
                                              • y - The y coordinate of the mouse pointer within this component

                                              mouse_down(x, y, button, keys)

                                              When a mouse button is pressed on this component

                                              • x - The x coordinate of the mouse pointer within this component
                                              • y - The y coordinate of the mouse pointer within this component
                                              • button - The button that was pressed (1 = left, 2 = middle, 3 = right)
                                              • keys - A dictionary of keys including 'shift', 'alt', 'ctrl', 'meta'. Each key's value is a boolean indicating if it was pressed during the click event. The meta key on a mac is the Command key

                                              mouse_up(x, y, button, keys)

                                              When a mouse button is released on this component

                                              • x - The x coordinate of the mouse pointer within this component
                                              • y - The y coordinate of the mouse pointer within this component
                                              • button - The button that was released (1 = left, 2 = middle, 3 = right)
                                              • keys - A dictionary of keys including 'shift', 'alt', 'ctrl', 'meta'. Each key's value is a boolean indicating if it was pressed during the click event. The meta key on a mac is the Command key


                                              CheckBox (more info)

                                              Create a new ‘CheckBox’ object


                                              Base class: anvil.Component

                                              Constructor

                                              CheckBox([checked=], [allow_indeterminate=], [enabled=], [width=], [spacing_above=], [spacing_below=], [text=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                CheckBox Methods

                                                focus()

                                                Set the keyboard focus to this component


                                                CheckBox Properties

                                                align - string

                                                Align this component’s text

                                                allow_indeterminate - boolean

                                                Support an indeterminate state. The indeterminate state can only be set in code by setting checked=None.

                                                background - color

                                                The background colour of this component.

                                                bold - boolean

                                                Display this component’s text in bold

                                                border - string

                                                The border of this component. Can take any valid CSS border value.

                                                checked - boolean

                                                The status of the checkbox

                                                enabled - boolean

                                                True if this component should allow user interaction.

                                                font - string

                                                The font to use for this component.

                                                font_size - number

                                                The height of text displayed on this component in pixels

                                                foreground - color

                                                The foreground colour of this component.

                                                italic - boolean

                                                Display this component’s text in italics

                                                parent

                                                role - themeRole

                                                Choose how this component can appear, based on your app’s visual theme.

                                                spacing_above - string

                                                The vertical space above this component.

                                                spacing_below - string

                                                The vertical space below this component.

                                                tag - object

                                                Use this property to store any extra information about this component

                                                text - string

                                                The text displayed on this component

                                                tooltip - string

                                                Text to display when you hover the mouse over this component

                                                underline - boolean

                                                Display this component’s text underlined

                                                visible - boolean

                                                Should this component be displayed?

                                                width - string

                                                The width of this CheckBox, or “default” to have the width set by the container.


                                                CheckBox Events

                                                change()

                                                When this checkbox is checked or unchecked

                                                show()

                                                When the CheckBox is shown on the screen

                                                hide()

                                                When the CheckBox is removed from the screen


                                                ColumnPanel (more info)

                                                Create a new ‘ColumnPanel’ object


                                                Base class: anvil.Container

                                                Constructor

                                                ColumnPanel([col_widths=], [wrap_on=], [col_spacing=], [width=], [spacing_above=], [spacing_below=], [row_spacing=], [background=], [foreground=], [border=], [visible=], [role=], [tag=], [tooltip=])

                                                  ColumnPanel Methods

                                                  add_component(component, full_width_row=False, **layout_props)

                                                  Add a component to the bottom of this ColumnPanel. Useful layout properties:

                                                  full_width_row = True|False row_background = [colour]


                                                    ColumnPanel Properties

                                                    background - color

                                                    The background colour of this component.

                                                    border - string

                                                    The border of this component. Can take any valid CSS border value.

                                                    col_spacing - string

                                                    Space between columns

                                                    col_widths - string

                                                    Custom column widths in this panel

                                                    foreground - color

                                                    The foreground colour of this component.

                                                    parent

                                                    role - themeRole

                                                    Choose how this component can appear, based on your app’s visual theme.

                                                    row_spacing - number

                                                    The spacing between rows of components in this container, in pixels.

                                                    spacing_above - string

                                                    The vertical space above this component.

                                                    spacing_below - string

                                                    The vertical space below this component.

                                                    tag - object

                                                    Use this property to store any extra information about this component

                                                    tooltip - string

                                                    Text to display when you hover the mouse over this component

                                                    visible - boolean

                                                    Should this component be displayed?

                                                    width - string

                                                    The width of this ColumnPanel, or “default” to have the width set by the container.

                                                    wrap_on - string

                                                    The largest display on which to wrap columns in this panel


                                                    ColumnPanel Events

                                                    show()

                                                    When the ColumnPanel is shown on the screen

                                                    hide()

                                                    When the ColumnPanel is removed from the screen


                                                    Component

                                                    Create a new ‘Component’ object

                                                    Constructor

                                                    Component()

                                                    Instance Methods

                                                    add_event_handler(event_name, handler_func)

                                                    Add an event handler function to be called when the event happens on this component. Event handlers will be called in the order they are added. Adding the same event handler multiple times will mean it gets called multiple times.

                                                      get_event_handlers(event_name) → tuple_of_event_handlers

                                                      Get the current event_handlers for a given event_name

                                                        raise_event(event_name, **event_args)

                                                        Trigger the event on this component. Any keyword arguments are passed to the handler function.

                                                          remove_event_handler(event_name, [handler_func])

                                                          Remove a specific event handler function for a given event. Calling remove_event_handler with just the event name will remove all the handlers for this event

                                                            remove_from_parent()

                                                            Remove this component from its parent container.

                                                            scroll_into_view(smooth=False)

                                                            Scroll the window to make sure this component is in view.

                                                              set_event_handler(event_name, handler_func)

                                                              Set a function to call when the ‘event_name’ event happens on this component. Using set_event_handler removes all other handlers. Setting the handler function to None removes all handlers.


                                                                Container

                                                                Create a new ‘Container’ object


                                                                Base class: anvil.Component

                                                                Constructor

                                                                Container()

                                                                Instance Methods

                                                                add_component(component)

                                                                Add a component to this container.

                                                                  clear()

                                                                  Remove all components from this container

                                                                  get_components()

                                                                  Get a list of components in this container

                                                                  raise_event_on_children(event_name, **event_args)

                                                                  Trigger the ‘event_name’ event on all children of this component. Any keyword arguments are passed to the handler function.


                                                                    DataGrid (more info)

                                                                    Create a new ‘DataGrid’ object


                                                                    Base class: anvil.Container

                                                                    Constructor

                                                                    DataGrid([columns=], [auto_header=], [show_page_controls=], [rows_per_page=], [wrap_on=], [width=], [spacing_above=], [spacing_below=], [row_spacing=], [background=], [foreground=], [border=], [visible=], [role=], [tag=], [tooltip=])

                                                                      DataGrid Methods

                                                                      add_component(component, [index=None], [pinned=False])

                                                                      Add a component to this DataGrid, in the ‘index’th position. If ‘index’ is not specified, adds to the bottom.

                                                                        get_page()

                                                                        Get the current page number of this DataGrid

                                                                        jump_to_first_page()

                                                                        Jump to the first page of this DataGrid

                                                                        jump_to_last_page()

                                                                        Jump to the last page of this DataGrid

                                                                        next_page()

                                                                        Jump to the next page of this DataGrid

                                                                        previous_page()

                                                                        Jump to the previous page of this DataGrid

                                                                        set_page(page)

                                                                        Set the page number of this DataGrid. The page number must be positive.


                                                                          DataGrid Properties

                                                                          auto_header - boolean

                                                                          Whether to display an automatic header at the top of this Data Grid.

                                                                          background - color

                                                                          The background colour of this component.

                                                                          border - string

                                                                          The border of this component. Can take any valid CSS border value.

                                                                          columns - dataGridColumns

                                                                          A list of columns to display in this Data Grid.

                                                                          foreground - color

                                                                          The foreground colour of this component.

                                                                          parent

                                                                          role - themeRole

                                                                          Choose how this component can appear, based on your app’s visual theme.

                                                                          row_spacing - number

                                                                          The spacing between rows of components in this container, in pixels.

                                                                          rows_per_page - number

                                                                          The maximum number of rows to display at one time.

                                                                          show_page_controls - boolean

                                                                          Whether to display the next/previous page buttons.

                                                                          spacing_above - string

                                                                          The vertical space above this component.

                                                                          spacing_below - string

                                                                          The vertical space below this component.

                                                                          tag - object

                                                                          Use this property to store any extra information about this component

                                                                          tooltip - string

                                                                          Text to display when you hover the mouse over this component

                                                                          visible - boolean

                                                                          Should this component be displayed?

                                                                          width - string

                                                                          The width of this DataGrid, or “default” to have the width set by the container.

                                                                          wrap_on - string

                                                                          The largest display on which to wrap columns in this DataGrid


                                                                          DataGrid Events

                                                                          show()

                                                                          When the DataGrid is shown on the screen

                                                                          hide()

                                                                          When the DataGrid is removed from the screen


                                                                          DataRowPanel (more info)

                                                                          Create a new ‘DataRowPanel’ object


                                                                          Base class: anvil.Container

                                                                          Constructor

                                                                          DataRowPanel([item=], [auto_display_data=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [width=], [spacing_above=], [spacing_below=], [row_spacing=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                                            DataRowPanel Methods

                                                                            add_component(component, [column=None])

                                                                            Add a component to the specified column of this DataRowPanel. TODO: If ‘column’ is not specified, adds the component full-width.


                                                                              DataRowPanel Properties

                                                                              align - string

                                                                              Align this component’s text

                                                                              auto_display_data - boolean

                                                                              Whether to automatically display data in this row.

                                                                              background - color

                                                                              The background colour of this component.

                                                                              bold - boolean

                                                                              Display this component’s text in bold

                                                                              border - string

                                                                              The border of this component. Can take any valid CSS border value.

                                                                              font - string

                                                                              The font to use for this component.

                                                                              font_size - number

                                                                              The height of text displayed on this component in pixels

                                                                              foreground - color

                                                                              The foreground colour of this component.

                                                                              italic - boolean

                                                                              Display this component’s text in italics

                                                                              item - object

                                                                              The data to display in this row by default.

                                                                              parent

                                                                              role - themeRole

                                                                              Choose how this component can appear, based on your app’s visual theme.

                                                                              row_spacing - number

                                                                              The spacing between rows of components in this container, in pixels.

                                                                              spacing_above - string

                                                                              The vertical space above this component.

                                                                              spacing_below - string

                                                                              The vertical space below this component.

                                                                              tag - object

                                                                              Use this property to store any extra information about this component

                                                                              tooltip - string

                                                                              Text to display when you hover the mouse over this component

                                                                              underline - boolean

                                                                              Display this component’s text underlined

                                                                              visible - boolean

                                                                              Should this component be displayed?

                                                                              width - string

                                                                              The width of this DataRowPanel, or “default” to have the width set by the container.


                                                                              DataRowPanel Events

                                                                              show()

                                                                              When the DataRowPanel is shown on the screen

                                                                              hide()

                                                                              When the DataRowPanel is removed from the screen


                                                                              DatePicker (more info)

                                                                              Create a new ‘DatePicker’ object


                                                                              Base class: anvil.Component

                                                                              Constructor

                                                                              DatePicker([date=], [format=], [pick_time=], [min_date=], [max_date=], [placeholder=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [width=], [spacing_above=], [spacing_below=], [enabled=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                                                DatePicker Methods

                                                                                focus()

                                                                                Set the keyboard focus to this DatePicker


                                                                                DatePicker Properties

                                                                                align - string

                                                                                Align this component’s text

                                                                                background - color

                                                                                The background colour of this component.

                                                                                bold - boolean

                                                                                Display this component’s text in bold

                                                                                border - string

                                                                                The border of this component. Can take any valid CSS border value.

                                                                                date - string

                                                                                The date selected on this component.

                                                                                enabled - boolean

                                                                                True if this component should allow user interaction.

                                                                                font - string

                                                                                The font to use for this component.

                                                                                font_size - number

                                                                                The height of text displayed on this component in pixels

                                                                                foreground - color

                                                                                The foreground colour of this component.

                                                                                format - string

                                                                                The format in which to display the selected date.

                                                                                italic - boolean

                                                                                Display this component’s text in italics

                                                                                max_date - string

                                                                                The maximum date the user can select.

                                                                                min_date - string

                                                                                The minimum date the user can select.

                                                                                parent

                                                                                pick_time - boolean

                                                                                Whether the user should be able to select a time as well as a date

                                                                                placeholder - string

                                                                                A string to display when the DatePicker is empty.

                                                                                role - themeRole

                                                                                Choose how this component can appear, based on your app’s visual theme.

                                                                                spacing_above - string

                                                                                The vertical space above this component.

                                                                                spacing_below - string

                                                                                The vertical space below this component.

                                                                                tag - object

                                                                                Use this property to store any extra information about this component

                                                                                tooltip - string

                                                                                Text to display when you hover the mouse over this component

                                                                                underline - boolean

                                                                                Display this component’s text underlined

                                                                                visible - boolean

                                                                                Should this component be displayed?

                                                                                width - string

                                                                                The width of this DatePicker, or “default” to have the width set by the container.


                                                                                DatePicker Events

                                                                                change()

                                                                                When the selected date changes

                                                                                show()

                                                                                When the DatePicker is shown on the screen

                                                                                hide()

                                                                                When the DatePicker is removed from the screen


                                                                                Create a new ‘DropDown’ object


                                                                                Base class: anvil.Component
                                                                                DropDown([items=], [selected_value=], [include_placeholder=], [placeholder=], [width=], [spacing_above=], [spacing_below=], [enabled=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [background=], [foreground=], [border=], [visible=], [role=], [tag=], [tooltip=])

                                                                                  focus()

                                                                                  Set the keyboard focus to this component


                                                                                  align - string

                                                                                  The position of this dropdown in the available space.

                                                                                  background - color

                                                                                  The background colour of this component.

                                                                                  bold - boolean

                                                                                  Display this component’s text in bold

                                                                                  border - string

                                                                                  The border of this component. Can take any valid CSS border value.

                                                                                  enabled - boolean

                                                                                  True if this component should allow user interaction.

                                                                                  font - string

                                                                                  The font to use for this component.

                                                                                  font_size - number

                                                                                  The height of text displayed on this component in pixels

                                                                                  foreground - color

                                                                                  The foreground colour of this component.

                                                                                  include_placeholder - boolean

                                                                                  Whether to add a placeholder item to the list with value None

                                                                                  italic - boolean

                                                                                  Display this component’s text in italics

                                                                                  items - text[]

                                                                                  The items to display in this dropdown.

                                                                                  parent

                                                                                  placeholder - string

                                                                                  The text to be displayed when the selected_value is None.

                                                                                  role - themeRole

                                                                                  Choose how this component can appear, based on your app’s visual theme.

                                                                                  selected_value - object

                                                                                  The value of the currently selected item. Can only be set at runtime.

                                                                                  spacing_above - string

                                                                                  The vertical space above this component.

                                                                                  spacing_below - string

                                                                                  The vertical space below this component.

                                                                                  tag - object

                                                                                  Use this property to store any extra information about this component

                                                                                  tooltip - string

                                                                                  Text to display when you hover the mouse over this component

                                                                                  underline - boolean

                                                                                  Display this component’s text underlined

                                                                                  visible - boolean

                                                                                  Should this component be displayed?

                                                                                  width - string

                                                                                  The width of this DropDown, or “default” to have the width set by the container.


                                                                                  change()

                                                                                  When an item is selected

                                                                                  show()

                                                                                  When the DropDown is shown on the screen

                                                                                  hide()

                                                                                  When the DropDown is removed from the screen


                                                                                  FileLoader (more info)

                                                                                  Create a new ‘FileLoader’ object


                                                                                  Base class: anvil.Component

                                                                                  Constructor

                                                                                  FileLoader([multiple=], [show_state=], [file=], [files=], [file_types=], [width=], [spacing_above=], [spacing_below=], [text=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [background=], [foreground=], [border=], [visible=], [role=], [icon=], [icon_align=], [enabled=], [tag=], [tooltip=])

                                                                                    FileLoader Methods

                                                                                    clear()

                                                                                    Clear any selected files from this FileLoader

                                                                                    focus()

                                                                                    Set the keyboard focus to this FileLoader


                                                                                    FileLoader Properties

                                                                                    align - string

                                                                                    Align this component’s text

                                                                                    background - color

                                                                                    The background colour of this component.

                                                                                    bold - boolean

                                                                                    Display this component’s text in bold

                                                                                    border - string

                                                                                    The border of this component. Can take any valid CSS border value.

                                                                                    enabled - boolean

                                                                                    True if this component should allow user interaction.

                                                                                    file - anvil.Media instance

                                                                                    The currently selected file (or the first, if multiple files are selected). This is a Media object.

                                                                                    file_types - string

                                                                                    Specify what type of file to upload. Can accept a MIME type (eg “image/png” or “image/*“), or an extension (eg “.png”), or a comma-separated set of them (eg “.png,.jpg,.jpeg”)

                                                                                    files - list(anvil.Media instance)

                                                                                    A list of currently selected files. Each file is a Media object.

                                                                                    font - string

                                                                                    The font to use for this component.

                                                                                    font_size - number

                                                                                    The height of text displayed on this component in pixels

                                                                                    foreground - color

                                                                                    The foreground colour of this component.

                                                                                    icon - icon

                                                                                    The icon to display on this component. Either a URL, or a FontAwesome Icon, e.g. ‘fa:user’.

                                                                                    icon_align - string

                                                                                    The alignment of the icon on this component. Set to ‘top’ for a centred icon on a component with no text.

                                                                                    italic - boolean

                                                                                    Display this component’s text in italics

                                                                                    multiple - boolean

                                                                                    If True, this FileLoader can load multiple files at the same time

                                                                                    parent

                                                                                    role - themeRole

                                                                                    Choose how this component can appear, based on your app’s visual theme.

                                                                                    show_state - boolean

                                                                                    If True, display a message describing selected files.

                                                                                    spacing_above - string

                                                                                    The vertical space above this component.

                                                                                    spacing_below - string

                                                                                    The vertical space below this component.

                                                                                    tag - object

                                                                                    Use this property to store any extra information about this component

                                                                                    text - string

                                                                                    The text displayed on this component

                                                                                    tooltip - string

                                                                                    Text to display when you hover the mouse over this component

                                                                                    underline - boolean

                                                                                    Display this component’s text underlined

                                                                                    visible - boolean

                                                                                    Should this component be displayed?

                                                                                    width - string

                                                                                    The width of this FileLoader, or “default” to have the width set by the container.


                                                                                    FileLoader Events

                                                                                    change(file, files)

                                                                                    When a new file is loaded into this FileLoader

                                                                                    • file - The first selected file. Set the 'multiple' property to allow loading more than one file.
                                                                                    • files - A list of loaded files. Set the 'multiple' property to allow loading more than one file.

                                                                                    show()

                                                                                    When the FileLoader is shown on the screen

                                                                                    hide()

                                                                                    When the FileLoader is removed from the screen

                                                                                    focus()

                                                                                    When the FileLoader gets focus

                                                                                    lost_focus()

                                                                                    When the FileLoader loses focus


                                                                                    FlowPanel (more info)

                                                                                    Create a new ‘FlowPanel’ object


                                                                                    Base class: anvil.Container

                                                                                    Constructor

                                                                                    FlowPanel([align=], [spacing=], [background=], [foreground=], [border=], [visible=], [role=], [tag=], [width=], [spacing_above=], [spacing_below=], [tooltip=])

                                                                                      FlowPanel Methods

                                                                                      add_component(component, [index=], [width=], [expand=])

                                                                                      Add a component to this panel. Optionally specify the position in the panel to add it, or the width to apply to components that can’t self-size width-wise.


                                                                                        FlowPanel Properties

                                                                                        align - string

                                                                                        Align this component’s content

                                                                                        background - color

                                                                                        The background colour of this component.

                                                                                        border - string

                                                                                        The border of this component. Can take any valid CSS border value.

                                                                                        foreground - color

                                                                                        The foreground colour of this component.

                                                                                        parent

                                                                                        role - themeRole

                                                                                        Choose how this component can appear, based on your app’s visual theme.

                                                                                        spacing - string

                                                                                        Space between components

                                                                                        spacing_above - string

                                                                                        The vertical space above this component.

                                                                                        spacing_below - string

                                                                                        The vertical space below this component.

                                                                                        tag - object

                                                                                        Use this property to store any extra information about this component

                                                                                        tooltip - string

                                                                                        Text to display when you hover the mouse over this component

                                                                                        visible - boolean

                                                                                        Should this component be displayed?

                                                                                        width - string

                                                                                        The width of this FlowPanel, or “default” to have the width set by the container.


                                                                                        FlowPanel Events

                                                                                        show()

                                                                                        When the FlowPanel is shown on the screen

                                                                                        hide()

                                                                                        When the FlowPanel is removed from the screen


                                                                                        GoogleMap (more info)

                                                                                        Create a new ‘GoogleMap’ object


                                                                                        Base class: anvil.Container

                                                                                        Constructor

                                                                                        GoogleMap([map_data=], [background_color=], [center=], [clickable_icons=], [disable_default_ui=], [disable_double_click_zoom=], [draggable=], [draggable_cursor=], [dragging_cursor=], [fullscreen_control=], [fullscreen_control_options=], [gesture_handling=], [heading=], [keyboard_shortcuts=], [map_type_control=], [map_type_control_options=], [map_type_id=], [max_zoom=], [min_zoom=], [rotate_control=], [rotate_control_options=], [scale_control=], [scale_control_options=], [scroll_wheel=], [street_view_control=], [street_view_control_options=], [zoom=], [zoom_control=], [zoom_control_options=], [width=], [spacing_above=], [spacing_below=], [height=], [visible=], [tag=])

                                                                                          GoogleMap Properties

                                                                                          background_color - string

                                                                                          Color used for the background of the Map div. This color will be visible when tiles have not yet loaded as the user pans.

                                                                                          center - anvil.GoogleMap.LatLng instance

                                                                                          The Map center.

                                                                                          clickable_icons - boolean

                                                                                          When false, map icons are not clickable. A map icon represents a point of interest

                                                                                          disable_default_ui - boolean

                                                                                          Enables/disables all default UI.

                                                                                          disable_double_click_zoom - boolean

                                                                                          Enables/disables zoom and center on double click.

                                                                                          draggable - boolean

                                                                                          If false, prevents the map from being dragged.

                                                                                          draggable_cursor - string

                                                                                          The name or url of the cursor to display when mousing over a draggable map.

                                                                                          dragging_cursor - string

                                                                                          The name or url of the cursor to display when the map is being dragged.

                                                                                          fullscreen_control - boolean

                                                                                          The enabled/disabled state of the Fullscreen control.

                                                                                          fullscreen_control_options - anvil.GoogleMap.FullscreenControlOptions instance

                                                                                          The display options for the Fullscreen control.

                                                                                          gesture_handling - string

                                                                                          This setting controls how gestures on the map are handled.

                                                                                          heading - number

                                                                                          The heading for aerial imagery in degrees measured clockwise from cardinal direction North.

                                                                                          height - string

                                                                                          The height of this component.

                                                                                          keyboard_shortcuts - boolean

                                                                                          If false, prevents the map from being controlled by the keyboard.

                                                                                          map_data - anvil.GoogleMap.Data instance

                                                                                          Map data

                                                                                          map_type_control - boolean

                                                                                          The enabled/disabled state of the Map type control.

                                                                                          map_type_control_options - anvil.GoogleMap.MapTypeControlOptions instance

                                                                                          The display options for the Map type control.

                                                                                          map_type_id - anvil.GoogleMap.MapTypeId

                                                                                          The map type ID. Defaults to MapTypeId.ROADMAP

                                                                                          max_zoom - number

                                                                                          The maximum zoom level which will be displayed on the map.

                                                                                          min_zoom - number

                                                                                          The minimum zoom level which will be displayed on the map.

                                                                                          parent

                                                                                          rotate_control - boolean

                                                                                          The enabled/disabled state of the rotate control.

                                                                                          rotate_control_options - anvil.GoogleMap.RotateControlOptions instance

                                                                                          The display options for the rotate control.

                                                                                          scale_control - boolean

                                                                                          The enabled/disabled state of the scale control.

                                                                                          scale_control_options - anvil.GoogleMap.ScaleControlOptions instance

                                                                                          The display options for the scale control.

                                                                                          scroll_wheel - boolean

                                                                                          If false, disables scrollwheel zooming on the map.

                                                                                          spacing_above - string

                                                                                          The vertical space above this component.

                                                                                          spacing_below - string

                                                                                          The vertical space below this component.

                                                                                          street_view_control - boolean

                                                                                          The enabled/disabled state of the street view control.

                                                                                          street_view_control_options - anvil.GoogleMap.StreetViewControlOptions instance

                                                                                          The display options for the street view control.

                                                                                          tag - object

                                                                                          Use this property to store any extra information about this component

                                                                                          visible - boolean

                                                                                          Should this component be displayed?

                                                                                          width - string

                                                                                          The width of this GoogleMap, or “default” to have the width set by the container.

                                                                                          zoom - number

                                                                                          The map zoom level.

                                                                                          zoom_control - boolean

                                                                                          The enabled/disabled state of the zoom control.

                                                                                          zoom_control_options - anvil.GoogleMap.ZoomControlOptions instance

                                                                                          The display options for the zoom control.


                                                                                          GoogleMap Events

                                                                                          bounds_changed()

                                                                                          when the viewport bounds have changed.

                                                                                          center_changed()

                                                                                          when the map center property changes.

                                                                                          click(lat_lng, pixel)

                                                                                          when the user clicks on the map.

                                                                                          • lat_lng - The position that was clicked.
                                                                                          • pixel - The position that was clicked.

                                                                                          dbl_click(lat_lng, pixel)

                                                                                          when the user double-clicks on the map.

                                                                                          • lat_lng - The position that was double-clicked.
                                                                                          • pixel - The position that was double-clicked.

                                                                                          drag()

                                                                                          This event is repeatedly fired while the user drags the map.

                                                                                          dragend()

                                                                                          when the user stops dragging the map.

                                                                                          dragstart()

                                                                                          when the user starts dragging the map.

                                                                                          heading_changed()

                                                                                          when the map heading property changes.

                                                                                          idle()

                                                                                          when the map becomes idle after panning or zooming.

                                                                                          maptypeid_changed()

                                                                                          when the mapTypeId property changes.

                                                                                          mousemove(lat_lng, pixel)

                                                                                          whenever the user's mouse moves over the map container.

                                                                                          • lat_lng - The position of the cursor.
                                                                                          • pixel - The position of the cursor.

                                                                                          mouseout(lat_lng, pixel)

                                                                                          when the user's mouse exits the map container.

                                                                                          • lat_lng - The position of the cursor.
                                                                                          • pixel - The position of the cursor.

                                                                                          mouseover(lat_lng, pixel)

                                                                                          when the user's mouse enters the map container.

                                                                                          • lat_lng - The position of the cursor.
                                                                                          • pixel - The position of the cursor.

                                                                                          projection_changed()

                                                                                          when the projection has changed.

                                                                                          rightclick(lat_lng, pixel)

                                                                                          when the user right-clicks on the map container.

                                                                                          • lat_lng - The position that was right-clicked.
                                                                                          • pixel - The position that was right-clicked.

                                                                                          tilesloaded()

                                                                                          when the visible tiles have finished loading.

                                                                                          tilt_changed()

                                                                                          when the map tilt property changes.

                                                                                          zoom_changed()

                                                                                          when the map zoom property changes.

                                                                                          data_addfeature(feature)

                                                                                          when the viewport bounds have changed.

                                                                                          • feature - The feature that was added.

                                                                                          data_click(feature, lat_lng)

                                                                                          for a click on the geometry.

                                                                                          • feature - The feature that was clicked.
                                                                                          • lat_lng - The position that was clicked.

                                                                                          data_dbl_click(feature, lat_lng)

                                                                                          for a double click on the geometry.

                                                                                          • feature - The feature that was double-clicked.
                                                                                          • lat_lng - The position that was double-clicked.

                                                                                          data_mousedown(feature, lat_lng)

                                                                                          for a mousedown on the geometry.

                                                                                          • feature - The feature the mouse is over.
                                                                                          • lat_lng - The position of the cursor.

                                                                                          data_mouseout(feature, lat_lng)

                                                                                          when the mouse leaves the area of the geometry.

                                                                                          • feature - The feature the mouse left.
                                                                                          • lat_lng - The position of the cursor.

                                                                                          data_mouseover(feature, lat_lng)

                                                                                          when the mouse enters the area of the geometry.

                                                                                          • feature - The feature the mouse is over.
                                                                                          • lat_lng - The position of the cursor.

                                                                                          data_mouseup(feature, lat_lng)

                                                                                          for a mouseup on the geometry.

                                                                                          • feature - The feature the mouse is over.
                                                                                          • lat_lng - The position of the cursor.

                                                                                          data_removefeature(feature)

                                                                                          when a feature is removed from the collection.

                                                                                          • feature - The feature that was removed.

                                                                                          data_removeproperty(feature, name, old_value)

                                                                                          when a feature's property is removed.

                                                                                          • feature - The feature whose property was removed.
                                                                                          • name - The name of the property that was removed.
                                                                                          • old_value - The old value of the property that was removed.

                                                                                          data_rightclick(feature, lat_lng)

                                                                                          for a right-click on the geometry.

                                                                                          • feature - The feature that was right-clicked.
                                                                                          • lat_lng - The position that was right-clicked.

                                                                                          data_setgeometry(feature, new_geometry, old_geometry)

                                                                                          when a feature's geometry is set.

                                                                                          • feature - The feature that was removed.
                                                                                          • new_geometry - The geometry that was set.
                                                                                          • old_geometry - The geometry that was replaced.

                                                                                          data_setproperty(feature, name, new_value, old_value)

                                                                                          when a feature's property is set.

                                                                                          • feature - The feature whose property was set.
                                                                                          • name - The name of the property that was set.
                                                                                          • new_value - The new value of the property that was set.
                                                                                          • old_value - The old value of the property that was set.

                                                                                          show()

                                                                                          When the GoogleMap is shown on the screen

                                                                                          hide()

                                                                                          When the GoogleMap is removed from the screen


                                                                                          GridPanel (more info)

                                                                                          Create a new ‘GridPanel’ object


                                                                                          Base class: anvil.Container

                                                                                          Constructor

                                                                                          GridPanel([width=], [spacing_above=], [spacing_below=], [row_spacing=], [background=], [foreground=], [border=], [visible=], [role=], [tag=], [tooltip=])

                                                                                            GridPanel Methods

                                                                                            add_component(component, [row=], [col_xs=], [width_xs=])

                                                                                            Add a component to this GridPanel


                                                                                              GridPanel Properties

                                                                                              background - color

                                                                                              The background colour of this component.

                                                                                              border - string

                                                                                              The border of this component. Can take any valid CSS border value.

                                                                                              foreground - color

                                                                                              The foreground colour of this component.

                                                                                              parent

                                                                                              role - themeRole

                                                                                              Choose how this component can appear, based on your app’s visual theme.

                                                                                              row_spacing - number

                                                                                              The spacing between rows of components in this container, in pixels.

                                                                                              spacing_above - string

                                                                                              The vertical space above this component.

                                                                                              spacing_below - string

                                                                                              The vertical space below this component.

                                                                                              tag - object

                                                                                              Use this property to store any extra information about this component

                                                                                              tooltip - string

                                                                                              Text to display when you hover the mouse over this component

                                                                                              visible - boolean

                                                                                              Should this component be displayed?

                                                                                              width - string

                                                                                              The width of this GridPanel, or “default” to have the width set by the container.


                                                                                              GridPanel Events

                                                                                              show()

                                                                                              When the GridPanel is shown on the screen

                                                                                              hide()

                                                                                              When the GridPanel is removed from the screen


                                                                                              HtmlTemplate (more info)

                                                                                              Create a new ‘HtmlTemplate’ object


                                                                                              Base class: anvil.Container

                                                                                              Constructor

                                                                                              HtmlTemplate([html=], [tag=], [tooltip=], [background=], [foreground=], [border=], [visible=], [role=])

                                                                                                HtmlTemplate Methods

                                                                                                add_component(component, [slot="default"])

                                                                                                Add a component to the named slot of this HTML templated panel. If no slot is specified, the ‘default’ slot will be used.

                                                                                                  call_js(js_function_name, *args)

                                                                                                  Call a Javascript function

                                                                                                    clear([slot="default"])

                                                                                                    clear the HTML template of all components or clear a specific slot of components.


                                                                                                      HtmlTemplate Properties

                                                                                                      background - color

                                                                                                      The background colour of this component.

                                                                                                      border - string

                                                                                                      The border of this component. Can take any valid CSS border value.

                                                                                                      foreground - color

                                                                                                      The foreground colour of this component.

                                                                                                      html - html

                                                                                                      The HTML from which this panel is defined

                                                                                                      parent

                                                                                                      role - themeRole

                                                                                                      Choose how this component can appear, based on your app’s visual theme.

                                                                                                      tag - object

                                                                                                      Use this property to store any extra information about this component

                                                                                                      tooltip - string

                                                                                                      Text to display when you hover the mouse over this component

                                                                                                      visible - boolean

                                                                                                      Should this component be displayed?


                                                                                                      HtmlTemplate Events

                                                                                                      show()

                                                                                                      When the HtmlTemplate is shown on the screen

                                                                                                      hide()

                                                                                                      When the HtmlTemplate is removed from the screen


                                                                                                      Image (more info)

                                                                                                      Create a new ‘Image’ object


                                                                                                      Base class: anvil.Component

                                                                                                      Constructor

                                                                                                      Image([display_mode=], [horizontal_align=], [vertical_align=], [source=], [width=], [spacing_above=], [spacing_below=], [height=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                                                                        Image Properties

                                                                                                        background - color

                                                                                                        The background colour of this component.

                                                                                                        border - string

                                                                                                        The border of this component. Can take any valid CSS border value.

                                                                                                        display_mode - string

                                                                                                        Determines how the image’s size should be adjusted to fit the size of this Image component

                                                                                                        foreground - color

                                                                                                        The foreground colour of this component.

                                                                                                        height - string

                                                                                                        The height of this component.

                                                                                                        horizontal_align - string

                                                                                                        Position the image horizontally within this component

                                                                                                        parent

                                                                                                        role - themeRole

                                                                                                        Choose how this component can appear, based on your app’s visual theme.

                                                                                                        source - uri

                                                                                                        The image source - set a string for a URL or a Media object in code

                                                                                                        spacing_above - string

                                                                                                        The vertical space above this component.

                                                                                                        spacing_below - string

                                                                                                        The vertical space below this component.

                                                                                                        tag - object

                                                                                                        Use this property to store any extra information about this component

                                                                                                        tooltip - string

                                                                                                        Text to display when you hover the mouse over this component

                                                                                                        vertical_align - string

                                                                                                        Position the image vertically within this component

                                                                                                        visible - boolean

                                                                                                        Should this component be displayed?

                                                                                                        width - string

                                                                                                        The width of this Image, or “default” to have the width set by the container.


                                                                                                        Image Events

                                                                                                        show()

                                                                                                        When the Image is shown on the screen

                                                                                                        hide()

                                                                                                        When the Image is removed from the screen

                                                                                                        mouse_enter(x, y)

                                                                                                        When the mouse cursor enters this component

                                                                                                        • x - The x coordinate of the mouse pointer, within this component
                                                                                                        • y - The y coordinate of the mouse pointer, within this component

                                                                                                        mouse_leave(x, y)

                                                                                                        When the mouse cursor leaves this component

                                                                                                        • x - The x coordinate of the mouse pointer relative to this component
                                                                                                        • y - The y coordinate of the mouse pointer relative to this component

                                                                                                        mouse_move(x, y)

                                                                                                        When the mouse cursor moves over this component

                                                                                                        • x - The x coordinate of the mouse pointer within this component
                                                                                                        • y - The y coordinate of the mouse pointer within this component

                                                                                                        mouse_down(x, y, button, keys)

                                                                                                        When a mouse button is pressed on this component

                                                                                                        • x - The x coordinate of the mouse pointer within this component
                                                                                                        • y - The y coordinate of the mouse pointer within this component
                                                                                                        • button - The button that was pressed (1 = left, 2 = middle, 3 = right)
                                                                                                        • keys - A dictionary of keys including 'shift', 'alt', 'ctrl', 'meta'. Each key's value is a boolean indicating if it was pressed during the click event. The meta key on a mac is the Command key

                                                                                                        mouse_up(x, y, button, keys)

                                                                                                        When a mouse button is released on this component

                                                                                                        • x - The x coordinate of the mouse pointer within this component
                                                                                                        • y - The y coordinate of the mouse pointer within this component
                                                                                                        • button - The button that was released (1 = left, 2 = middle, 3 = right)
                                                                                                        • keys - A dictionary of keys including 'shift', 'alt', 'ctrl', 'meta'. Each key's value is a boolean indicating if it was pressed during the click event. The meta key on a mac is the Command key


                                                                                                        Label (more info)

                                                                                                        Create a new ‘Label’ object


                                                                                                        Base class: anvil.Component

                                                                                                        Constructor

                                                                                                        Label([width=], [spacing_above=], [spacing_below=], [text=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [background=], [foreground=], [border=], [visible=], [role=], [icon=], [icon_align=], [tooltip=], [tag=])

                                                                                                          Label Properties

                                                                                                          align - string

                                                                                                          Align this component’s text

                                                                                                          background - color

                                                                                                          The background colour of this component.

                                                                                                          bold - boolean

                                                                                                          Display this component’s text in bold

                                                                                                          border - string

                                                                                                          The border of this component. Can take any valid CSS border value.

                                                                                                          font - string

                                                                                                          The font to use for this component.

                                                                                                          font_size - number

                                                                                                          The height of text displayed on this component in pixels

                                                                                                          foreground - color

                                                                                                          The foreground colour of this component.

                                                                                                          icon - icon

                                                                                                          The icon to display on this component. Either a URL, or a FontAwesome Icon, e.g. ‘fa:user’.

                                                                                                          icon_align - string

                                                                                                          The alignment of the icon on this component. Set to ‘top’ for a centred icon on a component with no text.

                                                                                                          italic - boolean

                                                                                                          Display this component’s text in italics

                                                                                                          parent

                                                                                                          role - themeRole

                                                                                                          Choose how this component can appear, based on your app’s visual theme.

                                                                                                          spacing_above - string

                                                                                                          The vertical space above this component.

                                                                                                          spacing_below - string

                                                                                                          The vertical space below this component.

                                                                                                          tag - object

                                                                                                          Use this property to store any extra information about this component

                                                                                                          text - string

                                                                                                          The text displayed on this component

                                                                                                          tooltip - string

                                                                                                          Text to display when you hover the mouse over this component

                                                                                                          underline - boolean

                                                                                                          Display this component’s text underlined

                                                                                                          visible - boolean

                                                                                                          Should this component be displayed?

                                                                                                          width - string

                                                                                                          The width of this Label, or “default” to have the width set by the container.


                                                                                                          Label Events

                                                                                                          show()

                                                                                                          When the Label is shown on the screen

                                                                                                          hide()

                                                                                                          When the Label is removed from the screen


                                                                                                          LinearPanel (more info)

                                                                                                          Create a new ‘LinearPanel’ object


                                                                                                          Base class: anvil.Container

                                                                                                          Constructor

                                                                                                          LinearPanel([width=], [spacing_above=], [spacing_below=], [row_spacing=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                                                                            LinearPanel Methods

                                                                                                            add_component(component, [index=None])

                                                                                                            Add a component to this LinearPanel, in the ‘index’th position. If ‘index’ is not specified, adds to the bottom.


                                                                                                              LinearPanel Properties

                                                                                                              background - color

                                                                                                              The background colour of this component.

                                                                                                              border - string

                                                                                                              The border of this component. Can take any valid CSS border value.

                                                                                                              foreground - color

                                                                                                              The foreground colour of this component.

                                                                                                              parent

                                                                                                              role - themeRole

                                                                                                              Choose how this component can appear, based on your app’s visual theme.

                                                                                                              row_spacing - number

                                                                                                              The spacing between rows of components in this container, in pixels.

                                                                                                              spacing_above - string

                                                                                                              The vertical space above this component.

                                                                                                              spacing_below - string

                                                                                                              The vertical space below this component.

                                                                                                              tag - object

                                                                                                              Use this property to store any extra information about this component

                                                                                                              tooltip - string

                                                                                                              Text to display when you hover the mouse over this component

                                                                                                              visible - boolean

                                                                                                              Should this component be displayed?

                                                                                                              width - string

                                                                                                              The width of this LinearPanel, or “default” to have the width set by the container.


                                                                                                              LinearPanel Events

                                                                                                              show()

                                                                                                              When the LinearPanel is shown on the screen

                                                                                                              hide()

                                                                                                              When the LinearPanel is removed from the screen


                                                                                                              Create a new ‘Link’ object


                                                                                                              Base class: anvil.ColumnPanel
                                                                                                              Link([url=], [text=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [icon=], [icon_align=], [tooltip=], [tag=], [col_widths=], [wrap_on=], [col_spacing=], [width=], [spacing_above=], [spacing_below=], [row_spacing=], [background=], [foreground=], [border=], [visible=], [role=])

                                                                                                                align - string

                                                                                                                Align this component’s text

                                                                                                                bold - boolean

                                                                                                                Display this component’s text in bold

                                                                                                                font - string

                                                                                                                The font to use for this component.

                                                                                                                font_size - number

                                                                                                                The height of text displayed on this component in pixels

                                                                                                                icon - icon

                                                                                                                The icon to display on this component. Either a URL, or a FontAwesome Icon, e.g. ‘fa:user’.

                                                                                                                icon_align - string

                                                                                                                The alignment of the icon on this component. Set to ‘top’ for a centred icon on a component with no text.

                                                                                                                italic - boolean

                                                                                                                Display this component’s text in italics

                                                                                                                parent

                                                                                                                tag - object

                                                                                                                Use this property to store any extra information about this component

                                                                                                                text - string

                                                                                                                The text displayed on this component

                                                                                                                tooltip - string

                                                                                                                Text to display when you hover the mouse over this component

                                                                                                                underline - boolean

                                                                                                                Display this component’s text underlined

                                                                                                                url - string

                                                                                                                The target URL of the link. Can be set to a URL string or to a Media object.


                                                                                                                click(keys)

                                                                                                                When the link is clicked

                                                                                                                • keys - A dictionary of keys including 'shift', 'alt', 'ctrl', 'meta'. Each key's value is a boolean indicating if it was pressed during the click event. The meta key on a mac is the Command key


                                                                                                                Media

                                                                                                                Create a new ‘Media’ object

                                                                                                                Constructor

                                                                                                                Media()

                                                                                                                Instance Methods

                                                                                                                get_bytes()

                                                                                                                Get a binary string of the data represented by this Media object


                                                                                                                Media Attributes

                                                                                                                content_type - string

                                                                                                                The MIME type of this Media

                                                                                                                length - number

                                                                                                                The length of this Media, in bytes

                                                                                                                name - string

                                                                                                                The file name associated with this Media, or None if it has no name

                                                                                                                url - string

                                                                                                                The URL where you can download this Media, or None if it is not downloadable


                                                                                                                Notification

                                                                                                                Create a popup notification. Call the show() method to display it.

                                                                                                                Constructor

                                                                                                                Notification(message, [title=""], [style="info"], [timeout=2])

                                                                                                                  Instance Methods

                                                                                                                  __enter__() → anvil.Notification instance

                                                                                                                  Show the notification when entering a ‘with’ block

                                                                                                                  __exit__() → anvil.Notification instance

                                                                                                                  Hide the notification when exiting a ‘with’ block

                                                                                                                  hide()

                                                                                                                  Hides the notification immediately

                                                                                                                  show() → anvil.Notification instance

                                                                                                                  Shows the notification


                                                                                                                  Plot (more info)

                                                                                                                  Create a new ‘Plot’ object


                                                                                                                  Base class: anvil.Component

                                                                                                                  Constructor

                                                                                                                  Plot([data=], [layout=], [config=], [figure=], [interactive=], [width=], [spacing_above=], [spacing_below=], [height=], [visible=], [tooltip=], [tag=])

                                                                                                                    Plot Methods

                                                                                                                    extend_traces(data, traces)

                                                                                                                    Adds data to an existing trace.

                                                                                                                      prepend_traces(data, traces)

                                                                                                                      Prepends data to an existing trace.

                                                                                                                        redraw()

                                                                                                                        Redraws the chart. Call this function if you have updated data or layout properties.

                                                                                                                        relayout(update)

                                                                                                                        A more efficient means of updating just the layout in a graphDiv. The call signature and arguments for relayout are similar (but simpler) to restyle.

                                                                                                                          restyle(update, traces)

                                                                                                                          A more efficient means of changing attributes in the data array. When restyling, you may choose to have the specified changes effect as many traces as desired.

                                                                                                                            to_image(options) → anvil.URLMedia instance

                                                                                                                            Returns a Media object containing a snapshot of this plot. The argument is a dictionary specifying image options.


                                                                                                                              Plot Properties

                                                                                                                              config - dict

                                                                                                                              Plot config

                                                                                                                              data - object

                                                                                                                              Plot traces

                                                                                                                              figure - dict

                                                                                                                              The Plotly figure to display. Specifies layout and data.

                                                                                                                              height - string

                                                                                                                              The height of this component.

                                                                                                                              interactive - boolean

                                                                                                                              Whether this plot should be interactive

                                                                                                                              layout - plotly.graph_objs.Layout instance

                                                                                                                              Plot layout

                                                                                                                              parent

                                                                                                                              spacing_above - string

                                                                                                                              The vertical space above this component.

                                                                                                                              spacing_below - string

                                                                                                                              The vertical space below this component.

                                                                                                                              tag - object

                                                                                                                              Use this property to store any extra information about this component

                                                                                                                              templates - mapping

                                                                                                                              plotly templates, see plotly docs for valid template names. Set the default template using Plot.templates.default = ‘seaborn’.

                                                                                                                              tooltip - string

                                                                                                                              Text to display when you hover the mouse over this component

                                                                                                                              visible - boolean

                                                                                                                              Should this component be displayed?

                                                                                                                              width - string

                                                                                                                              The width of this Plot, or “default” to have the width set by the container.


                                                                                                                              Plot Events

                                                                                                                              click(points)

                                                                                                                              when a data point is clicked.

                                                                                                                              • points - A list of the data points that were clicked.

                                                                                                                              double_click()

                                                                                                                              when the plot is double-clicked.

                                                                                                                              afterplot()

                                                                                                                              after then plot is redrawn.

                                                                                                                              select(points)

                                                                                                                              when a data point is selected.

                                                                                                                              • points - A list of the data points that were selected.

                                                                                                                              hover(points)

                                                                                                                              when a data point is hovered.

                                                                                                                              • points - A list of the data points that were hovered.

                                                                                                                              unhover(points)

                                                                                                                              when a data point is unhovered.

                                                                                                                              • points - A list of the data points that were unhovered.

                                                                                                                              show()

                                                                                                                              When the Plot is shown on the screen

                                                                                                                              hide()

                                                                                                                              When the Plot is removed from the screen


                                                                                                                              RadioButton (more info)

                                                                                                                              Create a new ‘RadioButton’ object


                                                                                                                              Base class: anvil.Component

                                                                                                                              Constructor

                                                                                                                              RadioButton([selected=], [value=], [group_name=], [text=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [width=], [spacing_above=], [spacing_below=], [enabled=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                                                                                                RadioButton Methods

                                                                                                                                get_group_value() → str

                                                                                                                                returns the value of the button in the group which is pressed.


                                                                                                                                RadioButton Properties

                                                                                                                                align - string

                                                                                                                                Align this component’s text

                                                                                                                                background - color

                                                                                                                                The background colour of this component.

                                                                                                                                bold - boolean

                                                                                                                                Display this component’s text in bold

                                                                                                                                border - string

                                                                                                                                The border of this component. Can take any valid CSS border value.

                                                                                                                                enabled - boolean

                                                                                                                                True if this component should allow user interaction.

                                                                                                                                font - string

                                                                                                                                The font to use for this component.

                                                                                                                                font_size - number

                                                                                                                                The height of text displayed on this component in pixels

                                                                                                                                foreground - color

                                                                                                                                The foreground colour of this component.

                                                                                                                                group_name - string

                                                                                                                                The name of the group this radio button belongs to.

                                                                                                                                italic - boolean

                                                                                                                                Display this component’s text in italics

                                                                                                                                parent

                                                                                                                                role - themeRole

                                                                                                                                Choose how this component can appear, based on your app’s visual theme.

                                                                                                                                selected - boolean

                                                                                                                                The status of the radio button

                                                                                                                                spacing_above - string

                                                                                                                                The vertical space above this component.

                                                                                                                                spacing_below - string

                                                                                                                                The vertical space below this component.

                                                                                                                                tag - object

                                                                                                                                Use this property to store any extra information about this component

                                                                                                                                text - string

                                                                                                                                The text displayed on this component

                                                                                                                                tooltip - string

                                                                                                                                Text to display when you hover the mouse over this component

                                                                                                                                underline - boolean

                                                                                                                                Display this component’s text underlined

                                                                                                                                value - string

                                                                                                                                The value of the group when this radio button is selected

                                                                                                                                visible - boolean

                                                                                                                                Should this component be displayed?

                                                                                                                                width - string

                                                                                                                                The width of this RadioButton, or “default” to have the width set by the container.


                                                                                                                                RadioButton Events

                                                                                                                                clicked()

                                                                                                                                When this radio button is selected

                                                                                                                                show()

                                                                                                                                When the RadioButton is shown on the screen

                                                                                                                                hide()

                                                                                                                                When the RadioButton is removed from the screen


                                                                                                                                RepeatingPanel (more info)

                                                                                                                                Create a new ‘RepeatingPanel’ object


                                                                                                                                Base class: anvil.Component

                                                                                                                                Constructor

                                                                                                                                RepeatingPanel([item_template=], [items=], [background=], [foreground=], [border=], [visible=], [role=], [width=], [spacing_above=], [spacing_below=], [tooltip=], [tag=])

                                                                                                                                  RepeatingPanel Methods

                                                                                                                                  get_components()

                                                                                                                                  Get the list of components created by this Repeating Panel. Each will be an instance of ‘item_template’, one for each item in ‘items’.

                                                                                                                                  raise_event_on_children(event_name, **event_args)

                                                                                                                                  Trigger the ‘event_name’ event on all children of this component. Any keyword arguments are passed to the handler function.


                                                                                                                                    RepeatingPanel Properties

                                                                                                                                    background - color

                                                                                                                                    The background colour of this component.

                                                                                                                                    border - string

                                                                                                                                    The border of this component. Can take any valid CSS border value.

                                                                                                                                    foreground - color

                                                                                                                                    The foreground colour of this component.

                                                                                                                                    item_template - form

                                                                                                                                    The name of the form to repeat for every item

                                                                                                                                    items - object

                                                                                                                                    A list of items for which the ‘item_template’ will be instantiated.

                                                                                                                                    parent

                                                                                                                                    role - themeRole

                                                                                                                                    Choose how this component can appear, based on your app’s visual theme.

                                                                                                                                    spacing_above - string

                                                                                                                                    The vertical space above this component.

                                                                                                                                    spacing_below - string

                                                                                                                                    The vertical space below this component.

                                                                                                                                    tag - object

                                                                                                                                    Use this property to store any extra information about this component

                                                                                                                                    tooltip - string

                                                                                                                                    Text to display when you hover the mouse over this component

                                                                                                                                    visible - boolean

                                                                                                                                    Should this component be displayed?

                                                                                                                                    width - string

                                                                                                                                    The width of this RepeatingPanel, or “default” to have the width set by the container.


                                                                                                                                    RepeatingPanel Events

                                                                                                                                    show()

                                                                                                                                    When the RepeatingPanel is shown on the screen

                                                                                                                                    hide()

                                                                                                                                    When the RepeatingPanel is removed from the screen


                                                                                                                                    RichText (more info)

                                                                                                                                    Create a new ‘RichText’ object


                                                                                                                                    Base class: anvil.Container

                                                                                                                                    Constructor

                                                                                                                                    RichText([content=], [format=], [data=], [enable_slots=], [align=], [font_size=], [font=], [width=], [spacing_above=], [spacing_below=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                                                                                                      RichText Methods

                                                                                                                                      add_component(component, slot)

                                                                                                                                      Add a component to this panel, in the specified slot

                                                                                                                                        clear([slot="slot_name"])

                                                                                                                                        clear the Rich Text Component of all components or clear a specific slot of components.


                                                                                                                                          RichText Properties

                                                                                                                                          align - string

                                                                                                                                          Align this component’s text

                                                                                                                                          background - color

                                                                                                                                          The background colour of this component.

                                                                                                                                          border - string

                                                                                                                                          The border of this component. Can take any valid CSS border value.

                                                                                                                                          content - string

                                                                                                                                          The content to render in this component, in the format specified by the ‘format’ property

                                                                                                                                          data - object

                                                                                                                                          A dict of data or Components to populate the named content {slots}.

                                                                                                                                          enable_slots - boolean

                                                                                                                                          If true {braces} in content define slots. If false, braces in content display normally.

                                                                                                                                          font - string

                                                                                                                                          The font to use for this component.

                                                                                                                                          font_size - number

                                                                                                                                          The height of text displayed on this component in pixels

                                                                                                                                          foreground - color

                                                                                                                                          The foreground colour of this component.

                                                                                                                                          format - string

                                                                                                                                          The format of the content of this component.

                                                                                                                                          parent

                                                                                                                                          role - themeRole

                                                                                                                                          Choose how this component can appear, based on your app’s visual theme.

                                                                                                                                          spacing_above - string

                                                                                                                                          The vertical space above this component.

                                                                                                                                          spacing_below - string

                                                                                                                                          The vertical space below this component.

                                                                                                                                          tag - object

                                                                                                                                          Use this property to store any extra information about this component

                                                                                                                                          tooltip - string

                                                                                                                                          Text to display when you hover the mouse over this component

                                                                                                                                          visible - boolean

                                                                                                                                          Should this component be displayed?

                                                                                                                                          width - string

                                                                                                                                          The width of this RichText, or “default” to have the width set by the container.


                                                                                                                                          RichText Events

                                                                                                                                          show()

                                                                                                                                          When the RichText is shown on the screen

                                                                                                                                          hide()

                                                                                                                                          When the RichText is removed from the screen


                                                                                                                                          Spacer (more info)

                                                                                                                                          Create a new ‘Spacer’ object


                                                                                                                                          Base class: anvil.Component

                                                                                                                                          Constructor

                                                                                                                                          Spacer([visible=], [width=], [spacing_above=], [spacing_below=], [height=], [tooltip=], [tag=])

                                                                                                                                            Spacer Properties

                                                                                                                                            height - string

                                                                                                                                            The height of this component.

                                                                                                                                            parent

                                                                                                                                            spacing_above - string

                                                                                                                                            The vertical space above this component.

                                                                                                                                            spacing_below - string

                                                                                                                                            The vertical space below this component.

                                                                                                                                            tag - object

                                                                                                                                            Use this property to store any extra information about this component

                                                                                                                                            tooltip - string

                                                                                                                                            Text to display when you hover the mouse over this component

                                                                                                                                            visible - boolean

                                                                                                                                            Should this component be displayed?

                                                                                                                                            width - string

                                                                                                                                            The width of this Spacer, or “default” to have the width set by the container.


                                                                                                                                            Spacer Events

                                                                                                                                            show()

                                                                                                                                            When the Spacer is shown on the screen

                                                                                                                                            hide()

                                                                                                                                            When the Spacer is removed from the screen


                                                                                                                                            TextArea (more info)

                                                                                                                                            Create a new ‘TextArea’ object


                                                                                                                                            Base class: anvil.Component

                                                                                                                                            Constructor

                                                                                                                                            TextArea([placeholder=], [auto_expand=], [width=], [spacing_above=], [spacing_below=], [height=], [text=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [enabled=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                                                                                                              TextArea Methods

                                                                                                                                              focus()

                                                                                                                                              Set the keyboard focus to this TextArea

                                                                                                                                              select()

                                                                                                                                              Select all the text in this TextArea


                                                                                                                                              TextArea Properties

                                                                                                                                              align - string

                                                                                                                                              Align this component’s text

                                                                                                                                              auto_expand - boolean

                                                                                                                                              If true, the text area will expand vertically to fit its contents

                                                                                                                                              background - color

                                                                                                                                              The background colour of this component.

                                                                                                                                              bold - boolean

                                                                                                                                              Display this component’s text in bold

                                                                                                                                              border - string

                                                                                                                                              The border of this component. Can take any valid CSS border value.

                                                                                                                                              enabled - boolean

                                                                                                                                              True if this component should allow user interaction.

                                                                                                                                              font - string

                                                                                                                                              The font to use for this component.

                                                                                                                                              font_size - number

                                                                                                                                              The height of text displayed on this component in pixels

                                                                                                                                              foreground - color

                                                                                                                                              The foreground colour of this component.

                                                                                                                                              height - string

                                                                                                                                              The height of this component.

                                                                                                                                              italic - boolean

                                                                                                                                              Display this component’s text in italics

                                                                                                                                              parent

                                                                                                                                              placeholder - string

                                                                                                                                              The text to be displayed when the component is empty.

                                                                                                                                              role - themeRole

                                                                                                                                              Choose how this component can appear, based on your app’s visual theme.

                                                                                                                                              spacing_above - string

                                                                                                                                              The vertical space above this component.

                                                                                                                                              spacing_below - string

                                                                                                                                              The vertical space below this component.

                                                                                                                                              tag - object

                                                                                                                                              Use this property to store any extra information about this component

                                                                                                                                              text - string

                                                                                                                                              The text displayed on this component

                                                                                                                                              tooltip - string

                                                                                                                                              Text to display when you hover the mouse over this component

                                                                                                                                              underline - boolean

                                                                                                                                              Display this component’s text underlined

                                                                                                                                              visible - boolean

                                                                                                                                              Should this component be displayed?

                                                                                                                                              width - string

                                                                                                                                              The width of this TextArea, or “default” to have the width set by the container.


                                                                                                                                              TextArea Events

                                                                                                                                              change()

                                                                                                                                              When the text in this text area is edited

                                                                                                                                              show()

                                                                                                                                              When the TextArea is shown on the screen

                                                                                                                                              hide()

                                                                                                                                              When the TextArea is removed from the screen

                                                                                                                                              focus()

                                                                                                                                              When the TextArea gets focus

                                                                                                                                              lost_focus()

                                                                                                                                              When the TextArea loses focus


                                                                                                                                              TextBox (more info)

                                                                                                                                              Create a new ‘TextBox’ object


                                                                                                                                              Base class: anvil.Component

                                                                                                                                              Constructor

                                                                                                                                              TextBox([placeholder=], [hide_text=], [type=], [width=], [spacing_above=], [spacing_below=], [text=], [align=], [font_size=], [font=], [bold=], [italic=], [underline=], [enabled=], [background=], [foreground=], [border=], [visible=], [role=], [tooltip=], [tag=])

                                                                                                                                                TextBox Methods

                                                                                                                                                focus()

                                                                                                                                                Set the keyboard focus to this TextBox

                                                                                                                                                select()

                                                                                                                                                Select the text in this TextBox


                                                                                                                                                TextBox Properties

                                                                                                                                                align - string

                                                                                                                                                Align this component’s text

                                                                                                                                                background - color

                                                                                                                                                The background colour of this component.

                                                                                                                                                bold - boolean

                                                                                                                                                Display this component’s text in bold

                                                                                                                                                border - string

                                                                                                                                                The border of this component. Can take any valid CSS border value.

                                                                                                                                                enabled - boolean

                                                                                                                                                True if this component should allow user interaction.

                                                                                                                                                font - string

                                                                                                                                                The font to use for this component.

                                                                                                                                                font_size - number

                                                                                                                                                The height of text displayed on this component in pixels

                                                                                                                                                foreground - color

                                                                                                                                                The foreground colour of this component.

                                                                                                                                                hide_text - boolean

                                                                                                                                                Display stars instead of the text in this box

                                                                                                                                                italic - boolean

                                                                                                                                                Display this component’s text in italics

                                                                                                                                                parent

                                                                                                                                                placeholder - string

                                                                                                                                                The text to be displayed when the component is empty.

                                                                                                                                                role - themeRole

                                                                                                                                                Choose how this component can appear, based on your app’s visual theme.

                                                                                                                                                spacing_above - string

                                                                                                                                                The vertical space above this component.

                                                                                                                                                spacing_below - string

                                                                                                                                                The vertical space below this component.

                                                                                                                                                tag - object

                                                                                                                                                Use this property to store any extra information about this component

                                                                                                                                                text - string

                                                                                                                                                The text displayed on this component

                                                                                                                                                tooltip - string

                                                                                                                                                Text to display when you hover the mouse over this component

                                                                                                                                                type - string

                                                                                                                                                What type of data will be entered into this box?

                                                                                                                                                underline - boolean

                                                                                                                                                Display this component’s text underlined

                                                                                                                                                visible - boolean

                                                                                                                                                Should this component be displayed?

                                                                                                                                                width - string

                                                                                                                                                The width of this TextBox, or “default” to have the width set by the container.


                                                                                                                                                TextBox Events

                                                                                                                                                change()

                                                                                                                                                When the text in this text box is edited

                                                                                                                                                pressed_enter()

                                                                                                                                                When the user presses Enter in this text box

                                                                                                                                                show()

                                                                                                                                                When the TextBox is shown on the screen

                                                                                                                                                hide()

                                                                                                                                                When the TextBox is removed from the screen

                                                                                                                                                focus()

                                                                                                                                                When the TextBox gets focus

                                                                                                                                                lost_focus()

                                                                                                                                                When the TextBox loses focus


                                                                                                                                                Timer (more info)

                                                                                                                                                Create a new ‘Timer’ object


                                                                                                                                                Base class: anvil.Component

                                                                                                                                                Constructor

                                                                                                                                                Timer([interval=])

                                                                                                                                                  Timer Properties

                                                                                                                                                  interval - number

                                                                                                                                                  The number of seconds between each tick. 0 switches the timer off.

                                                                                                                                                  parent


                                                                                                                                                  Timer Events

                                                                                                                                                  tick()

                                                                                                                                                  Every [interval] seconds. Does not trigger if [interval] is 0.

                                                                                                                                                  show()

                                                                                                                                                  When this timer's form is shown on the screen (or it is added to a visible form)

                                                                                                                                                  hide()

                                                                                                                                                  When this timer's form is hidden from the screen (or it is removed from a visible form)


                                                                                                                                                  URLMedia

                                                                                                                                                  Create a Media object representing the data at a specific URL. Caution: Getting data from URLs directly in your code will often fail for security reasons, or fail to handle binary data.


                                                                                                                                                  Base class: anvil.Media

                                                                                                                                                  Constructor

                                                                                                                                                  URLMedia(url)

                                                                                                                                                    XYPanel (more info)

                                                                                                                                                    Create a new ‘XYPanel’ object


                                                                                                                                                    Base class: anvil.Container

                                                                                                                                                    Constructor

                                                                                                                                                    XYPanel([width=], [spacing_above=], [spacing_below=], [height=], [background=], [foreground=], [border=], [visible=], [role=], [align=], [tooltip=], [tag=])

                                                                                                                                                      XYPanel Methods

                                                                                                                                                      add_component(component, [x=0], [y=0], [width=None])

                                                                                                                                                      Add a component to this XYPanel, at the specified coordinates. If the component’s width is not specified, uses the component’s default width.

                                                                                                                                                        get_width() → number

                                                                                                                                                        Get the width of this XYPanel, in pixels.


                                                                                                                                                        XYPanel Properties

                                                                                                                                                        align - string

                                                                                                                                                        Align this component’s content

                                                                                                                                                        background - color

                                                                                                                                                        The background colour of this component.

                                                                                                                                                        border - string

                                                                                                                                                        The border of this component. Can take any valid CSS border value.

                                                                                                                                                        foreground - color

                                                                                                                                                        The foreground colour of this component.

                                                                                                                                                        height - string

                                                                                                                                                        The height of this component.

                                                                                                                                                        parent

                                                                                                                                                        role - themeRole

                                                                                                                                                        Choose how this component can appear, based on your app’s visual theme.

                                                                                                                                                        spacing_above - string

                                                                                                                                                        The vertical space above this component.

                                                                                                                                                        spacing_below - string

                                                                                                                                                        The vertical space below this component.

                                                                                                                                                        tag - object

                                                                                                                                                        Use this property to store any extra information about this component

                                                                                                                                                        tooltip - string

                                                                                                                                                        Text to display when you hover the mouse over this component

                                                                                                                                                        visible - boolean

                                                                                                                                                        Should this component be displayed?

                                                                                                                                                        width - string

                                                                                                                                                        The width of this XYPanel, or “default” to have the width set by the container.


                                                                                                                                                        XYPanel Events

                                                                                                                                                        show()

                                                                                                                                                        When the XYPanel is shown on the screen

                                                                                                                                                        hide()

                                                                                                                                                        When the XYPanel is removed from the screen


                                                                                                                                                        YouTubeVideo (more info)

                                                                                                                                                        Create a new ‘YouTubeVideo’ object


                                                                                                                                                        Base class: anvil.Component

                                                                                                                                                        Constructor

                                                                                                                                                        YouTubeVideo([youtube_id=], [autoplay=], [loop=], [current_time=], [volume=], [state=], [duration=], [mute=], [width=], [spacing_above=], [spacing_below=], [height=], [background=], [foreground=], [border=], [visible=], [role=], [tag=])

                                                                                                                                                          YouTubeVideo Methods

                                                                                                                                                          pause()

                                                                                                                                                          Pause this YouTube video

                                                                                                                                                          play()

                                                                                                                                                          Start playing this YouTube video

                                                                                                                                                          stop()

                                                                                                                                                          Stop playing this YouTube video


                                                                                                                                                          YouTubeVideo Properties

                                                                                                                                                          autoplay - boolean

                                                                                                                                                          Set to true to play this video immediately

                                                                                                                                                          background - color

                                                                                                                                                          The background colour of this component.

                                                                                                                                                          border - string

                                                                                                                                                          The border of this component. Can take any valid CSS border value.

                                                                                                                                                          current_time - object

                                                                                                                                                          Get or set the current playback position, in seconds.

                                                                                                                                                          duration - object

                                                                                                                                                          Get the duration of the video in seconds.

                                                                                                                                                          foreground - color

                                                                                                                                                          The foreground colour of this component.

                                                                                                                                                          height - string

                                                                                                                                                          The height of this component.

                                                                                                                                                          loop - boolean

                                                                                                                                                          Set to true to play this video repeatedly

                                                                                                                                                          mute - boolean

                                                                                                                                                          Set whether the video is muted or not.

                                                                                                                                                          parent

                                                                                                                                                          role - themeRole

                                                                                                                                                          Choose how this component can appear, based on your app’s visual theme.

                                                                                                                                                          spacing_above - string

                                                                                                                                                          The vertical space above this component.

                                                                                                                                                          spacing_below - string

                                                                                                                                                          The vertical space below this component.

                                                                                                                                                          state - object

                                                                                                                                                          Get the current playback state of the video as a string. E.g. PLAYING

                                                                                                                                                          tag - object

                                                                                                                                                          Use this property to store any extra information about this component

                                                                                                                                                          visible - boolean

                                                                                                                                                          Should this component be displayed?

                                                                                                                                                          volume - object

                                                                                                                                                          Get or set the current volume, from 0 - 100.

                                                                                                                                                          width - string

                                                                                                                                                          The width of this YouTubeVideo, or “default” to have the width set by the container.

                                                                                                                                                          youtube_id - string

                                                                                                                                                          The ID of the YouTube video to play


                                                                                                                                                          YouTubeVideo Events

                                                                                                                                                          state_change(state)

                                                                                                                                                          When the video changes state (eg PAUSED to PLAYING)

                                                                                                                                                          • state - The new state of the video (values from the YouTube API)

                                                                                                                                                          show()

                                                                                                                                                          When this video is shown on the screen (or it is added to a visible form)

                                                                                                                                                          hide()

                                                                                                                                                          When this video is hidden from the screen (or it is removed from a visible form)


                                                                                                                                                          Functions

                                                                                                                                                          alert(content, [title=""], [buttons=], [large=False], [dismissible=True], [role=])

                                                                                                                                                          Pop up an alert box. By default, it will have a single “OK” button which will return True when clicked.


                                                                                                                                                            confirm(content, [title=""], [buttons=], [large=False], [dismissible=False], [role=])

                                                                                                                                                            Pop up a confirmation box. By default, it will have “Yes” and “No” buttons which will return True and False respectively when clicked.


                                                                                                                                                              download(media)

                                                                                                                                                              Download the given Media Object immediately in the user’s browser.


                                                                                                                                                                get_focused_component() → anvil.Component instance

                                                                                                                                                                Get the currently focused Anvil component, or None if focus is not in a component.


                                                                                                                                                                get_open_form()

                                                                                                                                                                Returns the form most recently opened with open_form().


                                                                                                                                                                get_url_hash()

                                                                                                                                                                Get the decoded hash (the part after the ‘#’ character) of the URL used to open this app. If the first character of the hash is a question mark (eg ‘#?a=foo&b=bar’), it will be interpreted as query-string-type parameters and returned as a dictionary (eg {‘a’: ‘foo’, ‘b’: ‘bar’}).


                                                                                                                                                                is_server_side() → boolean

                                                                                                                                                                Check whether Anvil is running server side or not.


                                                                                                                                                                open_form(form, *args, **kwargs)

                                                                                                                                                                Open the specified form as a new page.

                                                                                                                                                                If ‘form’ is a string, a new form will be created (extra arguments will be passed to its constructor). If ‘form’ is a Form object, it will be opened directly.


                                                                                                                                                                  set_default_error_handling(handler_fn)

                                                                                                                                                                  Set a function to be called when an uncaught exception occurs. If set to None, a pop-up will appear letting the user know that an error has occurred.


                                                                                                                                                                    Globals

                                                                                                                                                                    app

                                                                                                                                                                    Information about the current app, as an instance of anvil.AppInfo