[gnue] r10254 - in trunk/gnue-forms: . src/GFObjects

[email protected] Thu, 2 Dec 2010 14:47:51 -0600 (CST)
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: reinhard
Date: 2010-12-02 14:47:51 -0600 (Thu, 02 Dec 2010)
New Revision: 10254

Modified:
   trunk/gnue-forms/
   trunk/gnue-forms/src/GFObjects/GFBlock.py
Log:
Enable scrolling through a grid while the block has no current record.



Property changes on: trunk/gnue-forms
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2010-12-02 21:29:40.832000017 +0100
committer: Reinhard M=C3=BCller <[email protected]>
properties:=20
	branch-nick: forms

   + timestamp: 2010-12-02 21:46:05.552000046 +0100
committer: Reinhard M=C3=BCller <[email protected]>
properties:=20
	branch-nick: forms

Name: bzr:file-ids
   - src/GFObjects/GFBlock.py	1459@3a364389-8fce-0310-8f11-cc363fde16c7:t=
runk%2Fgnue-forms:src%2FGFObjects%2FGFBlock.py
src/GFObjects/GFEntry.py	1459@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%=
2Fgnue-forms:src%2FGFObjects%2FGFEntry.py
src/GFObjects/GFField.py	1459@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%=
2Fgnue-forms:src%2FGFObjects%2FGFField.py
src/GFObjects/GFTabStop.py	3166@3a364389-8fce-0310-8f11-cc363fde16c7:trun=
k%2Fgnue-forms:src%2FGFObjects%2FGFTabStop.py
src/uidrivers/wx/widgets/entry.py	10053@3a364389-8fce-0310-8f11-cc363fde1=
6c7:trunk%2Fgnue-forms:src%2Fuidrivers%2Fwx%2Fwidgets%2Fentry.py

   + src/GFObjects/GFBlock.py	1459@3a364389-8fce-0310-8f11-cc363fde16c7:t=
runk%2Fgnue-forms:src%2FGFObjects%2FGFBlock.py

Name: bzr:revision-id:v4
   - 3116 [email protected]
3117 [email protected]
3118 [email protected]
3119 [email protected]
3120 [email protected]
3121 [email protected]
3122 [email protected]
3123 [email protected]
3124 [email protected]
3125 [email protected]
3126 [email protected]
3127 [email protected]
3128 [email protected]
3129 [email protected]
3130 [email protected]
3131 [email protected]
3132 [email protected]
3133 [email protected]
3134 [email protected]
3135 [email protected]
3136 [email protected]
3137 [email protected]
3138 [email protected]
3139 [email protected]
3140 [email protected]
3141 [email protected]
3142 [email protected]
3143 [email protected]
3144 [email protected]
3145 [email protected]
3146 [email protected]
3147 [email protected]
3148 [email protected]
3149 [email protected]
3150 [email protected]
3151 [email protected]
3152 [email protected]
3153 [email protected]
3154 [email protected]
3155 [email protected]
3156 [email protected]
3157 [email protected]
3158 [email protected]
3159 [email protected]
3160 [email protected]
3161 [email protected]
3162 [email protected]
3163 [email protected]
3164 [email protected]

   + 3116 [email protected]
3117 [email protected]
3118 [email protected]
3119 [email protected]
3120 [email protected]
3121 [email protected]
3122 [email protected]
3123 [email protected]
3124 [email protected]
3125 [email protected]
3126 [email protected]
3127 [email protected]
3128 [email protected]
3129 [email protected]
3130 [email protected]
3131 [email protected]
3132 [email protected]
3133 [email protected]
3134 [email protected]
3135 [email protected]
3136 [email protected]
3137 [email protected]
3138 [email protected]
3139 [email protected]
3140 [email protected]
3141 [email protected]
3142 [email protected]
3143 [email protected]
3144 [email protected]
3145 [email protected]
3146 [email protected]
3147 [email protected]
3148 [email protected]
3149 [email protected]
3150 [email protected]
3151 [email protected]
3152 [email protected]
3153 [email protected]
3154 [email protected]
3155 [email protected]
3156 [email protected]
3157 [email protected]
3158 [email protected]
3159 [email protected]
3160 [email protected]
3161 [email protected]
3162 [email protected]
3163 [email protected]
3164 [email protected]
3165 [email protected]

Name: bzr:text-parents
   - src/GFObjects/GFBlock.py	[email protected]=
-d9ydcs06o8kfy8h7
src/GFObjects/GFEntry.py	[email protected]=
cs06o8kfy8h7
src/GFObjects/GFField.py	[email protected]=
cs06o8kfy8h7

   +=20

Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/gnue-forms/src/GFObjects/GFBlock.py	2010-12-02 20:47:47 UTC (re=
v 10253)
+++ trunk/gnue-forms/src/GFObjects/GFBlock.py	2010-12-02 20:47:51 UTC (re=
v 10254)
@@ -505,17 +505,18 @@
             return
=20
         # Jump to another record if necessary
-        self.__scrolling_blocked =3D True
         jumped =3D False
-        try:
-            if self._currentRecord < position:
-                self.goto_record(position)
-                jumped =3D True
-            elif self._currentRecord > position + self._rows -1:
-                self.goto_record(position + self._rows - 1)
-                jumped =3D True
-        finally:
-            self.__scrolling_blocked =3D False
+        if self._currentRecord !=3D -1:
+            self.__scrolling_blocked =3D True
+            try:
+                if self._currentRecord < position:
+                    self.goto_record(position)
+                    jumped =3D True
+                elif self._currentRecord > position + self._rows -1:
+                    self.goto_record(position + self._rows - 1)
+                    jumped =3D True
+            finally:
+                self.__scrolling_blocked =3D False
=20
         # And now scroll the entries
         if jumped:
@@ -1534,16 +1535,12 @@
             newRecord =3D self.__resultset.getRecordNumber()
             newRecordCount =3D self.__resultset.getRecordCount()
=20
-        if new_visible_start is None:
-            new_visible_start =3D self.__visible_start
-        new_visible_start =3D max(new_visible_start, newRecord - self._r=
ows + 1)
-        new_visible_start =3D max(new_visible_start, 0)
-        new_visible_start =3D min(new_visible_start, newRecord)
+        if new_visible_start is not None:
+            scroll =3D new_visible_start - self.__visible_start
+            self.__visible_start =3D new_visible_start
+        else:
+            scroll =3D 0
=20
-        scroll =3D new_visible_start - self.__visible_start
-
-        self.__visible_start =3D new_visible_start
-
         # Find out which ui entries to refresh
         if refresh_all:
             # Result set completely changed, refresh everything