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

Class cPhraseWheelBase

source code

     object --+                    
              |                    
wx._core.Object --+                
                  |                
wx._core.EvtHandler --+            
                      |            
        wx._core.Window --+        
                          |        
           wx._core.Control --+    
                              |    
          wx._controls.TextCtrl --+
                                  |
                                 cPhraseWheelBase
Known Subclasses:

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
EvtHandler
__init__(self, parent=None, id=-1, *args, **kwargs)
__init__(self, Window parent, int id=-1, String value=EmptyString, ...
source code
 
GetData(self, can_create=False)
Retrieve the data associated with the displayed string(s).
source code
 
SetText(self, value=u'', 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
 
display_as_disabled(self, disabled=None) 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

Inherited from wx._controls.TextCtrl: AppendText, CanCopy, CanCut, CanPaste, CanRedo, CanUndo, Clear, Copy, Create, Cut, DiscardEdits, EmulateKeyPress, GetDefaultStyle, GetInsertionPoint, GetLastPosition, GetLineLength, GetLineText, GetNumberOfLines, GetRange, GetSelection, GetString, GetStringSelection, GetStyle, GetValue, HitTest, HitTestPos, IsEditable, IsModified, IsMultiLine, IsSingleLine, LoadFile, MarkDirty, Paste, PositionToXY, Redo, Remove, Replace, SaveFile, SelectAll, SetDefaultStyle, SetEditable, SetInsertionPoint, SetInsertionPointEnd, SetMaxLength, SetSelection, SetStyle, SetValue, ShowPosition, Undo, WriteText, XYToPosition, __repr__, write

Inherited from wx._core.Control: Command, GetLabel, SetLabel

Inherited from wx._core.Window: AcceptsFocus, AcceptsFocusFromKeyboard, AddChild, AssociateHandle, CacheBestSize, CaptureMouse, Center, CenterOnParent, CenterOnScreen, Centre, CentreOnParent, CentreOnScreen, ClearBackground, ClientToScreen, ClientToScreenXY, Close, ConvertDialogPointToPixels, ConvertDialogSizeToPixels, ConvertPixelPointToDialog, ConvertPixelSizeToDialog, DLG_PNT, DLG_SZE, Destroy, DestroyChildren, Disable, DissociateHandle, DragAcceptFiles, Enable, FindWindowById, FindWindowByName, Fit, FitInside, Freeze, GetAcceleratorTable, GetAdjustedBestSize, GetAutoLayout, GetBackgroundColour, GetBackgroundStyle, GetBestFittingSize, GetBestSize, GetBestSizeTuple, GetBestVirtualSize, GetBorder, GetCaret, GetCharHeight, GetCharWidth, GetChildren, GetClientAreaOrigin, GetClientRect, GetClientSize, GetClientSizeTuple, GetConstraints, GetContainingSizer, GetCursor, GetDefaultAttributes, GetDefaultItem, GetDropTarget, GetEventHandler, GetExtraStyle, GetFont, GetForegroundColour, GetFullTextExtent, GetGrandParent, GetHandle, GetHelpText, GetId, GetMaxHeight, GetMaxSize, GetMaxWidth, GetMinHeight, GetMinSize, GetMinWidth, GetName, GetParent, GetPosition, GetPositionTuple, GetRect, GetScrollPos, GetScrollRange, GetScrollThumb, GetSize, GetSizeTuple, GetSizer, GetTextExtent, GetThemeEnabled, GetTitle, GetToolTip, GetUpdateClientRect, GetUpdateRegion, GetValidator, GetVirtualSize, GetVirtualSizeTuple, GetWindowStyle, GetWindowStyleFlag, GetWindowVariant, HasCapture, HasFlag, HasScrollbar, HasTransparentBackground, Hide, HitTestXY, InheritAttributes, InheritsBackgroundColour, InitDialog, InvalidateBestSize, IsBeingDeleted, IsEnabled, IsExposed, IsExposedPoint, IsExposedRect, IsRetained, IsShown, IsTopLevel, Layout, LineDown, LineUp, Lower, MakeModal, Move, MoveAfterInTabOrder, MoveBeforeInTabOrder, MoveXY, Navigate, PageDown, PageUp, PopEventHandler, PopupMenu, PopupMenuXY, PostCreate, PrepareDC, PushEventHandler, Raise, Refresh, RefreshRect, RegisterHotKey, ReleaseMouse, RemoveChild, RemoveEventHandler, Reparent, ScreenToClient, ScreenToClientXY, ScrollLines, ScrollPages, ScrollWindow, SendSizeEvent, SetAcceleratorTable, SetAutoLayout, SetBackgroundColour, SetBackgroundStyle, SetBestFittingSize, SetCaret, SetClientRect, SetClientSize, SetClientSizeWH, SetConstraints, SetContainingSizer, SetCursor, SetDefaultItem, SetDimensions, SetDropTarget, SetEventHandler, SetExtraStyle, SetFocus, SetFocusFromKbd, SetFont, SetForegroundColour, SetHelpText, SetHelpTextForId, SetId, SetMaxSize, SetMinSize, SetName, SetOwnBackgroundColour, SetOwnFont, SetOwnForegroundColour, SetPosition, SetRect, SetScrollPos, SetScrollbar, SetSize, SetSizeHints, SetSizeHintsSz, SetSizeWH, SetSizer, SetSizerAndFit, SetThemeEnabled, SetTitle, SetTmpDefaultItem, SetToolTip, SetToolTipString, SetValidator, SetVirtualSize, SetVirtualSizeHints, SetVirtualSizeHintsSz, SetVirtualSizeWH, SetWindowStyle, SetWindowStyleFlag, SetWindowVariant, ShouldInheritColours, Show, Thaw, TransferDataFromWindow, TransferDataToWindow, UnregisterHotKey, Update, UpdateWindowUI, UseBgCol, Validate, WarpPointer

Inherited from wx._core.EvtHandler: AddPendingEvent, Bind, Connect, Disconnect, GetEvtHandlerEnabled, GetNextHandler, GetPreviousHandler, ProcessEvent, ProcessPendingEvents, SetEvtHandlerEnabled, SetNextHandler, SetPreviousHandler, Unbind

Inherited from wx._core.Object: GetClassName

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods

Inherited from wx._controls.TextCtrl: GetClassDefaultAttributes

Inherited from wx._core.Window: FindFocus, GetCapture, NewControlId, NextControlId, PrevControlId

Properties
  speller_word_separators
  static_tooltip_extra
  accepted_chars
  final_regex
  final_regex_error_msg
  data

Inherited from object: __class__

Method Details

__init__(self, parent=None, id=-1, *args, **kwargs)
(Constructor)

source code 

__init__(self, Window parent, int id=-1, String value=EmptyString, 
    Point pos=DefaultPosition, Size size=DefaultSize, 
    long style=0, Validator validator=DefaultValidator, 
    String name=TextCtrlNameStr) -> TextCtrl

Returns: EvtHandler
Overrides: object.__init__
(inherited documentation)

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.


Property Details

speller_word_separators

Get Method:
_get_speller_word_separators(self)
Set Method:
_set_speller_word_separators(self, word_separators)

static_tooltip_extra

Get Method:
_get_static_tt_extra(self)
Set Method:
_set_static_tt_extra(self, tt)

accepted_chars

Get Method:
_get_accepted_chars(self)
Set Method:
_set_accepted_chars(self, accepted_chars=None)

final_regex

Get Method:
_get_final_regex(self)
Set Method:
_set_final_regex(self, final_regex='.*')

final_regex_error_msg

Get Method:
_get_final_regex_error_msg(self)
Set Method:
_set_final_regex_error_msg(self, msg)

data

Get Method:
_get_data(self)
Set Method:
_set_data(self, data)