4 canvas
Highly specialized existing graphic applications (e.g. process visualization) which have to have direct access to the underlying window system can use the dialog object canvas as their individual
drawing area.
The DM provides this object for the application. The DM does not consider the contents of this object; the application itself is responsible for the contents. For this reason, a canvas must not contain any child objects.
Definition
{ export | reexport } { model } canvas { <Identifier> } { <standard attributes> <plain attributes> <hierarchy attributes> <layout attributes> <object-specific attributes> }
The DM uses the attributes listed in chapter “Attributes” in the usual manner. This object is typically used when the application has to display dynamic charts or diagrams.
Events
Children
Parent
Menu
4.1 Attributes
Attribute |
RLD |
PID |
Properties |
Short Description |
---|---|---|---|---|
string object |
string text |
S.G/D/C |
overwrites the Automation Identifier for Microsoft UI Automation |
|
object string |
text string |
S.G/D/C |
overwrites the Automation Name for Microsoft UI Automation |
|
identifier |
accel |
S,G/D/C |
accelerator of object |
|
identifier |
color |
S,G/D/C |
background color |
|
identifier |
color |
S,G/D/C |
border color |
|
boolean |
boolean |
S,G/D/- |
controls computation of geometry with active grid |
|
enum |
enum |
S,G/D/C |
defines the style, i.e. representation and characteristics of the borders (since IDM version A.06.01.a) |
|
integer |
integer |
S,G/D/C |
borderwidth |
|
identifier |
func |
S,G/D/C |
canvas function |
|
class |
class |
-,G/-/- |
class/id of object |
|
identifier |
instance |
-,G/-/- |
control currently belonging to object |
|
identifier |
cursor |
S,G/D/C |
cursor belonging to object |
|
boolean |
boolean |
S,G/-/- |
cut operation not yet carried out |
|
boolean |
boolean |
-,G/-/- |
changing state during cut operation |
|
identifier |
instance |
-,G/-/- |
dialog to which the object belongs |
|
object |
document |
S,G/-/- |
accesses the I-th XML Document |
|
boolean |
boolean |
-,G/-/- |
returns if the object class is an USW class |
|
class |
class |
-,G/-/- |
returns the I-th registered USW class |
|
identifier |
color |
S,G/D/C |
foreground color |
|
object |
record |
S,G/-/C |
accesses the first record of an object |
|
boolean |
boolean |
S,G/-/C |
input focus on object |
|
identifier |
font |
S,G/D/C |
object font |
|
identifier |
func |
S,G/D/C |
function belonging to object |
|
identifier |
instance |
-,G/-/- |
object groupbox |
|
integer |
integer |
S,G/D/C |
object height |
|
string identifier |
string text |
S,G/D/C |
help text of object |
|
integer index |
integer index |
-,G/-/- |
current index of object in the child list of its parent |
|
string |
string |
S,G/D/C |
name/identifier of object |
|
object |
record |
S,G/-/C |
accesses the last record of an object |
|
object |
object |
-,G/-/- |
layoutbox of object |
|
boolean |
boolean |
S,G/D/- |
defers the display of a visibly created object |
|
attribute |
attribute |
-,G/-,- |
user-defined attribute [I] of object |
|
integer |
integer |
-,G/-,- |
number of user-defined attributes |
|
identifier |
instance |
S,G/D/C |
object menu |
|
identifier |
instance |
S,G/D/C |
model belonging to object |
|
object |
object |
-,G/-/- |
notepage of object |
|
boolean |
boolean |
S,G/D/- |
special options of object |
|
identifier |
instance |
S,G/-/- |
parent of object |
|
boolean |
boolean |
S,G/D/C |
positions refer to grid |
|
integer |
integer |
-,G/-/- |
real height of object |
|
boolean |
boolean |
-,G/-/- |
real selectivity of object |
|
boolean |
boolean |
-,G/-/- |
real visibility of object |
|
integer |
integer |
-,G/-/- |
real width of object |
|
integer |
integer |
-,G/-/- |
real distance from left (in pixel) |
|
integer |
integer |
-,G/-/- |
real distance from top (in pixel) |
|
object |
record |
S,G/-/C |
accesses the I-th record of an object |
|
integer |
integer |
-,G/-/- |
queries the number of child records |
|
integer |
scope |
-,G/-/- |
queries the object type (Default, Model or instance) |
|
boolean |
boolean |
S,G/D/C |
selectivity of object |
|
boolean |
boolean |
S,G/D/C |
size refers to grid of parent object |
|
string object |
string text |
S,G/-/C |
text to be displayed in statusbar |
|
object |
object |
-,G/-/- |
toolbar of object |
|
.toolhelp |
string object |
string text |
S,G/D/C |
gives a short explanation of object at the cursor |
anyvalue |
anyvalue |
S,G/D/C |
object userdata (any DM datatype) |
|
boolean |
boolean |
S,G/D/C |
visibility of object |
|
integer may be 0 |
integer |
S,G/D/C |
actual width of object |
|
identifier |
instance |
-,G/-/- |
window to which object belongs |
|
integer (-1, 0, 1) |
integer |
S,G/D/C |
definition type of x-coordinates |
|
integer |
integer |
S,G/D/C |
x-coordinate, distance from the left |
|
integer |
integer |
S,G/D/C |
x-coordinate, distance from the right |
|
integer (-1, 0, 1) |
integer |
S,G/D/C |
definition type of y-coordinates |
|
integer |
integer |
S,G/D/C |
y-coordinate, distance from bottom |
|
integer |
integer |
S,G/D/C |
y-coordinate, distance from top |
4.2 Specific Attributes
With Motif 1.1, you cannot navigate over an object with keyboard navigation, if this object is a composite widget
and if this widget has no children. A program abort is also likely.
Therefore, the attribute .options[enum] which decides whether a DrawingArea-Widget (composite
, i.e. it accepts children) or a DrawnButton-Widget (primitive
, i.e. it does not accept children) is to be used has been made available for the object canvas.
The DrawnButton-Widget is used as default.
Applications which include their own widgets or special widgets in the canvas, have to set the option opt_accept_child.
If opt_accept_child is set to true, a DrawingArea-widget (composite) will be used for the canvas. Default is a DrawnButton-widget.
The following enum options are only evaluated if opt_accept_child is not set.
If opt_focus_frame is set to false, the location-cursor-border
(keyboard focus) will not be drawn if the canvas does not have the focus. The default is true.
option_index |
Meaning |
---|---|
canvas accepts child widgets (i.e. no focus) |
|
no focus frame will be drawn |
|
canvas draws motif shadow frame |
4.3 Example
model canvas MCanvas
{
.canvasfunc CanvasEvent;
.xauto 0;
.xleft 0;
.xright 0;
.yauto 0;
.ytop 0;
.ybottom 5;
.fgc DiaColor20;
.bgc Background;
.posraster true;
.sizeraster true;
.font DiaFont;
}