@@ -129,6 +129,7 @@ def _init_ctrls(self, prnt):
129
129
130
130
# -------------------------------------------------------------------------------
131
131
editPage = RB .RibbonPage (self , wx .ID_ANY , "Edit" )
132
+ # editPage.Bind(wx.EVT_ENTER_WINDOW, self.on_mouse_enter)
132
133
133
134
main_panel = RB .RibbonPanel (editPage , wx .ID_ANY , "Main" , wx .NullBitmap , wx .DefaultPosition , wx .DefaultSize ,
134
135
RB .RIBBON_PANEL_NO_AUTO_MINIMISE )
@@ -204,14 +205,28 @@ def _init_ctrls(self, prnt):
204
205
self .CurrPage = 1
205
206
self .SetActivePageByIndex (self .CurrPage )
206
207
207
- self .bindEvents ()
208
+ self .__bind_events ()
208
209
self .initPubSub ()
209
210
210
211
def __init__ (self , parent , id , name ):
211
212
self .parent = parent
212
213
self ._init_ctrls (parent )
213
214
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 ):
215
230
###Docking Window Selection
216
231
self .Bind (RB .EVT_RIBBONBUTTONBAR_CLICKED , self .onDocking , id = wxID_RIBBONVIEWTABLE )
217
232
self .Bind (RB .EVT_RIBBONBUTTONBAR_CLICKED , self .onDocking , id = wxID_RIBBONVIEWSERIES )
@@ -262,6 +277,24 @@ def bindEvents(self):
262
277
###Ribbon Event
263
278
self .Bind (RB .EVT_RIBBONBAR_PAGE_CHANGED , self .onFileMenu , id = wxID_PANEL1 )
264
279
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
+
265
298
def initPubSub (self ):
266
299
Publisher .subscribe (self .toggleEditButtons , "EnableEditButtons" )
267
300
Publisher .subscribe (self .enableButtons , "EnablePlotButtons" )
0 commit comments