Package Gnumed :: Package wxpython :: Module gmPhraseWheel :: Class cPhraseWheelBase |
[frames] | no frames]

# Class cPhraseWheelBase

source code

    wx.TextCtrl --+
                  |
                 cPhraseWheelBase

    Widget for smart guessing of user fields, after Richard Terry's interface.

    - VB implementation by Richard Terry
    - Python port by Ian Haywood for GNUmed
    - enhanced by Karsten Hilbert for GNUmed
    - enhanced by Ian Haywood for aumed
    - enhanced by Karsten Hilbert for GNUmed

    @param matcher: a class used to find matches for the current input
    @type matcher: a L{match provider<Gnumed.pycommon.gmMatchProvider.cMatchProvider>}
            instance or C{None}

    @param selection_only: whether free-text can be entered without associated data
    @type selection_only: boolean

    @param capitalisation_mode: how to auto-capitalize input, valid values
            are found in L{capitalize()<Gnumed.pycommon.gmTools.capitalize>}
    @type capitalisation_mode: integer

    @param accepted_chars: a regex pattern defining the characters
            acceptable in the input string, if None no checking is performed
    @type accepted_chars: None or a string holding a valid regex pattern

    @param final_regex: when the control loses focus the input is
            checked against this regular expression
    @type final_regex: a string holding a valid regex pattern

    @param navigate_after_selection: whether or not to immediately
            navigate to the widget next-in-tab-order after selecting an
            item from the dropdown picklist
    @type navigate_after_selection: boolean

    @param speller: if not None used to spellcheck the current input
            and to retrieve suggested replacements/completions
    @type speller: None or a L{enchant Dict<enchant>} descendant

    @param picklist_delay: this much time of user inactivity must have
            passed before the input related smarts kick in and the drop
            down pick list is shown
    @type picklist_delay: integer (milliseconds)

Instance Methods
__init__(self, parent=None, id=-1, *args, **kwargs) | source code
GetData(self, can_create=False) Retrieve the data associated with the displayed string(s). | source code
SetText(self, value='', data=None, suppress_smarts=False) | source code
set_from_instance(self, instance) | source code
set_from_pk(self, pk) | source code
display_as_valid(self, valid=None, partially_invalid=False) | source code
Disable(self) | source code
Enable(self, enable=True) | source code
add_callback_on_selection(self, callback=None) Add a callback for invocation when a picklist item is selected. | source code
add_callback_on_set_focus(self, callback=None) Add a callback for invocation when getting focus. | source code
add_callback_on_lose_focus(self, callback=None) Add a callback for invocation when losing focus. | source code
add_callback_on_modified(self, callback=None) Add a callback for invocation when the content is modified. | source code
set_context(self, context=None, val=None) | source code
unset_context(self, context=None) | source code
enable_default_spellchecker(self) | source code

Class Variables
| speller_word_separators = `property(_get_speller_word_separator`...``
| static_tooltip_extra = `property(_get_static_tt_extra, _set_sta`...``
| accepted_chars = `property(_get_accepted_chars, _set_accepted_c`...``
| final_regex = `property(_get_final_regex, _set_final_regex)`
| final_regex_error_msg = `property(_get_final_regex_error_msg, _`...``
| data = `property(_get_data, _set_data)`

Method Details

### GetData(self, can_create=False) | source code
    Retrieve the data associated with the displayed string(s).

    - self._create_data() must set self.data if possible (/successful)

### add_callback_on_selection(self, callback=None) | source code
Add a callback for invocation when a picklist item is selected. The callback will be invoked whenever an item is selected from the picklist. The associated data is passed in as a single parameter. Callbacks must be able to cope with None as the data parameter as that is sent whenever the user changes a previously selected value.

### add_callback_on_modified(self, callback=None) | source code
Add a callback for invocation when the content is modified. This callback will NOT be passed any values.

Class Variable Details

  ### speller_word_separators Value:
      property(_get_speller_word_separators, _set_speller_word_separators)

  ### static_tooltip_extra Value:
      property(_get_static_tt_extra, _set_static_tt_extra)

  ### accepted_chars Value:
      property(_get_accepted_chars, _set_accepted_chars)

  ### final_regex_error_msg Value:
      property(_get_final_regex_error_msg, _set_final_regex_error_msg)