Author: reinhard Date: 2010-10-20 07:46:14 -0500 (Wed, 20 Oct 2010) New Revision: 10205
Modified: trunk/gnue-forms/ trunk/gnue-forms/src/GFObjects/GFImage.py trunk/gnue-forms/src/uidrivers/wx/widgets/image.py Log: Honor label attribute for image elements. Property changes on: trunk/gnue-forms ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2010-10-20 14:44:25.436000109 +0200 committer: Reinhard Müller <[email protected]> properties: branch-nick: forms + timestamp: 2010-10-20 14:45:41.104000092 +0200 committer: Reinhard Müller <[email protected]> properties: branch-nick: forms Name: bzr:file-ids - src/GFParser.py 1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFParser.py + src/GFObjects/GFImage.py 3...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2FGFObjects%2FGFImage.py src/uidrivers/wx/widgets/image.py 10...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:src%2Fuidrivers%2Fwx%2Fwidgets%2Fimage.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] + 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] Name: bzr:text-parents - src/GFParser.py [email protected] + src/GFObjects/GFImage.py svn-v3-single1-dHJ1bmsvZ251ZS1mb3Jtcw..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:10015 src/uidrivers/wx/widgets/image.py svn-v3-single1-dHJ1bmsvZ251ZS1mb3Jtcw..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-forms:10117 Modified: trunk/gnue-forms/src/GFObjects/GFImage.py =================================================================== --- trunk/gnue-forms/src/GFObjects/GFImage.py 2010-10-20 12:46:11 UTC (rev 10204) +++ trunk/gnue-forms/src/GFObjects/GFImage.py 2010-10-20 12:46:14 UTC (rev 10205) @@ -43,6 +43,7 @@ # Default attributes (these may be replaced by parser) self.type = "URL" + self.label = None # ------------------------------------------------------------------------- @@ -55,7 +56,7 @@ # ------------------------------------------------------------------------- - # Implementation of virtual methods + # Phase 1 init # ------------------------------------------------------------------------- def _phase_1_init_(self): @@ -64,3 +65,15 @@ if not hasattr(self, 'Char__height'): self.Char__height = int(gConfigForms('widgetHeight')) + + # ------------------------------------------------------------------------- + # Indicate whether this widget makes use of the separate label column + # ------------------------------------------------------------------------- + + def __get_has_label(self): + + return (self.label is not None and self.style != 'checkbox') + + has_label = property(__get_has_label) + + Modified: trunk/gnue-forms/src/uidrivers/wx/widgets/image.py =================================================================== --- trunk/gnue-forms/src/uidrivers/wx/widgets/image.py 2010-10-20 12:46:11 UTC (rev 10204) +++ trunk/gnue-forms/src/uidrivers/wx/widgets/image.py 2010-10-20 12:46:14 UTC (rev 10205) @@ -199,6 +199,15 @@ self.widget = ImageViewer(parent, self.image_size, self._gfObject.fit) + if self._gfObject.label: + # Replace blanks by non-breaking space to avoid random linebreaks + # in labels (sometimes done by wx, probably due to rounding errors + # in size calculations) + text = self._gfObject.label.replace(u" ", u"\240") + self.label = wx.StaticText(parent, -1, text) + else: + self.label = None + self.getParent().add_widgets(self, spacer) return self.widget @@ -248,6 +257,21 @@ pass + # ------------------------------------------------------------------------- + # Indicate whether this widget is growable + # ------------------------------------------------------------------------- + + def can_grow_x(self): + + return True + + # ------------------------------------------------------------------------- + + def can_grow_y(self): + + return True + + # ============================================================================= # Configuration data # ============================================================================= _______________________________________________ commit-gnue mailing list [email protected] http://lists.gnu.org/mailman/listinfo/commit-gnue
