Thanks for this. I tried to compare your code to mine and don’t see anything obvious. When I add .CenterPane() to the AddPane method the AuiNotebook appears in the full width and height of the panel. However its not undockable. Does this Widget Inspection screen shot reveal anything?
I’m suspicious that I may be missing a sizer, either I have to add one or ones interfering. I layout of the panel I’m displaying is complex and needs to stay all together. It works fine except for the fact that when the program starts the panel is a an 18px sliver on the left side of the frame.
tabOne = wx.Panel(self)
ledger.AddPage(tabOne, 'Ledger')
tabOne_sizer = wx.BoxSizer(wx.VERTICAL)
self.mgr.AddPane(ledger,
aui.AuiPaneInfo()
# .CenterPane()
# .Caption("Ledger")
.Resizable()
.Dockable()
.Dock()
# .Floatable()
)
self.mgr.Update()
search_sizer = wx.BoxSizer(wx.HORIZONTAL)
tabOne_sizer.Add(search_sizer, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 10)
search_label = wx.StaticText(tabOne, label="Budget Item:")
font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL,
wx.FONTWEIGHT_NORMAL)
search_label.SetFont(font)
search_label.SetForegroundColour(wx.WHITE) # Set the text color to white
search_sizer.Add(search_label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
search_sizer.Add(search_label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
budget_items = budget_items_combobox()
self.budgetItemSelected = wx.ComboBox(tabOne,
value=budget_items[1]
if budget_items else "",
choices=budget_items)
self.budgetItemSelected.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
search_sizer.Add(self.budgetItemSelected, 2, wx.ALL, 5)
self.search_ctrl.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
search_label = wx.StaticText(tabOne, label="Player Account:")
font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL,
wx.FONTWEIGHT_NORMAL)
search_label.SetFont(font)
search_label.SetForegroundColour(wx.WHITE) # Set the text color to white
search_sizer.Add(search_label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
playerAccounts = playerAccount_items_combobox()
self.playerAccountSelected = wx.ComboBox(tabOne,
value=playerAccounts[1]
if playerAccounts else "",
choices=playerAccounts)
playerAccountWidth = 125
self.playerAccountSelected.SetMinSize((playerAccountWidth, -1))
search_sizer.Add(self.playerAccountSelected, 2, wx.ALL, 5)
self.playerAccountSelected.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
search_label = wx.StaticText(tabOne, label="Payment Method:")
font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL,
wx.FONTWEIGHT_NORMAL)
search_label.SetFont(font)
search_label.SetForegroundColour(wx.WHITE) # Set the text color to white
search_sizer.Add(search_label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
paymentMethod = [
"eTransfer",
"Cheque",
"Credit Card",
"All"]
self.paymentMethod = wx.ComboBox(tabOne, value="All",
choices=paymentMethod)
paymentMethodWidth = 125
self.paymentMethod.SetMinSize((paymentMethodWidth, -1))
search_sizer.Add(self.paymentMethod, 2, wx.ALL, 5)
self.paymentMethod.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
search_btn = wx.Button(tabOne, label="Search")
search_sizer.Add(search_btn, 0, wx.ALL, 5)
search_btn.Bind(wx.EVT_BUTTON, self.OnSearch)
search_sizer.AddStretchSpacer(12) # Add a flexible space to push elements to the right
credit_label = wx.StaticText(tabOne, label="Credit:")
credit_label_font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
credit_label.SetFont(credit_label_font)
credit_label.SetForegroundColour(wx.WHITE) # Set the text color to white
search_sizer.Add(credit_label, 0, 5)
self.credit_text = wx.TextCtrl(tabOne, style=wx.NO_BORDER) # Create a TextCtrl instance with initial value
self.credit_text.SetBackgroundColour(wx.Colour(71, 106, 115))
self.credit_text.SetForegroundColour(wx.Colour(255, 255, 255))
credit_text_font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
self.credit_text.SetFont(credit_text_font)
self.credit_text.SetMaxSize((-1, -1)) # Set minimum width for credit text box
self.credit_text.SetValue("0.00")
search_sizer.Add(self.credit_text, 0, wx.ALL | wx.CENTER, 5)
debit_label = wx.StaticText(tabOne, label="Debit:")
debit_label_font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
debit_label.SetFont(debit_label_font)
debit_label.SetForegroundColour(wx.WHITE) # Set the text color to white
search_sizer.Add(debit_label, 0, 5)
self.debit_text = wx.TextCtrl(tabOne, style=wx.NO_BORDER) # Create a TextCtrl instance with initial value
self.debit_text.SetMaxSize((-1, -1)) # Set minimum width for debit text box
self.debit_text.SetBackgroundColour(wx.Colour(71, 106, 115))
self.debit_text.SetForegroundColour(wx.Colour(255, 255, 255)) # Set the text color to white
debit_text_font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
self.debit_text.SetFont(debit_text_font)
self.debit_text.SetValue("0.00")
search_sizer.Add(self.debit_text, 0, wx.ALL | wx.CENTER, 5)
balance_label = wx.StaticText(tabOne, label="Balance:")
balance_label_font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
balance_label.SetFont(balance_label_font)
balance_label.SetForegroundColour(wx.Colour(255, 255, 255))
balance_label.SetBackgroundColour(wx.Colour(71, 106, 115))
search_sizer.Add(balance_label, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
self.balance_text = wx.TextCtrl(tabOne, style=wx.NO_BORDER) # Create a TextCtrl instance with initial value
balance_text_font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
self.balance_text.SetFont(balance_text_font)
self.balance_text.SetMaxSize((-1, -1)) # Set minimum width for balance text box
self.balance_text.SetForegroundColour(wx.Colour(255, 255, 255))
self.balance_text.SetBackgroundColour(wx.Colour(71, 106, 115))
self.balance_text.SetValue("0.00")
search_sizer.Add(self.balance_text, 0, wx.ALIGN_CENTER_VERTICAL, 1)
search_sizer.AddStretchSpacer(1) # Add another flexible space to push the elements to the far right
font = wx.Font(11, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
self.ledger_results_olv.SetFont(font)
# Add the results to the sizer
tabOne_sizer.Add(self.ledger_results_olv, 1, wx.ALL | wx.EXPAND, 1)
# Create button sizer and add it to tabOne.
btn_sizer = wx.BoxSizer(wx.HORIZONTAL)
tabOne_sizer.Add(btn_sizer, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)
# Set row colors
self.ledger_results_olv.evenRowsBackColor = wx.Colour(230, 230, 230)
self.ledger_results_olv.oddRowsBackColor = wx.Colour(250, 250, 250)
# Add Record Button
add_record_btn = wx.Button(tabOne, label="Add")
# add_record_btn.SetBackgroundColour((29, 38, 89))
add_record_btn.Bind(wx.EVT_BUTTON, self.add_record)
btn_sizer.Add(add_record_btn, 0, wx.ALL, 5)
# Edit Record Button
edit_record_btn = wx.Button(tabOne, label="Edit")
edit_record_btn.Bind(wx.EVT_BUTTON, self.edit_record)
btn_sizer.Add(edit_record_btn, 0, wx.ALL, 5)
# Delete Button
delete_record_btn = wx.Button(tabOne, label="Delete")
delete_record_btn.Bind(wx.EVT_BUTTON, self.OnDeleteRecord)
btn_sizer.Add(delete_record_btn, 0, wx.ALL, 5)
# Show All Button
show_all_btn = wx.Button(tabOne, label="Show All")
show_all_btn.Bind(wx.EVT_BUTTON, self.OnShowAll)
btn_sizer.Add(show_all_btn, 0, wx.ALL, 5)
tabOne.SetSizer(tabOne_sizer)
# self.SetSizer(panel_sizer)
self.Layout()
self.Centre()