Dialogs

Provides CustomDialog and ReplacementItemsContent.

class acg.custom_widgets.dialogs.CustomContentBase[source]

Base-class to be used for instances of CustomDialog.content_cls.

get_result(self)[source]

Placeholder-function.

class acg.custom_widgets.dialogs.CustomDialog(**kwargs)[source]

Bases: kivymd.uix.dialog.MDDialog

Custom dialog.

auto_dismiss = False[source]

Do not dismiss on click outside the dialog.

button_cls_name[source]

StringProperty defaults to "DialogButton".

button_texts[source]

ListProperty defaults to ["OK", "CANCEL"].

callback[source]

ObjectProperty defaults to None.

on_button_press(self, obj, callback_txt=None)[source]

Call CustomDialog.callback().

The arguments are the text of the pressed button and the result of content_cls.``get_result``.

on_item_press(self, content, item)[source]

Placeholder-function.

set_data(self, data)[source]

Set data of content_cls.

class acg.custom_widgets.dialogs.ItemsContent(**kwargs)[source]

Bases: acg.custom_widgets.scroll_widgets.ScrollList, acg.custom_widgets.dialogs.CustomContentBase

Scrollable list of items.

Items dispatch on_press-events and itself dispatches on_item_press event.

data[source]

ListProperty.

on_item_press(self, *_)[source]

Placeholder-function.

class acg.custom_widgets.dialogs.ReplacementDialog(**kwargs)[source]

Bases: acg.custom_widgets.dialogs.CustomDialog

Dialog with optional replacements.

class acg.custom_widgets.dialogs.ReplacementItem(**kwargs)[source]

Bases: kivy.uix.behaviors.ButtonBehavior, kivy.uix.boxlayout.BoxLayout

Item displaying a word (word) and a possible replacement (lemma).

lemma can be edited and the selection of word vs replacement switches on click.

edit[source]

BooleanProperty defaults to False. While True the lemma can be edited.

lemma[source]

StringProperty defaults to "".

on_press(self, *_)[source]

Placeholder-function.

take_lemma[source]

BooleanProperty defaults to False. Indicates user choice.

word[source]

StringProperty defaults to "".

class acg.custom_widgets.dialogs.ReplacementItemsContent(**kwargs)[source]

Bases: acg.custom_widgets.dialogs.ItemsContent

Content for the ReplacementDialog.

child_class_name[source]

StringProperty defaults to "ReplacementItem".

get_result(self)[source]

Get user selection.

class acg.custom_widgets.dialogs.ScrollList(**kwargs)[source]

Bases: acg.custom_widgets.behaviors.ChildrenFromDataBehavior, kivy.uix.scrollview.ScrollView

Scrollable List whose items are constructed as instances of item_type from item_dicts.

Automatically updates upon change of item_dicts.

data

ListProperty containing the dictionaries from which the items are constructed.

list

ObjectProperty set to MDList. Contains the items.

class acg.custom_widgets.dialogs.TextFieldContent(**kwargs)[source]

Bases: acg.custom_widgets.dialogs.CustomContentBase, kivy.uix.boxlayout.BoxLayout

kivy.uix.BoxLayout containing a kivymd.uix.MDTextField.

For use as:attr:kivymd.uix.dialog.content_cls.

focus(self)[source]

Focus text-input.

get_result(self)[source]

Return current entry of the text_field.

on_parent(self, *_)[source]

Call focus().

class acg.custom_widgets.dialogs.TextInputDialog(**kwargs)[source]

Bases: acg.custom_widgets.dialogs.CustomDialog

Dialog with one text field.

default_text[source]

defaults to “”, the default text entry in the :~kivymd.uix.MDTextField:.

Type:StringProperty