Sure, here's some code. I'm glad it works generally, as that means
it's me and not the technology. Thus, it can be fixed!
My Notebook is set up like this:
class ADJMFrame(wx.Frame):
def __init__(self, parent, title="AutoDist Job Manager", size=(700,
500), useHighContrast=False, jobsList=):
super(ADJMFrame, self).__init__(parent, title=title, size=size)
self.logger = logging.getLogger(globals.appName+"."+__name__+".ADJMFrame")
notebook = wx.Notebook(self)
jobsPanel = JobsListManager(notebook, "Jobs", reformattedJobsList,
["Job Name", "Status", "Time Last Run", "Time to Next Run"],
useHighContrast=useHighContrast)
tablesPanel = DBTablesListManager(notebook, "Tables", tablesList,
["Table Name"], schemas, showEditButton=False,
useHighContrast=useHighContrast)
notebook.AddPage(jobsPanel, jobsPanel.title)
notebook.AddPage(tablesPanel, tablesPanel.title)
if useHighContrast:
self.SetBackgroundColour("black")
self.Center()
self.Show(True)
#end def __init__
Here's part of the __init__ for the panels. I have two types there,
but they both subclass ListManager, so I'll give that one. I've
removed the "self.var=var" stuff for brevity.
class ListManager(wx.Panel):
"""This is the base class for ListManager objects. It takes an array
of arrays and displays each sub-array as a row in a wx.listCtrl, using
the array of columnHeaders as headers. Subclasses should implement the
initUI() method to position/color things, add columns, sort data, and
so on. Remember that this is a wx.Panel, not a wx.Frame."""
def __init__(self,
parent, #the panel's parent
title, #string that will be the panel's title
choices, #an array of arrays, where each array is a row and each
item is a value
columnHeaders, #an array of strings to use as column headers
showAddButton=False, #true if you want an 'Add' button shown
addButtonLabel = None, #string that will be the "add" button's label
showEditButton = True,
editButtonLabel = None,
showDeleteButton=False,
deleteButtonLabel = None,
buttonSize=(80, 30),
useHighContrast = False, #true to use ridiculous, but easy-to-see, colors
selectedIndex = 0, #an integer, 0-len(choices)-1, that is the index
of the item you want focused when this widget is created
):
super(ListManager, self).__init__(parent)
self.logger = logging.getLogger(globals.appName+"."+__name__+"."+title)
self.logger.debug("Initializing.")
self.addButtonLabel = "&Add" if addButtonLabel == None else addButtonLabel
self.editButtonLabel = "&Edit" if editButtonLabel == None else editButtonLabel
self.deleteButtonLabel = "&Delete" if deleteButtonLabel == None else
deleteButtonLabel
self.items_listControl = wx.ListCtrl(self, id=wx.ID_ANY,
style=wx.LC_REPORT, size=(-1, -1))
self.add_button = wx.Button(self, wx.ID_ANY, label =
self.addButtonLabel, size=self.buttonSize)
self.edit_button = wx.Button(self, id=wx.ID_ANY,
label=self.editButtonLabel, size=self.buttonSize)
self.delete_button = wx.Button(self, id=wx.ID_ANY,
label=self.deleteButtonLabel, size=self.buttonSize)
self.add_button.Enable(self.showAddButton)
self.edit_button.Enable(self.showEditButton)
self.delete_button.Enable(self.showDeleteButton)
#set the headers
#now set the data
self.items_listControl.Bind(wx.EVT_LIST_ITEM_SELECTED,
self.updateSelectedIndex)
self.blueColor = "#8888ff"
self.greenColor = "#88ff88"
self.fireEngineRedColor = "#f62817"
#end def __init__
Finally, this is all kicked off by main.py calling this method:
def initGUI(jobsList, useHighContrast=False):
mainFrame = ADJMFrame(None, globals.appName, (900, 700),
useHighContrast, jobsList)
···
On 2/4/16, James Scholes <james@jls-radio.com> wrote:
Alex Hall wrote:
In my panel, though (loaded into a notebook which is in a frame), tab
stops moving at the last control. I can shift-tab, but nothing loops.
Stranger still, object review mode (which should let me explore all
controls, not just the focusable ones) doesn't seem to realize my
panel is there at all.
Doesn't sound like a wx issue. There might not be many screen reader
users here, or on the wxWidgets lists, but there are plenty that
understand the importance of tab navigation so this would've been picked
up as a bug already. There are also a number of WX-based apps I use on
a daily basis which have a panel inside a notebook, and screen reader
access works fine.
It's more likely that, for whatever reason, your panel isn't being added
to its parent properly. This is usually the cause of such issues.
Unfortunately, without code, it's impossible to say anything further.
If you can, try to get into the habbit of posting code that reproduces
the problem from the very beginning, especially for something like this.
--
James Scholes
x.com
--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.