-
Notifications
You must be signed in to change notification settings - Fork 1
draw box
senso edited this page Jun 22, 2026
·
2 revisions
#example #drawing #mouse #settings #control #graphics
Interactive rectangle drawing with mouse input.
| Module Name | draw box |
| Type | mtControl |
| Color | clInterfaceDesignModuleColor |
| Source | examples/DrawBox/ |
Draw and manipulate a rectangle on a canvas using mouse interaction. Supports zoom via mouse wheel, randomization, and contextual menus.
| # | Name | Type | I/O | Callback |
|---|---|---|---|---|
| 0 | reset |
ptButton |
Input | ctImmediate |
| 1 | randomize |
ptButton |
Input | ctImmediate |
- Mouse down: Records the starting corner of the rectangle
- Mouse move: Updates the opposite corner while dragging
- Mouse up: Releases the rectangle
- Mouse wheel: Scales the rectangle around the mouse position
-
onPaint: Draws a filled rectangle withsdkFillRect -
onRandomize: Generates random rectangle dimensions
-
Full mouse interaction:
onMouseMove,onMouseDown,onMouseUp,onMouseWheel -
sdkFillRectfor rectangle drawing -
onRandomizefor preset randomization support -
onCreateCommandsfor contextual menu entries - Settings panel with color picker
-
DontProcess = TRUE— no audio processing
onGetModuleInfo · onInitModule · onGetParamInfo · onCallBack · onCreateSettings · onSettingsHasChanged · onCreateCommands · onPaint · onMouseMove · onMouseDown · onMouseUp · onMouseWheel · onRandomize
- DrawTrajectoryBox — Advanced drawing with curves
- SimplePad — Multi-pad mouse interaction
- DataOscilloscope — Custom drawing with path API