Navigation on the new pedegree form

svn: r369
This commit is contained in:
Don Allingham 2001-09-01 02:32:38 +00:00
parent 99d2576c82
commit 9dbb49151b

View File

@ -2358,8 +2358,11 @@ def load_canvas():
startx,yfactor[(i*2)+1]+(h/2), startx,yfactor[(i*2)+1]+(h/2),
xfactor[(i*2)+1],yfactor[(i*2)+1]+(h/2)] xfactor[(i*2)+1],yfactor[(i*2)+1]+(h/2)]
item = root.add("line", item = root.add("line",
width_pixels=2,
points=pts, points=pts,
fill_color_gdk=style.black) fill_color_gdk=style.black)
item.set_data("p",list[(2*i)+1])
item.connect("event",line_event)
canvas_items.append(item) canvas_items.append(item)
if list[(2*i)+2]: if list[(2*i)+2]:
pts = [startx,yfactor[i]+h, pts = [startx,yfactor[i]+h,
@ -2367,7 +2370,10 @@ def load_canvas():
xfactor[(i*2)+2],yfactor[(i*2)+2]+(h/2)] xfactor[(i*2)+2],yfactor[(i*2)+2]+(h/2)]
item = root.add("line", item = root.add("line",
points=pts, points=pts,
width_pixels=2,
fill_color_gdk=style.black) fill_color_gdk=style.black)
item.set_data("p",list[(2*i)+2])
item.connect("event",line_event)
canvas_items.append(item) canvas_items.append(item)
add_box(root,xfactor[i],yfactor[i],w,h,list[i],style) add_box(root,xfactor[i],yfactor[i],w,h,list[i],style)
@ -2375,6 +2381,7 @@ def load_canvas():
old_h = h old_h = h
old_w = w old_w = w
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #
@ -2462,6 +2469,23 @@ def box_event(obj,event):
obj.children()[3].destroy() obj.children()[3].destroy()
canvas.update_now() canvas.update_now()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def line_event(obj,event):
if event.type == GDK._2BUTTON_PRESS:
if event.button == 1 and event.type == GDK._2BUTTON_PRESS:
change_active_person(obj.get_data("p"))
load_canvas()
elif event.type == GDK.ENTER_NOTIFY:
canvas = gtop.get_widget("canvas1")
obj.set(fill_color_gdk=canvas['style'].bg[STATE_SELECTED])
elif event.type == GDK.LEAVE_NOTIFY:
canvas = gtop.get_widget("canvas1")
obj.set(fill_color_gdk=canvas['style'].black)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# #