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

A Buffered window class. More...

Public Member Functions

def __init__
def Draw
 Draws histogram or clears window.
def OnPaint
 Draw psuedo DC to buffer.
def OnSize
 Init image size to match window size.
def OnIdle
 Only re-render a histogram image from GRASS during idle time instead of multiple times during resizing.
def SaveToFile
 This will save the contents of the buffer to the specified file.
def GetImage
 Converts files to wx.Image.
def UpdateHist
 Update canvas if histogram options changes or window changes geometry.
def EraseMap
 Erase the map display.

Data Fields

 parent
 Map
 mapname
 render
 resize
 dragimg
 pen
 mapfile
 img
 imagedict
 pdc

Detailed Description

A Buffered window class.

When the drawing needs to change, you app needs to call the UpdateHist() method. Since the drawing is stored in a bitmap, you can also save the drawing to file by calling the SaveToFile(self,file_name,file_type) method.

Definition at line 35 of file histogram.py.

Constructor & Destructor Documentation

def gui_modules.histogram.BufferedWindow.__init__ (   self,
  parent,
  id = wx.ID_ANY,
  style = wx.NO_FULL_REPAINT_ON_RESIZE,
  Map = None,
  kwargs 
)

Definition at line 45 of file histogram.py.

Member Function Documentation

def gui_modules.histogram.BufferedWindow.EraseMap (   self)
def gui_modules.histogram.BufferedWindow.OnIdle (   self,
  event 
)
def gui_modules.histogram.BufferedWindow.OnPaint (   self,
  event 
)

Draw psuedo DC to buffer.

Definition at line 121 of file histogram.py.

References gui_modules.histogram.BufferedWindow._buffer.

Referenced by gui_modules.nviz_mapdisp.GLWindow.OnMouseAction().

def gui_modules.histogram.BufferedWindow.SaveToFile (   self,
  FileName,
  FileType,
  width,
  height 
)

This will save the contents of the buffer to the specified file.

See the wx.Windows docs for wx.Bitmap::SaveFile for the details

Definition at line 171 of file histogram.py.

References gui_modules.histogram.BufferedWindow.Draw(), gui_modules.colorrules.BufferedWindow.Draw(), gui_modules.histogram.BufferedWindow.GetImage(), gui_modules.colorrules.BufferedWindow.GetImage(), max, gui_modules.histogram.BufferedWindow.pdc, and gui_modules.colorrules.BufferedWindow.pdc.

Field Documentation

gui_modules.histogram.BufferedWindow.dragimg

Definition at line 58 of file histogram.py.

Referenced by gui_modules.mapdisp_window.BufferedWindow.DragMap().

gui_modules.histogram.BufferedWindow.mapname

The documentation for this class was generated from the following file: