GRASS Programmer's Manual  6.4.2(2012)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gui_modules.psmap Namespace Reference

Data Structures

class  PsMapFrame
class  PsMapBufferedWindow
 A buffered window class. More...

Functions

def getFile
 busy.Destroy()
def OnInstructionFile
def OnLoadFile
 Load file and read instructions.
def OnPageSetup
 Specify paper size, margins and orientation.
def OnPointer
def OnPan
def OnZoomIn
def OnZoomOut
def OnZoomAll
def OnAddMap
 Add or edit map frame.
def OnAddRaster
 Add raster map.
def OnAddVect
 Add vector map.
def OnDecoration
 Decorations overlay menu.
def OnAddScalebar
 Add scalebar.
def OnAddLegend
 Add raster or vector legend.
def OnAddMapinfo
def OnAddText
 Show dialog for text adding and editing.
def getModifiedTextBounds
 computes bounding box of rotated text, not very precisely
def makePSFont
 creates a wx.Font object from selected postscript font.
def getTextExtent
 Estimates bounding rectangle of text.
def getInitMap
 Create default map frame when no map is selected, needed for coordinates in map units.
def OnDelete
def deleteObject
 Deletes object, his id and redraws.
def DialogDataChanged
def OnPageChanged
 Flatnotebook page has changed.
def OnPageChanging
 Flatnotebook page is changing.
def OnHelp
 Show help.
def OnAbout
 Display About window.
def OnCloseWindow
 Close window.
def DrawImage
 Draw preview image to pseudoDC.
def DrawPaper
 Draw paper and margins.
def ImageRect
 Returns image centered in canvas, computes scale.
def RedrawSelectBox
 Redraws select box when selected object changes its size.
def UpdateMapLabel
 Updates map frame label.
def OnSize
 Init image size to match window size.
def OnIdle
 Only re-render a image during idle time instead of multiple times during resizing.
def ScaleRect
 Scale rectangle.
def main

Variables

 haveImage = True
tuple im = Image.open(event.userData['filename'])
 wx.BusyInfo does not display the message busy = wx.BusyInfo(message = "Generating preview, wait please", parent = self)
tuple message = _("Unable to generate preview. %s")
tuple rect = self.previewCanvas.ImageRect()
tuple dlg
 dlg = MapDialog(parent = self, id = id, settings = self.instruction, notebook = notebook) dlg.ShowModal()
tuple fn = self.parent.makePSFont(textDict)
 if textDict['border'] != 'none' and not rot: units = UnitConversion(self) borderWidth = units.convert(value = textDict['width'], fromUnit = 'point', toUnit = 'pixel' ) * self.currScale pdc.SetPen(wx.Pen(colour = convertRGB(textDict['border']), width = borderWidth)) pdc.DrawRectangle(*bounds)
 instruction
 objectId
 pageId
 mouseOld
 currentPage
 cursorOld
 actionOld
 currScale
 dragId
 _buffer
 resize

Function Documentation

def gui_modules.psmap.deleteObject (   self,
  id 
)

Deletes object, his id and redraws.

Definition at line 778 of file psmap.py.

def gui_modules.psmap.DrawImage (   self,
  rect 
)

Draw preview image to pseudoDC.

Definition at line 1584 of file psmap.py.

def gui_modules.psmap.DrawPaper (   self,
  rect 
)

Draw paper and margins.

Definition at line 1601 of file psmap.py.

def gui_modules.psmap.getFile (   self,
  wildcard 
)

busy.Destroy()

Definition at line 338 of file psmap.py.

References gui_modules.utils.split().

def gui_modules.psmap.getInitMap (   self)

Create default map frame when no map is selected, needed for coordinates in map units.

Definition at line 739 of file psmap.py.

References gui_modules.psmap_dialogs.GetMapBounds().

def gui_modules.psmap.getModifiedTextBounds (   self,
  x,
  y,
  textExtent,
  rotation 
)

computes bounding box of rotated text, not very precisely

Definition at line 663 of file psmap.py.

def gui_modules.psmap.getTextExtent (   self,
  textDict 
)

Estimates bounding rectangle of text.

Definition at line 725 of file psmap.py.

def gui_modules.psmap.ImageRect (   self)

Returns image centered in canvas, computes scale.

Definition at line 1626 of file psmap.py.

def gui_modules.psmap.main ( void  )

Definition at line 1708 of file psmap.py.

def gui_modules.psmap.makePSFont (   self,
  textDict 
)

creates a wx.Font object from selected postscript font.

To be used for estimating bounding rectangle of text

Definition at line 679 of file psmap.py.

References gui_modules.utils.split().

def gui_modules.psmap.OnAbout (   self,
  event 
)

Display About window.

Definition at line 907 of file psmap.py.

def gui_modules.psmap.OnAddLegend (   self,
  event,
  page = 0 
)

Add raster or vector legend.

Definition at line 624 of file psmap.py.

Referenced by gui_modules.goutput.GMConsole.RunCmd().

def gui_modules.psmap.OnAddMap (   self,
  event,
  notebook = False 
)

Add or edit map frame.

Definition at line 464 of file psmap.py.

def gui_modules.psmap.OnAddMapinfo (   self,
  event 
)

Definition at line 640 of file psmap.py.

def gui_modules.psmap.OnAddRaster (   self,
  event 
)

Add raster map.

Definition at line 534 of file psmap.py.

def gui_modules.psmap.OnAddScalebar (   self,
  event 
)

Add scalebar.

Definition at line 610 of file psmap.py.

References gui_modules.psmap_dialogs.projInfo().

def gui_modules.psmap.OnAddText (   self,
  event,
  id = None 
)

Show dialog for text adding and editing.

Definition at line 650 of file psmap.py.

References gui_modules.psmap_dialogs.OnApply().

def gui_modules.psmap.OnAddVect (   self,
  event 
)

Add vector map.

Definition at line 558 of file psmap.py.

def gui_modules.psmap.OnCloseWindow (   self,
  event 
)

Close window.

Definition at line 920 of file psmap.py.

def gui_modules.psmap.OnDecoration (   self,
  event 
)

Decorations overlay menu.

Definition at line 581 of file psmap.py.

def gui_modules.psmap.OnDelete (   self,
  event 
)

Definition at line 769 of file psmap.py.

def gui_modules.psmap.OnHelp (   self,
  event 
)

Show help.

Definition at line 896 of file psmap.py.

References gui_modules.gcmd.RunCommand().

def gui_modules.psmap.OnIdle (   self,
  event 
)

Only re-render a image during idle time instead of multiple times during resizing.

Definition at line 1690 of file psmap.py.

def gui_modules.psmap.OnInstructionFile (   self,
  event 
)

Definition at line 372 of file psmap.py.

def gui_modules.psmap.OnLoadFile (   self,
  event 
)

Load file and read instructions.

Definition at line 379 of file psmap.py.

def gui_modules.psmap.OnPageChanged (   self,
  event 
)

Flatnotebook page has changed.

Definition at line 886 of file psmap.py.

def gui_modules.psmap.OnPageChanging (   self,
  event 
)

Flatnotebook page is changing.

Definition at line 891 of file psmap.py.

def gui_modules.psmap.OnPageSetup (   self,
  event = None 
)

Specify paper size, margins and orientation.

Definition at line 409 of file psmap.py.

def gui_modules.psmap.OnPan (   self,
  event 
)

Definition at line 427 of file psmap.py.

def gui_modules.psmap.OnPointer (   self,
  event 
)

Definition at line 421 of file psmap.py.

def gui_modules.psmap.OnSize (   self,
  event 
)

Init image size to match window size.

Definition at line 1681 of file psmap.py.

def gui_modules.psmap.OnZoomAll (   self,
  event 
)

Definition at line 445 of file psmap.py.

def gui_modules.psmap.OnZoomIn (   self,
  event 
)

Definition at line 433 of file psmap.py.

def gui_modules.psmap.OnZoomOut (   self,
  event 
)

Definition at line 439 of file psmap.py.

def gui_modules.psmap.RedrawSelectBox (   self,
  id 
)

Redraws select box when selected object changes its size.

Definition at line 1641 of file psmap.py.

def gui_modules.psmap.ScaleRect (   self,
  rect,
  scale 
)

Scale rectangle.

Definition at line 1703 of file psmap.py.

def gui_modules.psmap.UpdateMapLabel (   self)

Updates map frame label.

Definition at line 1656 of file psmap.py.

References gui_modules.utils.split().

Variable Documentation

gui_modules.psmap._buffer

Definition at line 1699 of file psmap.py.

gui_modules.psmap.actionOld

Definition at line 468 of file psmap.py.

gui_modules.psmap.currentPage

Definition at line 447 of file psmap.py.

gui_modules.psmap.currScale

Definition at line 1632 of file psmap.py.

gui_modules.psmap.cursorOld

Definition at line 448 of file psmap.py.

tuple gui_modules.psmap.dlg
Initial value:
1 MapDialog(parent = self, id = id, settings = self.instruction,
2  notebook = notebook)

dlg = MapDialog(parent = self, id = id, settings = self.instruction, notebook = notebook) dlg.ShowModal()

dlg = MainVectorDialog(self, id = id, settings = self.instruction) dlg.ShowModal()

dlg = RasterDialog(self, id = id, settings = self.instruction) dlg.ShowModal()

Definition at line 512 of file psmap.py.

gui_modules.psmap.dragId

Definition at line 1643 of file psmap.py.

tuple gui_modules.psmap.fn = self.parent.makePSFont(textDict)

if textDict['border'] != 'none' and not rot: units = UnitConversion(self) borderWidth = units.convert(value = textDict['width'], fromUnit = 'point', toUnit = 'pixel' ) * self.currScale pdc.SetPen(wx.Pen(colour = convertRGB(textDict['border']), width = borderWidth)) pdc.DrawRectangle(*bounds)

Definition at line 1574 of file psmap.py.

Referenced by gui_modules.menuform.cmdPanel.OnUpdateDialog(), and Vect_net_shortest_path_coor2().

gui_modules.psmap.haveImage = True

Definition at line 24 of file psmap.py.

tuple gui_modules.psmap.im = Image.open(event.userData['filename'])

wx.BusyInfo does not display the message busy = wx.BusyInfo(message = "Generating preview, wait please", parent = self)

Definition at line 313 of file psmap.py.

Referenced by class_discont().

gui_modules.psmap.instruction

Definition at line 398 of file psmap.py.

tuple gui_modules.psmap.message = _("Unable to generate preview. %s")

Definition at line 321 of file psmap.py.

gui_modules.psmap.mouseOld

Definition at line 446 of file psmap.py.

gui_modules.psmap.objectId

Definition at line 399 of file psmap.py.

gui_modules.psmap.pageId

Definition at line 400 of file psmap.py.

tuple gui_modules.psmap.rect = self.previewCanvas.ImageRect()

Definition at line 325 of file psmap.py.

gui_modules.psmap.resize

Definition at line 1701 of file psmap.py.