Author: bugman
Date: Tue Dec 28 21:48:14 2010
New Revision: 12009
URL: http://svn.gna.org/viewcvs/relax?rev=12009&view=rev
Log:
The position of the URLs now take scrolling of the about window into account.
The scrolling of the window previously was not shifting the URL positions
with the text.
Modified:
branches/bieri_gui/gui_bieri/about.py
Modified: branches/bieri_gui/gui_bieri/about.py
URL:
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/about.py?rev=12009&r1=12008&r2=12009&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/about.py (original)
+++ branches/bieri_gui/gui_bieri/about.py Tue Dec 28 21:48:14 2010
@@ -59,6 +59,9 @@
# Destroy on clicking.
DESTROY_ON_CLICK = True
+ # Scrolling rate.
+ SCROLL_RATE = 20
+
def __init__(self, parent=None, id=-1, title='', html_text=None):
"""Build the dialog."""
@@ -161,6 +164,9 @@
# Determine the mouse position.
x = event.GetX()
y = event.GetY()
+
+ # Scrolling.
+ y = y + self.window.GetViewStart()[1]*self.SCROLL_RATE
# Selection cursor.
over_url = False
@@ -178,8 +184,6 @@
# Reset the cursor type.
self.cursor_type = 'select'
-
- # The flag.
# Normal cursor.
if not over_url and self.cursor_type == 'select':
@@ -351,6 +355,9 @@
x = event.GetX()
y = event.GetY()
+ # Scrolling.
+ y = y + self.window.GetViewStart()[1]*self.SCROLL_RATE
+
# A click on a URL.
for i in range(len(self.url_pos)):
if x > self.url_pos[i][0, 0] and x < self.url_pos[i][0, 1] and y
self.url_pos[i][1, 0] and y < self.url_pos[i][1, 1]:
@@ -446,7 +453,7 @@
self.window.SetVirtualSize((self.virt_x, self.virt_y))
# Add y scrolling, if needed.
- self.window.SetScrollRate(0,20)
+ self.window.SetScrollRate(0, self.SCROLL_RATE)