|
ILOG Views Controls
In Step 2, we will see how ILOG Views Studio manages multipanel applications with the Application concept.
First press the Classes button 
The bottom part of the main window now looks like this:
This part of the window will let you manage all the panels of your application. Our application will include the two panels previously created (main panel and second panel). Note that the Classes subwindow is dockable, so you can remove it from the Studio main window or move it to another place.
To add a panel in the application, go to the Classes subwindow and click the New Panel Class button. 
This will add the currently edited panel to the panel list. Now switch to the second panel window to make it active and press the same button again. You should now have both panels in the Classes subwindow:
As a result of all these operations, you will find an application-class instance in the generated code (an IlvApplication instance), which will manage all the application panels. For each panel, you will have a class-generated named with the panel name. One panel from each class will be created during the application initialization. The Classes subwindow illustrates class organization, which is the application that creates the panels.
Now we should customize panel initialization by specifying initial panel positions and visibility. Remember that in our example, we don't want the second panel to be visible when our application starts. It will appear when the user clicks the Open button of the main panel.
Drag the panel icons into ILOG Studio's Application window. When you drop an icon into the window, the panel should appear, showing how it will appear on the screen when our application is started. After dragging and dropping both panels, and you should see this:
To set the visibility of the second panel, click on its window border. The Inspector panel appears and lets you change panel properties:
-
Name: Used by ILOG Views API, so you may change it.
-
Class: Name of the panel class in the generated code (the name you used to save the panel ILV file).
-
User class: Used when you define a panel-derived subclass. We will see this later.
-
Title: Title of the panel which appears in the window border.
-
Destroy Callback: Panel behavior when the Close button of the window is pressed (Hide hides the window, and Exit stops the whole application).
-
Visible: You can specify whether you want the panel to be visible when created. In our example, we don't want the second panel to be visible on startup.
You can now edit the main panel so that the application ends if the user presses the Close button. To do so, open the panel inspector and modify the Destroy Callback (select the Exit option). Since the application window is active in ILOG Studio, you may press the Test button to test the whole application. If you press this button you should only see the main panel, because the second panel has been defined as invisible on startup.
All the application settings can be saved in a file. When the application window is active, use the Save command to save your application settings in an IVA file (application description file). This file is only intended for use with ILOG Studio. If you have to restart ILOG Studio to edit your interface design, you only need to open this IVA application file; it will automatically open the panel files (ILV files).
Our two-panel application is now ready for code generation.
|