@@ -129,6 +129,7 @@ def _init_ctrls(self, prnt):
129129
130130 # -------------------------------------------------------------------------------
131131 editPage = RB .RibbonPage (self , wx .ID_ANY , "Edit" )
132+ # editPage.Bind(wx.EVT_ENTER_WINDOW, self.on_mouse_enter)
132133
133134 main_panel = RB .RibbonPanel (editPage , wx .ID_ANY , "Main" , wx .NullBitmap , wx .DefaultPosition , wx .DefaultSize ,
134135 RB .RIBBON_PANEL_NO_AUTO_MINIMISE )
@@ -204,14 +205,28 @@ def _init_ctrls(self, prnt):
204205 self .CurrPage = 1
205206 self .SetActivePageByIndex (self .CurrPage )
206207
207- self .bindEvents ()
208+ self .__bind_events ()
208209 self .initPubSub ()
209210
210211 def __init__ (self , parent , id , name ):
211212 self .parent = parent
212213 self ._init_ctrls (parent )
213214
214- def bindEvents (self ):
215+ def on_mouse_enter (self , event ):
216+ ribbon_panel = event .GetEventObject ().GetParent ()
217+ ribbon_panel ._hovered = True
218+
219+ self .Refresh ()
220+ event .Skip ()
221+
222+ def on_mouse_leave (self , event ):
223+ ribbon_panel = event .GetEventObject ().GetParent ()
224+ ribbon_panel ._hovered = False
225+
226+ self .Refresh ()
227+ event .Skip ()
228+
229+ def __bind_events (self ):
215230 ###Docking Window Selection
216231 self .Bind (RB .EVT_RIBBONBUTTONBAR_CLICKED , self .onDocking , id = wxID_RIBBONVIEWTABLE )
217232 self .Bind (RB .EVT_RIBBONBUTTONBAR_CLICKED , self .onDocking , id = wxID_RIBBONVIEWSERIES )
@@ -262,6 +277,24 @@ def bindEvents(self):
262277 ###Ribbon Event
263278 self .Bind (RB .EVT_RIBBONBAR_PAGE_CHANGED , self .onFileMenu , id = wxID_PANEL1 )
264279
280+ # ENTER
281+ self .main_bar .Bind (wx .EVT_ENTER_WINDOW , self .on_mouse_enter ) # 1
282+ self .edit_bar .Bind (wx .EVT_ENTER_WINDOW , self .on_mouse_enter ) # 2
283+ self .record_bar .Bind (wx .EVT_ENTER_WINDOW , self .on_mouse_enter ) # 3
284+ self .PlotsOptions_bar .Bind (wx .EVT_ENTER_WINDOW , self .on_mouse_enter ) # 4
285+ self .plots_bar .Bind (wx .EVT_ENTER_WINDOW , self .on_mouse_enter ) # 5
286+ self .dateTime_buttonbar .Bind (wx .EVT_ENTER_WINDOW , self .on_mouse_enter ) # 6
287+ self .scriptBar .Bind (wx .EVT_ENTER_WINDOW , self .on_mouse_enter ) # 7
288+
289+ # LEAVE
290+ self .main_bar .Bind (wx .EVT_LEAVE_WINDOW , self .on_mouse_leave ) # 1
291+ self .edit_bar .Bind (wx .EVT_LEAVE_WINDOW , self .on_mouse_leave ) # 2
292+ self .record_bar .Bind (wx .EVT_LEAVE_WINDOW , self .on_mouse_leave ) # 3
293+ self .PlotsOptions_bar .Bind (wx .EVT_LEAVE_WINDOW , self .on_mouse_leave ) # 4
294+ self .plots_bar .Bind (wx .EVT_LEAVE_WINDOW , self .on_mouse_leave ) # 5
295+ self .dateTime_buttonbar .Bind (wx .EVT_LEAVE_WINDOW , self .on_mouse_leave ) # 6
296+ self .scriptBar .Bind (wx .EVT_LEAVE_WINDOW , self .on_mouse_leave ) # 7
297+
265298 def initPubSub (self ):
266299 Publisher .subscribe (self .toggleEditButtons , "EnableEditButtons" )
267300 Publisher .subscribe (self .enableButtons , "EnablePlotButtons" )
0 commit comments