class LM_MeshPreview

The LM_MeshPreview class is a user interface class that is used in a dialog to preview what a vector mesh will look like. This can be used by a script that generates 2D vector shapes, giving the user a chance to see the result before it is inserted into the Moho document. You can create an LM_MeshPreview object using the following function:


LM_MeshPreview MeshPreview(width, height)

Creates a new mesh preview object that can then be used in a dialog layout.

Return value (LM_MeshPreview): the newly-created mesh preview
width (int): width in pixels
height (int): height in pixels

Member Functions

M_Mesh Mesh()

Returns the M_Mesh object associated with the preview object. You can then modify the mesh to change what is displayed in the preview region.

Return value (M_Mesh): a mesh object

bool CreateShape(filled)

Creates a shape out of the selected points in the mesh.

Return value (bool): true if successful, otherwise false
filled (bool): true for a filled shape, false for just an outline

void AutoZoom()

Automatically zooms in on the mesh so that is fills the preview region.

Return value: none

void Refresh()

Forces the preview region to re-draw itself. Call this function after making changes to the mesh.

Return value: none
class LM_MeshPreview : public LM_View {
  M_Mesh *Mesh();
  bool CreateShape(bool filled);
  void AutoZoom();
  void Refresh();
};