commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10773 - gnuradio/branches/features/experimental-gui/f


From: jblum
Subject: [Commit-gnuradio] r10773 - gnuradio/branches/features/experimental-gui/forms
Date: Sat, 4 Apr 2009 18:05:31 -0600 (MDT)

Author: jblum
Date: 2009-04-04 18:05:31 -0600 (Sat, 04 Apr 2009)
New Revision: 10773

Modified:
   gnuradio/branches/features/experimental-gui/forms/forms.py
Log:
additional flag for add widget, slider uses for expand

Modified: gnuradio/branches/features/experimental-gui/forms/forms.py
===================================================================
--- gnuradio/branches/features/experimental-gui/forms/forms.py  2009-04-04 
20:59:24 UTC (rev 10772)
+++ gnuradio/branches/features/experimental-gui/forms/forms.py  2009-04-05 
00:05:31 UTC (rev 10773)
@@ -73,21 +73,22 @@
                self.subscribe(EXT_KEY, self._translate_external_to_internal)
                if self._callback: self.subscribe(EXT_KEY, self._callback)
 
-       def _add_widget(self, widget, label=''):
+       def _add_widget(self, widget, label='', flag=0):
                """
                Add the main widget to this object sizer.
                If label is passed, add a label as well.
                Register the widget and the label in the widgets list (for 
enable/disable).
                @param widget the main widget
                @param label the optional label
+               @param flag additional flags for widget
                """
                self._widgets.append(widget)
-               if not label: self.Add(widget, 1, wx.ALIGN_CENTER_VERTICAL)
+               if not label: self.Add(widget, 1, wx.ALIGN_CENTER_VERTICAL | 
flag)
                else:
                        label_text = wx.StaticText(self._parent, label='%s: 
'%label)
                        self._widgets.append(label_text)
                        self.Add(label_text, 0, wx.ALIGN_CENTER_VERTICAL | 
wx.ALIGN_LEFT)
-                       self.Add(widget, 1, wx.ALIGN_CENTER_VERTICAL | 
wx.ALIGN_RIGHT)
+                       self.Add(widget, 1, wx.ALIGN_CENTER_VERTICAL | 
wx.ALIGN_RIGHT | flag)
                self._init()
 
        def _translate_external_to_internal(self, external):
@@ -174,7 +175,7 @@
                else: raise NotImplementedError
                self._slider = wx.Slider(self._parent, minValue=0, 
maxValue=num_steps, size=slider_size, style=style)
                self._slider.Bind(wx.EVT_SCROLL, self._handle)
-               self._add_widget(self._slider, label)
+               self._add_widget(self._slider, label, flag=wx.EXPAND)
 
        def _handle(self, event): self[INT_KEY] = self._slider.GetValue()
        def _update(self, value): self._slider.SetValue(value)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]