diff options
author | jblum | 2008-10-12 18:40:30 +0000 |
---|---|---|
committer | jblum | 2008-10-12 18:40:30 +0000 |
commit | 4e6d4d61e28f236c7210ee8584c434d393bea993 (patch) | |
tree | dcfdd25e7b2c7fe60f0f0a3876415aceddbe5726 /grc/src/grc_gnuradio/wxgui | |
parent | bdc6be8f9dd7f591122078302607b01f3890ec23 (diff) | |
download | gnuradio-4e6d4d61e28f236c7210ee8584c434d393bea993.tar.gz gnuradio-4e6d4d61e28f236c7210ee8584c434d393bea993.tar.bz2 gnuradio-4e6d4d61e28f236c7210ee8584c434d393bea993.zip |
autohide grid pos and slider len, added slider len param
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9784 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/grc_gnuradio/wxgui')
-rw-r--r-- | grc/src/grc_gnuradio/wxgui/callback_controls.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/grc/src/grc_gnuradio/wxgui/callback_controls.py b/grc/src/grc_gnuradio/wxgui/callback_controls.py index 2bb0b994e..a8e7a9320 100644 --- a/grc/src/grc_gnuradio/wxgui/callback_controls.py +++ b/grc/src/grc_gnuradio/wxgui/callback_controls.py @@ -152,7 +152,7 @@ class radio_buttons_vertical_control(_radio_buttons_control_base): class _slider_control_base(_control_base): """House a Slider and a Text Box for variable control.""" - def __init__(self, window, callback, label='Label', value=50, min=0, max=100, num_steps=100): + def __init__(self, window, callback, label='Label', value=50, min=0, max=100, num_steps=100, slider_length=200): """ Slider contructor. Create the slider, text box, and label. @@ -163,12 +163,14 @@ class _slider_control_base(_control_base): @param min the min @param max the max @param num_steps the number of steps + @param slider_length the length of the slider bar in pixels """ #initialize _control_base.__init__(self, window, callback) self.min = float(min) self.max = float(max) self.num_steps = int(num_steps) + self.slider_length = slider_length #create gui elements label_text_sizer = wx.BoxSizer(self.label_text_orientation) #label and text box container label_text = LabelText(self.get_window(), '%s: '%str(label)) @@ -178,7 +180,7 @@ class _slider_control_base(_control_base): label_text_sizer.Add(obj, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL) self.Add(label_text_sizer, 0, wx.ALIGN_CENTER) #make the slider - self.slider = slider = wx.Slider(self.get_window(), -1, size=wx.Size(*self.slider_size), style=self.slider_style) + self.slider = slider = wx.Slider(self.get_window(), -1, size=wx.Size(*self.get_slider_size()), style=self.slider_style) try: slider.SetRange(0, num_steps) except Exception, e: print >> sys.stderr, 'Error in set slider range: "%s".'%e @@ -230,11 +232,11 @@ class _slider_control_base(_control_base): class slider_horizontal_control(_slider_control_base): label_text_orientation = wx.HORIZONTAL slider_style = wx.SL_HORIZONTAL - slider_size = 200, 20 + def get_slider_size(self): return self.slider_length, 20 class slider_vertical_control(_slider_control_base): label_text_orientation = wx.VERTICAL slider_style = wx.SL_VERTICAL - slider_size = 20, 200 + def get_slider_size(self): return 20, self.slider_length ############################################################################################## # Text Box Control |