Use Dynamic Icons
You can replace the icons displayed on label widgets during a dialog box life time depending on rules.
-
From the Compass, click
3D Modeling
Apps
,
and select
Know-how Apps User Experience.
The Know-how Apps Component opens. Click OK.
- Switch to the Design layout tab to create a dialog box containing an area and two radio buttons. To find out more, see Creating a Knowledgeware Dialog Box.
- Add a label called myStaticLabel next to the first radio button, and set it with a static icon in .bmp format but without the .bmp extension in the Properties tab.
-
Add a label
myDynamicLabel next to the second radio
button, click the
Properties tab and set
Is dynamic to
True. Enter the icon name in the
Dynamic field.
The icons must be stored in the Icons\normal folder.
- Click the Events tab, and expand the RadioButton1 node if need be.
-
Double-click the line located below the
RadioButton1 line.
The DialogBox 1 Action definition for modified event appears.
-
Select
On Modified in the Knowledge action
scrolling list and click
OK.
The Action editor appears.
- Define an action that adapts the icon to the radio buttons events. To do so, enter the following script:
-
Enter the following script and click
OK when done.
if (Frame1\RadioButton1\checked == true) Frame1\myDynamicLabel\DynIconName = "Icon_Name1" else Frame1\myDynamicLabel\DynIconName = "Icon_Name2"
- Expose the app.
-
Integrate the dialog box into an action bar. To do so:
- Click the app in the tree.
-
Click
Create Section in Action Bar
.
- Enter its title and click OK.
-
Click
Create Custom Command
.
The Edit starter definition dialog box is displayed. - Select DialogBox1 in the Definition identifier scrolling list. Click OK.
- Save your work.
- Click 3D Modeling Apps , and selectYour_App to start the app.
-
Click the command and click the radio buttons.
The icons change.Note: The icons used for the dynamic icon must be inserted into the resource container using Import Files into Folder
. This way, the dialog box will be deployed easily.