Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tooltip problems on Windows (Linux seems OK)

1 view
Skip to first unread message

defr...@gmail.com

unread,
Aug 15, 2008, 2:54:48 PM8/15/08
to
There seems to be a problem with tooltips on a toolbar that is managed
with AUI on Windows.

When the toobar is added via "AddPane" in non-floating mode (docked)
we can see the tooltip. When we pull the toolbar out and float it, the
tooltips are gone. When we re-dock it, the tooltips come back.

If the toolbar was initially added via "AddPane" in floating mode, the
tooltips are never seen.

The problem does not seem to appear in Linux.

You can see the problem in the aui sample program by adding tootips to
the large vertical toolbar that is initially docked on the left (tb5).
For example:

tb5->AddTool(101, wxT("Test"),
wxArtProvider::GetBitmap(wxART_ERROR), _T("Tooltip1"));
tb5->AddSeparator();
tb5->AddTool(102, wxT("Test"),
wxArtProvider::GetBitmap(wxART_QUESTION), _T("Tooltip2"));
tb5->AddTool(103, wxT("Test"),
wxArtProvider::GetBitmap(wxART_INFORMATION), _T("Tooltip3"));
tb5->AddTool(103, wxT("Test"),
wxArtProvider::GetBitmap(wxART_WARNING), _T("Tooltip4"));
tb5->AddTool(103, wxT("Test"),
wxArtProvider::GetBitmap(wxART_MISSING_IMAGE), _T("Tooltip5"));

There is also another problem which I do not think is related to AUI.
Note that the tooltips on Windows seem to get confused when tools have
the same ID. For example, note that 3rd, 4th and 5th tool have the
same ID. There is no tooltip shown for the 3rd and 4th tool and the
tooltip for the 5th tool shows "Tooltip3" instead of "Tooltip5".

Again, in Linux the tooltips seem correctly aligned.

I am using wxWidgets version 2.8.8.

Vadim Zeitlin

unread,
Aug 18, 2008, 9:37:16 AM8/18/08
to
On Fri, 15 Aug 2008 11:54:48 -0700 (PDT) defr...@gmail.com wrote:

> When the toobar is added via "AddPane" in non-floating mode (docked)
> we can see the tooltip. When we pull the toolbar out and float it, the
> tooltips are gone. When we re-dock it, the tooltips come back.

I don't see this with the current svn trunk.

> You can see the problem in the aui sample program by adding tootips to
> the large vertical toolbar that is initially docked on the left (tb5).

Here is what I did:

Index: samples/aui/auidemo.cpp
===================================================================
--- samples/aui/auidemo.cpp (revision 55085)
+++ samples/aui/auidemo.cpp (working copy)
@@ -803,12 +803,12 @@
wxToolBar* tb5 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxTB_FLAT | wxTB_NODIVIDER | wxTB_VERTICAL);
tb5->SetToolBitmapSize(wxSize(48,48));
- tb5->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR));
+ tb5->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR), _T("Tooltip1"));
tb5->AddSeparator();
- tb5->AddTool(102, wxT("Test"), wxArtProvider::GetBitmap(wxART_QUESTION));
- tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_INFORMATION));
- tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_WARNING));
- tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_MISSING_IMAGE));
+ tb5->AddTool(102, wxT("Test"), wxArtProvider::GetBitmap(wxART_QUESTION), _T("Tooltip2"));
+ tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_INFORMATION), _T("Tooltip3"));
+ tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_WARNING), _T("Tooltip4"));
+ tb5->AddTool(103, wxT("Test"), wxArtProvider::GetBitmap(wxART_MISSING_IMAGE), _T("Tooltip5"));
tb5->Realize();

// add a bunch of panes

And I see the tooltips just fine when the toolbar is undocked. I didn't
test with 2.8 yet but I don't remember any changes in this area so I wonder
if it could be due to some other difference between our setups. I use MSVC
7.1 under Windows 2003.

> There is also another problem which I do not think is related to AUI.
> Note that the tooltips on Windows seem to get confused when tools have
> the same ID. For example, note that 3rd, 4th and 5th tool have the
> same ID. There is no tooltip shown for the 3rd and 4th tool and the
> tooltip for the 5th tool shows "Tooltip3" instead of "Tooltip5".

Using controls with the same ids under Windows is just a bad idea. I've
changed the sample to not do it.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

defr...@gmail.com

unread,
Aug 19, 2008, 10:31:58 AM8/19/08
to
On Aug 18, 9:37 am, Vadim Zeitlin <va...@wxwidgets.org> wrote:
> ...I see the tooltips just fine when the toolbar is undocked.

> I didn't test with 2.8 yet but I don't remember any changes
> in this area so I wonder if it could be due to some other
> difference between our setups. I use MSVC 7.1 under Windows
> 2003.

I am using MSYS/MINGW, which uses gcc 3.4.2 (mingw-special) on Windows
XP. We do have a different setup... perhaps that is what accounts for
the differences we see?

0 new messages