GRAphical Programming for Eiffel index contents

Appendix H. GRAPE Resource Files


GRAPE Resource file Description

The GRAPE portable resource definition language was introduced because it was necessary to provide a uniform way of developing resources across the platforms. Resource definition syntax is different on each platform.

The GRAPE resource definition language follows the GRAPE class hierarchy and most of GRAPE's classes can be loaded from resources.

Under Windows a ERC file is converted to an ordinary RC file and later being processed by a native Windows resource compiler. We can recommend you to create a Dynamic Link Library from each ERC file making possible physically separating the resources from the code.


Grammar


ercfile	     : ercfile statement SEMICOLON
             | SEMICOLON
	     |

statement    : rectid  rect_body
	     | menuid	menu_body
	     | mitemid	menu_item_body
	     | smitemid	submenu_body
	     | colorid		color_body
	     | penid		pen_body
	     | brushid	brush_body
	     | fontid		font_body
	     | pictureid	picture_body
	     | iconid		icon_body
	     | cursorid	cursor_body
	     | tileid		tile_body
	     | controlid	control_body
	     | textbtnid	textbtn_body
	     | checkbtnid	checkbtn_body
	     | radiobtnid	radiobtn_body
	     | picbtnid	picbtn_body
	     | groupboxid	groupbox_body
	     | stattextid	stattext_body
	     | statpictid	statpict_body
	     | listboxid	listbox_body
	     | comboboxid	combobox_body
	     | historyid	history_body
	     | sliderid	slider_body
	     | tleid		tle_body
	     | memoid	memo_body
	     | dialogid	dialog_body
	     | windowid	window_body
	     | deskelid	deskel_body
	     | mboxid	mbox_body
	     | stringid	string_body

Alphabetical resource list

Below is the list of all available resources:

BRUSH ICON SLIDER
CHECK_BUTTON LIST_BOX STATIC_PICTURE
COLOR MEMO_ENTRY STATIC_TEXT
COMBO_BOX MENU STRING
CONTROL MENU_ITEM SUB_MENU
CURSOR MESSAGE_BOX TEXT_BUTTON
DESKTOP_ELEMENT PEN TEXT_LINE_ENTRY
DIALOG PICTURE TILE
FONT PICTURE_BUTTON WINDOW
GROUP_BOX RADIO_BUTTON
HISTORY RECT

RECT

Description

This resource type is used to define a rectangle. It corresponds to class RECT.

Grammar


rectid	        : RECT IDENTIFIER

rect_body       : IS rect_components END

rect_components	:
	        | rect_components rect_component SEMICOLON

rect_component	: X ASSIGN NUMERIC_CONST
	        | Y ASSIGN NUMERIC_CONST
	        | WIDTH ASSIGN NUMERIC_CONST
	        | HEIGHT ASSIGN NUMERIC_CONST

Example

  
rect MY_RECT is 
x := 10; 
y := 20; width := 30; height := 40; 
end; 

See also TILE, STRING


MENU

Description

This resource corresponds to the MENU class.

Grammar


menuid	        : MENU IDENTIFIER

menu_body	: IS menu_components END

menu_components	:
	        | menu_components menu_component SEMICOLON

menu_component	: sub_menu
	        | menu_item
	        | separator

separator       : SEPARATOR

Example

  
menu APP_MENU is 
   sub_menu is 
     text := "&File";
     menu_item is
       text := "&New";
       command := IDM_NEW;
       context := CTX_NEW;
     end;
     menu_item is
       text := "&Open";
       command := IDM_OPEN;
       context := CTX_OPEN;
     end;
     menu_item is
       text := "&Save";
       command := IDM_SAVE;
       context := CTX_OPEN;
       disabled := True;
     end;
     menu_item is
       text := "Save &as";
       command := IDM_SAVE_AS;
       context := CTX_SAVE_AS;
       disabled := True;
     end;
     menu_item is
       text := "Save as &RC";
       command := IDM_SAVE_AS_RC;
       context := CTX_SAVE_AS_RC;
     end;
     menu_item is
       text := "&Close";
       command := IDM_CLOSE;
       context := CTX_CLOSE;
     end;
     separator;
     menu_item is
       text := "Open &multiple";
       command := IDM_OPEN_MULTIPLE;
       context := CTX_OPEN_MULTIPLE;
       checked := True;
     end;
     menu_item is 
       text := "Close al&l";
       command := IDM_CLOSE_ALL;
       context := CTX_CLOSE_ALL;
     end;
     separator;
     menu_item is 
       text := "E&xit";
       command := IDM_QUIT;
       context := CTX_QUIT;
     end;
   end;
   sub_menu is
     text := "&Window";
     menu_item is
       text := "&Tile";
       command := IDM_TILE;
       context := CTX_TILE;
     end;
     menu_item is
       text := "&Cascade";
       command := IDM_CASCADE;
       context := CTX_CASCADE;
     end;
     menu_item is
     text := "&Arrange icons";
     command := IDM_ARRANGE;
     context := CTX_ARRANGE;
     end;
   end; 
end; 

See also MENU_ITEM, SUB_MENU


MENU_ITEM

Description

This resource corresponds to MENU_ITEM class.

Grammar


menu_item	 : menu_item_id menu_item_body

mitemid		 : MENU_ITEM IDENTIFIER

menu_item_id	 : MENU_ITEM

menu_item_body	 : IS mitem_components END

mitem_components :
	        | mitem_components mitem_component SEMICOLON

mitem_component	: mitem_text
	        | mitem_command
	        | mitem_checked
	        | mitem_disabled
	        | mitem_context

mitem_text	: TEXT ASSIGN STRING_CONST

mitem_command	: COMMAND ASSIGN IDENTIFIER

mitem_context	: CONTEXT ASSIGN IDENTIFIER

mitem_checked	: CHECKED ASSIGN BOOLEAN_TRUE
	        | CHECKED ASSIGN BOOLEAN_FALSE

mitem_disabled	: DISABLED ASSIGN BOOLEAN_TRUE
                | DISABLED ASSIGN BOOLEAN_FALSE

Example

menu_item MY_MENU_ITEM is
   text := "&Cascade";
   command := IDM_CASCADE;
   context := CTX_CASCADE;
   disabled := False;
   checked := False;
end; 

See also MENU, SUB_MENU


SUB_MENU

Description

This resource corresponds to SUB_MENU class.

Grammar


sub_menu	: submenu_id submenu_body

smitemid	: SUB_MENU IDENTIFIER

submenu_id	: SUB_MENU

submenu_body	: IS smenu_components END

smenu_components:
	        | smenu_components smenu_component SEMICOLON

smenu_component	: smenu_text
         	| smenu_context
	        | sub_menu
	        | menu_item
 	        | separator

smenu_text	: TEXT ASSIGN STRING_CONST

smenu_context	: CONTEXT ASSIGN IDENTIFIER

Example

sub_menu MY_SUB_MENU is 
   text := "&Window";
   menu_item is
     text := "&Tile";
     command := IDM_TILE;
     context := CTX_TILE;
   end;
   menu_item is
     text := "&Cascade";
     command := IDM_CASCADE;
     context := CTX_CASCADE;
   end;
   menu_item is
     text := "&Arrange icons";
     command := IDM_ARRANGE;
     context := CTX_ARRANGE;
   end;
end; 

See also MENU, MENU_ITEM


COLOR

Description

This resource corresponds to the COLOR class.

Grammar


colorid	        : COLOR IDENTIFIER
color_body	: IS color_components END

color_components:
	        | system_color
	        | predefined_color
	        | rgb_color

system_color	: SYSTEM ASSIGN syscolor SEMICOLON

syscolor	: COLOR_ACTIVEBORDER
                | COLOR_ACTIVECAPTION
                | COLOR_APPWORKSPACE
                | COLOR_BACKGROUND
	        | COLOR_BTNFACE
                | COLOR_BTNHIGHLIGHT
	        | COLOR_BTNSHADOW
                | COLOR_BTNTEXT
	        | COLOR_CAPTIONTEXT
	        | COLOR_GRAYTEXT
	        | COLOR_HIGHLIGHT
	        | COLOR_HIGHLIGHTTEXT
	        | COLOR_INACTIVEBORDER
	        | COLOR_INACTIVECAPTION
	        | COLOR_INACTIVECAPTIONTEXT
	        | COLOR_MENU
	        | COLOR_MENUTEXT
	        | COLOR_SCROLLBAR
	        | COLOR_WINDOW
	        | COLOR_WINDOWFRAME
	        | COLOR_WINDOWTEXT

predefined_color : PREDEFINED ASSIGN precolor SEMICOLON

precolor	: BLACK
	        | WHITE
	        | RED
	        | GREEN
	        | BLUE
	        | YELLOW
	        | MAGENTA
	        | CYAN
	        | DARKRED
	        | DARKGREEN
	        | DARKBLUE
	        | LIGHTBROWN
	        | PURPLE
                | DARKCYAN
	        | LIGHTGRAY
	        | GRAY

rgb_color	: RGB IS rgb_body END SEMICOLON

rgb_body	:
	        | rgb_body rgb_compo SEMICOLON

rgb_compo	:
	        | RED ASSIGN NUMERIC_CONST
	        | GREEN ASSIGN NUMERIC_CONST
                | BLUE ASSIGN NUMERIC_CONST

Example

-- United colors of GRAPE

color MY_FIRST_COLOR is
   predefined := lightgray;
end;

color MY_SECOND_COLOR is
   system := color_btnface;
end;

color MY_THIRD_COLOR is
   rgb is
     red := 128;
     green := 128;
     blue := 128;
   end;
end;

See also PEN, BRUSH, FONT, TILE


PEN

Description

This resource corresponds to the PEN class.

Grammar


penid	        : PEN IDENTIFIER
pen_body	: IS pen_components END

pen_components	:
                | pen_components pen_component SEMICOLON

pen_component	: pen_style
	        | pen_width
	        | pen_color

pen_style	: STYLE ASSIGN pstyle

pstyle	        : SOLID_PEN
	        | DASH_PEN
                | DOT_PEN
	        | DASHDOT_PEN
	        | DASHDOTDOT_PEN
	        | NULL_PEN

pen_width	: WIDTH ASSIGN pwidth

pwidth	        : NORMAL_WIDTH
	        | THICK_WIDTH
	        | NUMERIC_CONST

pen_color	: pcolor color_body

pcolor	        : COLOR


Example

pen MY_FIRST_PEN is 
   style := solid_pen; 
   width := normal_width;
   color is
     system := color_btnface;
   end;
end;

pen MY_SECOND_PEN is
   style := dashdot_pen;
   width := 8; -- pixels
   color is
     predefined := purple;
   end; 
end; 

See also BRISH, FONT, COLOR


BRUSH

Description

This resource corresponds to the BRUSH class.

Grammar


brushid	        : BRUSH IDENTIFIER

brush_body 	: IS brush_components END

brush_components:
	        | brush_components brush_component SEMICOLON

brush_component : brush_style
	        | brush_hatch
	        | brush_color

brush_style 	: STYLE ASSIGN bstyle

bstyle	        : SOLID_BRUSH
	        | HATCH_BRUSH
	        | NULL_BRUSH

brush_hatch	: HATCH ASSIGN bhatch

bhatch	        : HORIZONTAL_HATCH
	        | VERTICAL_HATCH
	        | DIAGONAL_HATCH
	        | BACKDIAGONAL_HATCH
	        | CROSS_HATCH
	        | DIAGONALCROSS_HATCH

brush_color	: brcolor color_body

brcolor	        : COLOR

Example

brush MY_FIRST_BRUSH is 
   style := solid_brush; 
   color is
     system := color_btnface;
   end;
end;

brush MY_SECOND_BRUSH is
   style := hatch_brush;
   hatch := cross_hatch;
   color is
     rgb is
       red := 192;
       green := 192;
       blue := 192;
     end;
   end; 
end; 

See also PEN, FONT, COLOR


FONT

Description

This resource corresponds to the FONT class.

Grammar


fontid	        : FONT IDENTIFIER

font_body	: IS font_components END

font_components : system_font SEMICOLON
	        | system_font SEMICOLON fcolor SEMICOLON
	        | custom_font

system_font	: SYSTEM ASSIGN STD_SYSTEM_FONT
	        | SYSTEM ASSIGN STD_SMALL_SYSTEM_FONT

custom_font	:
	        | custom_font fcompo SEMICOLON

fcompo	        : fheight
	        | typeface
	        | bold
	        | italic
	        | underline
	        | strike_out
	        | fcolor

fheight	        : HEIGHT ASSIGN NUMERIC_CONST

typeface	: TYPEFACE ASSIGN STRING_CONST

bold	        : BOLD ASSIGN BOOLEAN_TRUE
	        | BOLD ASSIGN BOOLEAN_FALSE

italic	        : ITALIC ASSIGN BOOLEAN_TRUE
	        | ITALIC ASSIGN BOOLEAN_FALSE

underline	: UNDERLINE ASSIGN BOOLEAN_TRUE
	        | UNDERLINE ASSIGN BOOLEAN_FALSE

strike_out	: STRIKE_OUT ASSIGN BOOLEAN_TRUE
	        | STRIKE_OUT ASSIGN BOOLEAN_FALSE

fcolor	        : ffclr color_body

ffclr           : COLOR

Example

font MY_FIRST_FONT is 
   typeface := "ms sans serif"; 
   height := 9;
   bold := True;
   italic := True;
   underline := False;
   strike_out := False;
   color is
     predefined := green;
   end;
end;

font MY_SECOND_FONT is 
   system := std_system_font;
   color is
     system := color_menu;
   end; 
end; 

See also CONTROL


PICTURE

Description

This resource corresponds to the PICTURE class.

Grammar


pictureid		: PICTURE IDENTIFIER

picture_body		: IS picture_components END

picture_components	: FILENAME ASSIGN STRING_CONST SEMICOLON

Example

picture MY_FIRST_PICTURE is
   filename := "d:/path/calculat.bmp"; 
   -- we recommend to use "right" slashes in path
   -- not backslashes !!
end; 

See also STATIC_PICTURE, ICON, GRAPHICS_CURSOR


ICON

Description

This resource corresponds to the ICON class.

Grammar


iconid	        : ICON IDENTIFIER

icon_body	: IS icon_components END

icon_components : FILENAME ASSIGN STRING_CONST SEMICOLON

Example

icon MY_FIRST_ICON is 
   filename := "d:/path/my_icon.ico"; 
   -- we recommend to use "right" slashes in path
   -- not backslashes !!
end; 
 

See also PICTURE, GRAPHICS_CURSOR


GRAPHICS_CURSOR

Description

This resource corresponds to the GRAPHICS_CURSOR class.

Grammar


cursorid        : CURSOR IDENTIFIER

cursor_body     : IS cursor_components END

cursor_components: system_cursor
	        | custom_cursor

system_cursor	: SYSTEM ASSIGN sys_cursor SEMICOLON

sys_cursor	: STD_PLATFORM_CURSOR
	        | STD_WAITING_CURSOR
	        | STD_TERMINAL_CURSOR
	        | STD_CROSS_CURSOR
	        | STD_ARROW_UP_CURSOR

custom_cursor	  : FILENAME ASSIGN STRING_CONST SEMICOLON

Example

cursor MY_FIRST_CURSOR is
   system := std_waiting_cursor;
end;

cursor MY_SECOND_CURSOR is
   filename := "d:/path/my_cursor.cur";
   -- we recommend to use "right" slashes in path 
   -- not backslashes !!
end; 

See also PICTURE, ICON


TILE

Description

This resource corresponds to the TILE class.

Grammar


tileid	        : TILE IDENTIFIER

tile_body	: IS tile_components END

tile_components :
	        | tile_components tile_component SEMICOLON

tile_component  : tborder
	        | tvisible
	        | tdisabled
	        | tgroup
	        | ttabstop
	        | trect
	        | ttext
	        | tbkcolor
	        | tcontext

tborder		: BORDER_STYLE ASSIGN bord_style

bord_style	: NO_FRAME
	        | SIMPLE_FRAME
	        | MODAL_FRAME
	        | RESIZABLE_FRAME

tvisible	: STYLE_VISIBLE ASSIGN BOOLEAN_TRUE
	        | STYLE_VISIBLE ASSIGN BOOLEAN_FALSE

tdisabled	: STYLE_DISABLED ASSIGN BOOLEAN_TRUE
	        | STYLE_DISABLED ASSIGN BOOLEAN_FALSE

tgroup	        : STYLE_GROUP ASSIGN BOOLEAN_TRUE
	        | STYLE_GROUP ASSIGN BOOLEAN_FALSE

ttabstop	: STYLE_TABSTOP ASSIGN BOOLEAN_TRUE
	        | STYLE_TABSTOP ASSIGN BOOLEAN_FALSE

ttext	        : TEXT ASSIGN STRING_CONST

tcontext 	: CONTEXT ASSIGN IDENTIFIER

trect	        : ttrect rect_body

ttrect	        : RECT

tbkcolor	: ttbkcolor color_body

ttbkcolor 	: BACKGROUND

Example

  
tile MY_FIRST_TILE is 
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   --
   text := "My tile"
   border_style := no_frame;
   style_visible := True;
   style_disabled := False;
   style_group := True;
   style_tabstop := True;
   context := MY_TILE_CONTEXT;
   background is
     predefined := blue;
   end;
   rect is
     x := 0;
     y := 0;
     width := 0.5;
     height := 0.5;
   end; 
end;

See also CONTROL, WINDOW


CONTROL

Description

This resource corresponds to the CONTROL class.

Grammar


controlid	: CONTROL IDENTIFIER

control_body	: IS control_components END

control_components:
	        | control_components control_component SEMICOLON

control_component: tile_component
	        | cfont
	        | ctransparent

ctransparent	: CONTROL_TRANSPARENCY ASSIGN BOOLEAN_TRUE
                | CONTROL_TRANSPARENCY ASSIGN BOOLEAN_FALSE

cfont		 : ccfont font_body

ccfont		 : FONT

Example

control MY_FIRST_CONTROL is 
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   --
   -------------------------- section of TILE attrs--
   text := "My control"
   border_style := no_frame;
   style_visible := True;
   style_disabled := False;
   style_group := True;
   style_tabstop := True;
   context := MY_CONTROL_CONTEXT;
   background is
     predefined := blue;
   end;
   rect is
     x := 0;
     y := 0;
     width := 0.5;
     height := 0.5;
   end;
   --------------------end of section of TILE attrs--
   control_transparency := False;
   font is
     system := std_small_system_font;
   end;
end; 

See also TILE, WINDOW


TEXT_BUTTON

Description

This resource corresponds to the TEXT_BUTTON class.

Grammar


textbtnid	: TEXT_BUTTON IDENTIFIER

textbtn_body	: IS textbtn_compo END

textbtn_compo	: control_components

Example

text_button MY_FIRST_TEXT_BUTTON is 
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   --
   -------------------------- section of TILE attrs--
   text := "&Cancel"
   style_visible := True;
   style_group := True;
   style_tabstop := True; 
   context := MY_TEXT_BUTTON_CONTEXT;
   rect is
     x := 10;
     y := 10;
     width := 100;
     height := 100;
   end;
   --------------------end of section of TILE attrs--
   font is
     typeface := "ms sans serif";
     height := 8;
     bold := True;
   end; 
end; 
  

See also TILE, CONTROL


CHECK_BUTTON

Description

This resource corresponds to the CHECK_BUTTON class.

Grammar


checkbtnid	: CHECK_BUTTON IDENTIFIER

checkbtn_body	: IS control_components END

Example

check_button MY_FIRST_CHECK_BUTTON is
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   --
   -------------------------- section of TILE attrs--
   text := "&Check box"
   style_visible := True;
   style_group := True;
   style_tabstop := True;
   context := MY_CHECK_BUTTON_CONTEXT;
   rect is
     x := 10;
     y := 10;
     width := 100;
     height := 100;
   end;
   --------------------end of section of TILE attrs--
     font is
       typeface := "ms sans serif";
       height := 8;
       bold := True;
       color is
         predefined := blue;
       end;
     end;
   control_transparency := True; 
end; 
 

See also TILE, CONTROL


RADIO_BUTTON

Description

This resource corresponds to the RADIO_BUTTON class.

Grammar


radiobtnid	: RADIO_BUTTON IDENTIFIER

radiobtn_body	: IS control_components END

Example

radio_button MY_FIRST_RADIO_BUTTON is 
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   -- -------------------------- section of TILE attrs--
   text := "&Radio button"
   style_visible := True;
   style_group := True;
   style_tabstop := True;
   context := MY_RADIO_BUTTON_CONTEXT;
   rect is
     x := 10;
     y := 10;
     width := 100;
     height := 100;
   end;
   --------------------end of section of TILE attrs--
     font is
       typeface := "ms sans serif";
       height := 8;
       bold := True;
     color is
       predefined := cyan;
     end;
   end;
   control_transparency := True; 
end; 

See also TILE, CONTROL


PICTURE_BUTTON

Description

This resource corresponds to the PICTURE_BUTTON class.

Grammar


picbtnid	: PICTURE_BUTTON IDENTIFIER

picbtn_body	: IS pb_components END

pb_components	:
                | pb_components pb_component SEMICOLON

pb_component	: control_component
	        | pb_picture

pb_picture	: ppb_picture picture_body

ppb_picture	: PICTURE

Example

picture_button is 
   text := "Picture button"; 
   rect is
     x := 400;
     y := 10;
     width := 100;
     height := 30;
   end;
  
   context := CTX_PB;
   style_visible := True;
   style_group := False;
   style_tabstop := True;
   font is
     typeface := "ms sans serif";
     height := 9;
     bold := True;
     italic := True;
     underline := False;
     color is
       predefined := darkred;
     end;
   end;
   picture is
     filename := "calculat.bmp";
   end; 
end; 

See also TILE, CONTROL


GROUP_BOX

Description

This resource corresponds to the GROUP_BOX class.

Grammar


groupboxid	: GROUP_BOX IDENTIFIER

groupbox_body	: IS control_components END

Example

group_box MY_FIRST_GROUP_BOX is 
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   -- -------------------------- section of TILE attrs--
   text := "Group box"
   style_visible := True;
   style_group := True;
   style_tabstop := False;
   context := MY_GROUP_BOX_CONTEXT;
   rect is
     x := 10;
     y := 10;
     width := 100;
     height := 100;
   end; --------------------end of section of TILE attrs--
   font is
     typeface := "ms sans serif";
     height := 8;
     bold := True;
     color is
       predefined := lightgray;
     end;
   end;
   control_transparency := True; 
end; 
  

See also TILE, CONTROL


STATIC_TEXT

Description

This resourcecorresponds to the STATIC_TEXT class.

Grammar


stattextid	: STATIC_TEXT IDENTIFIER

stattext_body	: IS st_components END

st_components	:
	        | st_components st_component SEMICOLON

st_component	: control_component
	        | st_align

st_align	: ALIGNMENT ASSIGN sst_align

sst_align	: LEFT
	        | RIGHT
        	| CENTER

Example

static_text MY_FIRST_STATIC_TEXT is 
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   -- -------------------------- section of TILE attrs--
   text := "Static text"
   style_visible := True;
   style_group := True;
   style_tabstop := False;
   context := MY_STATIC_TEXT_CONTEXT;
   rect is
     x := 10;
     y := 10;
     width := 100;
     height := 100;
   end;
   --------------------end of section of TILE attrs--
     font is
       typeface := "ms sans serif";
       height := 8;
       bold := True;
     color is
       predefined := green;
     end;
   end;
   control_transparency := True; 
end; 

See also TILE, CONTROL, STRING, MESSAGE_BOX


STATIC_PICTURE

Description

This resource corresponds to the STATIC_PICTURE class.

Grammar


statpictid	: STATIC_PICTURE IDENTIFIER

statpict_body	: IS sp_components END

sp_components	:
	        | sp_components sp_component SEMICOLON

sp_component	: control_component
	        | sp_picture

sp_picture	: ssp_picture picture_body

ssp_picture	: PICTURE

Example

static_picture is 
   rect is 
     x := 400;
     y := 50;
     width := 100;
     height := 100;
   end;
   context := CTX_SP;
   style_visible := True;
   style_group := False;
   style_tabstop := True;
   style_disabled := False;

   picture is
     filename := "leaves.bmp";
   end; 
end; 
 

See also TILE, CONTROL


LIST_BOX

Description

This resource corresponds to the LIST_BOX class.

Grammar


listboxid	: LIST_BOX IDENTIFIER

listbox_body	: IS lb_components END

lb_components	:
	        | lb_components lb_component SEMICOLON

lb_component	: control_component
	        | lb_multi
	        | lb_selfdrawing
	        | lb_itemheight

lb_multi	: MULTIPLE_SELECTION ASSIGN BOOLEAN_TRUE
	        | MULTIPLE_SELECTION ASSIGN BOOLEAN_FALSE

lb_selfdrawing	: SELF_DRAWING ASSIGN BOOLEAN_TRUE
	        | SELF_DRAWING ASSIGN BOOLEAN_FALSE

lb_itemheight	: ITEM_HEIGHT ASSIGN NUMERIC_CONST

Example

list_box MY_FIRST_LIST_BOX is 
   rect is 
     x := 140;
     y := 10;
     width := 100;
     height := 50;
   end;
   context := CTX_1;
   style_visible := True;
   style_group := True;
   style_tabstop := True;
   style_disabled := False;

   font is
     typeface := "ms sans serif";    
     height := 8;
     bold := true;
   end;

   multiple_selection := False;
   self_drawing := False; 
end; 

See also TILE, CONTROL


COMBO_BOX

Description

This resource corresponds to the COMBO_BOX class.

Grammar


comboboxid	: COMBO_BOX IDENTIFIER

combobox_body   : IS cb_components END

cb_components	:
	        | cb_components cb_component SEMICOLON

cb_component	: control_component
	        | lb_selfdrawing
        	| lb_itemheight

Example

combo_box MY_FIRST_COMBO_BOX is 
   rect is 
     x := 140; 
     y := 10;
     width := 100;
     height := 50;
   end;
   context := CTX_1;
   style_visible := True;
   style_group := True;
   style_tabstop := True;
   style_disabled := False;

   font is
     typeface := "ms sans serif";
     height := 8;
     bold := True;
   end;

   self_drawing := True;
   item_height := 12; 
end; 

See also TILE, CONTROL, LIST_BOX


HISTORY

Description

This resource corresponds to the HISTORY class.

Grammar


historyid	: HISTORY IDENTIFIER

history_body	: IS control_components END

Example

history MY_FIRST_HISTORY is 

   text := "history";

   rect is
     x := 140;
     y := 140;
     width := 100;
     height := 50;
   end;

   context := CTX_1;
   style_visible := True;
   style_group := False;
   style_tabstop := True;

   font is
     typeface := "ms sans serif";
     height := 8;
     bold := True;
   end; 
end; 

See also TILE, CONTROL, LIST_BOX, COMBO_BOX


SLIDER

Description

This resource corresponds to the SLIDER class.

Grammar


sliderid	: SLIDER IDENTIFIER

slider_body	: IS sl_components END

sl_components	:
	        | sl_components sl_component SEMICOLON

sl_component	: control_component
	        | sl_style

sl_style	: STYLE ASSIGN HORIZONTAL
        	| STYLE ASSIGN VERTICAL

Example

slider MY_FIRST_SLIDER is 
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   --
   -------------------------- section of TILE attrs--
   style_visible := True;
   style_group := True;
   style_tabstop := True;
   context := MY_SLIDER_CONTEXT;
   rect is
     x := 10;
     y := 10;
     width := 100;
     height := 30;
   end;
   --------------------end of section of TILE attrs--
   style := horizontal; 
end;


See also TILE, CONTROL


TEXT_LINE_ENTRY

Description

This resource corresponds to the TEXT_LINE_ENTRY class.

Grammar


tleid	        : TEXT_LINE_ENTRY IDENTIFIER

tle_body	: IS tle_components END

tle_components	:
	        | tle_components tle_component SEMICOLON

tle_component	: control_component
	        | tle_password
	        | tle_limit

tle_password	: PASSWORD ASSIGN BOOLEAN_TRUE
                | PASSWORD ASSIGN BOOLEAN_FALSE

tle_limit	: INPUT_SIZE ASSIGN NUMERIC_CONST

Example

text_line_entry MY_FIRST_TEXT_LINE_ENTRY is
   --
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   --
   -------------------------- section of TILE attrs--
   text := "Initial text in the entry"
   style_visible := True;
   style_group := True;
   style_tabstop := True;
   context := MY_TLE_CONTEXT;
   rect is
     x := 10;
     y := 10;
     width := 100;
     height := 100;
   end;
   --------------------end of section of TILE attrs--
     font is
       typeface := "ms sans serif";
       height := 8;
       bold := True;
     color is
       predefined := blue;
     end;
   end;
   control_transparency := True;
   --------------------------------------------------
   password := False;
   input_size := 20;
end;

See also TILE, CONTROL, MEMO_ENTRY


MEMO_ENTRY

Description

This resource corresponds to the MEMO_ENTRY class.

Grammar


memoid	        : MEMO_ENTRY IDENTIFIER

memo_body	: IS memo_components END

memo_components :
	        | memo_components memo_component SEMICOLON

memo_component  : control_component
	        | memo_scroll
	        | memo_align
	        | memo_readonly

memo_scroll	: SCROLL_TYPE ASSIGN mscroll

mscroll	        : NO_SCROLL
	        | V_SCROLL
	        | H_SCROLL
	        | VH_SCROLL

memo_align	: ALIGNMENT ASSIGN malign

malign	        : LEFT
	        | RIGHT
	        | CENTER

memo_readonly	: READ_ONLY ASSIGN BOOLEAN_TRUE
          	| READ_ONLY ASSIGN BOOLEAN_FALSE

Example

memo_entry is 
   -- 
   -- all attributes are not mandatory
   -- if omitted they'll get default values
   --
   -------------------------- section of TILE attrs--
   text := "tle";
   rect is
     x := 280;
     y := 60;
     width := 100;
     height := 60;
   end;
   context := CTX_1;
   style_visible := True;
   style_group := False;
   style_tabstop := True;
   style_disabled := False;
   border_style := simple_frame;
   --------------------end of section of TILE attrs--
   font is
     typeface := "ms sans serif";
     height := 9;
     bold := True;
     italic := True;
   end;
   --------------------------------------------------
   scroll_type := h_scroll;
   alignment := center;
   read_only := False; 
end;

See also TILE, CONTROL, TEXT_LINE_ENTRY


WINDOW

Description

This resource corresponds to the WINDOW class.

Grammar


windowid	: WINDOW IDENTIFIER

window_body	: IS window_components END

window_components :
	        | window_components window_component SEMICOLON

window_component: tile_component
	        | win_caption
	        | win_sysmenu
	        | win_maxbutton
	        | win_minbutton
	        | child_window

child_window 	:
	        | tile_child   tile_body
	        | control_child	  control_body
	        | textbtn_child	  textbtn_body
	        | checkbtn_child   checkbtn_body
	        | radiobtn_child   radiobtn_body
	        | picbtn_child   picbtn_body
	        | groupbox_child   groupbox_body
	        | stattext_child   stattext_body
	        | statpict_child   statpict_body
	        | listbox_child	  listbox_body
	        | combobox_child   ombobox_body
	        | history_child	  history_body
	        | slider_child	 slider_body
	        | tle_child   tle_body
	        | memo_child   memo_body
	        | window_child	 window_body

win_caption	: STYLE_CAPTION ASSIGN BOOLEAN_TRUE
	        | STYLE_CAPTION ASSIGN BOOLEAN_FALSE

win_sysmenu	: STYLE_SYSTEM_MENU ASSIGN BOOLEAN_TRUE
	        | STYLE_SYSTEM_MENU ASSIGN BOOLEAN_FALSE

win_maxbutton	: STYLE_MAXIMIZE_BUTTON ASSIGN BOOLEAN_TRUE
	        | STYLE_MAXIMIZE_BUTTON ASSIGN BOOLEAN_FALSE

win_minbutton	: STYLE_MINIMIZE_BUTTON ASSIGN BOOLEAN_TRUE
	        | STYLE_MINIMIZE_BUTTON ASSIGN BOOLEAN_FALSE

tile_child	: TILE
control_child	: CONTROL
textbtn_child	: TEXT_BUTTON
checkbtn_child	: CHECK_BUTTON
radiobtn_child	: RADIO_BUTTON
picbtn_child	: PICTURE_BUTTON
groupbox_child	: GROUP_BOX
stattext_child	: STATIC_TEXT
statpict_child	: STATIC_PICTURE
listbox_child	: LIST_BOX
combobox_child : COMBO_BOX
history_child	: HISTORY
slider_child	: SLIDER
tle_child	: TEXT_LINE_ENTRY
memo_child	: MEMO_ENTRY
window_child	: WINDOW

Example

  
window MY_FIRST_WINDOW is 
   text := "Window"; 
   background is
     predefined := darkgreen;
   end;
   rect is
     x := 10;
     y := 10;
     width := 300;
     height := 300;
   end;
   context := CTX_WIN;
   style_visible := True;
   border_style := resizable_frame;

   style_caption := True;
   style_system_menu := True;
   style_minimize_button := True;
   style_maximize_button := True;

   text_button is
     text := "Button";
     rect is
       x := 10;
       y := 10;
       width := 100;
       height := 30;
     end;

     context := CTX_1;
     style_visible := True;
     style_group := False;
     style_tabstop := True;
     style_disabled := False;

     font is
       typeface := "ms sans serif";
       height := 9;
       bold := True; 
       italic := True;
       underline := False;
       strike_out := False;
     end;
   end; 
end; 
 

See also TILE, CONTROL, DIALOG, DESKTOP_ELEMENT


DIALOG

Description

This resource corresponds to the DIALOG class.

Grammar


dialogid        : DIALOG IDENTIFIER

dialog_body	: IS dialog_components END

dialog_components :
	        | dialog_components dialog_component SEMICOLON

dialog_component : window_component

Example

dialog MY_FIRST_DIALOG is 
   text := "ERC Desktop Element"; 
   background is
     predefined := darkgreen;
   end;
   rect is
     x := 10;
     y := 10;
     width := 300;
     height := 300;
   end;
   context := CTX_DE;
   style_visible := True;
   style_group := False;
   style_tabstop := True;
   style_disabled := False;
   border_style := modal_frame;
   style_caption := True;
   style_system_menu := True;

   text_button is
     text := "Button";
     rect is
       x := 10;
       y := 10;
       width := 100;
       height := 30;
     end;

     context := CTX_1;
     style_visible := True;
     style_group := False;
     style_tabstop := True;
     style_disabled := False;

     font is
       typeface := "ms sans serif";
       height := 9;
       bold := True;
       italic := True;
       underline := False;
       strike_out := False;
     end;
   end; 
end; 

See also TILE, CONTROL, DESKTOP_ELEMENT, WINDOW


DESKTOP_ELEMENT

Description

This resource corresponds to the DESKTOP_ELEMENT class.

Grammar


deskelid	: DESKTOP_ELEMENT IDENTIFIER

deskel_body	: IS deskel_components END

deskel_components :
	        | deskel_components deskel_component SEMICOLON

deskel_component: window_component

Example

  
desktop_element DESKEL is 
   text := "ERC Desktop Element"; 
   background is
     predefined := darkgreen;
   end;
   rect is
     x := 10;
     y := 10;
     width := 300;
     height := 300;
   end;
   context := CTX_DE;
   style_visible := True;
   style_group := False; 
   style_tabstop := True;
   style_disabled := False;
   border_style := resizable_frame;
   style_caption := True;
   style_system_menu := True;
   style_minimize_button := True;
   style_maximize_button := True;

   text_button is
     text := "Button";
     rect is
       x := 10;
       y := 10;
       width := 100;
       height := 30;
     end;

     context := CTX_1;
     style_visible := True;
     style_group := False;
     style_tabstop := True;
     style_disabled := False;
 
     font is
       typeface := "ms sans serif";
       height := 9;
       bold := True;
       italic := True;
       underline := False;
       strike_out := False;
     end;
   end; 
end; 

See also TILE, CONTROL, WINDOW, DIALOG


MESSAGE_BOX

Description

This resource corresponds to the MESSAGE_BOX class.

Grammar


mboxid	        : MESSAGE_BOX IDENTIFIER

mbox_body	: IS mbox_components END

mbox_components :
	        | mbox_components mbox_component SEMICOLON

mbox_component  : mbox_style
	        | mbox_icon
	        | mbox_caption
	        | mbox_text

mbox_style	: STYLE ASSIGN mbstyle
mbox_icon	: ICON ASSIGN mbicon
mbox_caption	: CAPTION ASSIGN STRING_CONST
mbox_text	: TEXT ASSIGN STRING_CONST

mbstyle	        : ABORT_RETRY_IGNORE
	        | OK
	        | OK_CANCEL
	        | RETRY_CANCEL
	        | YES_NO
	        | YES_NO_CANCEL

mbicon	        : ICON_INFORMATION
	        | ICON_EXCLAMATION
	        | ICON_QUESTION
	        | ICON_STOP

Example

message_box MY_MESSAGE_BOX is 
   style := ok_cancel; 
   icon := icon_question;
   caption := "This is a caption of a message box";
   text := "This is a text of a message"; 
end; 

See also STRING, DIALOG


STRING

Description

This resource allows to store text strings outside the application.

Grammar


stringid	: STRING_KWD IDENTIFIER

string_body	: ASSIGN STRING_CONST

Example

string MY_STRING := "Text of my string"; 
string MY_SECOND_STRING := "Text of my second string";

See also RECT, MESSAGE_BOX, STATIC_TEXT


© Object Tools -- info@object-tools.com -- December 1999