|
pycrossword
0.3
Pure-Python implementation of a crossword puzzle generator and editor
|
Small dialog window to look for words matching a given pattern among the word sources. More...
Public Member Functions | |
| def | __init__ (self, mainwindow, word='', word_editable=False, getresults=None, parent=None, flags=QtCore.Qt.WindowFlags()) |
| Constructor. More... | |
| def | addMainLayout (self) |
| Creates the main (central) layout for controls. More... | |
| def | showEvent (self, event) |
| Fires when the dialog shows up. More... | |
| def | closeEvent (self, event) |
| Fires when the dialog closes. More... | |
| def | init (self, word='', word_editable=False) |
| Creates and initializes members. More... | |
| def | validate (self) |
| Checks that a suggestion is selected before quitting. More... | |
| def | fill_words (self) |
| Retrieves suggestions and fills them into the list box. More... | |
| def | update_actions (self) |
| Enables / disables actions depending on the number of returned suggestions. More... | |
| def | sort_words (self, order='') |
| Sorts the suggestions in the list box. More... | |
| def | on_ch_truncate (self, checked) |
| When the 'Truncate' checkbox is (un)checked. More... | |
| def | on_word_edited (self, text) |
| When the word pattern is edited: store the new pattern. More... | |
| def | on_word_dblclick (self, item) |
| When a suggestion is double-clicked: select it and quit. More... | |
| def | on_act_refresh (self, checked) |
| Refresh action handler: update suggestions. More... | |
| def | on_act_sort (self, checked) |
| Sort action handler: sort suggestions. More... | |
| def | on_act_shuffle (self, checked) |
| Shuffle action handler: shuffle suggestions randomly. More... | |
| def | on_act_source_config (self, checked) |
| Word source settings action: show word source management page in settings dialog. More... | |
Public Member Functions inherited from pycross.forms.BasicDialog | |
| def | initUI (self, geometry=None, title=None, icon=None) |
| Creates the core controls: OK and Cancel buttons and layouts. More... | |
| def | on_btn_OK_clicked (self) |
| Fires when the OK button is clicked. More... | |
| def | on_btn_cancel_clicked (self) |
| Fires when the Cancel button is clicked: rejects input and closes window. More... | |
Public Attributes | |
| mainwindow | |
QtWidgets.QMainWindow pointer to gui::MainWindow instance More... | |
| sortdir | |
str suggestions sort order: 'A' = ascending, 'D' = descending More... | |
| word | |
str word pattern to find suggestions for More... | |
| word_editable | |
bool whether the word string can be edited directly in the dialog More... | |
| getresults | |
callable pointer to function that retrieves word suggestions More... | |
| results | |
list list of retrieved suggestions (word strings) More... | |
| selected | |
str the selected word (from the suggested list) More... | |
| layout_controls | |
| layout_top | |
| l_word | |
| le_word | |
| layout_center | |
| lw_words | |
| tb_actions | |
| act_refresh | |
| act_sort | |
| act_shuffle | |
| act_source_config | |
| l_count | |
| ch_truncate | |
| layout_lower | |
| old_truncate | |
Public Attributes inherited from pycross.forms.BasicDialog | |
| layout_controls | |
QtWidgets.QFormLayout central layout for controls More... | |
| btn_OK | |
QtWidgets.QPushButton OK button More... | |
| btn_cancel | |
QtWidgets.QPushButton Cancel button More... | |
| layout_bottom | |
QtWidgets.QHBoxLayout bottom layout for OK and Cancel buttons More... | |
| layout_main | |
QtWidgets.QVBoxLayout window layout More... | |
Small dialog window to look for words matching a given pattern among the word sources.
| def pycross.forms.WordSuggestDialog.__init__ | ( | self, | |
| mainwindow, | |||
word = '', |
|||
word_editable = False, |
|||
getresults = None, |
|||
parent = None, |
|||
flags = QtCore.Qt.WindowFlags() |
|||
| ) |
Constructor.
| mainwindow | QtWidgets.QMainWindow pointer to gui::MainWindow instance |
| word | str the word pattern to look up in suggestions, e.g. 'f_th__' |
| word_editable | bool whether the word string can be edited directly in the dialog (default = False) |
| getresults | callable pointer to function that retrieves word suggestions. This function takes one argument (the word pattern string) and returns suggestions as a list of strings. |
| parent | QtWidgets.QWidget parent widget (default = None, i.e. no parent) |
| flags | QtCore.Qt.WindowFlags Qt window flags |
Reimplemented from pycross.forms.BasicDialog.
| def pycross.forms.WordSuggestDialog.addMainLayout | ( | self | ) |
Creates the main (central) layout for controls.
Must be overridden by child classes to change the layout type (default = QtWidgets.QFormLayout) and add controls.
Reimplemented from pycross.forms.BasicDialog.
| def pycross.forms.WordSuggestDialog.closeEvent | ( | self, | |
| event | |||
| ) |
Fires when the dialog closes.
| def pycross.forms.WordSuggestDialog.fill_words | ( | self | ) |
Retrieves suggestions and fills them into the list box.
| def pycross.forms.WordSuggestDialog.init | ( | self, | |
word = '', |
|||
word_editable = False |
|||
| ) |
Creates and initializes members.
| def pycross.forms.WordSuggestDialog.on_act_refresh | ( | self, | |
| checked | |||
| ) |
Refresh action handler: update suggestions.
| def pycross.forms.WordSuggestDialog.on_act_shuffle | ( | self, | |
| checked | |||
| ) |
Shuffle action handler: shuffle suggestions randomly.
| def pycross.forms.WordSuggestDialog.on_act_sort | ( | self, | |
| checked | |||
| ) |
Sort action handler: sort suggestions.
| def pycross.forms.WordSuggestDialog.on_act_source_config | ( | self, | |
| checked | |||
| ) |
Word source settings action: show word source management page in settings dialog.
| def pycross.forms.WordSuggestDialog.on_ch_truncate | ( | self, | |
| checked | |||
| ) |
When the 'Truncate' checkbox is (un)checked.
| def pycross.forms.WordSuggestDialog.on_word_dblclick | ( | self, | |
| item | |||
| ) |
When a suggestion is double-clicked: select it and quit.
| def pycross.forms.WordSuggestDialog.on_word_edited | ( | self, | |
| text | |||
| ) |
When the word pattern is edited: store the new pattern.
| def pycross.forms.WordSuggestDialog.showEvent | ( | self, | |
| event | |||
| ) |
Fires when the dialog shows up.
| def pycross.forms.WordSuggestDialog.sort_words | ( | self, | |
order = '' |
|||
| ) |
Sorts the suggestions in the list box.
| order | str sort order: 'A' = ascending, 'D' = descending, 'toggle' = toggle order, empty = use WordSuggestDialog::sortdir |
| def pycross.forms.WordSuggestDialog.update_actions | ( | self | ) |
Enables / disables actions depending on the number of returned suggestions.
| def pycross.forms.WordSuggestDialog.validate | ( | self | ) |
Checks that a suggestion is selected before quitting.
Reimplemented from pycross.forms.BasicDialog.
| pycross.forms.WordSuggestDialog.act_refresh |
| pycross.forms.WordSuggestDialog.act_shuffle |
| pycross.forms.WordSuggestDialog.act_sort |
| pycross.forms.WordSuggestDialog.act_source_config |
| pycross.forms.WordSuggestDialog.ch_truncate |
| pycross.forms.WordSuggestDialog.getresults |
callable pointer to function that retrieves word suggestions
| pycross.forms.WordSuggestDialog.l_count |
| pycross.forms.WordSuggestDialog.l_word |
| pycross.forms.WordSuggestDialog.layout_center |
| pycross.forms.WordSuggestDialog.layout_controls |
| pycross.forms.WordSuggestDialog.layout_lower |
| pycross.forms.WordSuggestDialog.layout_top |
| pycross.forms.WordSuggestDialog.le_word |
| pycross.forms.WordSuggestDialog.lw_words |
| pycross.forms.WordSuggestDialog.mainwindow |
QtWidgets.QMainWindow pointer to gui::MainWindow instance
| pycross.forms.WordSuggestDialog.old_truncate |
| pycross.forms.WordSuggestDialog.results |
list list of retrieved suggestions (word strings)
| pycross.forms.WordSuggestDialog.selected |
str the selected word (from the suggested list)
| pycross.forms.WordSuggestDialog.sortdir |
str suggestions sort order: 'A' = ascending, 'D' = descending
| pycross.forms.WordSuggestDialog.tb_actions |
| pycross.forms.WordSuggestDialog.word |
str word pattern to find suggestions for
| pycross.forms.WordSuggestDialog.word_editable |
bool whether the word string can be edited directly in the dialog
1.8.17