PYME.contrib.TextCtrlAutoComplete module

wxPython Custom Widget Collection 20060207 Written By: Edward Flick (eddy -=at=- cdf-imaging -=dot=- com)

Michele Petrazzo (michele -=dot=- petrazzo -=at=- unipex -=dot=- it) Will Sadkin (wsadkin-=at=- nameconnector -=dot=- com)

Copyright 2006 (c) CDF Inc. ( http://www.cdf-imaging.com ) Contributed to the wxPython project under the wxPython project’s license.

class PYME.contrib.TextCtrlAutoComplete.TextCtrlAutoComplete(parent, colNames=None, choices=None, multiChoices=None, showHead=True, dropDownClick=True, colFetch=-1, colSearch=0, hideOnNoMatch=True, selectCallback=None, entryCallback=None, matchFunction=None, **therest)

Bases: wx._controls.TextCtrl, wx.lib.mixins.listctrl.ColumnSorterMixin

Constructor works just like wx.TextCtrl except you can pass in a list of choices. You can also change the choice list at any time by calling setChoices.

Attributes

AcceleratorTable See GetAcceleratorTable and SetAcceleratorTable
Alignment See GetAlignment
AutoLayout See GetAutoLayout and SetAutoLayout
BackgroundColour See GetBackgroundColour and SetBackgroundColour
BackgroundStyle See GetBackgroundStyle and SetBackgroundStyle
BestSize See GetBestSize
BestVirtualSize See GetBestVirtualSize
Border See GetBorder
Caret See GetCaret and SetCaret
CharHeight See GetCharHeight
CharWidth See GetCharWidth
Children See GetChildren
ClassName See GetClassName
ClientAreaOrigin See GetClientAreaOrigin
ClientRect See GetClientRect and SetClientRect
ClientSize See GetClientSize and SetClientSize
Constraints See GetConstraints and SetConstraints
ContainingSizer See GetContainingSizer and SetContainingSizer
Cursor See GetCursor and SetCursor
DefaultAttributes See GetDefaultAttributes
DefaultStyle GetDefaultStyle(self) -> wxTextAttr
DropTarget See GetDropTarget and SetDropTarget
EffectiveMinSize See GetEffectiveMinSize
Enabled See IsEnabled and Enable
EventHandler See GetEventHandler and SetEventHandler
EvtHandlerEnabled See GetEvtHandlerEnabled and SetEvtHandlerEnabled
ExtraStyle See GetExtraStyle and SetExtraStyle
Font See GetFont and SetFont
ForegroundColour See GetForegroundColour and SetForegroundColour
GrandParent See GetGrandParent
GtkWidget GetGtkWidget(self) -> long
Handle See GetHandle
HelpText See GetHelpText and SetHelpText
Id See GetId and SetId
InsertionPoint GetInsertionPoint(self) -> long
Label See GetLabel and SetLabel
LabelText See GetLabelText
LastPosition GetLastPosition(self) -> long
LayoutDirection See GetLayoutDirection and SetLayoutDirection
MaxClientSize GetMaxClientSize(self) -> Size
MaxHeight See GetMaxHeight
MaxSize See GetMaxSize and SetMaxSize
MaxWidth See GetMaxWidth
MinClientSize GetMinClientSize(self) -> Size
MinHeight See GetMinHeight
MinSize See GetMinSize and SetMinSize
MinWidth See GetMinWidth
Name See GetName and SetName
NextHandler See GetNextHandler and SetNextHandler
NumberOfLines GetNumberOfLines(self) -> int
Parent See GetParent
Position See GetPosition and SetPosition
PreviousHandler See GetPreviousHandler and SetPreviousHandler
Rect See GetRect and SetRect
ScreenPosition See GetScreenPosition
ScreenRect See GetScreenRect
Selection If the return values from and to are the same, there is no selection.
Shown See IsShown and Show
Size See GetSize and SetSize
Sizer See GetSizer and SetSizer
ThemeEnabled See GetThemeEnabled and SetThemeEnabled
ToolTip See GetToolTip and SetToolTip
ToolTipString
TopLevel See IsTopLevel
TopLevelParent See GetTopLevelParent
UpdateClientRect See GetUpdateClientRect
UpdateRegion See GetUpdateRegion
Validator See GetValidator and SetValidator
Value GetValue(self) -> String
VirtualSize See GetVirtualSize and SetVirtualSize
WindowStyle See GetWindowStyle and SetWindowStyle
WindowStyleFlag See GetWindowStyleFlag and SetWindowStyleFlag
WindowVariant See GetWindowVariant and SetWindowVariant
thisown The membership flag

Methods

GetChoices()
GetListCtrl()
GetSortImages()
SetChoices(choices) Sets the choices available in the popup wx.ListBox.
SetEntryCallback([cb])
SetMatchFunction([mf])
SetMultipleChoices(choices[, colSearch, ...]) Set multi-column choice
SetSelectCallback([cb])
onClickToggleDown(event)
onClickToggleUp(event)
onControlChanged(event)
onEnteredText(event)
onKeyDown(event) Do some work when the user press on the keys:
onListClick(evt)
onListColClick(evt)
onListDClick(evt)
onListItemSelected(event)
GetChoices()
GetListCtrl()
GetSortImages()
SetChoices(choices)

Sets the choices available in the popup wx.ListBox. The items will be sorted case insensitively.

SetEntryCallback(cb=None)
SetMatchFunction(mf=None)
SetMultipleChoices(choices, colSearch=0, colFetch=-1)

Set multi-column choice

SetSelectCallback(cb=None)
onClickToggleDown(event)
onClickToggleUp(event)
onControlChanged(event)
onEnteredText(event)
onKeyDown(event)

Do some work when the user press on the keys: up and down: move the cursor left and right: move the search

onListClick(evt)
onListColClick(evt)
onListDClick(evt)
onListItemSelected(event)
PYME.contrib.TextCtrlAutoComplete.getSmallDnArrowBitmap()
PYME.contrib.TextCtrlAutoComplete.getSmallDnArrowData()
PYME.contrib.TextCtrlAutoComplete.getSmallDnArrowImage()
PYME.contrib.TextCtrlAutoComplete.getSmallUpArrowBitmap()
PYME.contrib.TextCtrlAutoComplete.getSmallUpArrowData()
PYME.contrib.TextCtrlAutoComplete.getSmallUpArrowImage()
class PYME.contrib.TextCtrlAutoComplete.myListCtrl(parent, ID=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=0)

Bases: wx._controls.ListCtrl, wx.lib.mixins.listctrl.ListCtrlAutoWidthMixin

Attributes

AcceleratorTable See GetAcceleratorTable and SetAcceleratorTable
Alignment See GetAlignment
AutoLayout See GetAutoLayout and SetAutoLayout
BackgroundColour See GetBackgroundColour and SetBackgroundColour
BackgroundStyle See GetBackgroundStyle and SetBackgroundStyle
BestSize See GetBestSize
BestVirtualSize See GetBestVirtualSize
Border See GetBorder
Caret See GetCaret and SetCaret
CharHeight See GetCharHeight
CharWidth See GetCharWidth
Children See GetChildren
ClassName See GetClassName
ClientAreaOrigin See GetClientAreaOrigin
ClientRect See GetClientRect and SetClientRect
ClientSize See GetClientSize and SetClientSize
ColumnCount See GetColumnCount
Constraints See GetConstraints and SetConstraints
ContainingSizer See GetContainingSizer and SetContainingSizer
CountPerPage See GetCountPerPage
Cursor See GetCursor and SetCursor
DefaultAttributes See GetDefaultAttributes
DropTarget See GetDropTarget and SetDropTarget
EditControl See GetEditControl
EffectiveMinSize See GetEffectiveMinSize
Enabled See IsEnabled and Enable
EventHandler See GetEventHandler and SetEventHandler
EvtHandlerEnabled See GetEvtHandlerEnabled and SetEvtHandlerEnabled
ExtraStyle See GetExtraStyle and SetExtraStyle
FocusedItem See GetFocusedItem
Font See GetFont and SetFont
ForegroundColour See GetForegroundColour and SetForegroundColour
GrandParent See GetGrandParent
GtkWidget GetGtkWidget(self) -> long
Handle See GetHandle
HelpText See GetHelpText and SetHelpText
Id See GetId and SetId
ItemCount See GetItemCount and SetItemCount
Label See GetLabel and SetLabel
LabelText See GetLabelText
LayoutDirection See GetLayoutDirection and SetLayoutDirection
MainWindow See GetMainWindow
MaxClientSize GetMaxClientSize(self) -> Size
MaxHeight See GetMaxHeight
MaxSize See GetMaxSize and SetMaxSize
MaxWidth See GetMaxWidth
MinClientSize GetMinClientSize(self) -> Size
MinHeight See GetMinHeight
MinSize See GetMinSize and SetMinSize
MinWidth See GetMinWidth
Name See GetName and SetName
NextHandler See GetNextHandler and SetNextHandler
Parent See GetParent
Position See GetPosition and SetPosition
PreviousHandler See GetPreviousHandler and SetPreviousHandler
Rect See GetRect and SetRect
ScreenPosition See GetScreenPosition
ScreenRect See GetScreenRect
SelectedItemCount See GetSelectedItemCount
Shown See IsShown and Show
Size See GetSize and SetSize
Sizer See GetSizer and SetSizer
TextColour See GetTextColour and SetTextColour
ThemeEnabled See GetThemeEnabled and SetThemeEnabled
ToolTip See GetToolTip and SetToolTip
ToolTipString
TopItem See GetTopItem
TopLevel See IsTopLevel
TopLevelParent See GetTopLevelParent
UpdateClientRect See GetUpdateClientRect
UpdateRegion See GetUpdateRegion
Validator See GetValidator and SetValidator
ViewRect See GetViewRect
VirtualSize See GetVirtualSize and SetVirtualSize
WindowStyle See GetWindowStyle and SetWindowStyle
WindowStyleFlag See GetWindowStyleFlag and SetWindowStyleFlag
WindowVariant See GetWindowVariant and SetWindowVariant
thisown The membership flag

Methods

class PYME.contrib.TextCtrlAutoComplete.test

Methods

match(text, choice) Demonstrate “smart” matching feature, by ignoring http:// and www.
onBtChangeChoice(event)
onBtDynamicChoices(event) Demonstrate dynamic adjustment of the auto-complete list, based on what’s
onBtMultiChoice(event)
onBtStartChoices(event)
selectCallback(values) Simply function that receive the row values when the
setDynamicChoices()
match(text, choice)

Demonstrate “smart” matching feature, by ignoring http:// and www. when doing matches.

onBtChangeChoice(event)
onBtDynamicChoices(event)

Demonstrate dynamic adjustment of the auto-complete list, based on what’s been typed so far:

onBtMultiChoice(event)
onBtStartChoices(event)
selectCallback(values)

Simply function that receive the row values when the user select an item

setDynamicChoices()