NotebookCtrl For wxPython ;-)

Hello NG,

I would like to “announce” my last child, NotebookCtrl. This is my biggest contribution since FoldPanelBar, and in my opinion is also the nicest one I have made till now.
I would be glad, happy and grateful for every comment/idea you may have. The same also if you only try the demo.

“”"
Description:

NotebookCtrl Mimics The Behavior Of wx.Notebook, And Most Of Its Functionalities
Are Implemented In NotebookCtrl. However, NotebookCtrl Has A Lot Of Options That
wx.Notebook Does Not Have, And It Is Therefore Quite Customizable.
wx.Notebook Styles Not Implemented In NotebookCtrl Are:

  • wx.NB_LEFT
  • wx.NB_RIGHT
  • wx.NB_MULTILINE (But NotebookCtrl Has A SpinButton To Navigate Through Tabs).

Supported Customizations For NotebookCtrl Include:

  • Setting Individual Tab Font And Text Colour;
  • Images On Tabs (Line wx.Notebook);
  • Setting Individual Tab Colours;
  • Disabling/Enabling Individual Tabs (Also Visually Effective);
  • Drawing Of A Small Closing “X” At The Right Of Every Tab, This Enables The User
    To Close A Tab With A Mouse Click (Like eMule Tab Style);
  • Enabling Highlighted Tabs On Selection;
  • Drawing Focus Indicator In Each Tab (Like wx.Notebook);
  • Ctrl-Tab Keyboard Navigation Between Pages (Like wx.Notebook);
  • Tab With Animated Icons (Animation On Tabs);
  • Drag And Drop Tabs In NotebookCtrl;
  • ToolTips On Individual Tabs, With Customizable ToolTip Time Popup And ToolTip
    Window Size For Individual Tabs.

“”"

I have uploaded the source code and a nice (for me) demo in the usual place:

http://xoomer.virgilio.it/infinity77/eng/freeware.html#notebookctrl

Or, if you prefer in italian :wink: :

http://xoomer.virgilio.it/infinity77/ita/freeware.html#notebookctrl

I also attach the class and the demo to this mail, noting that someone has reported that my web page is somewhat “unreachable” from certain server. In order to build the demo and to make it look like the wxPython notebook demo, I have modified the source of some scripts that wxPython demo uses to build wx.Notebook pages. I also attach these script.

I really welcome any comments, suggestions and ideas you may have, also reporting other platforms behavior (I’m on Windows 2000/XP, Python 2.4.1 and wxPython 2.6.1.1 prerelease).

Thanks for every comments, and sorry for the long post and for the attachment.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”
http://xoomer.virgilio.it/infinity77

Hello NG,

    thanks Tacao for the bug report. Now everything should be fine. This is
what happens now:

1) If a tab is disabled, it is no more closable using the "X";
2) If a tab is selected and *then* it is made inactive, the next active tab
is selected (using AdvanceSelection). I don't know if this is a desired
behavior, but in my opinion a disabled tab should not be selectable nor
selected.
3) If only 1 tab exists and then it is made inactive, there is nothing I can
do (I suppose) unless leaving it visible (selected).

Tacao has a great attitude in finding bugs in my controls :wink: , so I thank
you a lot about the bug reports and feedbacks you always provide. I am
unable to send to Tacao directly an email (your server always reject emails
from mine), so I'm attaching again NotebookCtrl to this email. Sorry for
that. And, obviously, it is re-uploaded here:

http://xoomer.virgilio.it/infinity77/eng/freeware.html#notebookctrl

Thanks a lot to everyone for your suggestions and pointers.

P.S. I don't know on which platforms Peter, Tacao and Michael are... I
always code in Windows, so I am always curious about how these little
controls behave on other platforms... How does it look like on other OSs?

Andrea.

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

NotebookCtrl.zip (34.6 KB)

···

----- Original Message -----
From: "E. A. Tacao" <e.a.tacao@estadao.com.br>
To: "E. A. Tacao" <wxPython-users@lists.wxwidgets.org>
Sent: Saturday, November 12, 2005 10:12 PM
Subject: Re[3]: [wxPython-users] ANN: NotebookCtrl For wxPython :wink:

Saturday, November 12, 2005, 6:08:37 PM, E. A. Tacao wrote:

> Saturday, November 12, 2005, 9:20:23 AM, Andrea Gavana wrote:

>> I also attach to this email the new implementation. I really welcome
>> any other comments or ideas, also new features requests.

> A disabled tab isn't closeable:

> - Open the demo;
> - Check the option "Show a disabled tab" -- the tab "Cyan" will be
> grayed out;
> - Click on the "Cyan" tab close button (nothing happens -- I guess
> it's ok).

> Now a disabled tab is closeable:

> - Open the demo;
> - Check the option "Show a disabled tab" -- the tab "Cyan" will be
> grayed out;
> - Click on any tab (except "Cyan") close button and click on "Yes";
> - Click on the "Cyan" tab close button and click on "Yes".

Actually is a bit stranger: clicking on a close button for a disabled
tab will close the the tab currently shown.

-- tacao

No bits were harmed during the making of this e-mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Sunday, November 13, 2005, 5:53:37 PM, Andrea Gavana wrote:

(...)
I am unable to send to Tacao directly an email (your server
always reject emails from mine), so I'm attaching again NotebookCtrl
to this email.

Please try sending to this address instead:
<e.a.tacao@bol.com.br>

-- tacao

No bits were harmed during the making of this e-mail.

First of all thank you for all your work! It's impressive!
I'm going to check the MAC issue on my mac mini, because i want to use your notebookctrl on my editor too ( www.sepy.it ) :slight_smile:

I'm just playing with the demo you provide within the .zip
I added this to the OnPageClosing:

print event.GetSelection()
print event.GetOldSeleection()

(this because i need to switch to the new selection before close a document..)

but i received this error:
AttributeError: 'NotebookCtrlEvent' object has no attribute '_oldselection'

Another question:
is it possible to have some sort of "mouse over" effect when mouse move over the "X" symbol?

thank you in advance :slight_smile:

Alessandro

Andrea Gavana wrote:

···

Hello NG,

I would like to "announce" my last child, NotebookCtrl. This is my biggest contribution since FoldPanelBar, and in my opinion is also the nicest one I have made till now.
I would be glad, happy and grateful for every comment/idea you may have. The same also if you only try the demo.

"""
Description:
NotebookCtrl Mimics The Behavior Of wx.Notebook, And Most Of Its Functionalities
Are Implemented In NotebookCtrl. However, NotebookCtrl Has A Lot Of Options That
wx.Notebook Does Not Have, And It Is Therefore Quite Customizable.
wx.Notebook Styles Not Implemented In NotebookCtrl Are:
- wx.NB_LEFT
- wx.NB_RIGHT
- wx.NB_MULTILINE (But NotebookCtrl Has A SpinButton To Navigate Through Tabs).
Supported Customizations For NotebookCtrl Include:
- Setting Individual Tab Font And Text Colour;
- Images On Tabs (Line wx.Notebook);
- Setting Individual Tab Colours;
- Disabling/Enabling Individual Tabs (Also Visually Effective);
- Drawing Of A Small Closing "X" At The Right Of Every Tab, This Enables The User
  To Close A Tab With A Mouse Click (Like eMule Tab Style);
- Enabling Highlighted Tabs On Selection;
- Drawing Focus Indicator In Each Tab (Like wx.Notebook);
- Ctrl-Tab Keyboard Navigation Between Pages (Like wx.Notebook);
- Tab With Animated Icons (Animation On Tabs);
- Drag And Drop Tabs In NotebookCtrl;
- ToolTips On Individual Tabs, With Customizable ToolTip Time Popup And ToolTip
  Window Size For Individual Tabs.

"""

I have uploaded the source code and a nice (for me) demo in the usual place:

http://xoomer.virgilio.it/infinity77/eng/freeware.html#notebookctrl

Or, if you prefer in italian :wink: :

http://xoomer.virgilio.it/infinity77/ita/freeware.html#notebookctrl

I also attach the class and the demo to this mail, noting that someone has reported that my web page is somewhat "unreachable" from certain server. In order to build the demo and to make it look like the wxPython notebook demo, I have modified the source of some scripts that wxPython demo uses to build wx.Notebook pages. I also attach these script.

I really welcome any comments, suggestions and ideas you may have, also reporting other platforms behavior (I'm on Windows 2000/XP, Python 2.4.1 and wxPython 2.6.1.1 prerelease).

Thanks for every comments, and sorry for the long post and for the attachment.

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

--
Alessandro Crugnola
Flash | PHP | Python Developer

+39 3939402645
+39 0236522445
--

Hello Alessandro & NG,

First of all thank you for all your work! It's impressive!
I'm going to check the MAC issue on my mac mini, because i want to use
your notebookctrl on my editor too ( www.sepy.it ) :slight_smile:

Thanks for this, there are now 3 wxPython users that have asked about
NotebookCtrl on Mac and I can't help them because I don't have Mac... :frowning:
If you manage to make it working under Mac, I think it will be a nice
contribution to wxPython, now that I know that it works on all platforms
excluding Mac.

I'm just playing with the demo you provide within the .zip
I added this to the OnPageClosing:

print event.GetSelection()
print event.GetOldSeleection()

(this because i need to switch to the new selection before close a
document..)

but i received this error:
AttributeError: 'NotebookCtrlEvent' object has no attribute

'_oldselection'

Mhm... this is something I have corrected now; it should work, but please
report if it does not what you expected.

Another question:
is it possible to have some sort of "mouse over" effect when mouse move
over the "X" symbol?

Yes, it should be doable... which kind of "mouse over" effect you would like
to have? In any case, adding a mouse over effect on the "X" symbol will mean
redrawing the tabs every time the mouse is over the "X" symbol. This could
slow down NotebookCtrl draw performances a bit (or a lot, I don't know). I
will try to play with wx.ClientDC() *outside* the OnPaint() method to avoid
the complete redraw of NotebookCtrl, but I am not sure if it will work.

I have re-uploaded the new version here (without the mouse over effects,
only with the OnPageChanging() changes):

http://xoomer.virgilio.it/infinity77/eng/freeware.html#notebookctrl

thank you in advance :slight_smile:

Thanks to you for your work on the Mac issue :wink:

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

Hi again,

    just to add a small comment: I will be away next week for work, so I
won't be able to read emails until tuesday 6 december. So, please be patient
if you discover something else that is not working correctly or if you want
to ask for a feature for NotebookCtrl. I will be very happy if you manage to
make NotebookCtrl working on wxMac :wink:

Thank you a lot.

Andrea.

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

···

----- Original Message -----
From: "Alessandro Crugnola" <wishmaster@sephiroth.it>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Sunday, November 27, 2005 8:25 PM
Subject: Re: [wxPython-users] NotebookCtrl For wxPython :wink:

First of all thank you for all your work! It's impressive!
I'm going to check the MAC issue on my mac mini, because i want to use
your notebookctrl on my editor too ( www.sepy.it ) :slight_smile:

I'm just playing with the demo you provide within the .zip
I added this to the OnPageClosing:

print event.GetSelection()
print event.GetOldSeleection()

(this because i need to switch to the new selection before close a
document..)

but i received this error:
AttributeError: 'NotebookCtrlEvent' object has no attribute

'_oldselection'

Another question:
is it possible to have some sort of "mouse over" effect when mouse move
over the "X" symbol?

thank you in advance :slight_smile:

Alessandro

Andrea Gavana wrote:
> Hello NG,
>
> I would like to "announce" my last child, NotebookCtrl. This is my
> biggest contribution since FoldPanelBar, and in my opinion is also the
> nicest one I have made till now.
> I would be glad, happy and grateful for every comment/idea you may have.
> The same also if you only try the demo.
>
> """
> Description:
>
> NotebookCtrl Mimics The Behavior Of wx.Notebook, And Most Of Its
> Functionalities
> Are Implemented In NotebookCtrl. However, NotebookCtrl Has A Lot Of
> Options That
> wx.Notebook Does Not Have, And It Is Therefore Quite Customizable.
> wx.Notebook Styles Not Implemented In NotebookCtrl Are:
>
> - wx.NB_LEFT
> - wx.NB_RIGHT
> - wx.NB_MULTILINE (But NotebookCtrl Has A SpinButton To Navigate Through
> Tabs).
>
> Supported Customizations For NotebookCtrl Include:
>
> - Setting Individual Tab Font And Text Colour;
> - Images On Tabs (Line wx.Notebook);
> - Setting Individual Tab Colours;
> - Disabling/Enabling Individual Tabs (Also Visually Effective);
> - Drawing Of A Small Closing "X" At The Right Of Every Tab, This Enables
> The User
> To Close A Tab With A Mouse Click (Like eMule Tab Style);
> - Enabling Highlighted Tabs On Selection;
> - Drawing Focus Indicator In Each Tab (Like wx.Notebook);
> - Ctrl-Tab Keyboard Navigation Between Pages (Like wx.Notebook);
> - Tab With Animated Icons (Animation On Tabs);
> - Drag And Drop Tabs In NotebookCtrl;
> - ToolTips On Individual Tabs, With Customizable ToolTip Time Popup And
> ToolTip
> Window Size For Individual Tabs.
>
> """
>
> I have uploaded the source code and a nice (for me) demo in the usual

place:

>
> http://xoomer.virgilio.it/infinity77/eng/freeware.html#notebookctrl
>
> Or, if you prefer in italian :wink: :
>
> http://xoomer.virgilio.it/infinity77/ita/freeware.html#notebookctrl
>
> I also attach the class and the demo to this mail, noting that someone
> has reported that my web page is somewhat "unreachable" from certain
> server. In order to build the demo and to make it look like the wxPython
> notebook demo, I have modified the source of some scripts that wxPython
> demo uses to build wx.Notebook pages. I also attach these script.
>
> I really welcome any comments, suggestions and ideas you may have, also
> reporting other platforms behavior (I'm on Windows 2000/XP, Python 2.4.1
> and wxPython 2.6.1.1 prerelease).
>
>
> Thanks for every comments, and sorry for the long post and for the
> attachment.
>
> Andrea.
> "Imagination Is The Only Weapon In The War Against Reality."
> http://xoomer.virgilio.it/infinity77

--
Alessandro Crugnola
Flash | PHP | Python Developer

http://www.blumerstudio.com
http://www.sephiroth.it

+39 3939402645
+39 0236522445
--

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

> Mhm... this is something I have corrected now; it should work, but please
> report if it does not what you expected.

I was expecting that
event.GetSelection() returns me the tab which is being deleted and
event.GetOldSelection() the old notebook selection before the "x" was clicked

Yes, it should be doable... which kind of "mouse over" effect you would like
to have? In any case, adding a mouse over effect on the "X" symbol will mean
redrawing the tabs every time the mouse is over the "X" symbol. This could
slow down NotebookCtrl draw performances a bit (or a lot, I don't know). I
will try to play with wx.ClientDC() *outside* the OnPaint() method to avoid
the complete redraw of NotebookCtrl, but I am not sure if it will work.

I dont think the performance will decrease so much.. but just an opinion.
What I mean is just an over effect like when you move mouse over the "X" symbols of windows explorers windows.. this is help users to understand that the close button is active..

···

--
Alessandro Crugnola
Flash | PHP | Python Developer

+39 3939402645
+39 0236522445
--

Hello Alessandro & NG,

I was expecting that
event.GetSelection() returns me the tab which is being deleted and
event.GetOldSelection() the old notebook selection before the "x" was
clicked

I think now it is doing what you are asking... or am I missing something?

I dont think the performance will decrease so much.. but just an opinion.
What I mean is just an over effect like when you move mouse over the "X"
symbols of windows explorers windows.. this is help users to understand
that the close button is active..

I have done some work this evening, you can try the new version at:

http://xoomer.virgilio.it/infinity77/eng/freeware.html#notebookctrl

that does some mouse over effect (highlighting of the "X" button). Is this
what you need? If I have misunderstood something, please let me know. This
modification affects both Opera and eMule "X" button style, but obviously is
much more visible on the Opera style :wink:

Andrea.

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