Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
Subclass - ControlEdit

Classes

class  XBMCAddon::xbmcgui::ControlEdit
 

Functions

 XBMCAddon::xbmcgui::ControlEdit::setLabel (...)
 

Function: setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor, label2])


Sets text heading for this edit control.
 
 XBMCAddon::xbmcgui::ControlEdit::getLabel ()
 

Function: getLabel()


Returns the text heading for this edit control.
 
 XBMCAddon::xbmcgui::ControlEdit::setText (...)
 

Function: setText(value)


Sets text value for this edit control.
 
 XBMCAddon::xbmcgui::ControlEdit::getText ()
 

Function: getText()


Returns the text value for this edit control.
 
 XBMCAddon::xbmcgui::ControlEdit::setType (...)
 

Function: setType(type, heading)


Sets the type of this edit control.
 

Detailed Description

Used as an input control for the osd keyboard and other input fields.

Class: ControlEdit(x, y, width, height, label[, font, textColor, /// disabledColor, alignment, focusTexture, noFocusTexture])

    The edit control allows a user to input text in Kodi. You can choose the
    font, size, colour, location and header of the text to be displayed.

    @note This class include also all calls from \ref python_xbmcgui_control "Control"

    @param x                    integer - x coordinate of control.
    @param y                    integer - y coordinate of control.
    @param width                integer - width of control.
    @param height               integer - height of control.
    @param label                string or unicode - text string.
    @param font                 [opt] string - font used for label text.
                                    (e.g. 'font13')
    @param textColor            [opt] hexstring - color of enabled
                                    label's label. (e.g. '0xFFFFFFFF')
    @param disabledColor        [opt] hexstring - color of disabled
                                    label's label. (e.g. '0xFFFF3300')
    @param alignment            [opt] integer - alignment of label
    - \ref kodi_gui_font_alignment "Flags for alignment" used as bits to have several together:
    | Definition name   |   Bitflag  | Description                         |
    |-------------------|:----------:|:------------------------------------|
    | XBFONT_LEFT       | 0x00000000 | Align X left
    | XBFONT_RIGHT      | 0x00000001 | Align X right
    | XBFONT_CENTER_X   | 0x00000002 | Align X center
    | XBFONT_CENTER_Y   | 0x00000004 | Align Y center
    | XBFONT_TRUNCATED  | 0x00000008 | Truncated text
    | XBFONT_JUSTIFIED  | 0x00000010 | Justify text
    | XBFONT_TRUNCATED_LEFT | 0x00000020 | Truncated text from left
    @param focusTexture         [opt] string - filename for focus texture.
    @param noFocusTexture       [opt] string - filename for no focus texture.

    @note You can use the above as keywords for arguments and skip certain
    optional arguments.\n
    Once you use a keyword, all following arguments require the keyword.\n
    After you create the control, you need to add it to the window with
    addControl().\n



   -------------------------------------------------------------------------
    \xrefitem python_v18 "v18 Python API changes" ""  Deprecated **isPassword**
    \xrefitem python_v19 "v19 Python API changes" ""  Removed **isPassword**

    **Example:**
    ~~~~~~~~~~~~~{.py}
    ...
    self.edit = xbmcgui.ControlEdit(100, 250, 125, 75, 'Status')
    ...
    ~~~~~~~~~~~~~

Function Documentation

◆ getLabel()

String XBMCAddon::xbmcgui::ControlEdit::getLabel ( )

Function: getLabel()


Returns the text heading for this edit control.

Returns
Heading text

Example:

...
label = self.edit.getLabel()
...

◆ getText()

String XBMCAddon::xbmcgui::ControlEdit::getText ( )

Function: getText()


Returns the text value for this edit control.

Returns
Text value of control

v14 Python API changes
New function added.

Example:

...
value = self.edit.getText()
...

◆ setLabel()

void XBMCAddon::xbmcgui::ControlEdit::setLabel ( ...)

Function: setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor, label2])


Sets text heading for this edit control.

Parameters
labelstring or unicode - text string.
font[opt] string - font used for label text. (e.g. 'font13')
textColor[opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')
disabledColor[opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')
shadowColor[opt] hexstring - color of button's label's shadow. (e.g. '0xFF000000')
focusedColor[opt] hexstring - color of focused button's label. (e.g. '0xFF00FFFF')
label2[opt] string or unicode - text string.

Example:

...
self.edit.setLabel('Status')
...

◆ setText()

void XBMCAddon::xbmcgui::ControlEdit::setText ( ...)

Function: setText(value)


Sets text value for this edit control.

Parameters
valuestring or unicode - text string.

Example:

...
self.edit.setText('online')
...

◆ setType()

void XBMCAddon::xbmcgui::ControlEdit::setType ( ...)

Function: setType(type, heading)


Sets the type of this edit control.

Parameters
typeinteger - type of the edit control.
Param Definition
xbmcgui.INPUT_TYPE_TEXT (standard keyboard)
xbmcgui.INPUT_TYPE_NUMBER (format: #)
xbmcgui.INPUT_TYPE_DATE (format: DD/MM/YYYY)
xbmcgui.INPUT_TYPE_TIME (format: HH:MM)
xbmcgui.INPUT_TYPE_IPADDRESS (format: #.#.#.#)
xbmcgui.INPUT_TYPE_PASSWORD (input is masked)
xbmcgui.INPUT_TYPE_PASSWORD_MD5 (input is masked, return md5 hash of input)
xbmcgui.INPUT_TYPE_SECONDS (format: SS or MM:SS or HH:MM:SS or MM min)
xbmcgui.INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW (numeric input is masked)
headingstring or unicode - heading that will be used for to numeric or keyboard dialog when the edit control is clicked.

v18 Python API changes
New function added.
v19 Python API changes
New option added to mask numeric input.

Example:

...
self.edit.setType(xbmcgui.INPUT_TYPE_TIME, 'Please enter the time')
...