[marinemap] push by sfletche - tweaking analysistools widgets a bit to solve depth widget slider bar ... on 2011-10-10 22:56 GMT

0 views
Skip to first unread message

mari...@googlecode.com

unread,
Oct 10, 2011, 6:57:04 PM10/10/11
to marinema...@googlegroups.com
Revision: 74fda15bcbea
Author: sfle...@gmail.com
Date: Mon Oct 10 15:56:06 2011
Log: tweaking analysistools widgets a bit to solve depth widget slider
bar defaulting to max depth of 100 meters rather than 0 after attempts at
client side solutions failed
http://code.google.com/p/marinemap/source/detail?r=74fda15bcbea

Modified:
/lingcod/analysistools/widgets.py

=======================================
--- /lingcod/analysistools/widgets.py Tue Aug 2 12:09:15 2011
+++ /lingcod/analysistools/widgets.py Mon Oct 10 15:56:06 2011
@@ -9,22 +9,13 @@
http://pastebin.com/f34f0c71d
"""

- def __init__(self, min=None, max=None, step=None, image=None,
attrs=None, show_number=True):
+ def __init__(self, min=0, max=100, step=None, image=None, attrs=None,
show_number=True):
super(SliderWidget, self).__init__(attrs)
- self.max = 100
- self.min = 0
- self.step = None
- self.image = None
- self.show_number = True
-
- if max:
- self.max = max
- if min:
- self.min = min
- if step:
- self.step = step
- if image:
- self.image = image
+
+ self.max = max
+ self.min = min
+ self.step = step
+ self.image = image
self.show_number = show_number

def get_step(self):
@@ -169,23 +160,15 @@

class DualSliderWidget(forms.TextInput):

- def __init__(self, min_field, max_field, min=None, max=None,
step=None, image=None, attrs=None):
+ def __init__(self, min_field, max_field, min=0, max=100, step=None,
image=None, attrs=None):
super(DualSliderWidget, self).__init__(attrs)
- self.max = 100
- self.min = 0
- self.step = None
- self.image = None
+
+ self.max = max
+ self.min = min
+ self.step = step
+ self.image = image
self.min_field = min_field
self.max_field = max_field
-
- if max:
- self.max = max
- if min:
- self.min = min
- if step:
- self.step = step
- if image:
- self.image = image

def get_step(self):
if self.step:

Reply all
Reply to author
Forward
0 new messages