FlatNotebook - navigate/focus to first control on tab

I am trying to set the focus to the first control in a panel which is a
page in the FNB.

I always get the focus on the tab, also I tried:

wx.CallLater(10, self.Navigate)

or from a FNB page changed event:
wx.CallAfter(self.searchCriteria.Navigate)
or
wx.CallAfter(self.searchCriteria..control.SetFocus)

If I do:
wx.CallLater(100, self.Navigate)

it works, but this is really a hack and I am sure there is a more
elegant/correct way of doing it.

Welcoming any tips, as the head is starting to hurt after all this
hitting against the wall :slight_smile:
Werner

Hello,

I am trying to set the focus to the first control in a panel which is a
page in the FNB.

I always get the focus on the tab, also I tried:

wx.CallLater(10, self.Navigate)

or from a FNB page changed event:
wx.CallAfter(self.searchCriteria.Navigate)
or
wx.CallAfter(self.searchCriteria..control.SetFocus)

If I do:
wx.CallLater(100, self.Navigate)

it works, but this is really a hack and I am sure there is a more
elegant/correct way of doing it.

I think I worked around this behavior in my local copy of fnb by
commenting out a SetFocus call in the FNB.PageContainer (see
Editra/src/extern/flatnotebook.py). I didn't want the tabs to ever
have focus so this worked for me a more general solution would
probably be to add another style parameter to the control for turning
this on and off.

Welcoming any tips, as the head is starting to hurt after all this
hitting against the wall :slight_smile:

Wear a helmet :wink:

Cody

···

On Mon, Jun 15, 2009 at 8:01 AM, Werner F. Bruhin<wbruhin@gmail.com> wrote:

Cody,

Cody Precord wrote:

..

I think I worked around this behavior in my local copy of fnb by
commenting out a SetFocus call in the FNB.PageContainer (see
Editra/src/extern/flatnotebook.py). I didn't want the tabs to ever
have focus so this worked for me a more general solution would
probably be to add another style parameter to the control for turning
this on and off.
  

Will have a look at this, thanks.

  

Welcoming any tips, as the head is starting to hurt after all this
hitting against the wall :slight_smile:
    
Wear a helmet :wink:
  

Oh, that is too easy :slight_smile:

Werner

Hi All,

Hello,

I am trying to set the focus to the first control in a panel which is a
page in the FNB.

I always get the focus on the tab, also I tried:

wx.CallLater(10, self.Navigate)

or from a FNB page changed event:
wx.CallAfter(self.searchCriteria.Navigate)
or
wx.CallAfter(self.searchCriteria..control.SetFocus)

If I do:
wx.CallLater(100, self.Navigate)

it works, but this is really a hack and I am sure there is a more
elegant/correct way of doing it.

I think I worked around this behavior in my local copy of fnb by
commenting out a SetFocus call in the FNB.PageContainer (see
Editra/src/extern/flatnotebook.py). I didn't want the tabs to ever
have focus so this worked for me a more general solution would
probably be to add another style parameter to the control for turning
this on and off.

Probably adding a new style is the only way to support both behaviour.
The problem is, I have probably run out of window styles for
FlatNotebook (before conflicting with the wxWidgets window styles).
I'll take a look at it tomorrow morning and see what can be done.

Andrea.

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

···

On Mon, Jun 15, 2009 at 2:41 PM, Cody Precord wrote:

On Mon, Jun 15, 2009 at 8:01 AM, Werner F. Bruhin<wbruhin@gmail.com> wrote:

Hi All,

Hi All,

Hello,

I am trying to set the focus to the first control in a panel which is a
page in the FNB.

I always get the focus on the tab, also I tried:

wx.CallLater(10, self.Navigate)

or from a FNB page changed event:
wx.CallAfter(self.searchCriteria.Navigate)
or
wx.CallAfter(self.searchCriteria..control.SetFocus)

If I do:
wx.CallLater(100, self.Navigate)

it works, but this is really a hack and I am sure there is a more
elegant/correct way of doing it.

I think I worked around this behavior in my local copy of fnb by
commenting out a SetFocus call in the FNB.PageContainer (see
Editra/src/extern/flatnotebook.py). I didn't want the tabs to ever
have focus so this worked for me a more general solution would
probably be to add another style parameter to the control for turning
this on and off.

Probably adding a new style is the only way to support both behaviour.
The problem is, I have probably run out of window styles for
FlatNotebook (before conflicting with the wxWidgets window styles).
I'll take a look at it tomorrow morning and see what can be done.

There is now an updated version of FlatNotebook in SVN which has a new
window style called FNB_NO_TAB_FOCUS. With this style specified, the
focus will not go on the notebook tabs but on the notebook pages
themselves. Thank you for the bug report/feature request!

Andrea.

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

···

On 15 June 2009 22:02, Andrea Gavana wrote:

On Mon, Jun 15, 2009 at 2:41 PM, Cody Precord wrote:

On Mon, Jun 15, 2009 at 8:01 AM, Werner F. Bruhin<wbruhin@gmail.com> wrote:

Andrea,

Andrea Gavana wrote:

Hi All,
  
...
There is now an updated version of FlatNotebook in SVN which has a new
window style called FNB_NO_TAB_FOCUS. With this style specified, the
focus will not go on the notebook tabs but on the notebook pages
themselves. Thank you for the bug report/feature request!
  

Thanks, works like a charm
Werner

Andrea,

···

On Jun 16, 3:09 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:

Hi All,

On 15 June 2009 22:02, Andrea Gavana wrote:

> Hi All,

> On Mon, Jun 15, 2009 at 2:41 PM, Cody Precord wrote:

>> Hello,

>> On Mon, Jun 15, 2009 at 8:01 AM, Werner F. Bruhin<wbru...@gmail.com> wrote:

>>> I am trying to set the focus to the first control in a panel which is a
>>> page in the FNB.

>>> I always get the focus on the tab, also I tried:

>>> wx.CallLater(10, self.Navigate)

>>> or from a FNB page changed event:
>>> wx.CallAfter(self.searchCriteria.Navigate)
>>> or
>>> wx.CallAfter(self.searchCriteria..control.SetFocus)

>>> If I do:
>>> wx.CallLater(100, self.Navigate)

>>> it works, but this is really a hack and I am sure there is a more
>>> elegant/correct way of doing it.

>> I think I worked around this behavior in my local copy of fnb by
>> commenting out a SetFocus call in the FNB.PageContainer (see
>> Editra/src/extern/flatnotebook.py). I didn't want the tabs to ever
>> have focus so this worked for me a more general solution would
>> probably be to add another style parameter to the control for turning
>> this on and off.

> Probably adding a new style is the only way to support both behaviour.
> The problem is, I have probably run out of window styles for
> FlatNotebook (before conflicting with the wxWidgets window styles).
> I'll take a look at it tomorrow morning and see what can be done.

There is now an updated version of FlatNotebook in SVN which has a new
window style called FNB_NO_TAB_FOCUS. With this style specified, the
focus will not go on the notebook tabs but on the notebook pages
themselves. Thank you for the bug report/feature request!

Andrea.

So, are all these window styles for your various cool widgets getting
documented somewhere? I seem to recall you said you were going to, but
I never saw a link...

- Mike

Hi Mike,

2009/6/16 Mike Driscoll:

Andrea,

Hi All,

> Hi All,

>> Hello,

>>> I am trying to set the focus to the first control in a panel which is a
>>> page in the FNB.

>>> I always get the focus on the tab, also I tried:

>>> wx.CallLater(10, self.Navigate)

>>> or from a FNB page changed event:
>>> wx.CallAfter(self.searchCriteria.Navigate)
>>> or
>>> wx.CallAfter(self.searchCriteria..control.SetFocus)

>>> If I do:
>>> wx.CallLater(100, self.Navigate)

>>> it works, but this is really a hack and I am sure there is a more
>>> elegant/correct way of doing it.

>> I think I worked around this behavior in my local copy of fnb by
>> commenting out a SetFocus call in the FNB.PageContainer (see
>> Editra/src/extern/flatnotebook.py). I didn't want the tabs to ever
>> have focus so this worked for me a more general solution would
>> probably be to add another style parameter to the control for turning
>> this on and off.

> Probably adding a new style is the only way to support both behaviour.
> The problem is, I have probably run out of window styles for
> FlatNotebook (before conflicting with the wxWidgets window styles).
> I'll take a look at it tomorrow morning and see what can be done.

There is now an updated version of FlatNotebook in SVN which has a new
window style called FNB_NO_TAB_FOCUS. With this style specified, the
focus will not go on the notebook tabs but on the notebook pages
themselves. Thank you for the bug report/feature request!

Andrea.

So, are all these window styles for your various cool widgets getting
documented somewhere? I seem to recall you said you were going to, but
I never saw a link...

They are documented as docstrings in the source code (not for all the
AGW widgets though), but it looks like epydoc is not picking their
docstrings: if you look in the New wxPyDocs page for FlatNotebook
here:

http://wxpython.org/docs/api/wx.lib.agw.flatnotebook-module.html

There are no window styles nor documentation for them (unless I am
unable to see them). But if you look at the source code here:

http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/AGW/agw/flatnotebook.py?revision=61057&view=markup

You'll see something like this:

# Use Visual Studio 2003 (VC7.1) style for tabs
FNB_VC71 = 1
"""Use Visual Studio 2003 (VC7.1) style for tabs"""

# Use fancy style - square tabs filled with gradient coloring
FNB_FANCY_TABS = 2
"""Use fancy style - square tabs filled with gradient coloring"""

And so on. This is true for AUI too and for some of the other widgets
(I don't recall which ones at the moment). Maybe the docstrings format
I used is incorrect, I am not sure how epydoc treats these constants.
Anyway, if you have a nice idea on how to present the different window
styles for AGW please let me know.

Andrea.

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

···

On Jun 16, 3:09 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:

On 15 June 2009 22:02, Andrea Gavana wrote:
> On Mon, Jun 15, 2009 at 2:41 PM, Cody Precord wrote:
>> On Mon, Jun 15, 2009 at 8:01 AM, Werner F. Bruhin<wbru...@gmail.com> wrote:

Andrea,

Hi Mike,

2009/6/16 Mike Driscoll:

> Andrea,

>> Hi All,

>> > Hi All,

>> >> Hello,

>> >>> I am trying to set the focus to the first control in a panel which is a
>> >>> page in the FNB.

>> >>> I always get the focus on the tab, also I tried:

>> >>> wx.CallLater(10, self.Navigate)

>> >>> or from a FNB page changed event:
>> >>> wx.CallAfter(self.searchCriteria.Navigate)
>> >>> or
>> >>> wx.CallAfter(self.searchCriteria..control.SetFocus)

>> >>> If I do:
>> >>> wx.CallLater(100, self.Navigate)

>> >>> it works, but this is really a hack and I am sure there is a more
>> >>> elegant/correct way of doing it.

>> >> I think I worked around this behavior in my local copy of fnb by
>> >> commenting out a SetFocus call in the FNB.PageContainer (see
>> >> Editra/src/extern/flatnotebook.py). I didn't want the tabs to ever
>> >> have focus so this worked for me a more general solution would
>> >> probably be to add another style parameter to the control for turning
>> >> this on and off.

>> > Probably adding a new style is the only way to support both behaviour.
>> > The problem is, I have probably run out of window styles for
>> > FlatNotebook (before conflicting with the wxWidgets window styles).
>> > I'll take a look at it tomorrow morning and see what can be done.

>> There is now an updated version of FlatNotebook in SVN which has a new
>> window style called FNB_NO_TAB_FOCUS. With this style specified, the
>> focus will not go on the notebook tabs but on the notebook pages
>> themselves. Thank you for the bug report/feature request!

>> Andrea.

> So, are all these window styles for your various cool widgets getting
> documented somewhere? I seem to recall you said you were going to, but
> I never saw a link...

They are documented as docstrings in the source code (not for all the
AGW widgets though), but it looks like epydoc is not picking their
docstrings: if you look in the New wxPyDocs page for FlatNotebook
here:

wxPython API Documentation — wxPython Phoenix 4.2.2 documentation

There are no window styles nor documentation for them (unless I am
unable to see them). But if you look at the source code here:

http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/AGW/agw/flatnote

You'll see something like this:

# Use Visual Studio 2003 (VC7.1) style for tabs
FNB_VC71 = 1
"""Use Visual Studio 2003 (VC7.1) style for tabs"""

# Use fancy style - square tabs filled with gradient coloring
FNB_FANCY_TABS = 2
"""Use fancy style - square tabs filled with gradient coloring"""

And so on. This is true for AUI too and for some of the other widgets
(I don't recall which ones at the moment). Maybe the docstrings format
I used is incorrect, I am not sure how epydoc treats these constants.
Anyway, if you have a nice idea on how to present the different window
styles for AGW please let me know.

Andrea.

I remember seeing this stuff in the code. Hmmm...I guess I was
thinking of some kind of list of the styles with little snapshots of
the effect next to them. I must be more of a visual learner than I
realized.

No big deal either way. Reading the code and using your fancy demos
are usually enough.

- Mike

···

On Jun 17, 5:56 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:

> On Jun 16, 3:09 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:
>> On 15 June 2009 22:02, Andrea Gavana wrote:
>> > On Mon, Jun 15, 2009 at 2:41 PM, Cody Precord wrote:
>> >> On Mon, Jun 15, 2009 at 8:01 AM, Werner F. Bruhin<wbru...@gmail.com> wrote:

Andrea Gavana wrote:

And so on. This is true for AUI too and for some of the other widgets
(I don't recall which ones at the moment). Maybe the docstrings format
I used is incorrect, I am not sure how epydoc treats these constants.

I'm not sure I remember the details of how epydoc handles things like this, but I may have simply turned it off because of the all the noise that would have been generated from the huge number of constants in the core wx modules.

Anyway, if you have a nice idea on how to present the different window
styles for AGW please let me know.

I would just make a table in the class docstring or perhaps in the docstring for the __init__ method. IOW, document them along with the items that use them.

···

--
Robin Dunn
Software Craftsman

Hi Andrea,

I get the following strange behaviour on GUI2Exe:

I compile a project, successfully, and get the following message:

Outlook.jpg

I then choose “Yes”, and always get the following error:

Outlook.jpg

How come ?

The GUI2Exe I use is:

Outlook.jpg

On Windows XP SP3.

Bye,

Ron.

Nothing defines humans better than their willingness to do irrational things in the pursuit of phenomenally unlikely payoffs.This is the principle behind lotteries, dating, and religion. (Scott Adams)

image001.jpg

image003.jpg

I can't seem to find a binary for pybdb for py2.6, which is a GUI2Exe dependency; does such a beast exist?

Ray

Ray,

RayS wrote:

I can't seem to find a binary for pybdb for py2.6, which is a GUI2Exe dependency; does such a beast exist?
  

What errors are you getting?

Gui2Exe uses

http://docs.python.org/library/bsddb.html

which is deprecatedin Py2.6, but still there.

where do you find a dependency for pybdb? I can't find anything in gui2exe nor with google by this name.

Werner

Hi All,

2009/6/17 Robin Dunn:

Andrea Gavana wrote:

And so on. This is true for AUI too and for some of the other widgets
(I don't recall which ones at the moment). Maybe the docstrings format
I used is incorrect, I am not sure how epydoc treats these constants.

I'm not sure I remember the details of how epydoc handles things like
this, but I may have simply turned it off because of the all the noise
that would have been generated from the huge number of constants in the
core wx modules.

Anyway, if you have a nice idea on how to present the different window
styles for AGW please let me know.

I would just make a table in the class docstring or perhaps in the
docstring for the __init__ method. IOW, document them along with the
items that use them.

I have polished a bit the AGW library and added the window styles and
event descriptions in the module documentation. You can see a
condensed version (all widgets together) of the new docs here:

http://xoomer.virgilio.it/infinity77/AGW_Docs/documentation.html

This has been done with Sphinx, obviously.

In any case, I believe epydoc will generate the correct tables once
the next wxPython documentation are updated.

Andrea.

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