diff --git a/doc/images/checkbox_false.png b/doc/images/checkbox_false.png new file mode 100644 index 0000000..3b96dcf Binary files /dev/null and b/doc/images/checkbox_false.png differ diff --git a/doc/images/checkbox_multiple.png b/doc/images/checkbox_multiple.png new file mode 100644 index 0000000..27895ae Binary files /dev/null and b/doc/images/checkbox_multiple.png differ diff --git a/doc/images/checkbox_true.png b/doc/images/checkbox_true.png new file mode 100644 index 0000000..8989d05 Binary files /dev/null and b/doc/images/checkbox_true.png differ diff --git a/doc/images/combobox_default.png b/doc/images/combobox_default.png new file mode 100644 index 0000000..efc9767 Binary files /dev/null and b/doc/images/combobox_default.png differ diff --git a/doc/images/combobox_empty.png b/doc/images/combobox_empty.png new file mode 100644 index 0000000..d095a7b Binary files /dev/null and b/doc/images/combobox_empty.png differ diff --git a/doc/images/date.png b/doc/images/date.png new file mode 100644 index 0000000..2592f57 Binary files /dev/null and b/doc/images/date.png differ diff --git a/doc/images/datetime.png b/doc/images/datetime.png new file mode 100644 index 0000000..0b7cece Binary files /dev/null and b/doc/images/datetime.png differ diff --git a/doc/images/line_edit_default.png b/doc/images/line_edit_default.png new file mode 100644 index 0000000..6a8cc4e Binary files /dev/null and b/doc/images/line_edit_default.png differ diff --git a/doc/images/line_edit_empty.png b/doc/images/line_edit_empty.png new file mode 100644 index 0000000..eaba0a4 Binary files /dev/null and b/doc/images/line_edit_empty.png differ diff --git a/doc/images/line_edit_password_after.png b/doc/images/line_edit_password_after.png new file mode 100644 index 0000000..120cfcb Binary files /dev/null and b/doc/images/line_edit_password_after.png differ diff --git a/doc/images/line_edit_password_before.png b/doc/images/line_edit_password_before.png new file mode 100644 index 0000000..4808f1a Binary files /dev/null and b/doc/images/line_edit_password_before.png differ diff --git a/doc/images/push_button.png b/doc/images/push_button.png new file mode 100644 index 0000000..d1651f9 Binary files /dev/null and b/doc/images/push_button.png differ diff --git a/doc/images/push_button_multiple.png b/doc/images/push_button_multiple.png new file mode 100644 index 0000000..9f5d56b Binary files /dev/null and b/doc/images/push_button_multiple.png differ diff --git a/doc/images/radio_buttons_default.png b/doc/images/radio_buttons_default.png new file mode 100644 index 0000000..36ea204 Binary files /dev/null and b/doc/images/radio_buttons_default.png differ diff --git a/doc/images/radio_buttons_empty.png b/doc/images/radio_buttons_empty.png new file mode 100644 index 0000000..c4303cb Binary files /dev/null and b/doc/images/radio_buttons_empty.png differ diff --git a/doc/images/separator.png b/doc/images/separator.png new file mode 100644 index 0000000..b3e8d5a Binary files /dev/null and b/doc/images/separator.png differ diff --git a/doc/images/text.png b/doc/images/text.png new file mode 100644 index 0000000..8c8d68f Binary files /dev/null and b/doc/images/text.png differ diff --git a/doc/images/text_edit_default.png b/doc/images/text_edit_default.png new file mode 100644 index 0000000..b9d7cbc Binary files /dev/null and b/doc/images/text_edit_default.png differ diff --git a/doc/images/text_edit_empty.png b/doc/images/text_edit_empty.png new file mode 100644 index 0000000..9db1c13 Binary files /dev/null and b/doc/images/text_edit_empty.png differ diff --git a/doc/images/text_red_bold.png b/doc/images/text_red_bold.png new file mode 100644 index 0000000..156f81f Binary files /dev/null and b/doc/images/text_red_bold.png differ diff --git a/doc/images/time.png b/doc/images/time.png new file mode 100644 index 0000000..dc5147e Binary files /dev/null and b/doc/images/time.png differ diff --git a/doc/index.rst b/doc/index.rst index fec3970..5894ea7 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -22,6 +22,7 @@ Contents: overview installation + widgets examples/index reference/index diff --git a/doc/widgets.rst b/doc/widgets.rst new file mode 100644 index 0000000..2f14dbc --- /dev/null +++ b/doc/widgets.rst @@ -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 red bold 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