Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/images/checkbox_false.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/checkbox_multiple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/checkbox_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/combobox_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/combobox_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/date.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/datetime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/line_edit_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/line_edit_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/line_edit_password_after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/line_edit_password_before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/push_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/push_button_multiple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/radio_buttons_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/radio_buttons_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/separator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/text_edit_default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/text_edit_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/text_red_bold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Contents:

overview
installation
widgets
examples/index
reference/index

Expand Down
223 changes: 223 additions & 0 deletions doc/widgets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
=======
Widgets
=======

Separator
=========

The label and the value must be ``None``.

label: ``None``
value: ``None``

.. image:: /images/separator.png

Text
====

The label must be ``None`` and the value can be any string.

label: ``None``
value: ``Some text``

.. image:: /images/text.png

The text can be formatted.

label: ``None``
value: ``Some <b><font color="red">red bold</font></b> text``

.. image:: /images/text_red_bold.png

Push button
===========

The label must be ``None`` and the value a list or a tuple of binomials.
The first element is the button label, the second is the callback function.

label: ``None``
value: ``[('Push !', push_function)]``

.. image:: /images/push_button.png

The ``&`` char can be used to specify a keyboard shortcut.

label: ``None``
value: ``[('fi&rst', first_function), ('s&econd', second_function)]``

.. image:: /images/push_button_multiple.png

Line edit
=========

Empty line edit
---------------

The value must be an empty string.

label: ``'Name'``
value: ``''``

.. image:: /images/line_edit_empty.png

Line edit with default content
------------------------------

The value can be any string excluding reserved strings.

label: ``'Name'``
value: ``'Florent'``

.. image:: /images/line_edit_default.png

Line edit for password
----------------------

The value must be the string ``password``.

label: ``'Password'``
value: ``'password'``

Before typing:

.. image:: /images/line_edit_password_before.png

After typing:

.. image:: /images/line_edit_password_after.png

Text edit
=========

Empty text edit
---------------

The value must be the string ``\n``.

label: ``'Motivation'``
value: ``'\n'``

.. image:: /images/text_edit_empty.png

Text edit with default content
------------------------------

The value can be any string with at least one ``\n`` inside.

label: ``'Name'``
value: ``'This is why\n'``

.. image:: /images/text_edit_default.png

Checkbox
========

Single checkbox
---------------

The value must be ``True`` or ``False``.

label: ``'False'``
value: ``False``

.. image:: /images/checkbox_false.png

label: ``'True'``
value: ``True``

.. image:: /images/checkbox_true.png

Multiple checkbox
-----------------

The value must be a list or a tuple of strings whose the first element is a bit string.

label: ``'Fruits'``
value: ``['0b101', 'Apple', 'Orange', 'Banana']``

.. image:: /images/checkbox_multiple.png

Radio buttons
=============

The value must be a tuple of strings whose the first element is an integer.

Empty radio buttons
-------------------

The index must be ``0``.

label: ``'Fruit'``
value: ``(0, 'Apple', 'Orange', 'Banana')``

.. image:: /images/radio_buttons_empty.png

Radio buttons with default choice
---------------------------------

The index must be the one of the chosen item.

label: ``'Fruit'``
value: ``(2, 'Apple', 'Orange', 'Banana')``

.. image:: /images/radio_buttons_default.png

Combobox
========

The value must be a list of strings whose the first element is an integer.

Empty combobox
--------------

The index must be ``0``.

label: ``'Fruit'``
value: ``[0, 'Apple', 'Orange', 'Banana']``

.. image:: /images/combobox_empty.png

Combobox with default choice
----------------------------

The index must be the one of the chosen item.

label: ``'Fruit'``
value: ``[2, 'Apple', 'Orange', 'Banana']``

.. image:: /images/combobox_default.png

Date and time
=============

You must use the ``datetime`` module of the Python's standard library.

Date
----

The value must be a ``datetime.date`` object.

label: ``'date'``
value: ``datetime.date(2010, 10, 10)``

.. image:: /images/date.png

Time
----

The value must be a ``datetime.time`` object.

label: ``'time'``
value: ``datetime.time(12, 30)``

.. image:: /images/time.png

Datetime
--------

The value must be a ``datetime.datetime`` object.

label: ``'datetime'``
value: ``datetime.datetime(2010, 10, 10, 12, 30)``

.. image:: /images/datetime.png