[ wxwindows-Bugs-1742682 ] AddControl broken in AUI toolbar for Mac
SourceForge.net
noreply at sourceforge.net
Thu Mar 6 10:04:43 PST 2008
Bugs item #1742682, was opened at 2007-06-25 09:05
Message generated for change (Comment added) made by csomor
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1742682&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: AUI
Group: None
Status: Pending
Resolution: Fixed
Priority: 5
Private: No
Submitted By: CM Barton (cmbarton)
Assigned to: Benjamin I. Williams (biwillia76)
Summary: AddControl broken in AUI toolbar for Mac
Initial Comment:
This is related to Bug 1732558. But the title of the bug is not very clear and it has been sitting unassigned for several months.
On the Mac, any control added to an AUI managed toolbar (i.e., with AddControl) is invisible and inaccessible. It creates no error; it just isn't there.
This behavior has been consistent on both PPC and Intel Macs, and remains the same with the current wxPython 2.8.4 (I assume it's a problem with the underlying wxWidgets).
----------------------------------------------------------------------
>Comment By: Stefan Csomor (csomor)
Date: 2008-03-06 19:04
Message:
Logged In: YES
user_id=81467
Originator: NO
WX_2_8_BRANCH to be specific...
----------------------------------------------------------------------
Comment By: Stefan Csomor (csomor)
Date: 2008-03-06 19:03
Message:
Logged In: YES
user_id=81467
Originator: NO
fix committed to src/mac/carbon/toolbar.cpp please verify
Thanks,
Stefan
----------------------------------------------------------------------
Comment By: Dave Page (pgsnake)
Date: 2008-03-06 18:05
Message:
Logged In: YES
user_id=1181215
Originator: NO
Stefan; Yes, using a 16x16 image fixes that particular issue - thanks. Not
sure why that code had 16x15...
----------------------------------------------------------------------
Comment By: CM Barton (cmbarton)
Date: 2008-03-06 17:41
Message:
Logged In: YES
user_id=1716814
Originator: YES
Thanks for looking into this. We'd like to use AUI toolbars so that they
can be torn off, but need them to work the same across all supported
platform.
Michael
----------------------------------------------------------------------
Comment By: Stefan Csomor (csomor)
Date: 2008-03-06 16:46
Message:
Logged In: YES
user_id=81467
Originator: NO
Hi Dave
re background: that's because it is not the native icon size of 16x16
(just fix the height and add a transparent line to see the change), so it
goes via a PICT conversion which looses alpha) is 16x15 standard on other
platforms ? if yes, then I'd add an explicit path to add an empty line
Best,
Stefan
----------------------------------------------------------------------
Comment By: Dave Page (pgsnake)
Date: 2008-03-06 16:21
Message:
Logged In: YES
user_id=1181215
Originator: NO
Thanks Stefan :-)
I should also note that although the non-native toolbar technically works,
the wxBitmapButton's background colour seems to be stuck at white which
looks ugly against the silver toolbar - so I'll be waiting for a proper fix
for pgAdmin :-p
Cheers, Dave.
----------------------------------------------------------------------
Comment By: Stefan Csomor (csomor)
Date: 2008-03-06 16:17
Message:
Logged In: YES
user_id=81467
Originator: NO
Hi Dave
this definitely helps, at least it helps me, I need native samples... I'll
try to see whether it is a low hanging fruit ;-)
Thanks,
Stefan
----------------------------------------------------------------------
Comment By: Dave Page (pgsnake)
Date: 2008-03-06 14:05
Message:
Logged In: YES
user_id=1181215
Originator: NO
If it helps, the patch below illustrates the problem using the aui sample
in 2.8.7. As noted in the related bug, using the non-native toolbar (by
defining wxMAC_USE_NATIVE_TOOLBAR=0 does also solve the problem).
*** auidemo.cpp.orig Thu Mar 6 12:11:35 2008
--- auidemo.cpp Thu Mar 6 12:14:28 2008
***************
*** 636,641 ****
--- 636,664 ----
EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, MyFrame::OnNotebookPageClose)
END_EVENT_TABLE()
+ static char *pulldown_xpm[] = {
+ /* columns rows colors chars-per-pixel */
+ "16 15 2 1",
+ ". c Black",
+ " c None",
+ /* pixels */
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ..... ",
+ " ... ",
+ " . ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " "
+ };
+
MyFrame::MyFrame(wxWindow* parent,
wxWindowID id,
***************
*** 771,776 ****
--- 794,807 ----
tb2->AddTool(101, wxT("Test"), tb2_bmp1);
tb2->AddTool(101, wxT("Test"), tb2_bmp1);
tb2->AddTool(101, wxT("Test"), tb2_bmp1);
+ tb2->AddSeparator();
+
+ // Add a wxBitmapButton
+ wxBitmap bmpPulldown(pulldown_xpm);
+ wxBitmapButton *btnBmp = new wxBitmapButton(tb2, wxID_ANY,
bmpPulldown, wxDefaultPosition, wxDefaultSize, wxNO_BORDER);
+ tb2->AddControl(btnBmp);
+
+ tb2->AddSeparator();
tb2->Realize();
----------------------------------------------------------------------
Comment By: CM Barton (cmbarton)
Date: 2007-06-27 23:02
Message:
Logged In: YES
user_id=1716814
Originator: YES
Correction. This is related to bug 1638728. I pasted in the wrong number.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1742682&group_id=9863
More information about the wx-dev
mailing list