jschuengel: thuban/Extensions/umn_mapserver mf_handle.py,1.3,1.4
cvs@intevation.de
cvs at intevation.de
Thu Jul 8 16:28:00 CEST 2004
Author: jschuengel
Update of /thubanrepository/thuban/Extensions/umn_mapserver
In directory doto:/tmp/cvs-serv25048
Modified Files:
mf_handle.py
Log Message:
Removed the image_type import statement, because its not needed anymore. The Outputformat is now given as string from the object. Make some formal changes to the code.
Index: mf_handle.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/umn_mapserver/mf_handle.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mf_handle.py 7 Jul 2004 12:52:16 -0000 1.3
+++ mf_handle.py 8 Jul 2004 14:27:58 -0000 1.4
@@ -52,7 +52,7 @@
from mapfile import unit_type, legend_status_type, legend_position_type, \
label_font_type, scalebar_status_type, scalebar_style_type, \
- scalebar_position_type, label_position_type, image_type
+ scalebar_position_type, label_position_type
# ###################################
#
@@ -85,7 +85,8 @@
#create size settings
insidetxt = self.tb_map_umn.get_size()
- staticSize = wxStaticBox(self, 1010, _("Size"), style = 0, name = "staticBox", )
+ staticSize = wxStaticBox(self, 1010, _("Size"), style = 0,
+ name = "staticBox", )
box_size = wxStaticBoxSizer(staticSize, wxVERTICAL)
box_sizepartWidth = wxBoxSizer(wxHORIZONTAL)
@@ -94,16 +95,17 @@
box_sizepartWidth.Add(self.text_width, 2, wxALL, 4)
box_size.Add(box_sizepartWidth, 0, wxALIGN_RIGHT | wxALL, 5)
box_sizepartHeight = wxBoxSizer(wxHORIZONTAL)
- box_sizepartHeight.Add(wxStaticText(self, -1, _("Height: ")), 0, wxALL, 4)
+ box_sizepartHeight.Add(wxStaticText(self, -1, _("Height: ")), 0,
+ wxALL, 4)
self.text_height = wxTextCtrl(self, -1, str(insidetxt[1]))
box_sizepartHeight.Add(self.text_height, 2, wxALL, 4)
box_size.Add(box_sizepartHeight, 0, wxALIGN_RIGHT | wxALL, 5)
- #get the set unittype
+ #unittype
insideunit = self.tb_map_umn.get_units()
-
- #create the Unittype selector
- box_unitsStatic = wxStaticBox(self, 1011, _("Unit Type"), style = 0, name = "imagecolor")
+ #Unittype selector
+ box_unitsStatic = wxStaticBox(self, 1011, _("Unit Type"),
+ style = 0, name = "imagecolor")
box_units = wxStaticBoxSizer(box_unitsStatic, wxVERTICAL)
sam = []
for key in unit_type:
@@ -113,11 +115,13 @@
box_units.Add(self.choice_units,0, wxEXPAND, wxALL, 5)
# color chouser
- box_colorStatic = wxStaticBox(self, 1011, _("ImageColor"), style = 0, name = "imagecolor")
+ box_colorStatic = wxStaticBox(self, 1011, _("ImageColor"),
+ style = 0, name = "imagecolor")
box_color = wxStaticBoxSizer(box_colorStatic, wxVERTICAL)
# preview box
- self.previewcolor = wxPanel(self,99, name = 'backgroundPanel', style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
+ self.previewcolor = wxPanel(self,99, name = 'backgroundPanel',
+ style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
imagecolor = self.tb_map_umn.get_imagecolor()
self.previewcolor.SetBackgroundColour(wxColour(imagecolor.get_red(),
imagecolor.get_green(), imagecolor.get_blue()))
@@ -135,14 +139,13 @@
name='status check', size=wxDefaultSize, style=wxRA_SPECIFY_ROWS)
self.choice_status.SetStringSelection(str(umn_status))
-
#buttons
box_buttons = wxBoxSizer(wxHORIZONTAL)
button = wxButton(self, wxID_OK, _("OK"))
box_buttons.Add(button, 0, wxALL, 5)
button = wxButton(self, wxID_CANCEL, _("Cancel"))
box_buttons.Add(button, 0, wxALL, 5)
- #set the button funcitons
+ #button functions
EVT_BUTTON(self, wxID_OK, self.OnOK)
EVT_BUTTON(self, wxID_CANCEL, self.OnCancel)
@@ -217,12 +220,18 @@
self.tb_map = parent.canvas.Map()
self.tb_map_umn = self.tb_map.extension_umn_mapobj
- #get the outputformat
+ #get the imagetype
umn_imagetype = self.tb_map_umn.get_imagetype()
+ # create a list with the outputformat names
+ umn_outputformats = []
+ for format in self.tb_map_umn.get_alloutputformats():
+ umn_outputformats.append(format.get_name())
#Imagetype selector
- box_imagetypeStatic = wxStaticBox(self, -1, _("Image Type"), style = 0, name = "imagetype")
+ box_imagetypeStatic = wxStaticBox(self, -1, _("Image Type"),
+ style = 0, name = "imagetype")
box_imagetype = wxStaticBoxSizer(box_imagetypeStatic, wxVERTICAL)
- self.choice_imgtype = wxChoice(self, 8060, (80, 50), choices = image_type)
+ self.choice_imgtype = wxChoice(self, 8060, (80, 50),
+ choices = umn_outputformats)
EVT_CHOICE(self, 8060, self.EvtChoiceBox)
self.choice_imgtype.SetStringSelection(umn_imagetype)
box_imagetype.Add(self.choice_imgtype,0, wxEXPAND, wxALL, 5)
@@ -246,10 +255,7 @@
top.Fit(self)
def EvtChoiceBox(self, event):
- print self.choice_imgtype.GetStringSelection()
outformat = self.tb_map_umn.get_outputformat().get_name()
- print outformat
-
def RunDialog(self):
self.ShowModal()
@@ -296,7 +302,8 @@
box_imagepath = wxBoxSizer(wxHORIZONTAL)
box_imagepath.Add(wxStaticText(self, -1, _("Imagepath:")), 0,
wxALL|wxALIGN_LEFT, 4)
- self.text_imagepath = wxTextCtrl(self, -1, str(self.umn_web.get_imagepath()))
+ self.text_imagepath = wxTextCtrl(self, -1,
+ str(self.umn_web.get_imagepath()))
box_imagepath.Add(self.text_imagepath, 0,
wxALL|wxALIGN_CENTER_VERTICAL, 4)
@@ -304,20 +311,10 @@
box_imageurl = wxBoxSizer(wxHORIZONTAL)
box_imageurl.Add(wxStaticText(self, -1, _("Imageurl:")), 0,
wxALL|wxALIGN_LEFT, 4)
- self.text_imageurl = wxTextCtrl(self, -1, str(self.umn_web.get_imageurl()))
+ self.text_imageurl = wxTextCtrl(self, -1,
+ str(self.umn_web.get_imageurl()))
box_imageurl.Add(self.text_imageurl, 0,
wxALL|wxALIGN_CENTER_VERTICAL, 4)
-
- # queryformat
- # include from a query dialog later
- """box_queryformat = wxBoxSizer(wxHORIZONTAL)
- box_queryformat.Add(wxStaticText(self, -1, _("Queryformat:")), 0,
- wxALL|wxALIGN_LEFT, 4)
- self.text_queryformat = wxTextCtrl(self, -1, str(self.umn_web.get_queryformat()))
- box_queryformat.Add(self.text_queryformat, 0,
- wxALL|wxALIGN_CENTER_VERTICAL, 4)
- top.Add(box_queryformat, 0, wxEXPAND |wxALL, 5)
- """
#buttons
box_buttons = wxBoxSizer(wxHORIZONTAL)
@@ -355,7 +352,6 @@
def OnOK(self, event):
self.umn_web.set_imagepath(self.text_imagepath.GetValue())
self.umn_web.set_imageurl(self.text_imageurl.GetValue())
- #self.umn_web.set_queryformat(self.text_queryformat.GetValue())
self.result ="OK"
self.end_dialog(self.result)
@@ -363,7 +359,6 @@
self.end_dialog(None)
-
ID_LABEL_CHANGE = 8011
class Legend_Dialog(wxDialog):
@@ -380,7 +375,8 @@
self.umn_legend = self.tb_map.extension_umn_mapobj.get_legend()
# create the Keysize
- keySize = wxStaticBox(self, 1010, _("KeySize"), style = 0, name = "KeySize Box", )
+ keySize = wxStaticBox(self, 1010, _("KeySize"), style = 0,
+ name = "KeySize Box", )
box_keysize = wxStaticBoxSizer(keySize, wxVERTICAL)
umn_legend_keysize = self.umn_legend.get_keysize()
box_sizepartWidth = wxBoxSizer(wxHORIZONTAL)
@@ -399,29 +395,32 @@
box_keysize.Add(box_sizepartHeight, 0, wxALIGN_RIGHT | wxALL, 2)
# create the Keyspacing
- keySpacing= wxStaticBox(self, 1010, _("KeySpacing"), style = 0, name = "KeySpacing Box", )
+ keySpacing= wxStaticBox(self, 1010, _("KeySpacing"), style = 0,
+ name = "KeySpacing Box", )
box_keyspacing = wxStaticBoxSizer(keySpacing, wxVERTICAL)
umn_legend_keyspacing = self.umn_legend.get_keyspacing()
box_sizepartWidth = wxBoxSizer(wxHORIZONTAL)
box_sizepartWidth.Add(wxStaticText(self, -1, _("Width: ")), 0, wxALL, 2)
self.text_keyspacing_width = wxSpinCtrl(self, -1,
- value=str(umn_legend_keyspacing[0]), max=100, min=0,
- name='spacingwidth', style=wxSP_ARROW_KEYS)
+ value=str(umn_legend_keyspacing[0]), max=100,
+ min=0, name='spacingwidth', style=wxSP_ARROW_KEYS)
box_sizepartWidth.Add(self.text_keyspacing_width, 2, wxALL, 2)
box_keyspacing.Add(box_sizepartWidth, 0, wxALIGN_RIGHT | wxALL, 2)
box_sizepartHeight = wxBoxSizer(wxHORIZONTAL)
box_sizepartHeight.Add(wxStaticText(self, -1, _("Height: ")), 0, wxALL, 2),
self.text_keyspacing_height = wxSpinCtrl(self, -1,
- value=str(umn_legend_keyspacing[1]), max=100, min=0,
- name='spacingheight', style=wxSP_ARROW_KEYS)
+ value=str(umn_legend_keyspacing[1]), max=100,
+ min=0,name='spacingheight', style=wxSP_ARROW_KEYS)
box_sizepartHeight.Add(self.text_keyspacing_height, 2, wxALL, 2)
box_keyspacing.Add(box_sizepartHeight, 0, wxALIGN_RIGHT | wxALL, 2)
# color chooser
- box_colorStatic = wxStaticBox(self, 1011, _("ImageColor"), style = 0, name = "imagecolor")
+ box_colorStatic = wxStaticBox(self, 1011, _("ImageColor"), style = 0,
+ name = "imagecolor")
box_color = wxStaticBoxSizer(box_colorStatic, wxVERTICAL)
# preview box
- self.previewcolor = wxPanel(self, 99, name = 'imagecolorPanel', style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
+ self.previewcolor = wxPanel(self, 99, name = 'imagecolorPanel',
+ style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
imagecolor = self.umn_legend.get_imagecolor()
self.previewcolor.SetBackgroundColour(wxColour(imagecolor.get_red(),
imagecolor.get_green(), imagecolor.get_blue()))
@@ -433,7 +432,7 @@
box_color.Add(button, 1, wxEXPAND|wxALL, 5)
# status
- umn_legend_status= self.umn_legend.get_status(art="string")
+ umn_legend_status= self.umn_legend.get_status(mode="string")
possible_choices = []
for key in legend_status_type:
possible_choices.append(legend_status_type[key])
@@ -443,13 +442,15 @@
self.choice_status.SetStringSelection(umn_legend_status)
# create the positionbox
- umn_legend_position= self.umn_legend.get_position(art="string")
+ umn_legend_position= self.umn_legend.get_position(mode="string")
possible_choices = []
for key in legend_position_type:
possible_choices.append(legend_position_type[key])
self.choice_position = wxRadioBox(self, -1, choices=possible_choices,
- label='Position', majorDimension=1,
- name='position check', size=wxDefaultSize, style=wxRA_SPECIFY_ROWS)
+ label='Position', majorDimension=1,
+ name='position check',
+ size=wxDefaultSize,
+ style=wxRA_SPECIFY_ROWS)
self.choice_position.SetStringSelection(umn_legend_position)
# button for label
@@ -482,7 +483,8 @@
def OnChangeLabel(self, event):
self.umn_label = self.umn_legend.get_label()
- dialog = Label_Dialog(self, -1, "Legend Label Settings", size=wxSize(350, 200),
+ dialog = Label_Dialog(self, -1, "Legend Label Settings",
+ size=wxSize(350, 200),
style = wxDEFAULT_DIALOG_STYLE
)
dialog.CenterOnScreen()
@@ -502,8 +504,9 @@
self.redcolor = int(round(self.retcolor.red*255))
self.greencolor = int(round(self.retcolor.green*255))
self.bluecolor = int(round(self.retcolor.blue*255))
- self.previewcolor.SetBackgroundColour(wxColour((self.redcolor),
- int(self.greencolor), int(self.bluecolor)))
+ self.previewcolor.SetBackgroundColour(wxColour(int(self.redcolor),
+ int(self.greencolor),
+ int(self.bluecolor)))
def RunDialog(self):
self.ShowModal()
@@ -546,7 +549,8 @@
self.umn_label = parent.umn_label
# size
- labelsize= wxStaticBox(self, 1010, _("Size"), style = 0, name = "Size Box", )
+ labelsize= wxStaticBox(self, 1010, _("Size"), style = 0,
+ name = "Size Box", )
box_labelsize = wxStaticBoxSizer(labelsize, wxVERTICAL)
umn_label_size= self.umn_label.get_size()
box_size = wxBoxSizer(wxHORIZONTAL)
@@ -557,10 +561,12 @@
box_labelsize.Add(box_size, 0, wxALIGN_RIGHT | wxALL, 2)
# color chooser
- box_colorStatic = wxStaticBox(self, 1011, _("Color"), style = 0, name = "color")
+ box_colorStatic = wxStaticBox(self, 1011, _("Color"), style = 0,
+ name = "color")
box_color = wxStaticBoxSizer(box_colorStatic, wxVERTICAL)
# preview box
- self.previewcolor = wxPanel(self, 99, name = 'colorPanel', style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
+ self.previewcolor = wxPanel(self, 99, name = 'colorPanel',
+ style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
color = self.umn_label.get_color()
self.previewcolor.SetBackgroundColour(wxColour(color.get_red(),
color.get_green(), color.get_blue()))
@@ -575,7 +581,8 @@
insidetype = self.umn_label.get_type()
#create the type selector for fonttype (Bitmap, TrueType)
# TODO: Truetype is not supported yet
- box_typeStatic = wxStaticBox(self, 1011, _("Type"), style = 0, name = "type")
+ box_typeStatic = wxStaticBox(self, 1011, _("Type"), style = 0,
+ name = "type")
box_type = wxStaticBoxSizer(box_typeStatic, wxVERTICAL)
sam = []
for key in label_font_type:
@@ -587,7 +594,8 @@
box_type.Add(self.choice_type,0, wxEXPAND, wxALL, 5)
# Offset
- offset= wxStaticBox(self, 1010, _("Offset"), style = 0, name = "Offset Box", )
+ offset= wxStaticBox(self, 1010, _("Offset"), style = 0,
+ name = "Offset Box", )
box_offset = wxStaticBoxSizer(offset, wxVERTICAL)
umn_label_offset = self.umn_label.get_offset()
box_offsetX = wxBoxSizer(wxHORIZONTAL)
@@ -608,8 +616,10 @@
# partials
umn_partials = self.umn_label.get_partials()
self.choice_partials = wxRadioBox(self, -1, choices=["True","False"],
- label='partials', majorDimension=1,
- name='partials check', size=wxDefaultSize, style=wxRA_SPECIFY_ROWS)
+ label='partials', majorDimension=1,
+ name='partials check',
+ size=wxDefaultSize,
+ style=wxRA_SPECIFY_ROWS)
self.choice_partials.SetStringSelection(str(umn_partials))
# force
@@ -620,7 +630,8 @@
self.choice_force.SetStringSelection(str(umn_force))
# buffer
- buffer = wxStaticBox(self, 1010, _("Buffer"), style = 0, name = "Buffer Box", )
+ buffer = wxStaticBox(self, 1010, _("Buffer"), style = 0,
+ name = "Buffer Box", )
box_buffer = wxStaticBoxSizer(buffer, wxVERTICAL)
umn_buffer= self.umn_label.get_buffer()
box_buffertext = wxBoxSizer(wxHORIZONTAL)
@@ -631,8 +642,8 @@
box_buffer.Add(box_buffertext, 0, wxALIGN_RIGHT | wxALL, 2)
# minfeaturesize
- minfeaturesize = wxStaticBox(self, 1010, _("Minfeaturesize"), style = 0,
- name = "Minfeaturesize Box", )
+ minfeaturesize = wxStaticBox(self, 1010, _("Minfeaturesize"),
+ style = 0, name = "Minfeaturesize Box")
box_minfeaturesize = wxStaticBoxSizer(minfeaturesize, wxVERTICAL)
umn_minfeaturesize= self.umn_label.get_minfeaturesize()
box_minfeaturesizetext = wxBoxSizer(wxHORIZONTAL)
@@ -657,13 +668,15 @@
wxALIGN_RIGHT | wxALL, 2)
# position
- umn_label_position= self.umn_label.get_position(art="string")
+ umn_label_position= self.umn_label.get_position(mode="string")
possible_choices = []
for key in label_position_type:
possible_choices.append(label_position_type[key])
self.choice_position = wxRadioBox(self, -1, choices=possible_choices,
- label='Position', majorDimension=1,
- name='position check', size=wxDefaultSize, style=wxRA_SPECIFY_ROWS)
+ label='Position', majorDimension=1,
+ name='position check',
+ size=wxDefaultSize,
+ style=wxRA_SPECIFY_ROWS)
self.choice_position.SetStringSelection(umn_label_position)
#buttons
@@ -716,8 +729,9 @@
self.redcolor = int(round(self.retcolor.red*255))
self.greencolor = int(round(self.retcolor.green*255))
self.bluecolor = int(round(self.retcolor.blue*255))
- self.previewcolor.SetBackgroundColour(wxColour((self.redcolor),
- int(self.greencolor), int(self.bluecolor)))
+ self.previewcolor.SetBackgroundColour(wxColour(int(self.redcolor),
+ int(self.greencolor),
+ int(self.bluecolor)))
def RunDialog(self):
self.ShowModal()
@@ -733,7 +747,8 @@
def OnOK(self, event):
self.umn_label.set_size(self.text_labelsize.GetValue())
- self.umn_label.set_offset(self.text_offsetx.GetValue(), self.text_offsety.GetValue())
+ self.umn_label.set_offset(self.text_offsetx.GetValue(),
+ self.text_offsety.GetValue())
self.umn_label.set_type(self.choice_type.GetStringSelection())
if self.choice_partials.GetStringSelection() == "True":
self.umn_label.set_partials(True)
@@ -770,10 +785,12 @@
self.umn_scalebar = self.tb_map.extension_umn_mapobj.get_scalebar()
# color chooser
- box_colorStatic = wxStaticBox(self, 1011, _("Color"), style = 0, name = "color")
+ box_colorStatic = wxStaticBox(self, 1011, _("Color"), style = 0,
+ name = "color")
box_color = wxStaticBoxSizer(box_colorStatic, wxVERTICAL)
# preview box
- self.previewcolor = wxPanel(self, 99, name = 'colorPanel', style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
+ self.previewcolor = wxPanel(self, 99, name = 'colorPanel',
+ style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
color = self.umn_scalebar.get_color()
self.previewcolor.SetBackgroundColour(wxColour(color.get_red(),
color.get_green(), color.get_blue()))
@@ -788,10 +805,12 @@
colorHor.Add(box_color,0, wxEXPAND |wxALL, 5)
# imagecolor chooser
- box_imgcolorStatic = wxStaticBox(self, 1011, _("Image Color"), style = 0, name = "imgcolor")
+ box_imgcolorStatic = wxStaticBox(self, 1011, _("Image Color"),
+ style = 0, name = "imgcolor")
box_imgcolor = wxStaticBoxSizer(box_imgcolorStatic, wxVERTICAL)
# preview box
- self.previewimgcolor = wxPanel(self, 99, name = 'colorPanel', style = wxSIMPLE_BORDER | wxCLIP_CHILDREN)
+ self.previewimgcolor = wxPanel(self, 99, name = 'colorPanel',
+ style = wxSIMPLE_BORDER|wxCLIP_CHILDREN)
color = self.umn_scalebar.get_imagecolor()
self.previewimgcolor.SetBackgroundColour(wxColour(color.get_red(),
color.get_green(), color.get_blue()))
@@ -804,7 +823,8 @@
colorHor.Add(box_imgcolor,0, wxEXPAND |wxALL, 5)
# create the intervals
- intervalsStatic = wxStaticBox(self, 1010, _("Intervals"), style = 0, name = "Intervals Box", )
+ intervalsStatic = wxStaticBox(self, 1010, _("Intervals"), style = 0,
+ name = "Intervals Box", )
box_intervals = wxStaticBoxSizer(intervalsStatic, wxVERTICAL)
umn_scalebar_intervals = self.umn_scalebar.get_intervals()
self.text_intervals = wxSpinCtrl(self, -1,
@@ -831,7 +851,8 @@
except:
insidetxt = (0,0)
# create the Size Box
- staticSize = wxStaticBox(self, -1, _("Size"), style = 0, name = "sizeBox", )
+ staticSize = wxStaticBox(self, -1, _("Size"), style = 0,
+ name="sizeBox")
box_size = wxStaticBoxSizer(staticSize, wxHORIZONTAL)
box_sizepartWidth = wxBoxSizer(wxHORIZONTAL)
@@ -840,13 +861,14 @@
box_sizepartWidth.Add(self.text_width, 2, wxALL, 4)
box_size.Add(box_sizepartWidth, 0, wxALIGN_RIGHT | wxALL, 5)
box_sizepartHeight = wxBoxSizer(wxHORIZONTAL)
- box_sizepartHeight.Add(wxStaticText(self, -1, _("Height: ")), 0, wxALL, 4)
+ box_sizepartHeight.Add(wxStaticText(self, -1, _("Height: ")), 0,
+ wxALL, 4)
self.text_height = wxTextCtrl(self, -1, str(insidetxt[1]))
box_sizepartHeight.Add(self.text_height, 2, wxALL, 4)
box_size.Add(box_sizepartHeight, 0, wxALIGN_RIGHT | wxALL, 5)
# status
- umn_scalebar_status= self.umn_scalebar.get_status(art="string")
+ umn_scalebar_status= self.umn_scalebar.get_status(mode="string")
possible_choices = []
for key in legend_status_type:
possible_choices.append(scalebar_status_type[key])
@@ -856,19 +878,21 @@
self.choice_status.SetStringSelection(umn_scalebar_status)
# position
- umn_scalebar_position= self.umn_scalebar.get_position(art="string")
+ umn_scalebar_position= self.umn_scalebar.get_position(mode="string")
possible_choices = []
for key in scalebar_position_type:
possible_choices.append(scalebar_position_type[key])
self.choice_position = wxRadioBox(self, -1, choices=possible_choices,
- label='Position', majorDimension=1,
- name='position check', size=wxDefaultSize, style=wxRA_SPECIFY_ROWS)
+ label='Position', majorDimension=1,
+ name='position check', size=wxDefaultSize,
+ style=wxRA_SPECIFY_ROWS)
self.choice_position.SetStringSelection(umn_scalebar_position)
#get the set unittype
insideunit = self.umn_scalebar .get_units()
#create the Unittype selector
- box_unitsStatic = wxStaticBox(self, -1, _("Unit Type"), style = 0, name = "unittype")
+ box_unitsStatic = wxStaticBox(self, -1, _("Unit Type"), style = 0,
+ name = "unittype")
box_units = wxStaticBoxSizer(box_unitsStatic, wxVERTICAL)
sam = []
for key in unit_type:
@@ -910,7 +934,8 @@
def OnChangeLabel(self, event):
# set the umn_label for scalebar so the Label_Dialog can be used
self.umn_label = self.umn_scalebar.get_label()
- dialog = Label_Dialog(self, -1, "Scalbar Label Settings", size=wxSize(350, 200),
+ dialog = Label_Dialog(self, -1, "Scalbar Label Settings",
+ size=wxSize(350, 200),
style = wxDEFAULT_DIALOG_STYLE
)
dialog.CenterOnScreen()
@@ -930,8 +955,9 @@
self.redcolor = int(round(self.retcolor.red*255))
self.greencolor = int(round(self.retcolor.green*255))
self.bluecolor = int(round(self.retcolor.blue*255))
- self.previewimgcolor.SetBackgroundColour(wxColour((self.redcolor),
- int(self.greencolor), int(self.bluecolor)))
+ self.previewimgcolor.SetBackgroundColour(wxColour(int(self.redcolor),
+ int(self.greencolor),
+ int(self.bluecolor)))
def OnChangeColor(self, event):
cur = self.umn_scalebar.get_color().get_thubancolor()
@@ -945,8 +971,9 @@
self.redcolor = int(round(self.retcolor.red*255))
self.greencolor = int(round(self.retcolor.green*255))
self.bluecolor = int(round(self.retcolor.blue*255))
- self.previewcolor.SetBackgroundColour(wxColour((self.redcolor),
- int(self.greencolor), int(self.bluecolor)))
+ self.previewcolor.SetBackgroundColour(wxColour(int(self.redcolor),
+ int(self.greencolor),
+ int(self.bluecolor)))
def RunDialog(self):
self.ShowModal()
@@ -966,7 +993,8 @@
self.umn_scalebar.set_intervals(self.text_intervals.GetValue())
self.umn_scalebar.set_style(self.choice_style.GetSelection())
self.umn_scalebar.set_position(self.choice_position.GetStringSelection())
- self.umn_scalebar.set_size(int(self.text_width.GetValue()), int(self.text_height.GetValue()))
+ self.umn_scalebar.set_size(int(self.text_width.GetValue()),
+ int(self.text_height.GetValue()))
previewcolor = self.previewcolor.GetBackgroundColour()
self.umn_scalebar.get_color().set_rgbcolor(previewcolor.Red(),
@@ -982,37 +1010,37 @@
def scalebarsettings(context):
- win = Scalebar_Dialog(context.mainwindow, -1, "Scalebar Settings", size=wxSize(350, 200),
- style = wxDEFAULT_DIALOG_STYLE
- )
+ win = Scalebar_Dialog(context.mainwindow, -1, "Scalebar Settings",
+ size=wxSize(350, 200),
+ style = wxDEFAULT_DIALOG_STYLE)
win.CenterOnScreen()
val = win.ShowModal()
def mapsettings(context):
- win = Map_Dialog(context.mainwindow, -1, "Map Settings", size=wxSize(350, 200),
- style = wxDEFAULT_DIALOG_STYLE
- )
+ win = Map_Dialog(context.mainwindow, -1, "Map Settings",
+ size=wxSize(350, 200),
+ style = wxDEFAULT_DIALOG_STYLE)
win.CenterOnScreen()
val = win.ShowModal()
def outputformatsettings(context):
win = OutputFormat_Dialog(context.mainwindow, -1, "OutputFormat Settings",
- size=wxSize(350, 200), style = wxDEFAULT_DIALOG_STYLE
- )
+ size=wxSize(350, 200),
+ style = wxDEFAULT_DIALOG_STYLE)
win.CenterOnScreen()
val = win.ShowModal()
def websettings(context):
- win = Web_Dialog(context.mainwindow, -1, "Web Settings", size=wxSize(350, 200),
- style = wxDEFAULT_DIALOG_STYLE
- )
+ win = Web_Dialog(context.mainwindow, -1, "Web Settings",
+ size=wxSize(350, 200),
+ style = wxDEFAULT_DIALOG_STYLE)
win.CenterOnScreen()
val = win.ShowModal()
def legendsettings(context):
- win = Legend_Dialog(context.mainwindow, -1, "Legend Settings", size=wxSize(350, 200),
- style = wxDEFAULT_DIALOG_STYLE
- )
+ win = Legend_Dialog(context.mainwindow, -1, "Legend Settings",
+ size=wxSize(350, 200),
+ style = wxDEFAULT_DIALOG_STYLE)
win.CenterOnScreen()
val = win.ShowModal()
@@ -1028,14 +1056,17 @@
# ###################################
# find the extensions menu (create it anew if not found)
-experimental_menu = main_menu.FindOrInsertMenu("experimental", _("Experimenta&l"))
+experimental_menu = main_menu.FindOrInsertMenu("experimental",
+ _("Experimenta&l"))
# find the extension menu and add a new submenu if found
-mapserver_menu = experimental_menu.FindOrInsertMenu("mapserver", _("&MapServer"))
+mapserver_menu = experimental_menu.FindOrInsertMenu("mapserver",
+ _("&MapServer"))
# register the new command
registry.Add(Command("create_new_mapfile", _("Create an empty MapObj"), \
- create_new_mapfile, helptext = _("Create a new empty mapscript MapObj")))
+ create_new_mapfile,
+ helptext = _("Create a new empty mapscript MapObj")))
# finally add the new entry to the extensions menu
mapserver_menu.InsertItem("create_new_mapfile")
@@ -1054,19 +1085,22 @@
mapserver_menu.InsertItem("OutputFormat Settings")
# register the new command (Map Settings Dialog)
-registry.Add(Command("Web Settings", _("Web Settings"), websettings,
+registry.Add(Command("Web Settings", _("Web Settings"),
+ websettings,
helptext = _("Edit the Web Setting")))
# finally add the new entry to the extensions menu
mapserver_menu.InsertItem("Web Settings")
# register the new command (Legend Settings Dialog)
-registry.Add(Command("Legend Settings", _("Legend Settings"), legendsettings,
+registry.Add(Command("Legend Settings", _("Legend Settings"),
+ legendsettings,
helptext = _("Edit the Legend Setting")))
# finally add the new entry to the extensions menu
mapserver_menu.InsertItem("Legend Settings")
# register the new command (Scalebar Settings Dialog)
-registry.Add(Command("Scalebar Settings", _("Scalebar Settings"), scalebarsettings,
+registry.Add(Command("Scalebar Settings", _("Scalebar Settings"),
+ scalebarsettings,
helptext = _("Edit the Scalebar Setting")))
# finally add the new entry to the extensions menu
mapserver_menu.InsertItem("Scalebar Settings")
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)