GRASS Programmer's Manual  6.4.2(2012)
gui_modules::psmap_dialogs Namespace Reference

Data Structures

class  UnitConversion
 Class for converting units. More...
class  TCValidator
 validates input in textctrls, combobox, taken from wxpython demo More...
class  PenStyleComboBox
 if self.flag == 'SCALE' and chr(key) in string.digits + ':': event.Skip() return More...
class  CheckListCtrl
 List control for managing order and labels of vector maps in legend. More...
class  Instruction
 Class which represents instruction file. More...
class  InstructionObject
 Abtract class representing single instruction. More...
class  InitMap
 Class representing virtual map. More...
class  MapFrame
 Class representing map (instructions maploc, scale, border) More...
class  PageSetup
 Class representing page instruction. More...
class  Mapinfo
 Class representing mapinfo instruction. More...
class  Text
 Class representing text instruction. More...
class  Scalebar
 Class representing scalebar instruction. More...
class  RasterLegend
 Class representing colortable instruction. More...
class  VectorLegend
 Class representing colortable instruction. More...
class  Raster
 Class representing raster instruction. More...
class  Vector
 Class keeps vector layers. More...
class  VProperties
 Class represents instructions vareas, vlines, vpoints. More...
class  PsmapDialog
class  PageSetupDialog
class  MapDialog
 Dialog for map frame settings and optionally raster and vector map selection. More...
class  MapFramePanel
 wx.Panel with map (scale, region, border) settings More...
class  RasterPanel
 Panel for raster map settings. More...
class  VectorPanel
 Panel for vector maps settings. More...
class  RasterDialog
class  MainVectorDialog
 if 'map' in self.parent.openDialogs: if self.parent.openDialogs['map'].mPanel.rasterTypeRadio.GetValue()\ and self.parent.openDialogs['map'].mPanel.select.GetValue(): if self.parent.openDialogs['map'].mPanel.drawMap.IsChecked(): self.rPanel.rasterSelect.SetValue(self.parent.openDialogs['map'].mPanel.select.GetValue()) More...
class  VPropertiesDialog
class  LegendDialog
class  MapinfoDialog
class  ScalebarDialog
 Dialog for scale bar. More...
class  TextDialog

Functions

def OnApply
 parent.font['colorLabel'] = wx.StaticText(parent, id = wx.ID_ANY, label = _("Color:")) colorChoices = [ 'aqua', 'black', 'blue', 'brown', 'cyan', 'gray', 'green', 'indigo', 'magenta',\ 'orange', 'purple', 'red', 'violet', 'white', 'yellow'] parent.colorCtrl = wx.Choice(parent, id = wx.ID_ANY, choices = colorChoices) parent.colorCtrl.SetStringSelection(parent.rLegendDict['color']) parent.font['colorCtrl'] = wx.ColourPickerCtrl(parent, id = wx.ID_ANY) parent.font['colorCtrl'].SetColour(dialogDict['color'])
def OnOK
 Apply changes, close dialog.
def OnCancel
 Close dialog.
def OnClose
 Destroy dialog and delete it from open dialogs.
def OnLayer
 Change columns on layer change.
def OnOutline
def OnFill
def OnColor
def OnSize
def OnRotation
def OnRotationType
def OnPattern
def EnableLayerSelection
def getColsChoice
 Returns a wx.Choice with table columns.
def update
def sizePositionFont
 Insert widgets for size, position and font control.
def OnIsLegend
 Enables and disables controls, it depends if raster or vector legend is checked.
def OnRaster
def OnDiscrete
 Change control according to the type of legend.
def OnRange
def OnUp
 Moves selected map up, changes order in vector legend.
def OnDown
 Moves selected map down, changes order in vector legend.
def OnEditLabel
 Change legend label of vector map.
def OnSpan
def OnFont
 Changes default width according to fontsize, width [inch] = fontsize[pt]/24.
def OnBorder
 Enables/disables colorPickerCtrl for border.
def updateRasterLegend
 Save information from raster legend dialog to dictionary.
def updateVectorLegend
 Save information from vector legend dialog to dictionary.
def updateDialog
 Update legend coordinates after moving.
def convertRGB
 Converts wx.Colour(r,g,b,a) to string 'r:g:b' or named color, or named color/r:g:b string to wx.Colour, depending on input.
def PaperMapCoordinates
 Converts paper (inch) coordinates -> map coordinates.
def AutoAdjust
 Computes map scale, center and map frame rectangle to fit region (scale is not fixed)
def SetResolution
 If resolution is too high, lower it.
def ComputeSetRegion
 Computes and sets region from current scale, map center coordinates and map rectangle.
def projInfo
 Return region projection and map units information, taken from render.py.
def GetMapBounds
 Run ps.map -b to get information about map bounding box.
def getRasterType
 Returns type of raster map (CELL, FCELL, DCELL)

Variables

 fs = None
list PSMAP_COLORS
list fontChoices
 parent.font['fontLabel'] = wx.StaticText(parent, id = wx.ID_ANY, label = _("Choose font:")) parent.font['fontCtrl'] = wx.FontPickerCtrl(parent, id = wx.ID_ANY)
tuple linecapText = wx.StaticText(panel, id = wx.ID_ANY, label = _("Choose linecap:"))
 self.styleCombo = wx.ComboBox(panel, id = wx.ID_ANY, choices = ["solid", "dashed", "dotted", "dashdotted"], validator = TCValidator(flag = 'ZERO_AND_ONE_ONLY')) self.styleCombo.SetToolTipString(_("It's possible to enter a series of 0's and 1's too. "\ "The first block of repeated zeros or ones represents 'draw', "\ "the second block represents 'blank'. An even number of blocks "\ "will repeat the pattern, an odd number of blocks will alternate the pattern."))
tuple h = self.unitConv.convert(value = float(legendDict['height']), fromUnit = 'inch', toUnit = legendDict['unit'])
 panel.defaultSize = wx.CheckBox(panel, id = wx.ID_ANY, label = _("Use default size")) panel.defaultSize.SetValue(legendDict['defaultSize'])
int minVect = 1
 self.rSizeGBSizer.Add(panel.defaultSize, pos = (0,0), span = (1,2), flag = wx.ALIGN_CENTER_VERTICAL, border = 0)
tuple maxVect = min(10, len(self.instruction[self.vectorId]['list']))
tuple cols = wx.StaticText(panel, id = wx.ID_ANY, label = _("Columns:"))
list min = minVect,maxmaxVect,initiallegendDict['cols']
tuple s = self.unitConv.convert(value = float(legendDict['span']), fromUnit = 'inch', toUnit = legendDict['unit'])
tuple box = wx.StaticBox(parent = panel, id = wx.ID_ANY, label = " %s " % _("Font settings"))
tuple fontSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
tuple flexSizer = wx.FlexGridSizer(cols = 2, hgap = 5, vgap = 5)
list fontsize = self.panelVector.font['fontSizeCtrl']
 fontsize = self.panelVector.font['fontCtrl'].GetSelectedFont().GetPointSize()
tuple unit = self.unitConv.findUnit(self.panelVector.units['unitsCtrl'].GetStringSelection())
int w = 24
tuple width = self.unitConv.convert(value = w, fromUnit = 'inch', toUnit = unit)
 patternCheck
 patFileCtrl
 patWidthText
 patWidthSpin
 patScaleText
 patScaleSpin
 currLayer
 type
 isVLegend
 vectorListCtrl
 btnUp
 btnDown
 btnLabel
 borderCheck
 borderColorCtrl
 vectorId
 rasterId
 unitConv

Function Documentation

def gui_modules.psmap_dialogs.AutoAdjust (   self,
  scaleType,
  rect,
  map = None,
  mapType = None,
  region = None 
)

Computes map scale, center and map frame rectangle to fit region (scale is not fixed)

Definition at line 5539 of file psmap_dialogs.py.

Referenced by gui_modules.psmap.PsMapBufferedWindow.OnMouse(), and gui_modules.psmap_dialogs.MapFramePanel.update().

def gui_modules.psmap_dialogs.ComputeSetRegion (   self,
  mapDict 
)

Computes and sets region from current scale, map center coordinates and map rectangle.

Definition at line 5615 of file psmap_dialogs.py.

References projInfo(), and gui_modules::gcmd.RunCommand().

Referenced by gui_modules.psmap.PsMapBufferedWindow.OnMouse(), and gui_modules.psmap_dialogs.MapFramePanel.update().

Converts wx.Colour(r,g,b,a) to string 'r:g:b' or named color, or named color/r:g:b string to wx.Colour, depending on input.

Definition at line 5473 of file psmap_dialogs.py.

References type.

Referenced by gui_modules.psmap.PsMapBufferedWindow.DrawRotText(), gui_modules.psmap_dialogs.MapFramePanel.update(), update(), gui_modules.psmap_dialogs.MapinfoDialog.update(), gui_modules.psmap_dialogs.TextDialog.update(), and updateRasterLegend().

def gui_modules.psmap_dialogs.EnableLayerSelection (   self,
  enable = True 
)

Definition at line 3634 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.getColsChoice (   self,
  parent 
)

Returns a wx.Choice with table columns.

Definition at line 3639 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.GetMapBounds (   filename,
  portrait = True 
)

Run ps.map -b to get information about map bounding box.

Parameters:
filenamepsmap input file
portraitpage orientation

Definition at line 5674 of file psmap_dialogs.py.

References gui_modules::render.map, and gui_modules::utils.split().

Referenced by gui_modules::psmap.getInitMap(), and gui_modules.psmap_dialogs.Instruction.Read().

def gui_modules.psmap_dialogs.OnApply (   self,
  event 
)

parent.font['colorLabel'] = wx.StaticText(parent, id = wx.ID_ANY, label = _("Color:")) colorChoices = [ 'aqua', 'black', 'blue', 'brown', 'cyan', 'gray', 'green', 'indigo', 'magenta',\ 'orange', 'purple', 'red', 'violet', 'white', 'yellow'] parent.colorCtrl = wx.Choice(parent, id = wx.ID_ANY, choices = colorChoices) parent.colorCtrl.SetStringSelection(parent.rLegendDict['color']) parent.font['colorCtrl'] = wx.ColourPickerCtrl(parent, id = wx.ID_ANY) parent.font['colorCtrl'].SetColour(dialogDict['color'])

Definition at line 1711 of file psmap_dialogs.py.

Referenced by gui_modules::psmap.OnAddText().

def gui_modules.psmap_dialogs.OnBorder (   self,
  event 
)

Enables/disables colorPickerCtrl for border.

Definition at line 4327 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnCancel (   self,
  event 
)

Close dialog.

Definition at line 1725 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnClose (   self,
  event 
)

Destroy dialog and delete it from open dialogs.

Definition at line 1729 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnColor (   self,
  event 
)

Definition at line 3608 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnDiscrete (   self,
  event 
)

Change control according to the type of legend.

Definition at line 4221 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnDown (   self,
  event 
)

Moves selected map down, changes order in vector legend.

Definition at line 4287 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnEditLabel (   self,
  event 
)

Change legend label of vector map.

Definition at line 4304 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnFill (   self,
  event 
)

Definition at line 3595 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnFont (   self,
  event 
)

Changes default width according to fontsize, width [inch] = fontsize[pt]/24.

Definition at line 4318 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnIsLegend (   self,
  event 
)

Enables and disables controls, it depends if raster or vector legend is checked.

Definition at line 4174 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnLayer (   self,
  event 
)

Change columns on layer change.

Definition at line 3573 of file psmap_dialogs.py.

def gui_modules::psmap_dialogs::OnOK (   self,
  event 
)

Apply changes, close dialog.

Definition at line 1719 of file psmap_dialogs.py.

Referenced by gui_modules::psmap.OnAddMap(), and update().

def gui_modules.psmap_dialogs.OnOutline (   self,
  event 
)

Definition at line 3590 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnPattern (   self,
  event 
)

Definition at line 3630 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnRange (   self,
  event 
)

Definition at line 4258 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnRaster (   self,
  event 
)

Definition at line 4201 of file psmap_dialogs.py.

References getRasterType().

def gui_modules.psmap_dialogs.OnRotation (   self,
  event 
)

Definition at line 3618 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnRotationType (   self,
  event 
)

Definition at line 3626 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnSize (   self,
  event 
)

Definition at line 3612 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnSpan (   self,
  event 
)

Definition at line 4316 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.OnUp (   self,
  event 
)

Moves selected map up, changes order in vector legend.

Definition at line 4270 of file psmap_dialogs.py.

def gui_modules.psmap_dialogs.PaperMapCoordinates (   map,
  x,
  y,
  paperToMap = True 
)

Converts paper (inch) coordinates -> map coordinates.

Definition at line 5495 of file psmap_dialogs.py.

Referenced by gui_modules.psmap_dialogs.Text.Read(), gui_modules.psmap.PsMapBufferedWindow.RecalculateEN(), and gui_modules.psmap_dialogs.TextDialog.update().

def gui_modules.psmap_dialogs.SetResolution (   dpi,
  width,
  height 
)

If resolution is too high, lower it.

Parameters:
dpimax DPI
widthmap frame width
heightmap frame height

Definition at line 5602 of file psmap_dialogs.py.

References gui_modules::gcmd.RunCommand().

Referenced by gui_modules::psmap.DialogDataChanged(), gui_modules.psmap.PsMapBufferedWindow.OnMouse(), gui_modules.psmap.PsMapFrame.PSFile(), gui_modules.psmap_dialogs.Instruction.Read(), and gui_modules.psmap_dialogs.MapFramePanel.update().

def gui_modules.psmap_dialogs.sizePositionFont (   self,
  legendType,
  parent,
  mainSizer 
)

Insert widgets for size, position and font control.

Definition at line 4049 of file psmap_dialogs.py.

Definition at line 3649 of file psmap_dialogs.py.

References convertRGB(), and OnOK().

Referenced by NetA_timetable_shortest_path().

Save information from raster legend dialog to dictionary.

Definition at line 4331 of file psmap_dialogs.py.

References convertRGB(), and getRasterType().

Save information from vector legend dialog to dictionary.

Definition at line 4434 of file psmap_dialogs.py.


Variable Documentation

tuple gui_modules::psmap_dialogs::cols = wx.StaticText(panel, id = wx.ID_ANY, label = _("Columns:"))
tuple gui_modules::psmap_dialogs::flexSizer = wx.FlexGridSizer(cols = 2, hgap = 5, vgap = 5)

Definition at line 4154 of file psmap_dialogs.py.

Initial value:
00001 [ 'Times-Roman', 'Times-Italic', 'Times-Bold', 'Times-BoldItalic', 'Helvetica',\
00002                         'Helvetica-Oblique', 'Helvetica-Bold', 'Helvetica-BoldOblique', 'Courier',\
00003                         'Courier-Oblique', 'Courier-Bold', 'Courier-BoldOblique']

parent.font['fontLabel'] = wx.StaticText(parent, id = wx.ID_ANY, label = _("Choose font:")) parent.font['fontCtrl'] = wx.FontPickerCtrl(parent, id = wx.ID_ANY)

parent.font['fontCtrl'].SetSelectedFont( wx.FontFromNativeInfoString(dialogDict['font'] + " " + str(dialogDict['fontsize']))) parent.font['fontCtrl'].SetMaxPointSize(50)

if color: parent.font['colorLabel'] = wx.StaticText(parent, id = wx.ID_ANY, label = _("Choose color:")) parent.font['colorCtrl'] = wx.ColourPickerCtrl(parent, id = wx.ID_ANY, style=wx.FNTP_FONTDESC_AS_LABEL) parent.font['colorCtrl'].SetColour(dialogDict['color']) parent.font['colorCtrl'].SetColour(convertRGB(dialogDict['color']))

Definition at line 1689 of file psmap_dialogs.py.

list gui_modules::psmap_dialogs::fontsize = self.panelVector.font['fontSizeCtrl']

fontsize = self.panelVector.font['fontCtrl'].GetSelectedFont().GetPointSize()

Definition at line 4321 of file psmap_dialogs.py.

tuple gui_modules::psmap_dialogs::fontSizer = wx.StaticBoxSizer(box, wx.VERTICAL)

Definition at line 4153 of file psmap_dialogs.py.

Definition at line 75 of file psmap_dialogs.py.

Referenced by G_site_format(), and gs_delete_surf().

string gui_modules::psmap_dialogs::h = self.unitConv.convert(value = float(legendDict['height']), fromUnit = 'inch', toUnit = legendDict['unit'])

panel.defaultSize = wx.CheckBox(panel, id = wx.ID_ANY, label = _("Use default size")) panel.defaultSize.SetValue(legendDict['defaultSize'])

Definition at line 4101 of file psmap_dialogs.py.

Referenced by db__send_short(), db_list_databases(), G_lat_format(), G_llres_format(), G_lon_format(), G_svdcmp(), G_tred2(), IL_check_at_points_2d(), IL_grid_calc_2d(), and pj_do_proj().

tuple gui_modules::psmap_dialogs::linecapText = wx.StaticText(panel, id = wx.ID_ANY, label = _("Choose linecap:"))

self.styleCombo = wx.ComboBox(panel, id = wx.ID_ANY, choices = ["solid", "dashed", "dotted", "dashdotted"], validator = TCValidator(flag = 'ZERO_AND_ONE_ONLY')) self.styleCombo.SetToolTipString(_("It's possible to enter a series of 0's and 1's too. "\ "The first block of repeated zeros or ones represents 'draw', "\ "the second block represents 'blank'. An even number of blocks "\ "will repeat the pattern, an odd number of blocks will alternate the pattern."))

Definition at line 3510 of file psmap_dialogs.py.

tuple gui_modules::psmap_dialogs::maxVect = min(10, len(self.instruction[self.vectorId]['list']))

Definition at line 4120 of file psmap_dialogs.py.

list gui_modules::psmap_dialogs::min = minVect,maxmaxVect,initiallegendDict['cols']

Definition at line 4123 of file psmap_dialogs.py.

Referenced by updateDialog().

self.rSizeGBSizer.Add(panel.defaultSize, pos = (0,0), span = (1,2), flag = wx.ALIGN_CENTER_VERTICAL, border = 0)

Definition at line 4119 of file psmap_dialogs.py.

Initial value:
00001 ['aqua', 'black', 'blue', 'brown', 'cyan', 'gray', 'grey', 'green', 'indigo',
00002                 'magenta','orange', 'purple', 'red', 'violet', 'white', 'yellow']

Definition at line 79 of file psmap_dialogs.py.

Definition at line 3649 of file psmap_dialogs.py.

Referenced by gui_modules.preferences.Settings::Append(), COM_Font_get(), convertRGB(), db_column_Ctype(), db_column_sqltype(), db_select_CatValArray(), db_select_int(), db_set_column_host_type(), gui_modules::psmap::DialogDataChanged(), dig_cidx_add_cat(), dig_cidx_add_cat_sorted(), gui_modules.mapdisp_window.BufferedWindow::DragItem(), gui_modules.nviz_tools.NvizToolWindow::EnablePage(), G3d_copyFromXdr(), G3d_copyToXdr(), G3d_fillHeader(), G3d_initCopyFromXdr(), G3d_initCopyToXdr(), G3d_openCellOld(), G3d_readCats(), G3d_setFileType(), G_get_gdal_link(), G_get_raster_row_colors(), G_is_reclass(), G_read_raster_cats(), G_read_vector_cats(), G_site_get(), gui_modules.preferences.Settings::Get(), python.task.grassTask::get_param(), gui_modules.render.Map::GetListOfLayers(), gs_set_att_type(), Gv_load_vect(), IL_output_2d(), IL_resample_output_2d(), iso_get_cube_value(), gui_modules.nviz_preferences.NvizPreferencesDialog::LoadSettings(), gui_modules.nviz_tools.NvizPreferencesDialog::LoadSettings(), gui_modules.mapdisp_window.BufferedWindow::MouseDraw(), N_alloc_array_2d(), N_alloc_array_3d(), N_read_rast3d_to_array_3d(), N_read_rast_to_array_2d(), N_write_array_2d_to_rast(), N_write_array_3d_to_rast3d(), NetA_get_node_costs(), NetA_varray_to_nodes(), new_part(), gui_modules.nviz_preferences.NvizPreferencesDialog::OnApply(), gui_modules.location_wizard.EPSGPage::OnBrowseCodes(), gui_modules.dbm.AttributeManager::OnDataItemEdit(), gui_modules.preferences.PreferencesDialog::OnLoadEpsgCodes(), gui_modules.nviz_tools.NvizPreferencesDialog::OnSave(), gui_modules.nviz_tools.NvizToolWindow::OnScroll(), gui_modules.nviz_tools.NvizToolWindow::OnVectorHeight(), python::core::parse_command(), parse_freetypecap(), PS_begin_scaled_raster(), gui_modules.preferences.Settings::SaveToFile(), gui_modules.dbm_base.VectorDBInfo::SelectFromTable(), gui_modules.preferences.Settings::Set(), slice_get_value(), gui_modules.dbm.VirtualAttributeList::Sorter(), gui_modules.location_wizard.ItemList::Sorter(), sqpAssignment(), sqpColumnDef(), sqpNewValueNode(), sqpValue(), gui_modules::dbm_base::unicodeValue(), gui_modules.dbm_dialogs.DisplayAttributesDialog::UpdateDialog(), gui_modules.nviz_mapdisp.GLWindow::UpdateSurfaceProperties(), gui_modules.nviz_tools.NvizToolWindow::UpdateVectorShow(), gui_modules.nviz_mapdisp.GLWindow::UpdateVolumeProperties(), V2_restore_line_nat(), Vect_build_line_area(), Vect_build_nat(), Vect_cidx_dump(), Vect_cidx_find_all(), Vect_clean_small_angles_at_nodes(), Vect_copy(), Vect_copy_map_lines(), Vect_copy_tables(), Vect_net_build_graph(), Vect_option_to_types(), Vect_rename(), Vect_set_constraint_type(), python::vector::vector_what(), Vedit_add_vertex(), Vedit_bulk_labeling(), Vedit_chtype_lines(), Vedit_copy_lines(), Vedit_flip_lines(), Vedit_modify_cats(), Vedit_move_lines(), Vedit_move_vertex(), Vedit_remove_vertex(), Vedit_snap_lines(), and Vedit_split_lines().

tuple gui_modules::psmap_dialogs::unit = self.unitConv.findUnit(self.panelVector.units['unitsCtrl'].GetStringSelection())
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines