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üller <[email protected]> properties: branch-nick: forms + timestamp: 2010-12-02 21:46:05.552000046 +0100 committer: Reinhard Müller <[email protected]> properties: branch-nick: forms Name: bzr:file-ids - src/GFObjects/GFBlock.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2FGFBlock.py src/GFObjects/GFEntry.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2FGFEntry.py src/GFObjects/GFField.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2FGFField.py src/GFObjects/GFTabStop.py 3...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2FGFTabStop.py src/uidrivers/wx/widgets/entry.py 10...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2Fuidrivers%2Fwx%2Fwidgets%2Fentry.py + src/GFObjects/GFBlock.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%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] src/GFObjects/GFEntry.py [email protected] src/GFObjects/GFField.py [email protected] + Modified: trunk/gnue-forms/src/GFObjects/GFBlock.py =================================================================== --- trunk/gnue-forms/src/GFObjects/GFBlock.py 2010-12-02 20:47:47 UTC (rev 10253) +++ trunk/gnue-forms/src/GFObjects/GFBlock.py 2010-12-02 20:47:51 UTC (rev 10254) @@ -505,17 +505,18 @@ return # Jump to another record if necessary - self.__scrolling_blocked = True jumped = False - try: - if self._currentRecord < position: - self.goto_record(position) - jumped = True - elif self._currentRecord > position + self._rows -1: - self.goto_record(position + self._rows - 1) - jumped = True - finally: - self.__scrolling_blocked = False + if self._currentRecord != -1: + self.__scrolling_blocked = True + try: + if self._currentRecord < position: + self.goto_record(position) + jumped = True + elif self._currentRecord > position + self._rows -1: + self.goto_record(position + self._rows - 1) + jumped = True + finally: + self.__scrolling_blocked = False # And now scroll the entries if jumped: @@ -1534,16 +1535,12 @@ newRecord = self.__resultset.getRecordNumber() newRecordCount = self.__resultset.getRecordCount() - if new_visible_start is None: - new_visible_start = self.__visible_start - new_visible_start = max(new_visible_start, newRecord - self._rows + 1) - new_visible_start = max(new_visible_start, 0) - new_visible_start = min(new_visible_start, newRecord) + if new_visible_start is not None: + scroll = new_visible_start - self.__visible_start + self.__visible_start = new_visible_start + else: + scroll = 0 - scroll = new_visible_start - self.__visible_start - - self.__visible_start = new_visible_start - # Find out which ui entries to refresh if refresh_all: # Result set completely changed, refresh everything _______________________________________________ commit-gnue mailing list [email protected] http://lists.gnu.org/mailman/listinfo/commit-gnue
