Graphics window Home

The LiteCAD graphics window is used to display and edit graphics data contained in the drawing object. Put it as a child-window it on the desired window/form of your application, by call the function lcCreateWindow, and link it with a drawing by the function lcWndSetBlock.

LiteCAD graphics window have service objects Magnifier and Aerial View.

These are the LiteCAD window functions:

Function Meaning
lcCreateWindow Creates the window
lcDeleteWindow Deletes the window
lcWndOnClose Stops active processes before a window to be closed
lcWndExeCommand Executes interactive command
lcWndResize Changes the size and position of the window
lcWndRedraw Redraws content of the window
lcWndRedrawAuto Activates multiple redraw by timer
lcWndSetFocus Sets the keyboard focus to the window
lcWndSetExtents Sets drawing's extents for the window
lcWndSetBlock Links graphics window with a block
lcWndSetProps Links graphics window with a properties window
lcWndSetCmdwin Links graphics window with a command window
lcWndSetBasePoint Set base point for Polar tracking
lcWndEmulator Pen movement emulation
lcWndMagnifier Defines Magnifier feature
lcWndHoverText Defines hover text
lcWndMessage Displays message box
lcWndPickEnt Let user to pick an entity on a window.
lcWndWaitPoint Waits until user pick a point on a screen
lcWndWaitPoint2 Waits until user pick a point on a screen
lcWndInputStr Input text string for a command
lcWndUpdate Updates a window
lcWndDrwAdd Adds a drawing
lcWndDrwDelete Deletes a drawing
lcWndDrwGet Enumerates all drawings of graphics window
    Zoom
lcWndZoomRect Defines a part of a drawing, visible in the window
lcWndZoomScale Changes visible scale of a drawing in the window (Zoom In / Zoom Out)
lcWndZoomMove Offsets visible part of a drawing (Pan view)
lcWndZoomPos Set view center and optional scale
lcWndZoomEnt Zoom on specified entity
    Coordinates
lcWndGetCursorCoord Returns cursor coordinates
lcCoordDrwToWnd
lcWndCoordFromDrw
Converts a drawing coordinates into a window coordinates
lcCoordWndToDrw
lcWndCoordToDrw
Converts a window coordinates into a drawing coordinates
    Retrieve entities
lcWndGetEntByPoint Gets one entity at specified position (window coordinates)
lcWndGetEntByPoint2 Gets one entity at specified position (drawing coordinates)
lcWndGetEntsByPoint Gets an array of entities at specified position (window coordinates)
lcWndGetEntsByRect Gets an array of entities by specified rectangle (drawing coordinates)
lcWndGetEntity Returns a handle to entity in the array
lcWndGetEntByID
lcWndGetEntByIDH
Retrieves an entity by its identifier
lcWndGetEntByKey Retrieves a graphic object by its key value

  Paint mode functions

The window object has the following properties:

Property Type Access Meaning
LC_PROP_WND_ID int RW Window Identifier
LC_PROP_WND_WIDTH int R Width of drawing's area, pixels
LC_PROP_WND_HEIGHT int R Height of drawing's area, pixels
LC_PROP_WND_FRAME_LEFT int R X position of the frame's left-top corner on parent window, pixels
LC_PROP_WND_FRAME_TOP int R Y position of the frame's left-top corner on parent window, pixels
LC_PROP_WND_FRAME_WIDTH int R Window frame width, pixels
LC_PROP_WND_FRAME_HEIGHT int R Window frame height, pixels
LC_PROP_WND_HWND handle R WinAPI handler (HWND) of a window
LC_PROP_WND_BLOCK
LC_PROP_WND_VIEWBLOCK
handle R Handle to a block linked with a window
LC_PROP_WND_DRW handle R Handle to a drawing currently displayed in a window
LC_PROP_WND_HASFOCUS bool R TRUE, if a window have input focus
LC_PROP_WND_PIXELSIZE float RW Current scale of the drawing in the window, units per pixel
LC_PROP_WND_SELECT bool RW Enable / disable selection of entities
LC_PROP_WND_DTIME int R Redraw time, milliseconds
LC_PROP_WND_FROZEN bool RW "Frozen" mode
LC_PROP_WND_FROZENVIEW bool RW "Frozen View" mode
LC_PROP_WND_COMMAND
LC_PROP_WND_CMD
int
handle
bool
R Id of active command
Handle to active command
TRUE if has active command
LC_PROP_WND_CMDENT1 bool RW TRUE - only one entity added by a command, FALSE - several entities
LC_PROP_WND_OSNAP int
bool
RW Object snap mode (LC_OSNAP_NODE and others)
On/Off
LC_PROP_WND_OSNAPMENU bool RW On/Off Object snap popup menu on <Shift> + <Right click>
LC_PROP_WND_PTRACK bool RW Enable Polar tracking
LC_PROP_WND_PTRACK_ANGLE float RW Step angle for Polar tracking
LC_PROP_WND_PTRACK_ANGREL bool RW If true then LC_PROP_WND_PTRACK_ANGLE is relative, false - absolute
LC_PROP_WND_PTRACK_DIST bool
float
RW Use distance step along polar vector
Value of distance step
LC_PROP_WND_BASEPT bool R Has base point (Used for Polar tracking)
LC_PROP_WND_BASEX float R X coordinate of base point
LC_PROP_WND_BASEY float R Y coordinate of base point
LC_PROP_WND_ORTHO bool RW Ortho mode
LC_PROP_WND_BGIMAGE string
bool
RW Filename of background image
Display background image (if loaded)
LC_PROP_WND_TIN handle RW Active TIN object
LC_PROP_WND_HASFILETABS bool R TRUE if window has file tabs (was created with style LC_WS_FILETABS)
LC_PROP_WND_NUMFILETABS int R Number of file tabs
LC_PROP_WND_NUMDRW int R Number of drawings that graphics window contains
LC_PROP_WND_ENT handle R Handle of picked entity. See lcWndPickEnt

      Visibility of some elements
LC_PROP_WND_RULERS bool RW Display window rulers (The window must be created with LC_WS_RULERS style flag)
LC_PROP_WND_MAGNIFIER bool RW Display Magnifier at right-bottom corner
LC_PROP_WND_NAVIGATOR bool RW Display "Aerial view" window
LC_PROP_WND_BREAKPOINTS bool RW Display breakpoints
LC_PROP_WND_BREAKPTNUMS bool RW Display breakpoint number
LC_PROP_WND_JUMPLINES bool RW Display jump lines
LC_PROP_WND_ALPHABLEND bool RW Enable alpha blend (transparent filling)
LC_PROP_WND_STDBLKFRAME bool RW Draw red frame around a window if standard block is active
LC_PROP_WND_BLKBASEPT bool RW Display block basepoint (LC_PROP_BLOCK_X, LC_PROP_BLOCK_Y)
LC_PROP_WND_DRAWPAPER bool RW Draw paper sheet for "Paper space" blocks
LC_PROP_WND_LTVIEWMIN int RW Linetype visibility, min size of pattern (pixels)
LC_PROP_WND_LTVIEWMAX int RW Linetype visibility, max size of pattern (pixels)

      Cursor type and position
LC_PROP_WND_CURSORARROW
LC_PROP_WND_CURSORSYS
bool
int
handle
RW
  W
RW
Enable arrow cursor
Set cursor by id (LC_CURSOR_ARROW, LC_CURSOR_CROSS, etc.)
Get cursor handle / Set cursor by handle (HCURSOR)
LC_PROP_WND_CURSORCROSS bool RW Enable crosshair cursor
LC_PROP_WND_CURSORSIZE int RW Size of crosshair cursor, % of screen, if negative - size in pixels
LC_PROP_WND_CURSORPBOX bool RW Enable a selecting square (pickbox) at cursor position
LC_PROP_WND_PICKBOXSIZE float R Half size of a selecting square (drawing's units)
LC_PROP_WND_CURX int
float
R Cursor position X, pixels
Cursor position X, drawing's units
LC_PROP_WND_CURY int
float
R Cursor position Y, pixels
Cursor position Y, drawing's units
LC_PROP_WND_CURLEF float R Left side coordinate of selecting square (drawing units)
LC_PROP_WND_CURBOT float R Bottom side coordinate of selecting square (drawing units)
LC_PROP_WND_CURRIG float R Right side coordinate of selecting square (drawing units)
LC_PROP_WND_CURTOP float R Top side coordinate of selecting square (drawing units)
LC_PROP_WND_COORDS bool RW Display cursor coordinates at left-bottom corner

      Drawing view coordinates
LC_PROP_WND_XMIN float R Xmin of currently visible drawing's area
LC_PROP_WND_YMIN float R Ymin of currently visible drawing's area
LC_PROP_WND_XMAX float R Xmax of currently visible drawing's area
LC_PROP_WND_YMAX float R Ymax of currently visible drawing's area
LC_PROP_WND_XCEN float R Center X of currently visible drawing's area
LC_PROP_WND_YCEN float R Center Y of currently visible drawing's area
LC_PROP_WND_DX float R Width of currently visible drawing's area
LC_PROP_WND_DY float R Height X of currently visible drawing's area

      Coordinate grid
LC_PROP_WND_GRIDSNAP bool RW Enable cursor snap to grid nodes
LC_PROP_WND_GRIDSHOW bool RW Display coordinate grid
LC_PROP_WND_GRIDDX float RW Distance between vertical grid lines
LC_PROP_WND_GRIDDY float RW Distance between horizontal grid lines
LC_PROP_WND_GRIDX0 float RW Grid origin point Y
LC_PROP_WND_GRIDY0 float RW Grid origin point X
LC_PROP_WND_GRIDBOLDX int RW X step for grid bold lines
LC_PROP_WND_GRIDBOLDY int RW Y step for grid bold lines
LC_PROP_WND_GRIDCOLOR int RW Color of grid line
LC_PROP_WND_GRIDDOTTED bool RW Grid line is dotted
LC_PROP_WND_GRIDCOLOR2 int RW Color of grid bold line
LC_PROP_WND_GRIDDOTTED2 bool RW Grid bold line is dotted

      Snap to rectangle border
LC_PROP_WND_RSNAP bool RW Enable snap to rectangle border
LC_PROP_WND_RSNAPSHOW bool RW Display snap rectanle
LC_PROP_WND_RSNAPLEF float RW X left
LC_PROP_WND_RSNAPBOT float RW Y bottom
LC_PROP_WND_RSNAPRIG float RW X right
LC_PROP_WND_RSNAPTOP float RW Y top
LC_PROP_WND_RSNAPW float RW Width (from X left)
LC_PROP_WND_RSNAPH float RW Height (from Y bottom)
LC_PROP_WND_RSNAPCOLORM int RW Rectangle filling color on Model space
LC_PROP_WND_RSNAPCOLORP int RW Rectangle filling color on Paper space

      Pan optimization
LC_PROP_WND_PANSTEP int RW Pan: minimal step, pixels
LC_PROP_WND_PANLW bool RW Pan: don't display linewidths
LC_PROP_WND_PANIMAGE bool RW Pan: don't draw raster images
LC_PROP_WND_PANFILL bool RW Pan: don't fill polygons
LC_PROP_WND_PANPIXSZ bool RW Pan: reduce resolution

      Measurements
LC_PROP_WND_MEASCOLORPNT int RW Measurement point color (COLORREF)
LC_PROP_WND_MEASCOLORLINE int RW Measurement line color (COLORREF)
LC_PROP_WND_MEASLINESIZE int RW Measurement line size
LC_PROP_WND_MEASFONTSIZE int RW Measurement font size
LC_PROP_WND_MEASFILLAREA int RW Fill area polygons with hatch

      Colors
LC_PROP_WND_COLORINFBG int RW Info box: background color
LC_PROP_WND_COLORINFBORD int RW Info box: border color
LC_PROP_WND_COLORINFTEXT int RW Info box: text color

      Magnifier
LC_PROP_WND_COLORINFBG int RW Info box: background color

      Clipping rectangles
LC_PROP_WND_CRECTS_EDIT bool RW "Edit Clipping Rectangles" mode
LC_PROP_WND_CRECTS_VISIBLE bool RW Display clipping rectangles when LC_PROP_WND_CRECTS_EDIT is false

      Move entities by keyboard
LC_PROP_WND_KBMOVE_ENABLE bool RW Enable entities movement by keyboard
LC_PROP_WND_KBMOVE_DIST float RW Distance step
LC_PROP_WND_KBMOVE_ANGLE float RW Angle step
LC_PROP_WND_KBMOVE_SCALE float RW Scale step

      User specified data
LC_PROP_WND_INT0
 . . .

LC_PROP_WND_INT9
int RW User integer variables
LC_PROP_WND_FLOAT0
 . . .

LC_PROP_WND_FLOAT9
float RW User float variables
LC_PROP_WND_STR0
 . . .

LC_PROP_WND_STR9
string RW User text variables


If a drawing is not linked with a window, the following properties are available:

Property Type Access Meaning
LC_PROP_WND_LWMODE int RW Line width mode (LC_LW_THIN, LC_LW_REAL, LC_LW_PIXEL)
LC_PROP_WND_LWSCALE float RW Screen scale for line width, mm/pixel (for LC_LW_PIXEL mode)
LC_PROP_WND_COLORBG int RW Window background color
LC_PROP_WND_COLORCURSOR int RW Cursor color
LC_PROP_WND_COLORFORE int RW Foreground color