14 image

This object is used to present images or charts. These images may be defined directly in the DM file or they may be imported from an external file.

Definition

{ export | reexport } { model } image { <Identifier> }
{
  <standard attributes>
  <plain attributes>
  <geometry attributes>
  <hierarchy attributes>
  <layout attributes>
  <text attributes>
  <object-specific attributes>
}

Events

cut

dbselect

extevent

focus

help

key

paste

select

Children

document

record

transformer

Parent

groupbox

layoutbox

module

notepage

splitbox

statusbar

toolbar

window

Menu

Pop-up Menu

14.1 attributes

.acc_label

.acc_text

.accelerator

.active

.alignment

.bgc

.borderstyle

.borderwidth

.class

.control

.cursor

.cut_pending

.cut_pending_changed

.dialog

.document[integer]

.external

.external[integer]

.fgc

.firstrecord

.focus

.focus_on_click

.font

.function

.groupbox

.height

.help

.imagebgc

.imagefgc

.index

.label

.lastrecord

.layoutbox

.mapped

.member[integer]

.membercount

.menu

.model

.module

.mouseover

.notepage

.options[enum]

.parent

.picture

.picture[enum]

.posraster

.real_height

.real_sensitive

.real_visible

.real_width

.real_x

.real_y

.record[integer]

.recordcount

.scope

.sensitive

.sizeraster

.spacing

.statushelp

.style

.text

.tilestyle

.toolhelp

.toolbar

.userdata

.visible

.width

.window

.xauto

.xleft

.xmargin

.xright

.yauto

.ybottom

.ymargin

.ytop

14.2 Specificattributes

attribute Description

.active

Indicates the active/inactive states.

See also chapter “Image display and mouseover events”.

.alignment

Horizontal presentation of the text.

Default: 0.

(See also .spacing and in particular the description in the “Attribute Reference” zu tilestyle).

.borderstyle

defines the style, i.e. representation and characteristics of the borders (since IDM version A.06.01.a)

Attribute is supported, but only border_none and border_toolkit are permitted. border_plain, border_raised and border_sunken are mapped to border_toolkit.

.focus_on_click

Determines whether the object gets the focus by mouse click.

.height

Height of the object.

At value 0 the DM automatically calculates the correct object size for the object.

.imagebgc

Background color of the image.

Evaluated only if the displayed image is not loaded from an external file.

.imagefgc

Foreground color of the image.

Evaluated only if the displayed image is not loaded from an external file.

.index

Index of the object in the child vector of the parent object.

.mouseover

Determines whether the object responds to mouseover events.

See also chapter “Image display and mouseover events”.

.options[enum]

Options of the object.

Index: opt_center_toolhelp (only IDM for Windows).

.picture

Specifies the tile pattern or image of the object.

See also chapter “Image display and mouseover events”.

.picture[enum]

Specifies the tile pattern or image of the object for the different states.

See also chapter “Image display and mouseover events”.

.spacing

Space between image and text.

(See also alignment and in particular the description in the “Attribute Reference” for tilestyle).

.style

Defines whether the object can represent the active/inactive states by different images or not.

See also chapter “Image display and mouseover events”.

In addition, under Windows you can specify whether the image should behave as a menu (see also chapter “Usage as menuitem replacement”).

.text

Specifies the text associated with the object.

It will be displayed below the image.

.tilestyle

Position of the image in the object.

Please also note detailed description “Attribute Reference” for tilestyle and attributes alignment and .spacing.

.width

Width of the object.

At value 0 the DM automatically calculates the correct object size for the object.

.xmargin

Vertical distance between content and margin.

See also detailed description “Attribute Reference” for xmargin.

.ymargin

Horizontal distance between content and border.

See also detailed description at “Attribute Reference” for ymargin.

14.2.1 Combination of the layout attributes

The attributes .xmargin and .ymargin define the distances between image border and display area (border shown dashed in the following image). The attribute .spacing defines the distance between tile and text within the display area of the image.

Figure 13-16: Image with text

Figure 13-17: Image without text

The following is an example of the effect of some attributes (the tile has the .scalestyle propscale):

Figure 13-18: effects of attributes

See also chaper“HighDPI Support” in manual “Programming Techniques”

14.2.2 Image display and mouseover events

The image to be displayed (e.g. a tile resource) is usually defined in the .picture attribute.

If the picture object is to display different pictures in different states (active, inactive...) (see attributes .style and .active) or react to mouseover, the necessary settings must be made in the attributes .picture[enum] or .mouseover (see “Attribute Reference”).

14.2.3 Usage as menuitem replacement

The image object can be used with a menu box style under Microsoft Windows. To do this, the attribute .style must be given the value menubox. Menus similar to Microsoft Office can then be designed. It makes sense to define all image objects with .style = menubox as children of a toolbar object. Furthermore, such a window should not have any other menus.

Beispiel

color MENU_BGC rgb(191,219,255);

 

tile TI_DEFAULT "xdefault.bmp" scale;

tile TI_OVER "xover.bmp" scale;

tile TI_ACTIVE "xactive.bmp" scale;

 

font MENU_FONT "ANSI_VAR_FONT";

 

model image Menu

{

  .style menubox;

  .borderwidth 0;

  .mouseover true;

  .focus_on_click false;

  .font MENU_FONT;

 

   .picture[tile_default] TI_DEFAULT;

  .picture[tile_mouse_over] TI_OVER;

  .picture[tile_active] TI_ACTIVE;

   .picture[tile_active_mouse_over] TI_ACTIVE;

   .tilestyle tilestyle_background;

}

 

model toolbar Menubar

{

   .docking dock_up;

  .autosize true;

  .sizeable[docking] false;

   .tile TI_DEFAULT;

   .tilestyle tilestyle_stretched;

  .bgc MENU_BGC;

}

14.3 Example

dialog Test

{

}

tile TestTile "IMAGE:Setup.bmp";

 

window WnTest

{

  .width 277;

  .height 257;

  .title "Testfenster";

 

  child image Im1

  {

    .xleft 34;

    .ytop 47;

    .picture TestTile;

  }

}

Figure 13-19: Bild