agw.aui Few more issues

Hello (Andrea),

All observed on wxMac haven't checked on windows yet.

1) Docking toolbars:
If you undock a toolbar in the demo then double click on its title pane to re-dock it it will be re-docked into an odd position and will no longer be able to be undocked or moved.

2) Floating Panes
These panes cannot be resized once they are undocked, would it be possible to use mini frames instead of these owner drawn frames that don't have a regular title bar like the current wx.aui does?

3) Clicking in a docked pane doesn't highlight its title bar.

4) The tab and pane close buttons have very jagged edges (this is just like the wx.aui). This is wxMac specific issue because they use round buttons, the gtk/windows buttons look fine.

5) The mouse over highlighting of the close buttons on a docked pane draw an off centered square around the button. This looks correct on gtk/msw, but since wxMac is using the round buttons this is incorrect. They should do something similar to what is done on the tab close buttons by colouring the buttons circle in darker.

6) What event handles when a floating pane is dropped to make it into a notebook tab, this as I mentioned before causes a crash on wxMac. I looked a little but couldn't see exactly where this was happening.

Thanks,

Cody

Hi Cody,

Thank you for the bug reports.

Hello (Andrea),

All observed on wxMac haven't checked on windows yet.

1) Docking toolbars:
If you undock a toolbar in the demo then double click on its title pane to
re-dock it it will be re-docked into an odd position and will no longer be
able to be undocked or moved.

This is fixed now, I didn't even noticed it :smiley:

2) Floating Panes
These panes cannot be resized once they are undocked, would it be possible
to use mini frames instead of these owner drawn frames that don't have a
regular title bar like the current wx.aui does?

It's a bit strange, they work well on Windows but they are problematic
on wxGTK (and wxMAC apparently), even though I explicitely set a
wx.RESIZE_BORDER for these frames. They are actually wx.MiniFrames.
I'll try and make a small modification to see if they work, otherwise
I will need to think on how to rework the logic to use simple
wx.MiniFrames like wx.aui.

3) Clicking in a docked pane doesn't highlight its title bar.

This is how wx.aui does: if you don't define the
AUI_MGR_ALLOW_ACTIVE_PANE style no highlighting of the title bar is
done for docked panes. I tested it on Windows and GTK and it seems to
work fine (in the demo, choose "Options" => "Allow Active Pane").

4) The tab and pane close buttons have very jagged edges (this is just like
the wx.aui). This is wxMac specific issue because they use round buttons,
the gtk/windows buttons look fine.

Uhm, do you happen to have a screenshot of it? What should I do to fix
this issue? Since it's Mac-specific, whatever modification I make will
be hard to test unless I have a very clear idea of what to do :-(. Or
maybe could you provide the correct close buttons images for the Mac?

5) The mouse over highlighting of the close buttons on a docked pane draw an
off centered square around the button. This looks correct on gtk/msw, but
since wxMac is using the round buttons this is incorrect. They should do
something similar to what is done on the tab close buttons by colouring the
buttons circle in darker.

Does this mean that I should change the way the pane buttons are
highlighted on the Mac? I'll try and copy the tab highlighting code to
framemanager and see if this is good enough.

6) What event handles when a floating pane is dropped to make it into a
notebook tab, this as I mentioned before causes a crash on wxMac. I looked a
little but couldn't see exactly where this was happening.

There is no event for that: it happens in the DoDropFloatingPane
method, when the docking hit test is wx.CENTER:

            elif dir == wx.CENTER:

                if not target.IsNotebookDockable():
                    continue
                if not paneInfo.IsNotebookDockable() and not
paneInfo.IsNotebookControl():
                    continue

                if not paneInfo.HasNotebook():

                    # Add a new notebook pane ...
                    id = len(self._notebooks)

                    bookBasePaneInfo = AuiPaneInfo()
                    bookBasePaneInfo.SetDockPos(paneInfo).NotebookControl(id). \
                        CloseButton(False).SetNameFromNotebookId(). \
                        NotebookDockable(False)
                    bookBasePaneInfo.best_size = paneInfo.best_size
                    panes.append(bookBasePaneInfo)

                    # add original pane as tab ...
                    paneInfo.NotebookPage(id)

                # Add new item to notebook
                target.NotebookPage(paneInfo.notebook_id)

The only platform in which automatic notebooks work fine is Windows:
on GTK you can dock a pane onto another to create a notebook, but when
you undock it to make it float again you get a segmentation fault. It
looks like on the Mac you can't even create automatic notebooks...
would it be possible for you to take a closer look on your platform?

Thank you again!

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Fri, Apr 3, 2009 at 4:10 AM, Cody Precord wrote:

Hello,

Hi Cody,

3) Clicking in a docked pane doesn't highlight its title bar.

This is how wx.aui does: if you don't define the
AUI_MGR_ALLOW_ACTIVE_PANE style no highlighting of the title bar is
done for docked panes. I tested it on Windows and GTK and it seems to
work fine (in the demo, choose "Options" => "Allow Active Pane").

Yes, I am aware of this. It must be not working on wxMac then, will try to look into it as time provides.

4) The tab and pane close buttons have very jagged edges (this is just like
the wx.aui). This is wxMac specific issue because they use round buttons,
the gtk/windows buttons look fine.

Uhm, do you happen to have a screenshot of it? What should I do to fix
this issue? Since it's Mac-specific, whatever modification I make will
be hard to test unless I have a very clear idea of what to do :-(. Or
maybe could you provide the correct close buttons images for the Mac?

I think its the bitmaps used to draw the buttons. It would be nice if they had antialiased edges or if we just drew them our selves on the fly with a GCDC instead of using a bitmap.

tab_buttons.png

camino_tabs.png

doc_pane_xbtn.png

···

On Apr 3, 2009, at 3:28 AM, Andrea Gavana wrote:

Hi Cody,

Hello,

Uhm, do you happen to have a screenshot of it? What should I do to fix
this issue? Since it's Mac-specific, whatever modification I make will
be hard to test unless I have a very clear idea of what to do :-(. Or
maybe could you provide the correct close buttons images for the Mac?

I think its the bitmaps used to draw the buttons. It would be nice if they
had antialiased edges or if we just drew them our selves on the fly with a
GCDC instead of using a bitmap.

That's not a big problem to me, I can modify the code to use GCDC and
draw the bitmaps. Let me dig into it and I'll see what I can do.

On mouse over they get highlighted black, it would look more natural if the
were just darkened some using a darker shade of the regular color.
Admittedly this is not a critical issue but it would make the overall
appearance much nicer.

Uhm, ok, I'll implement a possible solution and come back to you to
see if they look good enough on the Mac.

Would it be possible to also have an option to draw the close button on the
left side of the tab?

I think it can be done without much effort.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Fri, Apr 3, 2009 at 2:14 PM, Cody Precord wrote:

On Apr 3, 2009, at 3:28 AM, Andrea Gavana wrote:

Hi Cody & All,

Hello,

Hi Cody,

4) The tab and pane close buttons have very jagged edges (this is just
like
the wx.aui). This is wxMac specific issue because they use round buttons,
the gtk/windows buttons look fine.

Uhm, do you happen to have a screenshot of it? What should I do to fix
this issue? Since it's Mac-specific, whatever modification I make will
be hard to test unless I have a very clear idea of what to do :-(. Or
maybe could you provide the correct close buttons images for the Mac?

I think its the bitmaps used to draw the buttons. It would be nice if they
had antialiased edges or if we just drew them our selves on the fly with a
GCDC instead of using a bitmap.

Regarding this issue, I have hacked a small script that uses
wx.GraphicsContext to draw the close bitmaps. I attach it to this
e-mail. If you run it, you will see on the left the original AUI
bitmap (generated from bits) and on the right the one creates using
wx.GraphicsContext.

The Mac bitmap looks reasonably good; I am not so sure about the GTK
one and, although it is the simplest one, the MSW one doesn't look
good at all. This is because wx.GraphicsContext doesn't allow
non-integral pen widths, so I am either stuck with pen widths of 1 or
2.

Please feel free to make all modifications you like to the script. We
may end up with nicer bitmap using GCDC.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

aui_images_sample.py (4.2 KB)

···

On Fri, Apr 3, 2009 at 2:14 PM, Cody Precord wrote:

On Apr 3, 2009, at 3:28 AM, Andrea Gavana wrote:

Hello,

···

On Fri, Apr 3, 2009 at 10:50 AM, Andrea Gavana andrea.gavana@gmail.com wrote:

Hi Cody & All,

On Fri, Apr 3, 2009 at 2:14 PM, Cody Precord wrote:

Hello,

On Apr 3, 2009, at 3:28 AM, Andrea Gavana wrote:

Hi Cody,

  1. The tab and pane close buttons have very jagged edges (this is just
    like
    the wx.aui). This is wxMac specific issue because they use round buttons,
    the gtk/windows buttons look fine.

Uhm, do you happen to have a screenshot of it? What should I do to fix
this issue? Since it’s Mac-specific, whatever modification I make will
be hard to test unless I have a very clear idea of what to do :-(. Or

maybe could you provide the correct close buttons images for the Mac?

I think its the bitmaps used to draw the buttons. It would be nice if they
had antialiased edges or if we just drew them our selves on the fly with a

GCDC instead of using a bitmap.

Regarding this issue, I have hacked a small script that uses
wx.GraphicsContext to draw the close bitmaps. I attach it to this
e-mail. If you run it, you will see on the left the original AUI

bitmap (generated from bits) and on the right the one creates using
wx.GraphicsContext.

The Mac bitmap looks reasonably good; I am not so sure about the GTK
one and, although it is the simplest one, the MSW one doesn’t look

good at all. This is because wx.GraphicsContext doesn’t allow
non-integral pen widths, so I am either stuck with pen widths of 1 or
2.

I would say that the mac one is significantly better. I will double check again this evening on my machine at home (on XP right now).

The GTK one looks better on some levels but also looks slightly fuzzy, I will double check on one of my linux setups this evening as well an see if the drawing is any different there.

Thanks,

Cody

Hello,

···

On Apr 3, 2009, at 10:50 AM, Andrea Gavana wrote:

Hi Cody & All,

On Fri, Apr 3, 2009 at 2:14 PM, Cody Precord wrote:

Hello,

On Apr 3, 2009, at 3:28 AM, Andrea Gavana wrote:

Hi Cody,

4) The tab and pane close buttons have very jagged edges (this is just
like
the wx.aui). This is wxMac specific issue because they use round buttons,
the gtk/windows buttons look fine.

Uhm, do you happen to have a screenshot of it? What should I do to fix
this issue? Since it's Mac-specific, whatever modification I make will
be hard to test unless I have a very clear idea of what to do :-(. Or
maybe could you provide the correct close buttons images for the Mac?

I think its the bitmaps used to draw the buttons. It would be nice if they
had antialiased edges or if we just drew them our selves on the fly with a
GCDC instead of using a bitmap.

Regarding this issue, I have hacked a small script that uses
wx.GraphicsContext to draw the close bitmaps. I attach it to this
e-mail. If you run it, you will see on the left the original AUI
bitmap (generated from bits) and on the right the one creates using
wx.GraphicsContext.

The Mac bitmap looks reasonably good; I am not so sure about the GTK
one and, although it is the simplest one, the MSW one doesn't look
good at all. This is because wx.GraphicsContext doesn't allow
non-integral pen widths, so I am either stuck with pen widths of 1 or
2.

The Mac one is definitely better. The GTK one does not render so well on GTK though so I would say to stick with the bitmap version. So perhaps only draw the Mac one and use the bitmaps for the other platforms would seem to produce the best results for now.

Thanks,

Cody

Hi Cody & All,

Hello,

Hi Cody & All,

Hello,

Hi Cody,

4) The tab and pane close buttons have very jagged edges (this is just
like
the wx.aui). This is wxMac specific issue because they use round
buttons,
the gtk/windows buttons look fine.

Uhm, do you happen to have a screenshot of it? What should I do to fix
this issue? Since it's Mac-specific, whatever modification I make will
be hard to test unless I have a very clear idea of what to do :-(. Or
maybe could you provide the correct close buttons images for the Mac?

I think its the bitmaps used to draw the buttons. It would be nice if
they
had antialiased edges or if we just drew them our selves on the fly with
a
GCDC instead of using a bitmap.

Regarding this issue, I have hacked a small script that uses
wx.GraphicsContext to draw the close bitmaps. I attach it to this
e-mail. If you run it, you will see on the left the original AUI
bitmap (generated from bits) and on the right the one creates using
wx.GraphicsContext.

The Mac bitmap looks reasonably good; I am not so sure about the GTK
one and, although it is the simplest one, the MSW one doesn't look
good at all. This is because wx.GraphicsContext doesn't allow
non-integral pen widths, so I am either stuck with pen widths of 1 or
2.

The Mac one is definitely better. The GTK one does not render so well on GTK
though so I would say to stick with the bitmap version. So perhaps only draw
the Mac one and use the bitmaps for the other platforms would seem to
produce the best results for now.

I have updated the SVN with the wxMAC close bitmap drawn using
GraphicsContext, plus the following you pointed out:

- Added support for left close button on AuiNotebook tabs (with style
AUI_NB_CLOSE_ON_TAB_LEFT);
- Use wx.GraphicsContext to draw the wxMAC close buttons on tabs and on panes;
- No more square highlighting of pane buttons on mouse over on wxMAC
(the bitmap colour is slightly darkened instead).

Please let me know if these modifications are like what you expected.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Sat, Apr 4, 2009 at 9:00 PM, Cody Precord wrote:

On Apr 3, 2009, at 10:50 AM, Andrea Gavana wrote:

On Fri, Apr 3, 2009 at 2:14 PM, Cody Precord wrote:

On Apr 3, 2009, at 3:28 AM, Andrea Gavana wrote:

The tab buttons look much better, just made one small adjustment to the hover over colour.

The Pane close buttons don't have any indication when they are hovered over or clicked on now, on a quick inspection it looks like the plain colour and the hover over are both white.

When the panes are undocked is there a reason for using frames with custom drawn titlebars? or could they just use regular minframes with the native title bars on them like the wx.aui?

Thanks,

Cody

···

On Apr 5, 2009, at 6:53 AM, Andrea Gavana wrote:

Hi Cody & All,

The Mac one is definitely better. The GTK one does not render so well on GTK
though so I would say to stick with the bitmap version. So perhaps only draw
the Mac one and use the bitmaps for the other platforms would seem to
produce the best results for now.

I have updated the SVN with the wxMAC close bitmap drawn using
GraphicsContext, plus the following you pointed out:

- Added support for left close button on AuiNotebook tabs (with style
AUI_NB_CLOSE_ON_TAB_LEFT);
- Use wx.GraphicsContext to draw the wxMAC close buttons on tabs and on panes;
- No more square highlighting of pane buttons on mouse over on wxMAC
(the bitmap colour is slightly darkened instead).

Please let me know if these modifications are like what you expected.

Hi Cody,

Hi Cody & All,

The Mac one is definitely better. The GTK one does not render so well on
GTK
though so I would say to stick with the bitmap version. So perhaps only
draw
the Mac one and use the bitmaps for the other platforms would seem to
produce the best results for now.

I have updated the SVN with the wxMAC close bitmap drawn using
GraphicsContext, plus the following you pointed out:

- Added support for left close button on AuiNotebook tabs (with style
AUI_NB_CLOSE_ON_TAB_LEFT);
- Use wx.GraphicsContext to draw the wxMAC close buttons on tabs and on
panes;
- No more square highlighting of pane buttons on mouse over on wxMAC
(the bitmap colour is slightly darkened instead).

Please let me know if these modifications are like what you expected.

The tab buttons look much better, just made one small adjustment to the
hover over colour.

Thank you, it's a bit complicated for me to check if the modifications
I make have a nice effect or not on the Mac :smiley:

The Pane close buttons don't have any indication when they are hovered over
or clicked on now, on a quick inspection it looks like the plain colour and
the hover over are both white.

Uhm, to highlight the pane buttons I rebuild the bitmap on the fly
using AdjustChannels in this way (bmp is the caption bitmap):

    image = bmp.ConvertToImage()
    red = caption_colour.Red()/float(new_colour.Red())
    green = caption_colour.Green()/float(new_colour.Green())
    blue = caption_colour.Blue()/float(new_colour.Blue())
    image = image.AdjustChannels(red, green, blue)
    return image.ConvertToBitmap()

Where "caption_colour" is "self._active_caption_colour" in the dockart
and "new_colour" is a StepColour(self._active_caption_colour, 110).
Probably self._active_caption_colour is white on the Mac? I'll try
some other solution, or if you can come up with a reasonable value to
use in the StepColour function to achieve good contrast on the Mac I
would be happy to apply it.

When the panes are undocked is there a reason for using frames with custom
drawn titlebars? or could they just use regular minframes with the native
title bars on them like the wx.aui?

The reason behind using custom miniframes is mainly due to:

- wx.aui uses real wx.MiniFrames but binds the wx.EVT_MOVING and
wx.EVT_MOVE for the floating frames, and these generates a huge amount
of streaming events every time a floating pane is moved. These events
need to be caught, analyzed and sometimes discarded if the user is
moving the frame too fast (to avoid flickering in the redrawing);
- AUI does not catch these events: it processes instead the mouse
motion inside the custom miniframe, which results in a much smoother
movement than the wx.aui one. Unfortunately, if you use regular
wx.MiniFrames and the user drags the MiniFrame title bar, these mouse
motion events are not generated. For this reason, a fake titlebar must
be drawn in the custom MiniFrame client area and the look of the
floating pane may be less native than the wx.aui one. On Windows this
is not a big issue, as if you have the win32api installed, you can use
the ModernDockArt class in "dockart.py" to achieve platform native
look and feel for the floating and docked panes too.

I may be able to revert using standard wx.MiniFrames, but it's quite a
lot of work and I would prefer to avoid it...

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On Mon, Apr 6, 2009 at 1:54 AM, Cody Precord wrote:

On Apr 5, 2009, at 6:53 AM, Andrea Gavana wrote: