Notebook.HitTest( ) on Phoenix

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Notebook.HitTest( ) on Phoenix

Andy Kelts

I’m having trouble getting the Notebook’s HitTest( ) call to return anything other than ( -1, int ) in Phoenix.

The int is always some really large number that changes with every run, but is consistently the same across all tabs during each session.

 

wx.version( ) == '4.0.0a3 msw (phoenix)'

 

Sample code (also attached):

 

import wx

 

def _on_right( event ):

                pos = event.GetPosition( )

                print( event.GetEventObject( ).HitTest( pos ) )

                event.Skip( )

 

 

if __name__ == '__main__':

                app = wx.App( )

                frame = wx.Frame( None )

                szr_main = wx.BoxSizer( wx.HORIZONTAL )

                panel = wx.Panel( frame, size = ( 600, 600 ) )

                panel.SetSizer( szr_main )

 

                notebook = wx.Notebook( panel, size = ( 600, 600 ) )

                notebook.AddPage( wx.TextCtrl( notebook ), 'Page 1' )

                notebook.AddPage( wx.TextCtrl( notebook ), 'Page 2' )

                notebook.AddPage( wx.TextCtrl( notebook ), 'Page 3' )

                notebook.Bind( wx.EVT_RIGHT_DOWN, _on_right )

 

                szr_main.Add( notebook, 0, wx.ALL | wx.EXPAND, 2 )

 

                frame.Fit( )

                frame.Show( )

                app.MainLoop( )




This e-mail may contain CONFIDENTIAL AND PROPRIETARY INFORMATION and/or PRIVILEGED AND CONFIDENTIAL COMMUNICATION intended solely for the recipient and, therefore, may not be retransmitted to any party outside of the recipient's organization without the prior written consent of the sender. If you have received this e-mail in error please notify the sender immediately by telephone or reply e-mail and destroy the original message without making a copy. Deep Silver, Inc. accepts no liability for any losses or damages resulting from infected e-mail transmissions and viruses in e-mail attachments.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

notebook.py (974 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Notebook.HitTest( ) on Phoenix

Igor Korot
Hi,

On Tue, Sep 5, 2017 at 2:06 PM, Andy Kelts <[hidden email]> wrote:
> I’m having trouble getting the Notebook’s HitTest( ) call to return anything
> other than ( -1, int ) in Phoenix.

Where is the mouse cursor when you try to check the HitTest() return?

Thank you.

>
> The int is always some really large number that changes with every run, but
> is consistently the same across all tabs during each session.
>
>
>
> wx.version( ) == '4.0.0a3 msw (phoenix)'
>
>
>
> Sample code (also attached):
>
>
>
> import wx
>
>
>
> def _on_right( event ):
>
>                 pos = event.GetPosition( )
>
>                 print( event.GetEventObject( ).HitTest( pos ) )
>
>                 event.Skip( )
>
>
>
>
>
> if __name__ == '__main__':
>
>                 app = wx.App( )
>
>                 frame = wx.Frame( None )
>
>                 szr_main = wx.BoxSizer( wx.HORIZONTAL )
>
>                 panel = wx.Panel( frame, size = ( 600, 600 ) )
>
>                 panel.SetSizer( szr_main )
>
>
>
>                 notebook = wx.Notebook( panel, size = ( 600, 600 ) )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 1' )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 2' )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 3' )
>
>                 notebook.Bind( wx.EVT_RIGHT_DOWN, _on_right )
>
>
>
>                 szr_main.Add( notebook, 0, wx.ALL | wx.EXPAND, 2 )
>
>
>
>                 frame.Fit( )
>
>                 frame.Show( )
>
>                 app.MainLoop( )
>
>
>
> ________________________________
> This e-mail may contain CONFIDENTIAL AND PROPRIETARY INFORMATION and/or
> PRIVILEGED AND CONFIDENTIAL COMMUNICATION intended solely for the recipient
> and, therefore, may not be retransmitted to any party outside of the
> recipient's organization without the prior written consent of the sender. If
> you have received this e-mail in error please notify the sender immediately
> by telephone or reply e-mail and destroy the original message without making
> a copy. Deep Silver, Inc. accepts no liability for any losses or damages
> resulting from infected e-mail transmissions and viruses in e-mail
> attachments.
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Notebook.HitTest( ) on Phoenix

Andy Kelts
On any one of the tabs:


It doesn't matter which tab I right-click on; they all return exactly the same thing. 
If I right-click anywhere else, the event is not picked up.

On Tuesday, September 5, 2017 at 1:54:54 PM UTC-5, Igor Korot wrote:
Hi,

On Tue, Sep 5, 2017 at 2:06 PM, Andy Kelts <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="w7iAQvDGBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">Andy....@...> wrote:
> I’m having trouble getting the Notebook’s HitTest( ) call to return anything
> other than ( -1, int ) in Phoenix.

Where is the mouse cursor when you try to check the HitTest() return?

Thank you.

>
> The int is always some really large number that changes with every run, but
> is consistently the same across all tabs during each session.
>
>
>
> wx.version( ) == '4.0.0a3 msw (phoenix)'
>
>
>
> Sample code (also attached):
>
>
>
> import wx
>
>
>
> def _on_right( event ):
>
>                 pos = event.GetPosition( )
>
>                 print( event.GetEventObject( ).HitTest( pos ) )
>
>                 event.Skip( )
>
>
>
>
>
> if __name__ == '__main__':
>
>                 app = wx.App( )
>
>                 frame = wx.Frame( None )
>
>                 szr_main = wx.BoxSizer( wx.HORIZONTAL )
>
>                 panel = wx.Panel( frame, size = ( 600, 600 ) )
>
>                 panel.SetSizer( szr_main )
>
>
>
>                 notebook = wx.Notebook( panel, size = ( 600, 600 ) )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 1' )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 2' )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 3' )
>
>                 notebook.Bind( wx.EVT_RIGHT_DOWN, _on_right )
>
>
>
>                 szr_main.Add( notebook, 0, wx.ALL | wx.EXPAND, 2 )
>
>
>
>                 frame.Fit( )
>
>                 frame.Show( )
>
>                 app.MainLoop( )
>
>
>
> ________________________________
> This e-mail may contain CONFIDENTIAL AND PROPRIETARY INFORMATION and/or
> PRIVILEGED AND CONFIDENTIAL COMMUNICATION intended solely for the recipient
> and, therefore, may not be retransmitted to any party outside of the
> recipient's organization without the prior written consent of the sender. If
> you have received this e-mail in error please notify the sender immediately
> by telephone or reply e-mail and destroy the original message without making
> a copy. Deep Silver, Inc. accepts no liability for any losses or damages
> resulting from infected e-mail transmissions and viruses in e-mail
> attachments.
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="w7iAQvDGBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wxpython-user...@googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Notebook.HitTest( ) on Phoenix

Robin Dunn
It looks like the base class version of HitTest is being called instead of the one in wx.Notebook. It should be an easy fix, but please file an issue about this at Github anyway so it doesn't get forgotten.

Robin


On Tuesday, September 5, 2017 at 1:30:31 PM UTC-7, Andy Kelts wrote:
On any one of the tabs:

<a href="https://lh3.googleusercontent.com/-AkokSAJZ0NY/Wa8JS4LNaTI/AAAAAAAAAA4/J4Mf6P6RQ0EtIykwMS58Bit-VRQLYeipwCLcBGAs/s1600/screenshot.png" style="text-align:center;margin-left:1em;margin-right:1em" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://lh3.googleusercontent.com/-AkokSAJZ0NY/Wa8JS4LNaTI/AAAAAAAAAA4/J4Mf6P6RQ0EtIykwMS58Bit-VRQLYeipwCLcBGAs/s1600/screenshot.png&#39;;return true;" onclick="this.href=&#39;https://lh3.googleusercontent.com/-AkokSAJZ0NY/Wa8JS4LNaTI/AAAAAAAAAA4/J4Mf6P6RQ0EtIykwMS58Bit-VRQLYeipwCLcBGAs/s1600/screenshot.png&#39;;return true;">

It doesn't matter which tab I right-click on; they all return exactly the same thing. 
If I right-click anywhere else, the event is not picked up.

On Tuesday, September 5, 2017 at 1:54:54 PM UTC-5, Igor Korot wrote:
Hi,

On Tue, Sep 5, 2017 at 2:06 PM, Andy Kelts <[hidden email]> wrote:
> I’m having trouble getting the Notebook’s HitTest( ) call to return anything
> other than ( -1, int ) in Phoenix.

Where is the mouse cursor when you try to check the HitTest() return?

Thank you.

>
> The int is always some really large number that changes with every run, but
> is consistently the same across all tabs during each session.
>
>
>
> wx.version( ) == '4.0.0a3 msw (phoenix)'
>
>
>
> Sample code (also attached):
>
>
>
> import wx
>
>
>
> def _on_right( event ):
>
>                 pos = event.GetPosition( )
>
>                 print( event.GetEventObject( ).HitTest( pos ) )
>
>                 event.Skip( )
>
>
>
>
>
> if __name__ == '__main__':
>
>                 app = wx.App( )
>
>                 frame = wx.Frame( None )
>
>                 szr_main = wx.BoxSizer( wx.HORIZONTAL )
>
>                 panel = wx.Panel( frame, size = ( 600, 600 ) )
>
>                 panel.SetSizer( szr_main )
>
>
>
>                 notebook = wx.Notebook( panel, size = ( 600, 600 ) )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 1' )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 2' )
>
>                 notebook.AddPage( wx.TextCtrl( notebook ), 'Page 3' )
>
>                 notebook.Bind( wx.EVT_RIGHT_DOWN, _on_right )
>
>
>
>                 szr_main.Add( notebook, 0, wx.ALL | wx.EXPAND, 2 )
>
>
>
>                 frame.Fit( )
>
>                 frame.Show( )
>
>                 app.MainLoop( )
>
>
>
> ________________________________
> This e-mail may contain CONFIDENTIAL AND PROPRIETARY INFORMATION and/or
> PRIVILEGED AND CONFIDENTIAL COMMUNICATION intended solely for the recipient
> and, therefore, may not be retransmitted to any party outside of the
> recipient's organization without the prior written consent of the sender. If
> you have received this e-mail in error please notify the sender immediately
> by telephone or reply e-mail and destroy the original message without making
> a copy. Deep Silver, Inc. accepts no liability for any losses or damages
> resulting from infected e-mail transmissions and viruses in e-mail
> attachments.
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to wxpython-user...@googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.