It's kind of hard to know how to advise you based on no code sample or
screenshot, since it's a bit hard to picture exactly what you have from
that brief verbal description. That said, I'll try:
Che,
I've attached two examples that include the buttons at the bottom of the
data entry widgets, but their physical position on the notebook page depends
on how many widgets are above them.
The code used to generate the buttons follows:
# Define buttons
self.AddButton = wx.Button(self, wx.ID_ADD)
self.EditButton = wx.Button(self, wx.ID_EDIT)
self.CancelButton = wx.Button(self, wx.ID_CANCEL)
btn1Sizer = wx.StdDialogButtonSizer()
btn1Sizer.Add(self.AddButton, 0, wx.ALL, 0)
btn1Sizer.Add(self.EditButton, 0, wx.ALL, 0)
btn1Sizer.Add(self.CancelButton, 0, wx.ALL, 0)
# Bind to methods
self.Bind(wx.EVT_BUTTON, self.OnAdd, self.AddButton)
self.Bind(wx.EVT_BUTTON, self.OnEdit, self.EditButton)
self.Bind(wx.EVT_BUTTON, self.OnCancel, self.CancelButton)
btn1Sizer.Realize()
The button sizer is added to the bottom of the list of containers for each
page; e.g.,
topBox.Add(sb1Sizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
topBox.Add(sb2Sizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
topBox.Add(sb3Sizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
topBox.Add(commentBox, 0, wx.ALIGN_CENTER|wx.ALL, 5)
topBox.Add(btn1Sizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
Are these buttons supposed to be at the same place on each page?
Yes, at the bottom of all other widgets on that page.
How similar are the pages themselves?
Not at all. It depends on the category of data.
Again, hard to know without seeing, but I suppose you would have just a
general Add or Edit method that would then look up the details of the
database in some list or dictionary somewhere, right?
Yes, but I've not been able to envision how such a generic Add or Edit
method would invoke the specific code needed for each database table.
Rich
···
On Mon, 23 Feb 2015, C M wrote: