* src/DisplayTabs/_EmbeddedList.py: allow to define middle click

* src/Editors/_EditFamily.py: middle click on child calls edit child

2008-02-12 Benny Malengier <benny.malengier@gramps-project.org>


svn: r10021
This commit is contained in:
Benny Malengier 2008-02-12 12:38:47 +00:00
parent 3dbfd6cbac
commit 06b2b6da38
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2008-02-12 Benny Malengier <benny.malengier@gramps-project.org>
* src/DisplayTabs/_EmbeddedList.py: allow to define middle click
* src/Editors/_EditFamily.py: middle click on child calls edit child
2008-02-12 Benny Malengier <benny.malengier@gramps-project.org>
* src/Editors/_EditFamily.py: popup: edit child at top, add images.
* src/DisplayTabs/_EmbeddedList.py: allow popup with image/custom text

View File

@ -90,10 +90,17 @@ class EmbeddedList(ButtonTab):
self.show_all()
def _on_button_press(self, obj, event):
"""
Handle button press, not double-click, that is done in init_interface
"""
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
ref = self.get_selected()
if ref:
self.right_click(obj, event)
elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 2:
fun = self.get_middle_click()
if fun:
fun(obj)
def get_popup_menu_items(self):
"""
@ -121,6 +128,9 @@ class EmbeddedList(ButtonTab):
]
return itemlist
def get_middle_click(self):
return None
def right_click(self, obj, event):
"""
On right click show a popup menu.

View File

@ -125,6 +125,9 @@ class ChildEmbedList(EmbeddedList):
(True, True, gtk.STOCK_REMOVE, self.del_button_clicked),
]
def get_middle_click(self):
return self.edit_child_button_clicked
def find_index(self, obj):
"""
returns the index of the object within the associated data