Renamed current as trunk.

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1433 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eiffel-org
2015-09-23 17:16:49 +00:00
parent 2aba4b49af
commit 5e7183f738
2851 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
[[Property:title|Events]]
[[Property:weight|4]]
[[Property:uuid|fc32d1b5-72d6-2955-18fd-bce988ed8323]]
An event is considered to be an external action that occurs during a program's execution. Correctly dealing with events is vital part of developing an EiffelVision 2 application. For example, if a user clicks on a button, you will want to respond to this event by calling a routine that deals with the request. EiffelVision 2 contains action sequences for all kinds of widget events. To view the kind of events available to every widget, click [[ref:libraries/vision2/reference/ev_widget_action_sequences_chart|here]]. The Events cluster contains classes for event handling within EiffelVision 2.
==How Do I Connect to an Event?==
Every widget and item has an action sequence associated with it that relates to some kind of event. For example an [[ref:libraries/vision2/reference/ev_button_chart|EV_BUTTON]] has a <code>select_actions</code> action sequence. This gets fired when the user selects (clicks) the button. To have a procedure called on this event, you need to create an agent based on this procedure, and then add this to the action sequence (via extend). For a more detailed description of agents and their uses click [[ET: Agents|here]] .
An example of adding an agent to an action_sequence:
<code>
my_button.select_actions.extend (agent print ("Button Clicked!%N"))
</code>
All EiffelVision 2 action sequences inherit from [[ref:libraries/vision2/reference/ev_action_sequence_chart|EV_ACTION_SEQUENCE]] and when it is called, all of the agents held within are fired, thus calling all of the procedures represented by the agents. The signature of any agent that you place in an action sequence must conform to those of the action sequence's actual generic parameter(s).
When you want an agent to be called from a certain action sequence and the signatures do not match, you may use [[ref:libraries/vision2/reference/ev_action_sequence_chart|force_extend]] . This will call your agent but there are no guarantees as to the arguments passed to your procedure.

View File

@@ -0,0 +1,166 @@
[[Property:title|Figures]]
[[Property:weight|7]]
[[Property:uuid|c12fee6e-5e99-ae59-8ac5-f57abb4c1878]]
{{ReviewRequested}}
The EiffelVision 2 figure cluster provides a high-level way of drawing on an [[ref:libraries/vision2/reference/ev_drawable_chart|EV_DRAWABLE]] descendant. It offers a number of advantages:
* The model (tree of figures) is separated from the graphical representation by using projectors that take a "world" (an entire set of figures) and project it onto any device, not just a drawing area.
* Instead of drawing with static APIs like <code>draw_line</code>, you can use real figure objects, which internally remember their location, rotation and scaling; later on you can perform limitless transformations on them, either individually or as part of an entire branch in the tree of figures: move, rotation, scaling, change of color...
* For projection devices that support the mouse, pointer events propagate to the affected figures.
==Figure Classes==
Every basic figure class inherits from [[ref:libraries/vision2/reference/ev_atomic_figure_chart|EV_ATOMIC_FIGURE]]. An atomic figure has the property of having its own graphical representation. [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]] on the other hand is a collection of figures. Finally, [[ref:libraries/vision2/reference/ev_figure_chart|EV_FIGURE]] is the common ancestor to those two. Since [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]] is a collection of EV_FIGUREs, it can contain both atomic figures and subgroups, thus forming a tree of figures.
Any "branch" of that tree that wishes to be drawn (i.e. rendered to a device or file) (especially the top-level root) must be a figure group of type [[ref:libraries/vision2/reference/ev_figure_world_chart|EV_FIGURE_WORLD]]. It inherits from [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]], and adds some features for grid and background color, required for drawing.
===Figures===
{| border="1"
|-
| class
| open/closed
| points
| description
|-
| [[ref:libraries/vision2/reference/ev_figure_arc_chart|EV_FIGURE_ARC]]
| open
| 2
| a segment of an open ellipse
|-
| [[ref:libraries/vision2/reference/ev_figure_dot_chart|EV_FIGURE_DOT]]
| open
| 1
| a single point
|-
| [[ref:libraries/vision2/reference/ev_figure_ellipse_chart|EV_FIGURE_ELLIPSE]]
| closed
| 2
| an ellipse inside imaginary rectangle
|-
| [[ref:libraries/vision2/reference/ev_figure_equilateral_chart|EV_FIGURE_EQUILATERAL]]
| closed
| 2
| a figure with any number of sides of the same length
|-
| [[ref:libraries/vision2/reference/ev_figure_line_chart|EV_FIGURE_LINE]]
| open
| 2
| a straight line between two points
|-
| [[ref:libraries/vision2/reference/ev_figure_picture_chart|EV_FIGURE_PICTURE]]
| open
| 1
| an image positioned by its top-left point
|-
| [[ref:libraries/vision2/reference/ev_figure_pie_slice_chart|EV_FIGURE_PIE_SLICE]]
| closed
| 2
| a part of a closed ellipse
|-
| [[ref:libraries/vision2/reference/ev_figure_polygon_chart|EV_FIGURE_POLYGON]]
| closed
| *
| a figure defined by any number of points
|-
| [[ref:libraries/vision2/reference/ev_figure_polyline_chart|EV_FIGURE_POLYLINE]]
| open
| *
| a figure consisting of any number of connecting lines
|-
| [[ref:libraries/vision2/reference/ev_figure_rectangle_chart|EV_FIGURE_RECTANGLE]]
| closed
| 2
| a figure with four sides
|-
| [[ref:libraries/vision2/reference/ev_figure_star_chart|EV_FIGURE_STAR]]
| open
| 2
| any number of lines emerging from a center point
|-
| [[ref:libraries/vision2/reference/ev_figure_text_chart|EV_FIGURE_TEXT]]
| open
| 1
| a string positioned by its top-left point displayed in the specified font
|}
A closed figure is a figure that has some area enclosed when drawn that can optionally be filled with a color. Closed figures inherit [[ref:libraries/vision2/reference/ev_closed_figure_chart|EV_CLOSED_FIGURE]] which gives them the property <code>fill_color</code>. Open figures inherit [[ref:libraries/vision2/reference/ev_atomic_figure_chart|EV_ATOMIC_FIGURE]] directly, as does [[ref:libraries/vision2/reference/ev_closed_figure_chart|EV_CLOSED_FIGURE]].
===Points===
Central in the design of the figures are points. Figures are defined from their points. For example, an ellipse is not a center point with two radii, but is instead the largest fitting ellipse inside an imaginary rectangle, so of two points.
As you can see in the table above, each figure has a certain number of points. These values can be 1, 2 or * (any number). For each value there is a class the figure inherits from. These are:
* 1 (figure has one point): [[ref:libraries/vision2/reference/ev_single_pointed_figure_chart|EV_SINGLE_POINTED_FIGURE]].
* 2 (figure has two points): [[ref:libraries/vision2/reference/ev_double_pointed_figure_chart|EV_DOUBLE_POINTED_FIGURE]].
* * (figure has zero or more points): [[ref:libraries/vision2/reference/ev_multi_pointed_figure_chart|EV_MULTI_POINTED_FIGURE]].
These classes offer features to handle the given number of points. [[ref:libraries/vision2/reference/ev_single_pointed_figure_chart|EV_SINGLE_POINTED_FIGURE]] offers the feature:
<code>
point: EV_RELATIVE_POINT
</code>
[[ref:libraries/vision2/reference/ev_double_pointed_figure_chart|EV_DOUBLE_POINTED_FIGURE]] inherits [[ref:libraries/vision2/reference/ev_single_pointed_figure_chart|EV_SINGLE_POINTED_FIGURE]] for its first point, which is renamed to <eiffel>point_a</eiffel>. It adds <eiffel>point_b</eiffel>, so it has the features:
<code>
point_a: EV_RELATIVE_POINT
point_b: EV_RELATIVE_POINT
</code>
[[ref:libraries/vision2/reference/ev_multi_pointed_figure_chart|EV_MULTI_POINTED_FIGURE]] internally holds an array of points:
<code>
i_th_point (i: INTEGER): EV_RELATIVE_POINT
</code>
===Relative Point===
The points that the figures use are of type [[ref:libraries/vision2/reference/ev_relative_point_chart|EV_RELATIVE_POINT]]. Each point is relative to the location of the parent figure group (<code>point</code>), which is relative to the location of its parent figure group, and so on up to the top-level (world) figure group. Thus, each figure is defined by a set of relative points and a reference point (<code>origin</code>). If the reference point is not attached (as may be the case for immediate children of the top-level group, when it has no point object), the subordinate relative points are relative to point (0,0). The absolute coordinates are calculated only when needed by adding the absolute coordinates of the reference point to the relative coordinates.
{{note|Even the top-level (world) figure group can be "moved" by calling its <code>set_point</code> feature, passing a new relative point. However, if this is done, then THAT relative point is relative to point (0,0). If you do this, do so before <code>extend</code>-ing it with figures and sub-groups so that they receive the point in question as their reference point.}}
==Figure Worlds==
In order to put the figures you want to display in a context, you insert them (or the figure groups that contain them) into a top-level a "figure world" object: an instance of [[ref:libraries/vision2/reference/ev_figure_world_chart|EV_FIGURE_WORLD]]. This is a descendant of [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]] and hence works in the same way. This figure world is later associated with one or more projectors. [[ref:libraries/vision2/reference/ev_figure_world_chart|EV_FIGURE_WORLD]], as previously mentioned, adds a number of features to [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]]. These extra features are needed for graphical representation by a projector. One is the background color. This feature is used to erase the canvas for a graphical projector in the specified color. The other features are to manage the grid.
==Projectors==
A projector is an object that knows what a figure world should look like. The figure world itself is only a hint of its representation. For example, if a line is "20" long, this might mean 20 pixels, miles, centimeters or whatever. It is up to the projector to interpret units. Also, color might be interpreted as gray scale. Typically, a projector will do the best possible job projecting the "world" of figures onto its device.
With EiffelVision come these projectors:
* [[ref:libraries/vision2/reference/ev_postscript_projector_chart|EV_POSTSCRIPT_PROJECTOR]]
* [[ref:libraries/vision2/reference/ev_drawing_area_projector_chart|EV_DRAWING_AREA_PROJECTOR]]
* [[ref:libraries/vision2/reference/ev_pixmap_projector_chart|EV_PIXMAP_PROJECTOR]]
The first one maps figure worlds to a postscript file. The other two are descendants of [[ref:libraries/vision2/reference/ev_widget_projector_chart|EV_WIDGET_PROJECTOR]], and can project on widgets that inherit from [[ref:libraries/vision2/reference/ev_drawable_chart|EV_DRAWABLE]], two of which are [[ref:libraries/vision2/reference/ev_drawing_area_chart|EV_DRAWING_AREA]] and [[ref:libraries/vision2/reference/ev_pixmap_chart|EV_PIXMAP]], eventually using double-buffering, which normally results in a smoother animation but requires fast copying from memory to the video buffer (and thus can be slow if the display is remote).
==Events==
The other features of drawing area and widget is that they generate pointer events. These events are translated by projectors to the map of the figure world. These projectors send the event to the appropriate figure. Every figure is set up to receive all the common pointer events, including Pick-and-Drop events:
* <eiffel>pointer_motion_actions</eiffel>
* <eiffel>pointer_button_press_actions</eiffel>
* <eiffel>pointer_double_press_actions</eiffel>
* <eiffel>pointer_button_release_actions</eiffel>
* <eiffel>pointer_enter_actions</eiffel>
* <eiffel>pointer_leave_actions</eiffel>
* <eiffel>pick_actions</eiffel>
* <eiffel>conforming_pick_actions</eiffel>
* <eiffel>drop_actions</eiffel>
There are no events for keyboard focus and no key press events. If you need to use these events, use them from pixmap or drawing area.
When using events, keep the z-order in mind. This is the order in which the figures are stacked in the "figure world". The first item of a figure group is the figure that is the farthest away. Any figure can be obscured by (visible) figures in front of it. Events are only received by a figure when the (mouse) pointer is over its exposed areas, i.e. areas not obscured by (visible) figures in front of it. If a figure is fully obscured by visible figures in front of it, then it will receive no pointer events.
==Rotation and Scaling==
Relative Points, which supply the location, scale and orientation for EV_FIGURE_... objects, also support rotation and scaling. Both rotation and scaling can be entered at any point in the tree of relative points. One of the most useful of these points is the <code>point</code> of an [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]], which rotation and/or scaling will then propagate down the tree to all the contained figures and sub-groups, by way of something like <eiffel>my_figure_group.point.set_angle (...)</eiffel>. Rotation is in radians progressing counter-clockwise from the positive X axis. Scaling is multiplied into the chain of relative points. This means that when a relative point which is the root of a tree of several points is moved, the entire tree is moved. When it is scaled the entire tree is scaled, and the same for rotation.
The scaling factor has two components: horizontal (x) and vertical (y), which can be set separately or together. If the x/y scaling factor is 0.5, everything at that point and below in the tree is displayed at half its normal size.

View File

@@ -0,0 +1,24 @@
[[Property:title|EiffelVision Library Reference Manual]]
[[Property:weight|1]]
[[Property:uuid|b343b38b-c8b2-4247-072d-ecc1bc3e387a]]
EiffelVision 2 is a platform-independent Graphical User Interface (GUI) library that allows easy, simultaneous development of Windowed applications for both Windows- & Unix-based platforms. Heavily relying on the EiffelBase library, EiffelVision 2 has been designed primarily with ease of use in mind. By reusing EiffelBase structures, existing, as well as new Eiffel users will find EiffelVision to be surprising intuitive and easy to use. In very little time, users will be producing professional Windowed application skeletons which will run on a multitude of platforms with no change of source code.
The EiffelVision 2 library includes the following interface clusters:
* The [[Kernel| kernel]] cluster includes classes that are key to an EiffelVision 2 application. The most important class in this cluster is [[ref:libraries/vision2/reference/ev_application_chart| EV_APPLICATION]] which is the main entry point for all EiffelVision 2 applications.
* The [[Widgets| widgets]] cluster contains classes used to create EiffelVision 2 widgets. Widgets are the visible objects that the user sees and interacts with in the application. Examples of widgets are windows, buttons and labels.
* The [[Items| items]] cluster includes the classes needed to create items. Items are widgets that can only be contained within a certain type of widget. Example: [[ref:libraries/vision2/reference/ev_list_chart| EV_LIST]] widgets may only contain objects of type [[ref:libraries/vision2/reference/ev_list_item_chart|EV_LIST_ITEM]] . Items provide an abstract way of dealing with an item-widget's internal data structures and provide, in many cases, the same functionality that a widget does.
* The [[Events| events]] cluster contains classes that allow for user-initiated events, such as the clicking of a button to be dealt with via the use of a linked list of agents ([[ref:libraries/vision2/reference/ev_action_sequence_chart|EV_ACTION_SEQUENCE]]). An Agent can be thought of as an object that encapsulates a certain procedure. When a user clicks a button on the screen, the corresponding [[ref:libraries/vision2/reference/ev_button_chart| EV_BUTTON]] object has its <eiffel>`pointer_button_press_actions'</eiffel> fired, and this, in turn, fires all of the agents held within this list, thus calling all of the procedures represented by the agents. Every widget and item has a number of [[ref:libraries/base/reference/action_sequence_chart|ACTION_SEQUENCE]] objects, each of which are linked to a certain type of event. To link any number of different procedure calls with an event, it is only necessary to <eiffel>`extend'</eiffel> the action-sequence list associated with that event, with agents representing those calls.
* The [[Properties| properties]] cluster contains classes that allow for the customization of Vision 2 widgets and items. Classes such as [[ref:libraries/vision2/reference/ev_colorizable_chart|EV_COLORIZABLE]] and [[ref:libraries/vision2/reference/ev_fontable_chart|EV_FONTABLE]] contain routines that allow for (respectively) color and font to be altered for a widget.
* The [[Support| support]] cluster includes classes that provide more professional touches to an application, whether these are keyboard shortcuts ([[ref:libraries/vision2/reference/ev_accelerator_list_chart|EV_ACCELERATOR_LIST]]) or graphical output ([[ref:libraries/vision2/reference/ev_graphical_format_chart|EV_GRAPHICAL_FORMAT]]) for drawable widgets such as [[ref:/libraries/vision2/reference/ev_pixmap_chart|EV_PIXMAP]] .
* The [[Figures| figures]] cluster allows for the projection of two-dimensional shapes (figures) onto an [[ref:libraries/vision2/reference/ev_drawable_chart|EV_DRAWABLE]] or printer via the use of an [[ref:libraries/vision2/reference/ev_projector_chart|EV_PROJECTOR]] .
To see differences between released versions of EiffelVision, click [[Revisions and Bug Fixes|Here]]

View File

@@ -0,0 +1,41 @@
[[Property:title|Items]]
[[Property:weight|3]]
[[Property:uuid|3143511c-28bd-cc5c-c710-700796778982]]
An EiffelVision 2 "item" is an object that is used to display information inside certain primitives. For example, [[ref:libraries/vision2/reference/ev_list_chart|EV_LIST]] may hold items of type [[ref:libraries/vision2/reference/ev_list_item_chart|EV_LIST_ITEM]]. All EiffelVision 2 items are descendants of [[ref:libraries/vision2/reference/ev_item_chart|EV_ITEM]], which in turn is a descendant of [[ref:libraries/vision2/reference/ev_pixmapable_chart|EV_PIXMAPABLE]], which means that an item can display a [[ref:libraries/vision2/reference/ev_pixmap_chart|EV_PIXMAP]] object.
==Item Holders==
Below is a structure showing some of the EiffelVision 2 item-containing components and the items that they accept:
* [[ref:libraries/vision2/reference/ev_list_chart|EV_LIST]] accepts items of type:
** [[ref:libraries/vision2/reference/ev_list_item_chart|EV_LIST_ITEM]]
* [[ref:libraries/vision2/reference/ev_combo_box_chart|EV_COMBO_BOX]] accepts items of type:
** [[ref:libraries/vision2/reference/ev_list_item_chart|EV_LIST_ITEM]]
* [[ref:libraries/vision2/reference/ev_window_chart|EV_WINDOW]] accepts items of type (use <code>set_menu_bar</code>):
** [[ref:libraries/vision2/reference/ev_menu_bar_chart|EV_MENU_BAR]] accepts items of type:
*** [[ref:libraries/vision2/reference/ev_menu_chart|EV_MENU]] accepts items of type:
**** [[ref:libraries/vision2/reference/ev_menu_chart|EV_MENU]]
**** [[ref:libraries/vision2/reference/ev_menu_item_chart|EV_MENU_ITEM]]
**** [[ref:libraries/vision2/reference/ev_menu_separator_chart|EV_MENU_SEPARATOR]]
**** [[ref:libraries/vision2/reference/ev_radio_menu_item_chart|EV_RADIO_MENU_ITEM]]
**** [[ref:libraries/vision2/reference/ev_check_menu_item_chart|EV_CHECK_MENU_ITEM]]
* [[ref:libraries/vision2/reference/ev_multi_column_list_chart|EV_MULTI_COLUMN_LIST]] accepts items of type:
** [[ref:libraries/vision2/reference/ev_multi_column_list_row_chart|EV_MULTI_COLUMN_LIST_ROW]]
* [[ref:libraries/vision2/reference/ev_tool_bar_chart|EV_TOOL_BAR]] accepts items of type:
** [[ref:libraries/vision2/reference/ev_tool_bar_button_chart|EV_TOOL_BAR_BUTTON]]
** [[ref:libraries/vision2/reference/ev_tool_bar_radio_button_chart|EV_TOOL_BAR_RADIO_BUTTON]]
** [[ref:libraries/vision2/reference/ev_tool_bar_separator_chart|EV_TOOL_BAR_SEPARATOR]]
** [[ref:libraries/vision2/reference/ev_tool_bar_toggle_button_chart|EV_TOOL_BAR_TOGGLE_BUTTON]]
* EV_TREE accepts items of type:
** [[ref:libraries/vision2/reference/ev_dynamic_tree_item_chart|EV_DYNAMIC_TREE_ITEM]] accepts items of type:
*** [[ref:libraries/vision2/reference/ev_dynamic_tree_item_chart|EV_DYNAMIC_TREE_ITEM]]
*** [[ref:libraries/vision2/reference/ev_tree_item_chart|EV_TREE_ITEM]]
** [[ref:libraries/vision2/reference/ev_tree_item_chart|EV_TREE_ITEM]] accepts items of type:
*** [[ref:libraries/vision2/reference/ev_dynamic_tree_item_chart|EV_DYNAMIC_TREE_ITEM]]
*** [[ref:libraries/vision2/reference/ev_tree_item_chart|EV_TREE_ITEM]]

View File

@@ -0,0 +1,94 @@
[[Property:title|Kernel]]
[[Property:weight|1]]
[[Property:uuid|d830dc77-cd77-1f52-0e39-e0ec1cffa028]]
The kernel cluster contains classes that provide functionality common to most Windowed application. These classes are considered the core of any EiffelVision 2 application. The most important of these classes is [[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]]. This class is used to initialize the graphical toolkit and event loop of your EiffelVision 2 application. Kernel also includes classes such as [[ref:libraries/vision2/reference/ev_timeout_chart| EV_TIMEOUT]] that calls procedures (via agents) at specified intervals, and [[ref:libraries/vision2/reference/ev_color_chart| EV_COLOR]] which is used for coloring widgets and items. To start programming with EiffelVision 2, you first have to correctly initialize [[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]].
==Launching Your Application with EV_APPLICATION — The Heart of All EiffelVision 2 Systems==
[[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]] is the basis for every EiffelVision 2 application and is considered the most important class in the library. It is responsible for initializing the underlying toolkit that is driving the windowing system on the platform that you compile your system on. It is also where the main event loop that drives your application is executed.
{{note|It is an '''error''' to attempt to create any EiffelVision 2 components before the application object has been created (see the Flat Contracts view of [[ref:/libraries/vision2/reference/ev_environment_chart|EV_ENVIRONMENT]]). }}
You may inherit [[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]] or use it as a client in order to create your EiffelVision 2 application. A simple method of using EV_APPLICATION is as follows:
# Create an instance of EV_APPLICATION.
# Create one or more windows for your application.
# Launch the application.
An example of an EiffelVision 2 application using inheritance from [[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]] is shown below.
<code>
class
HELLOWORLD_APP
inherit
EV_APPLICATION
create
make
feature
make
-- Create the application.
local
helloworld_window: EV_TITLED_WINDOW
do
default_create
create helloworld_window
helloworld_window.set_title ("Helloworld!")
helloworld_window.close_request_actions.extend (agent destroy)
helloworld_window.show
launch
end
end
</code>
The following EiffelVision 2 application functions identically, but instead of inheriting from [[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]], it is used in a client/supplier relationship.
<code>
class
HELLOWORLD_APP
create
make
feature
make
-- Create the EiffelVision 2 application with a helloworld window.
local
app: EV_APPLICATION
helloworld_window: EV_TITLED_WINDOW
do
create app
create helloworld_window
helloworld_window.set_title ("Helloworld!")
helloworld_window.close_request_actions.extend (agent app.destroy)
helloworld_window.show
app.launch
end
end
</code>
==What Does Launch Actually Do?==
In EiffelVision 2, to launch an application means to pass control to the underlying graphical toolkit. Simply creating an application does not launch it. An explicit call to <eiffel>`launch'</eiffel> is required for the event processing to begin.
{{note|An EiffelVision 2 system is event based. This means that the way you control the execution within an EiffelVision 2 system is by responding appropriately to [[Events|events]] as they occur. Therefore, if you call launch on an [[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]], the processing for the application will continue indefinitely unless you have provided a way to exit the application. It is essential to initialize your components correctly, so your application can be exited (i.e. call <eiffel>`destroy'</eiffel> on the application object). }}
==Building Your Application Skeleton==
Now that you have a basic application skeleton set up, you can now:
* [[Widgets|Create widgets and set their properties.]]
* [[Containers|Add containers (that control widget layout) to your window(s), then place your created widgets in those containers.]]
* [[Events|Add code to respond to user actions with agents and action sequences.]]
Once you have learned the basics of GUI programming within EiffelVision 2, you will be well on your way to creating powerful multi-platform applications. The Application Programming Interface (API) of EiffelVision 2 has been designed in a way to ensure that the library is as intuitive, consistent and stylistic as possible. Heavy reuse of components from the EiffelBase library is one of the main ingredients that makes this possible.

View File

@@ -0,0 +1,88 @@
[[Property:title|EiffelVision Pick and Drop]]
[[Property:weight|0]]
[[Property:uuid|309203de-6536-fe26-4f73-cb1f4a450e6f]]
Pick-and-Drop is a unique user-interface action that permits a user to request an action be performed on a specified object. It is a more-ergonomic alternative to the typical drag-and-drop or "select-and-click" user operations found in most modern graphical user interfaces. Users of EiffelStudio have come to value Pick-and-Drop as both intuitive, and easier on the wrist and fingers with long-term use.
Pick-and-Drop uses the metaphor of '''pebbles and holes'''. The typical method of doing a pick-and-drop is that the end user selects the object to receive an action with a single right-click of the mouse. At that point, the mouse arrow turns into a "pebble" connected to the "point of picking" via a visible "band". This "pebble" is often a symbol representing the type of object that was "picked". In the case of the screen-shot below, it is a blue ellipse: the "pebble" symbol for a class.
[[Image:EiffelStudio during class pick and drop2|thumbnail|360px|center|EiffelStudio During Class Pick-and-Drop]]
The "pebble" may then be dropped into any compatible "hole" (drop target—a widget configured to accept "pebbles" of this type). Such "receiving" widgets are often tool-bar buttons or editing areas (or in the case of the screen-shot above, the editor "tab" bar), but can be any widget that inherits from [[ref:libraries/vision2/reference/ev_pick_and_dropable_chart|EV_PICK_AND_DROPABLE]] and is properly configured. The user then can either "drop the pebble into the hole" with a second right-click (on the receiving object), or may cancel the operation by single-clicking the left mouse button.
[[Image:EiffelStudio after class pick and drop2|thumbnail|360px|center|EiffelStudio After Class Pick-and-Drop]]
{{note|See [[uuid:a3789781-153b-7f4d-bb94-4bdf8923fb56|Retargeting Through Pick-and-Drop]] to see how EiffelStudio uses the Pick-and-Drop user interface.<br><br>}}
Because the Pick-and-Drop operation has been so popular, classes have been added to the EiffelVision 2 library to make implementing this user interface very easy.
From a technical viewpoint, Pick-and-Drop is a mechanism which allows data to be transported from a '''source''' object to a '''target'''. Any EiffelVision 2 object inheriting from [[ref:libraries/vision2/reference/ev_pick_and_dropable_chart|EV_PICK_AND_DROPABLE]] can be used to transport or receive data.
==A Simple Pick-and-Drop Example==
The two necessary components for a Pick-and-Drop operation are a '''source''' and a '''target''', both of which must [[uuid:b8c10baa-4f50-adfe-a6f8-9cb56a8f1917#Conformance|conform]] to [[ref:libraries/vision2/reference/ev_pick_and_dropable_chart|EV_PICK_AND_DROPABLE]]. The data that is to be transported is known as a '''pebble'''.
The following steps need to be undertaken to set up a simple pick and drop:
* Set the '''source''' by calling set_pebble.
* Set one or more '''targets''' by adding an [[ET: Agents|agent]] to their <eiffel>drop_actions</eiffel> list. To make the '''target''' accept that type of '''pebble''', the arguments of the [[ET: Agents|agent]] must match the type of the '''pebble''' to be transported for the '''source'''. Otherwise the transport will not be permitted.
A simple example of this is demonstrated here:
<code>
button1.set_pebble ("A PND transport has occured%N")
button2.drop_actions.extend (agent print (?))
</code>
Because <eiffel>print</eiffel> takes an argument of type [[ref:/libraries/base/reference/string_8_chart|STRING_8]], button2 becomes a valid drop-target for the pebble contained by button1. Right clicking the mouse pointer over the '''source''' will start the transport, and right clicking with the mouse pointer over a valid '''target''' will complete the transport. The transport can be canceled anytime with a simple left click, just as you would do in EiffelStudio.
{{note|Any type of object can be used as the '''pebble'''. When a transport completes, the '''pebble''' that was transported is passed as an argument to all agents in the '''target's''' <code>drop_actions</code> list to which the '''pebble''' [[uuid:b8c10baa-4f50-adfe-a6f8-9cb56a8f1917#Conformance|conforms]]. <br><br>}}
==Three Different Modes of Transport==
There are three different modes of transport available for pick and drop. They are listed below with details of their use:
* Pick and Drop Mode. <br/>
::This is the default mode for pick and drop, but can be set by calling <eiffel>set_pick_and_drop_mode</eiffel> on the '''source''' object. Right clicking on a '''source''' starts the transport and right clicking on a valid '''target''' completes the transport. During execution, a band is drawn from the screen position where the pick started to the current mouse position. Pressing the left mouse button or the escape key during execution will end the transport.
* Drag and Drop Mode <br/>
::This mode can be set by calling <eiffel>set_drag_and_drop_mode</eiffel> on the '''source''' object. Left clicking on a '''source''' starts the transport and releasing the left mouse button over a valid '''target''' completes the transport. During execution, a band is drawn from the screen position where the pick started to the current mouse position. Releasing the left mouse button or pressing the escape key during execution will end the transport.
* Target Menu Mode <br/>
::This mode can be set by calling <eiffel>set_target_menu_mode</eiffel> on the '''source''' object. Right clicking on a '''source''' brings up a menu of all the valid drop '''targets''' in the system. Selecting one of these targets completes the transport.
==Accept and Deny Cursors==
When <eiffel>mode_is_pick_and_drop</eiffel> or <eiffel>mode_is_drag_and_drop</eiffel> then the shape of the mouse cursor changes to reflect whether the current GUI component below the mouse accepts the pebble or not. Calling <eiffel>set_accept_cursor</eiffel> or <eiffel>set_deny_cursor</eiffel> on the '''source''' object allows you to customize the Accept- and Deny-Cursor respectively—used to represent a valid or invalid '''target''' respectively while the mouse pointer (pebble) is being moved around. The default Accept-Cursor is the standard mouse pointer. The default Deny-Cursor is a red circle with a diagonal line across it: the universal "not permitted" symbol.
Example:
<code>
add_some_widgets
-- Add some widgets with a Pick-and-Drop example into `main_window'.
local
my_hbox: EV_HORIZONTAL_BOX
my_button1: EV_BUTTON
my_button2: EV_BUTTON
bullseye_pix_buffer: EV_PIXEL_BUFFER
bullseye_ptr_style: EV_POINTER_STYLE
do
create my_hbox
create my_button1.make_with_text ("Button1")
create my_button2.make_with_text ("Button2")
my_hbox.extend (my_button1)
my_hbox.extend (my_button2)
my_hbox.extend (create {EV_BUTTON}.make_with_text ("Button3"))
main_window.extend (my_hbox)
my_button2.set_pebble ("A Pick-and-Drop has occurred.")
my_button1.drop_actions.extend (agent my_button1.set_text (?))
my_button1.drop_actions.extend (agent io.put_string (?))
create bullseye_pix_buffer.make_with_size (32, 32)
bullseye_pix_buffer.set_with_named_file ("BULLSEYE.png")
create bullseye_ptr_style.make_with_pixel_buffer (bullseye_pix_buffer, 32, 32)
my_button2.set_accept_cursor (bullseye_ptr_style)
end
</code>

View File

@@ -0,0 +1,47 @@
[[Property:title|Properties]]
[[Property:weight|5]]
[[Property:uuid|0d46c1eb-bce4-2d67-0272-da4aa5950c65]]
The Properties cluster contains all the common properties available for EiffelVision 2 [[Widgets|widgets]] and [[Items|items]]. Every EiffelVision 2 widget has the same set of properties inherited from EV_WIDGET, but many widgets also inherit additional properties, further refining the behavior of the widget.
EV_WIDGET inherits the following properties:
* [[ref:libraries/vision2/reference/ev_pick_and_dropable_chart|EV_PICK_AND_DROPABLE]]
** For an overview of the Pick and Drop mechanism, click [[EiffelVision Pick and Drop|here]] .
* [[ref:libraries/vision2/reference/ev_sensitive_chart|EV_SENSITIVE]]
** If an EiffelVision 2 component inherits from [[ref:libraries/vision2/reference/ev_sensitive_chart|EV_SENSITIVE]], it can be made to ignore events. <br/>
:::Use <eiffel>disable_sensitive</eiffel> to disable event handling, and <eiffel>enable_sensitive</eiffel> to restore event handling.
* [[ref:libraries/vision2/reference/ev_colorizable_chart|EV_COLORIZABLE]]
** If a EiffelVision 2 component inherits from [[ref:libraries/vision2/reference/ev_colorizable_chart|EV_COLORIZABLE]], it has facilities for modifying its foreground and background colors. <br/>
:::Use <eiffel>set_foreground_color</eiffel> to set <eiffel>foreground_color</eiffel> and <eiffel>set_background_color</eiffel> to set <eiffel>background_color</eiffel>. <br/>
:::Use <eiffel>set_default_colors</eiffel> to restore the colors to their defaults.
* [[ref:libraries/vision2/reference/ev_help_contextable_chart|EV_HELP_CONTEXTABLE]]
** If a EiffelVision 2 component inherits from [[ref:libraries/vision2/reference/ev_help_contextable_chart|EV_HELP_CONTEXTABLE]], facilities are provided for associating help to the component when F1 or Shift F1 is pressed.
* [[ref:libraries/vision2/reference/ev_positioned_chart|EV_POSITIONED]]
** If a EiffelVision 2 component inherits from [[ref:libraries/vision2/reference/ev_positioned_chart|EV_POSITIONED]], it is possible to query its current position, size and minimum size. <br/>
:::Use <eiffel>x_position</eiffel> and <eiffel>y_position</eiffel> to find its position relative to its parent. <br/>
:::Use <eiffel>width</eiffel> and <eiffel>height</eiffel> to find its size. <br/>
:::Use <eiffel>minimum_width</eiffel> and <eiffel>minimum_height</eiffel> to find its minimum size.
* [[ref:libraries/vision2/reference/ev_containable_chart|EV_CONTAINABLE]]
** If a EiffelVision 2 component inherits from [[ref:libraries/vision2/reference/ev_containable_chart|EV_CONTAINABLE]], it is able make calls on its parent. Use <eiffel>parent</eiffel> to make calls on the current parent.
{{note|[[ref:libraries/vision2/reference/ev_containable_chart|EV_CONTAINABLE]] has no features for setting the parent. In EiffelVision 2, a child has no features for setting its parent, while a parent such a descendant of EV_CONTAINER contains routines for adding children (one example is <eiffel>extend</eiffel>). }}
The following are several more properties used within EiffelVision 2:
* [[ref:libraries/vision2/reference/ev_deselectable_chart|EV_DESELECTABLE]]
* [[ref:libraries/vision2/reference/ev_drawable_chart|EV_DRAWABLE]]
* [[ref:libraries/vision2/reference/ev_fontable_chart|EV_FONTABLE]]
* [[ref:libraries/vision2/reference/ev_pixmapable_chart|EV_PIXMAPABLE]]
* [[ref:libraries/vision2/reference/ev_positionable_chart|EV_POSITIONABLE]]
* [[ref:libraries/vision2/reference/ev_selectable_chart|EV_SELECTABLE]]
* [[ref:libraries/vision2/reference/ev_textable_chart|EV_TEXTABLE]]
* [[ref:libraries/vision2/reference/ev_tooltipable_chart|EV_TOOLTIPABLE]]
For a full list of properties available, see the "interface/properties" sub-cluster of the EiffelVision 2 library.

View File

@@ -0,0 +1,22 @@
[[Property:title|Support]]
[[Property:weight|6]]
[[Property:uuid|fd72dc5e-32bd-55aa-0e2e-2c7af69c72fd]]
The support cluster contains many classes providing useful facilities within the library. Many of the classes within this cluster are constants classes, which are filled with constants values for specific contexts, generally indicated by their names. The following constants classes are available within this cluster:
* [[ref:libraries/vision2/reference/ev_character_format_constants_chart|EV_CHARACTER_FORMAT_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_dialog_constants_chart|EV_DIALOG_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_drawable_constants_chart|EV_DRAWABLE_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_font_constants_chart|EV_FONT_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_key_constants_chart|EV_KEY_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_paragraph_constants_chart|EV_PARAGRAPH_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_pointer_constants_chart|EV_POINTER_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_pointer_style_constants_chart|EV_POINTER_STYLE_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_postscript_page_constants_chart|EV_POSTSCRIPT_PAGE_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_scroll_constants_chart|EV_SCROLL_CONSTANTS]]
* [[ref:libraries/vision2/reference/ev_text_alignment_constants_chart|EV_TEXT_ALIGNMENT_CONSTANTS]]
In a similar vein to constant classes, the following two classes are provided to provide support for default [[ref:libraries/vision2/reference/ev_color_chart|EV_COLOR]]s and [[ref:libraries/vision2/reference/ev_pixmap_chart|EV_PIXMAP]]s.
* [[ref:libraries/vision2/reference/ev_stock_colors_chart|EV_STOCK_COLORS]]
* [[ref:libraries/vision2/reference/ev_stock_pixmaps_chart|EV_STOCK_PIXMAPS]]

View File

@@ -0,0 +1,64 @@
[[Property:title|Containers]]
[[Property:weight|1]]
[[Property:uuid|aa71e29d-f0e0-9eb2-a289-675d24aac927]]
A container is a EiffelVision 2 widget that may contain other widgets. All containers inherit from [[ref:libraries/vision2/reference/ev_container_chart|EV_CONTAINER]]. Some containers such as [[ref:libraries/vision2/reference/ev_cell_chart|EV_CELL]] may only hold one widget while containers such as [[ref:libraries/vision2/reference/ev_box_chart|EV_BOX]] may hold multiple widgets. Since all containers inherit from type [[ref:libraries/vision2/reference/ev_widget_chart|EV_WIDGET]], this means that a container may be placed inside another container. Windows inherit from [[ref:libraries/vision2/reference/ev_cell_chart|EV_CELL]] and are therefore also classified as containers.
{{note|Containers may only contain other widgets. Items may only be placed in certain primitives. For example, an [[ref:libraries/vision2/reference/ev_list_item_chart| EV_LIST_ITEM]] may only be contained in an [[ref:libraries/vision2/reference/ev_list_chart| EV_LIST]]. }}
==Inheritance from EiffelBase==
Wherever possible, EiffelVision 2 containers reuse the container structures provided by [[EiffelBase]]. This provides three main advantages:
# Familiarity for operations such as access, insertions, and removals. Anybody who already uses [[EiffelBase]] should find it easy to use EiffelVision 2 containers.
# The underlying structures used have been tried and tested for many years and their designs have proven to be robust and effective.
# Containers provide powerful methods of traversing and searching their contents. In the original EiffelVision library, you needed to keep references to widgets since you could not query the contents of their containers.
For example, [[ref:libraries/vision2/reference/ev_container_chart|EV_CONTAINER]] inherits from <eiffel>BOX</eiffel> and <eiffel>COLLECTION</eiffel>. Descendents of [[ref:libraries/vision2/reference/ev_container_chart|EV_CONTAINER]] such as [[ref:libraries/vision2/reference/ev_box_chart|EV_TABLE]] may also inherit from other structures in [[EiffelBase]].
==Using Containers==
The main role of a container is to position its children in a certain way. An [[ref:libraries/vision2/reference/ev_horizontal_box_chart| EV_HORIZONTAL_BOX]] for example positions its children side by side. To achieve vertical stacking you would use an [[ref:libraries/vision2/reference/ev_vertical_box_chart| EV_VERTICAL_BOX]] .
A code example of adding widgets to a container is as follows:
<code>
add_to_container
-- Add 3 buttons to a hbox and then show in window.
local
my_window: EV_TITLED_WINDOW
my_hbox: EV_HORIZONTAL_BOX
my_button: EV_BUTTON
do
create my_window
create my_hbox
create my_button.make_with_text ("Button1")
my_hbox.extend (my_button)
my_hbox.extend (create {EV_BUTTON}.make_with_text ("Button2"))
my_hbox.extend (create {EV_BUTTON}.make_with_text ("Button3"))
my_window.extend (my_hbox)
my_window.show
end
</code>
The mapping of a EiffelVision 2 container interface is very close to that of containers in [[EiffelBase]], such as a linked list.
* To add a widget to a container call <code>`extend'</code>.
* To remove a widget from the container call <code>`prune'</code>.
* To empty a container call <code>`wipe_out'</code>.
* To traverse the container, you can use features such as <code>start</code>, <code>forth</code>, <code>item</code>, and <code>off</code>.
{{note|When a widget is added to a container, the container is the parent of the widget. }}
==Size of a Widget Within a Container==
The size of a widget in a container is always at least its minimum size. By default, when a widget is added to a container it is expandable. This means that if the container gets bigger, the widget will expand to fit the extra space. This convenient functionality means that you don't have to worry about handling the size of the widget (such as when a user alters the size of a window) as this is all performed automatically. If, on the other hand, you decide you want the widget to remain at a certain size (its minimum size), [[ref:libraries/vision2/reference/ev_box_chart| EV_BOX]] (and therefore its descendants) contain the convenient call <code>disable_item_resize</code>.
==Sizing of Containers==
Since [[ref:libraries/vision2/reference/ev_container_chart|EV_CONTAINER]] inherits from type [[ref:libraries/vision2/reference/ev_widget_chart|EV_WIDGET]], the following facilities are provided for setting the minimum size: <code>set_minimum_width</code>, <code>set_minimum_height</code> and <code>set_minimum_size</code>. It is important to remember that as a general rule, '''the current size of a container is always at least the minimum size of all its contents.'''
{{note|The exception to this is: [[ref:libraries/vision2/reference/ev_fixed_chart|EV_FIXED]], [[ref:libraries/vision2/reference/ev_viewport_chart|EV_VIEWPORT]], and [[ref:libraries/vision2/reference/ev_scrollable_area_chart|EV_SCROLLABLE_AREA]] which do actually allow their contents to be larger than their current size.}}

View File

@@ -0,0 +1,32 @@
[[Property:title|EiffelVision Dialogs]]
[[Property:weight|2]]
[[Property:uuid|85cfcfd3-a46e-4e2e-330a-61c2d1579b0f]]
This cluster contains all the dialogs provided by EiffelVision 2.
==Standard Dialog Boxes==
A standard dialog box provides a way of interacting with the underlying platform (such as Windows or Linux) to perform basic tasks such as opening a file or printing a document. EiffelVision 2 provides six standard dialogs that allow the user to perform common tasks. They are:
* [[ref:libraries/vision2/reference/ev_color_dialog_chart|EV_COLOR_DIALOG]] — allows the user to select an RGB color (useful for graphical apps such as a Paint Program).
* [[ref:libraries/vision2/reference/ev_directory_dialog_chart|EV_DIRECTORY_DIALOG]] — allows the user to select a directory.
* [[ref:libraries/vision2/reference/ev_file_open_dialog_chart|EV_FILE_OPEN_DIALOG]] — allows the user to select an existing file to be opened.
* [[ref:libraries/vision2/reference/ev_file_save_dialog_chart|EV_FILE_SAVE_DIALOG]] — allows the user to select a filename to be used for creation of a file.
* [[ref:libraries/vision2/reference/ev_font_dialog_chart|EV_FONT_DIALOG]] — allows the user to select a font (useful for a Word Processor for example).
* [[ref:libraries/vision2/reference/ev_print_dialog_chart|EV_PRINT_DIALOG]] — allows the user to confirm or change printer settings for printing (may be used in conjunction with [[ref:libraries/vision2/reference/ev_print_projector_chart|EV_PRINT_PROJECTOR]]).
==Creating Custom Dialog Boxes==
If you wish to provide a custom dialog in your application, [[ref:libraries/vision2/reference/ev_dialog_chart| EV_DIALOG]] has been provided to facilitate this.
==Message Dialog Boxes==
A message dialog box gives your application a standard way of displaying information, or asking simple questions. This information can be displayed with the following message dialog boxes.
* [[ref:libraries/vision2/reference/ev_message_dialog_chart|EV_MESSAGE_DIALOG]] — displays a simple message with an "OK" button.
* [[ref:libraries/vision2/reference/ev_information_dialog_chart|EV_INFORMATION_DIALOG]] — displays information to the user (in Windows this dialog box contains an "information" icon).
* [[ref:libraries/vision2/reference/ev_question_dialog_chart|EV_QUESTION_DIALOG]] — displays a question and allows user to respond with "Yes" or "No" button.
* [[ref:libraries/vision2/reference/ev_warning_dialog_chart|EV_WARNING_DIALOG]] — displays a warning to the user.
* [[ref:libraries/vision2/reference/ev_confirmation_dialog_chart|EV_CONFIRMATION_DIALOG]] — allows the user to confirm an action that has been requested.
* [[ref:libraries/vision2/reference/ev_error_dialog_chart|EV_ERROR_DIALOG]] — displays an error message.

View File

@@ -0,0 +1,60 @@
[[Property:title|Widgets]]
[[Property:weight|2]]
[[Property:uuid|595bb73e-146a-ea19-221f-40f3415aad34]]
==What Is a Widget?==
A Widget is the fundamental building block of your application's GUI. Components such as Windows, Buttons, Text fields, Check Boxes, List Boxes and layout Containers are examples of widgets. The widget set in EiffelVision 2 provides you with the flexibility to easily create powerful graphical applications. All widgets in EiffelVision 2 inherit from [[ref:/libraries/vision2/reference/ev_widget_chart| EV_WIDGET]], thus the features provided in <eiffel>EV_WIDGET</eiffel> may be called on any widget.
==Variations of Widgets==
Within EiffelVision 2, widgets have been classified into three different groups:
* [[Primitives|Primitives]] — These are elements of the user interface that are mainly responsible for interaction with the user, such as an [[ref:/libraries/vision2/reference/ev_button_chart|EV_BUTTON]].
* [[Containers|Containers]] — These are used to contain other widgets and position them in a certain way, such as an [[ref:/libraries/vision2/reference/ev_vertical_box_chart| EV_VERTICAL_BOX ]] that stacks its child widgets one by one vertically.
* [[EiffelVision Dialogs|Dialogs]] — These are pop up dialog boxes used for interacting with the user for tasks such as opening a file (EV_FILE_OPEN_DIALOG) or displaying a message (EV_MESSAGE_DIALOG). You may also construct your own dialog boxes by inheriting from EV_DIALOG.
==How Do I Create a Widget?==
All widgets in EiffelVision 2 are based around the default_create mechanism in Eiffel. This means that all that needs to be done to create a widget is to declare a reference to a type (such as [[ref:libraries/vision2/reference/ev_button_chart|EV_BUTTON]] ) and then call create on that reference. An example of this is as follows.
<code>
my_button: EV_BUTTON
create my_button
</code>
Along with the default creation, EiffelVision 2 also includes a few additional creation features for convenience. An example of this is <code>make_with_text</code> for all widgets that may have text associated with them (those that inherit from [[ref:libraries/vision2/reference/ev_textable_chart| EV_TEXTABLE]] ), this saves a call to set_text upon default creation of the textable widget. Thus:
<code>
create my_button.make_with_text ("Click Me")
</code>
would replace
<code>
create my_button
my_button.set_text ("Click Me")
</code>
{{note|When a widget is created, no extra initialization has to be performed. '''The only exception is with windows, for which it is necessary to call <code>show</code> in order for the windows to be displayed on screen'''. This permits widgets to be added to a window while it is still invisible, and then when made visible with <code>show</code>, the window and all its visible widgets are displayed at once.}}
==Sizing==
Since [[ref:libraries/vision2/reference/ev_primitive_chart|EV_PRIMITIVE]] inherits from type [[ref:libraries/vision2/reference/ev_widget_chart|EV_WIDGET]], the following facilities are provided for setting the minimum size: <code>set_minimum_width</code>, <code>set_minimum_height</code> and <code>set_minimum_size</code>.
The minimum size of a widget is the smallest possible size that it can be inside its parent container. If an [[ref:libraries/vision2/reference/ev_button_chart|EV_BUTTON]] was created and set with a minimum_size of width/height (100, 100), if this button was inserted in to an [[ref:libraries/vision2/reference/ev_horizontal_box_chart| EV_HORIZONTAL_BOX]], then the box's size could never be below (100, 100) or it would violate the minimum size of the button. '''The size of a container must always be greater or equal to the minimum sizes of its children.'''
{{note|In EiffelVision 2, there is no way to set the current size of the primitive. The current size is dependent on the size of the parent or the minimum_size. }}
==Now What Do I Do?==
Now that you can create a widget, you will need to actually make it usable to your intended user. This will usually involve these three steps. <br/>
* Setting [[Properties| properties]] for the widget such as color and minimum size.
* Making the widget respond to user [[Events| events]] via the use of agents and action sequences.
* Placing the widget inside a [[Containers| container]] widget (either a window or a child of a window) so it can be shown on the screen.

View File

@@ -0,0 +1,18 @@
[[Property:title|Primitives]]
[[Property:weight|0]]
[[Property:uuid|09d70dd5-2e30-7615-88ac-4babe4eb7aa6]]
A primitive is an EiffelVision 2 widget that may not contain other widgets. Primitives may be placed in [[Containers|containers]], but a primitive [[Widgets|widget ]] may not contain any child widgets. Some examples of primitives are [[ref:libraries/vision2/reference/ev_button_chart|EV_BUTTON]] and [[ref:libraries/vision2/reference/ev_label_chart|EV_LABEL]]. All EiffelVision 2 primitives inherit from [[ref:libraries/vision2/reference/ev_primitive_chart|EV_PRIMITIVE]].
==Features of a Primitive==
All primitives inherit from [[ref:libraries/vision2/reference/ev_tooltipable_chart|EV_TOOLTIPABLE]] and therefore may have tooltips assigned to them. They all inherit many features from [[ref:libraries/vision2/reference/ev_widget_chart|EV_WIDGET]]. Each descendent of [[ref:libraries/vision2/reference/ev_primitive_chart|EV_PRIMITIVE]] will typically have many features specific to its type. For example, [[ref:libraries/vision2/reference/ev_separator_chart|EV_SEPARATOR]] has no extra features, but [[ref:libraries/vision2/reference/ev_label_chart|EV_LABEL]] has features for modifying the current font and text to be displayed.
==Widgets as Item Holders==
Although no primitive can contain another widget, certain primitives may contain one or more [[Items|items]]. One example of this is an [[ref:libraries/vision2/reference/ev_list_chart| EV_LIST]] containing [[ref:libraries/vision2/reference/ev_list_item_chart|EV_LIST_ITEM]]s.