mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 23:32:42 +01:00
Author:admin
Date:2008-09-17T13:53:28.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@3 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
[[Property:title|Events]]
|
||||
[[Property:weight|4]]
|
||||
This cluster contains classes for event handling within Vision2.
|
||||
|
||||
==What is an event?==
|
||||
|
||||
An event is considered to be an external action that occurs during a program's execution. Correctly dealing with events is an important part of developing a Vision2 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. Vision2 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]] .
|
||||
|
||||
==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 select_actions action sequence. This gets fired when the user clicks/selects 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 [[11 Agents|here]] .
|
||||
|
||||
An example of adding an agent to an action_sequence is as follows.
|
||||
<code>
|
||||
button.select_actions.extend (agent print ("Button Clicked!%N"))
|
||||
</code>
|
||||
|
||||
All Vision2 action sequences inherit [[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 sequences actual generic parameter.
|
||||
|
||||
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 has no guarantees on the arguments passed to your procedure.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
[[Property:title|Figures]]
|
||||
[[Property:weight|7]]
|
||||
The EiffelVision figure cluster can be considered a high-level way of drawing on an [[ref:libraries/vision2/reference/ev_drawable_chart|EV_DRAWABLE]] descendant. Here are some advantages:
|
||||
* The model is separated from the representation by using projectors that take a world of figures and project it to any device, not just a drawing area.
|
||||
* Instead of drawing with static API's like draw_line, real figure objects are used that can move, change color or morph.
|
||||
* For projection devices that allow this, events may be caught and fired through the appropriate figure object.
|
||||
|
||||
==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 a representation. [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]] on the other hand does not but is a collection of figures. On the top of those two stands [[ref:libraries/vision2/reference/ev_figure_chart|EV_FIGURE]] as common ancestor. As [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]] is a collection of EV_FIGUREs, it can contain subgroups.
|
||||
|
||||
As top-level group of a world of figures you must use [[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]] but adds some features for grid and background color.
|
||||
|
||||
===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
|
||||
| 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
|
||||
| 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 fill_color. Open figures inherit [[ref:libraries/vision2/reference/ev_atomic_figure_chart|EV_ATOMIC_FIGURE]] directly just as [[ref:libraries/vision2/reference/ev_closed_figure_chart|EV_CLOSED_FIGURE]] .
|
||||
===Points===
|
||||
|
||||
Central in the design of the figures are points. Figures are built up as much from points as possible. For example, an ellipse is not a center point with two radii, but the biggest 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 classes are:
|
||||
* 1 (a figure has one point): [[ref:libraries/vision2/reference/ev_single_pointed_figure_chart|EV_SINGLE_POINTED_FIGURE]] .
|
||||
* 2 (a figure has two points): [[ref:libraries/vision2/reference/ev_double_pointed_figure_chart|EV_DOUBLE_POINTED_FIGURE]] .
|
||||
* * (a 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. Its most important feature is:
|
||||
<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 another point, which is also relative. Each point is a set of coordinates and a reference point. The absolute coordinates are calculated only when needed by adding the absolute coordinates of the reference point to the relative coordinates.
|
||||
|
||||
==Figure worlds==
|
||||
|
||||
In order to put the figures you want to display in a context, you have to insert them in 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]] adds a number of features to [[ref:libraries/vision2/reference/ev_figure_group_chart|EV_FIGURE_GROUP]] . These extra features are needed for the representation by a projector. One is the background color. This feature will be 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 not more than a hint towards its representation. For example, if a line is "20" long, this unit might mean 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 to 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 [[ref:libraries/vision2/reference/ev_drawable_chart|EV_DRAWABLE]] : [[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 results in a more smooth animation but requires fast copying from memory to the video buffer (can be slow for a remote display).
|
||||
==Events==
|
||||
The other features of drawing area and widget is that they generate pointer events. These events can be translated by projectors to map the figure world. These projectors send the event to the appropriate figure. Every figure has all common pointer action sequences:
|
||||
* <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. In case you wish to use these events, use the ones of the 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 world. The first item of a figure group is the figure that is the farthest away. This means that the figure is obscured by any figures which are in front of it, and events will also not be propagated to this figure in that case.
|
||||
==Rotation and scaling==
|
||||
|
||||
The relative points also support rotation and scaling. These factors work just like coordinates, except scaling, which is multiplied instead of added in the chain of 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 same for rotation.
|
||||
|
||||
The scaling factor is divided into a horizontal and vertical component. If the factor is 0.5, everything is displayed at half its size. The rotation factor is in radians.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
[[Property:title|EiffelVision Interface Content]]
|
||||
[[Property:link_title|EiffelVision Library Reference Manual]]
|
||||
[[Property:weight|1]]
|
||||
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 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 no time, users will be producing good-looking Windowed application skeletons, of which will run on a multitude of platforms with no manipulation of code.
|
||||
The EiffelVision 2 library includes the following interface clusters:
|
||||
* A [[Kernel| kernel]] cluster that includes classes that are key to a Vision2 application. The main class being [[ref:libraries/vision2/reference/ev_application_chart| EV_APPLICATION]] which is the main entry point of all Vision2 applications.
|
||||
* A [[Widgets| widgets]] cluster containing classes that used to create Vision2 widgets. Widgets are the visible objects that the user sees and interacts with on the desktop, examples of widgets are windows, buttons and labels.
|
||||
* An [[Items| items]] cluster includes the classes needed to create items, items can be thought of as widgets that are contained within only a certain type of widget, such as an [[ref:libraries/vision2/reference/ev_list_chart| EV_LIST]] that 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.
|
||||
* An [[Events| events]] cluster containing 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]] ). Agents 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 associating pointer_button_press_actions fired and this in turn, fires all of the agents held within, thus calling all of the procedures represented by the agents. Every widget and item has a certain number of [[ref:libraries/base/reference/action_sequence_chart|ACTION_SEQUENCE]] objects that are linked with a certain type of event.
|
||||
* A [[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 color and fonts to be altered for a widget or item respectively.
|
||||
* A [[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]] .
|
||||
* A [[Figures| figures]] cluster that allows for the projection of two-dimensional shapes (figures) on to 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]]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
[[Property:title|Items]]
|
||||
[[Property:weight|3]]
|
||||
All Vision2 items inherit [[ref:libraries/vision2/reference/ev_item_chart|EV_ITEM]] .
|
||||
|
||||
==What is an item?==
|
||||
|
||||
A Vision2 item is an object that is used to display information within 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 Vision2 items are descendants of [[ref:libraries/vision2/reference/ev_pixmapable_chart|EV_PIXMAPABLE]] meaning they can display an [[ref:libraries/vision2/reference/ev_pixmap_chart|EV_PIXMAP]] .
|
||||
|
||||
==Item holders==
|
||||
|
||||
Below is a structure showing the Vision2 components and the items that they accept. All the items types available in Vision2 are included:
|
||||
* [[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 set_menu_bar):
|
||||
** [[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]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
[[Property:title|Kernel]]
|
||||
[[Property:weight|1]]
|
||||
The kernel cluster contains classes that provide functionality that are common to most Windowed application. These classes are considered the core, or kernel of any Vision2 application. The most important of these classes is [[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]] . This is used to initialize the graphical toolkit and event loop of your Vision2 application. Kernel also includes classes such as [[ref:libraries/vision2/reference/ev_timeout_chart| EV_TIMEOUT]] that calls procedures (via agents) at a set interval, and [[ref:libraries/vision2/reference/ev_color_chart| EV_COLOR]] which is used for coloring widgets and items. To start programming with Vision2, 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 Vision2 systems==
|
||||
|
||||
[[ref:libraries/vision2/reference/ev_application_chart|EV_APPLICATION]] is the basis for every Vision2 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 decide to compile your system on. It also also where the main event loop that drives your application is executed.
|
||||
|
||||
{{note| '''Note:''' It is ''' not''' possible to create a Vision2 component unless an application exists (query [[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 vision2 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 a Vision2 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 is
|
||||
-- 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>
|
||||
|
||||
This is the same Vision2 application but instead using <eiffel>[/libraries/vision2/reference/ev_application_chart.xml| EV_APPLICATION ]</eiffel> in a client/supplier relationship.
|
||||
<code>
|
||||
class
|
||||
HELLOWORLD_APP
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
feature
|
||||
|
||||
make is
|
||||
-- Create the Vision2 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 Vision2, 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 launch is required for the event processing to begin.
|
||||
{{note| '''Note: '''A Vision2 system is event based. This means that you do not have control of the execution within a Vision2 system, but must respond 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 (call <eiffel>destroy</eiffel> on the application). }}
|
||||
|
||||
==Building your application skeleton==
|
||||
|
||||
Now that you have a basic application skeleton set up you can now go about
|
||||
* [[Widgets|Creating widgets and setting their properties.]]
|
||||
* [[Containers|Adding containers 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 learnt the basics of GUI programming within Vision2, you are well on the way to creating powerful multi-platform applications. The Application Programming Interface (API) of Vision2 has been designed in a way to ensure that the library is as intuitive, consistent and stylistic as possible. Heavy reuse of components from EiffelBase has been one of the main reasons that made this possible.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
[[Property:title|EiffelVision Pick and Drop]]
|
||||
[[Property:weight|0]]
|
||||
Pick and drop is a mechanism which allows data to be transported from a '''source''' object to a '''target'''. Any Vision2 object inheriting [[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==
|
||||
|
||||
Two necessary components for a pick and drop transport are a '''source''' and a '''target''', both of which must 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 a function to their drop_actions. The arguments of the function 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>
|
||||
|
||||
As print takes an argument of type [[ref:/libraries/base/reference/string_8_chart|STRING_8]] , button2 becomes a valid target for the pebble contained in 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 end the transport. The transport can be canceled anytime with a simple left click, just as you would do in EiffelStudio.
|
||||
|
||||
{{note| '''Note''': When a transport completes, the '''pebble''' that was transported is passed as an argument to all features in the '''targets'''drop_actions whose argument type matches the '''pebble''' }}
|
||||
|
||||
==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 with <eiffel>set_pick_and_drop_mode</eiffel>. 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 with <eiffel>set_drag_and_drop_mode</eiffel>. 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 with <eiffel>set_target_menu_mode</eiffel>. 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> allows you to customize this cursor used to represent a valid '''target''' while calling <eiffel>set_deny_cursor</eiffel> allows you to customize the cursor used for non valid '''targets'''.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
[[Property:title|Properties]]
|
||||
[[Property:weight|5]]
|
||||
This cluster contains all the common properties available for Vision2 [[Widgets|widgets]] and [[Items|items]] . Every Vision2 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 a Vision2 component inherits [[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 Vision2 component inherits [[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 the <eiffel>foreground_color</eiffel> and <eiffel>set_background_color</eiffel> to set the <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 Vision2 component inherits [[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 Vision2 component inherits [[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 size.
|
||||
|
||||
* [[ref:libraries/vision2/reference/ev_containable_chart|EV_CONTAINABLE]]
|
||||
** If a Vision2 component inherits [[ref:libraries/vision2/reference/ev_containable_chart|EV_CONTAINABLE]] it is able question its parent. Use parent to query the current parent.
|
||||
|
||||
|
||||
|
||||
{{note| '''Note:''' [[ref:libraries/vision2/reference/ev_containable_chart|EV_CONTAINABLE]] has no features for setting the parent. In Vision2, a child has no features for setting its parent, while a parent such as ev_container contains routines for adding children (one example is <eiffel>extend</eiffel>). }}
|
||||
|
||||
The following properties are also used within Vision2:
|
||||
* [[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]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
[[Property:title|Support]]
|
||||
[[Property:weight|6]]
|
||||
The support cluster contains many classes providing useful facilities within the library. Many of the classes within this cluster are constant classes, which are filled with constant values for specific contexts, generally indicated by their names. The following constant classes are available within this cluster:
|
||||
* [[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_postscript_page_constants_chart|EV_POSTSCRIPT_PAGE_CONSTANTS]]
|
||||
In a similar vein to constant classes, the two following 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]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
[[Property:title|Containers]]
|
||||
[[Property:weight|1]]
|
||||
All Vision2 containers inherit [[ref:libraries/vision2/reference/ev_container_chart|EV_CONTAINER]]
|
||||
|
||||
==What is a container?==
|
||||
|
||||
A container is a Vision2 widget that may contain other widgets. 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. As a container is of type [[ref:libraries/vision2/reference/ev_widget_chart|EV_WIDGET]] , this means that a container may be placed within a container. Windows inherit from [[ref:libraries/vision2/reference/ev_cell_chart|EV_CELL]] and are therefore classed as containers also.
|
||||
|
||||
{{note| '''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 be contained in an [[ref:libraries/vision2/reference/ev_list_chart| EV_LIST]] . }}
|
||||
|
||||
==Inheritance from Base==
|
||||
|
||||
Wherever possible, Vision2 containers reuse the container structures provided by Base. This provides three main advantages:
|
||||
# Familiarity for operations such as access, insertions and removals. Anybody who already uses [[EiffelBase Library|Base]] should find it easy to adapt to using Vision2 containers.
|
||||
# The underlying structures used have been tried and tested for many years and their design has been proved to be robust and effective.
|
||||
# It provides powerful methods of querying the contents. In the original Vision library, you needed to keep reference to widgets as you could not query the contents of a container.
|
||||
|
||||
For example, [[ref:libraries/vision2/reference/ev_container_chart|EV_CONTAINER]] inherits <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_BOX]] may also inherit other structures from [[EiffelBase Library|Base]] .
|
||||
|
||||
==Usage of 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 along the horizontal axis. 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 is
|
||||
-- Add 3 buttons to a hbox and then show in window.
|
||||
local
|
||||
a_window: EV_TITLED_WINDOW
|
||||
a_hbox: EV_HORIZONTAL_BOX
|
||||
a_button: EV_BUTTON
|
||||
do
|
||||
create a_window
|
||||
create a_hbox
|
||||
create a_button.make_with_text ("Button1")
|
||||
a_hbox.extend (a_button)
|
||||
a_hbox.extend (create {EV_BUTTON}.make_with_text ("Button2"))
|
||||
a_hbox.extend (create {EV_BUTTON}.make_with_text ("Button3"))
|
||||
a_window.extend (a_hbox)
|
||||
a_window.show
|
||||
end
|
||||
</code>
|
||||
|
||||
The mapping of a Vision2 container interface is very close to that of containers in Base, such as a linked list.
|
||||
* To add a widget to a container call `extend'.
|
||||
* To remove a widget from the container call `prune'.
|
||||
* To empty a container call `wipe_out'.
|
||||
* To traverse the container, you can use features such as start, forth, item and off.
|
||||
|
||||
{{note| '''Note''': When a widget is added to a container, the container is the parent of the widget. }}
|
||||
|
||||
==Size of 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]] contains the convenient call disable_item_resize.
|
||||
|
||||
==Sizing of containers==
|
||||
As [[ref:libraries/vision2/reference/ev_container_chart|EV_CONTAINER]] is of type [[ref:libraries/vision2/reference/ev_widget_chart|EV_WIDGET]] , the following facilities are provided for setting the minimum size: set_minimum_width, set_minimum_height and set_minimum_size. 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| '''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. <br/>
|
||||
}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
[[Property:title|EiffelVision Dialogs]]
|
||||
[[Property:weight|2]]
|
||||
This cluster contains all the dialogs provided by Vision2.
|
||||
|
||||
==Standard dialogs==
|
||||
|
||||
A standard dialog 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. Vision2 provides six dialogs that allow the user to perform everyday tasks that are
|
||||
* [[ref:libraries/vision2/reference/ev_color_dialog_chart|EV_COLOR_DIALOG]] -- This allows the user of your app 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]] -- This allows the user of your app to select a directory.
|
||||
* [[ref:libraries/vision2/reference/ev_file_open_dialog_chart|EV_FILE_OPEN_DIALOG]] -- This allows the user of your app to select a file to be opened.
|
||||
* [[ref:libraries/vision2/reference/ev_file_save_dialog_chart|EV_FILE_SAVE_DIALOG]] -- This allows the user of your app to select a filename that will be used for the creation of a file.
|
||||
* [[ref:libraries/vision2/reference/ev_font_dialog_chart|EV_FONT_DIALOG]] -- This allows the user of your app to select a font (useful for a Word Processor for example).
|
||||
* [[ref:libraries/vision2/reference/ev_print_dialog_chart|EV_PRINT_DIALOG]] -- This allows the user of your app to choose printer settings may be used in conjunction with [[ref:libraries/vision2/reference/ev_print_projector_chart|EV_PRINT_PROJECTOR]] .
|
||||
|
||||
|
||||
==Creating custom dialogs==
|
||||
|
||||
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 dialogs==
|
||||
|
||||
A message dialog gives your application a standard way of displaying useful (or vital) information, this information can be displayed with the following message dialogs.
|
||||
* [[ref:libraries/vision2/reference/ev_message_dialog_chart|EV_MESSAGE_DIALOG]] -- Allows a simple message to be displayed to the user.
|
||||
* [[ref:libraries/vision2/reference/ev_information_dialog_chart|EV_INFORMATION_DIALOG]] -- Allows useful info to be displayed to the user.
|
||||
* [[ref:libraries/vision2/reference/ev_question_dialog_chart|EV_QUESTION_DIALOG]] -- Allows the user to respond to a question with Yes or No.
|
||||
* [[ref:libraries/vision2/reference/ev_warning_dialog_chart|EV_WARNING_DIALOG]] -- Allows a warning to be displayed 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]] -- Allows an error message to be shown to the user.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
[[Property:title|Widgets]]
|
||||
[[Property:weight|2]]
|
||||
==What is a Widget?==
|
||||
|
||||
A Widget is the fundamental building block of your applications GUI, components such as Windows, Buttons and Labels are examples of such. The widget set of Vision2 provides you with the flexibility to easily create powerful graphical applications. All widgets in Vision2 inherit from [[ref:/libraries/vision2/reference/ev_widget_chart| EV_WIDGET]] and the features provided in <eiffel> EV_WIDGET</eiffel> may be called on any widget.
|
||||
|
||||
==Variations of Widget==
|
||||
Within Vision2, 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 children one by one vertically.
|
||||
* [[EiffelVision Dialogs|Dialogs]] -- These are pop up dialog windows 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 construct your own dialogs by inheriting EV_DIALOG.
|
||||
|
||||
==How do I create a widget?==
|
||||
|
||||
All widgets in Vision2 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>
|
||||
a_button: EV_BUTTON
|
||||
create a_button
|
||||
</code>
|
||||
|
||||
Along with the default creation, Vision2 also includes a few convenience creation functions. Examples of this are make_with_text 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.
|
||||
<code>
|
||||
create a_button.make_with_text ("Click Me")
|
||||
</code>
|
||||
|
||||
This would be in place of
|
||||
<code>
|
||||
create a_button
|
||||
a_button.set_text ("Click Me")
|
||||
</code>
|
||||
|
||||
{{note|Note: When a widget is created no extra initialization has to be performed. '''The only exception is for a window where you have to call show in order for it to be displayed on screen'''. }}
|
||||
|
||||
==Sizing==
|
||||
|
||||
As [[ref:libraries/vision2/reference/ev_primitive_chart|EV_PRIMITIVE]] is of type [[ref:libraries/vision2/reference/ev_widget_chart|EV_WIDGET]] , the following facilities are provided for setting the minimum size: set_minimum_width, set_minimum_height and set_minimum_size.
|
||||
|
||||
The minimum size of a widget is the smallest possible size that it can possibly 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 break 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| '''Note: '''In Vision2, 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 the minimum size that a widget can possibly be in its parent container.
|
||||
* 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 screen.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
[[Property:title|Primitives]]
|
||||
[[Property:weight|0]]
|
||||
All Vision2 primitives inherit [[ref:libraries/vision2/reference/ev_primitive_chart|EV_PRIMITIVE]] .
|
||||
|
||||
==What is a primitive?==
|
||||
A primitive is a Vision2 widget that may not contain other widgets. Primitives may be placed in [[Containers|containers]] , but a [[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]] .
|
||||
==Features of a primitive==
|
||||
|
||||
All primitives inherit from [[ref:libraries/vision2/reference/ev_tooltipable_chart|EV_TOOLTIPABLE]] and therefore can 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 available features, specific to their 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 also the 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.
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user