Tips_gui   >   Icons   >   Icons (All Contents)
Icons
This section covers topics relating to icons in Omnis Studio.
Icons for your Omnis Studio app can be store in several locations:
- #ICONS system class located inside the System Classes folder of each library.
- #ICONS system class in the library specified by the $iconlib library property.
- omnispic.df1 file located inside the icons folder a subfolder of the folder containing the Omnis executable.
- userpic.df1 file located inside the icons folder a subfolder of the folder containing the Omnis executable.
Each icon given an ID number. The icon number must be unique within the location it is stored. It is possible to have the same icon ID in each of the 4 possible locations. In the event of a duplicate ID, Omnis Studio willl use the closest icon in the order of: #ICONS of the current library, #ICONS of the altenate library specified by $iconlib, omnispic.df1, userpic.df1.
Each library has an $iconlib property which allows you to point that library to look at the #ICONS class in a different library. This allows you to have a single repository #ICONS class for all of your libraries, thereby avoiding having to copy (and update) the #ICONS class to every module in your application.
The #ICONS class is the best place for storing your icons. If you have icons which are module specific, store them in the #ICONS class of that module's library. If you have multi-module use icons, store them in your applications startup library, or create a special myicons.lbs library where you store them and set the $iconlib property of your other libraries to myicons. (Replace myicons.lbs with a meaningful library name of your choice.)
Always, always set the library Prefs $defaultname in your myicons library. If you don't set the default name property the library name will change if someone accidentally changes the file name, causing the $iconlib property in other libraries to point to a now non-existent library name.
Icons Editor
To edit icons:
- Double-click a library in the F2 Browser.
- Double-click the System Classes folder.
- Double-click the #ICONS classy. This opens the Icons Editor window.
- If you are working with a new library, there will be no icons in the #ICONS class.
- Click New Icon Page... to start a new pages of icons.
- Enter the Page Name and check the sizes of icons you want to store on the page.
- If you want to be able to have opaque icons, select Solid & Alpha radio button.
If you select Solid and Alpha you really end up with 2 sheets within each page. The one sheet has the solid version icons, the other sheet has the alpha version icons. You switch between the sheets by clicking either of the uppercase A icons on the right side of the Icons Editor window. You can add the Alpha version icons sheet after by clicking the Page Options button and then clicking the Alpha copy of 24 bit button.
- Click the Create button.
- Copy an image to the clipboard. For example, copy a folder or file icon from your Desktop.
- Single-click one of the 20 empty icon picture fields on the top-right area of the Icon Editor window.
- Single-click the 16x16 picture field at the bottom-left of the Icon Editor window.
- Paste the image from the clipboard. It will be sized to fix the 16x16 pixels area.
- Repeat for the 32x32 and 48x48 picture fields if you are creating larger icons as well.
- If you are creating Alpha version icons, click the left uppercase A icon to switch to the Alpha sheet and repeat the above to paste the image from the clipboard to the different size icons.
- Click the Set Icon ID... button on the left side of the Icon Editor window. You will be prompted to enter an ID for the icon.
- To further edit icons, select the icon in the sheet, select the size at the bottom, then click the Edit Icon button.
If you are creating large and small icons, first create and edit the largest icon. After you are satisfied with the largest icon, copy and paste it to the smaller size icons.
Never edit icons in the omnispic.df1 file, your changes will be wiped out by new releases of Omnis Studio.
Transparent Icons
If you want part of a Solid Version icon to be transparent you need to do the following:
- Select the icon's page in the Icon Editor window.
- Make sure the Solid/Alpha A button is set to Solid Version.
- Click the Page Options... button near the bottom of the window.
- Check the Substitute Transparent Color checkbox if it isn't already checked.
- Click the Update Page Settings... button. The change won't take effect until you click this button.
- Click the Edit Icon button to edit the currently selected icon.
- You will notice one of the green colors in the color selector has the letter T in the color. This is the transparent color. Click the transparent color to select it.
- Click the paint can icon near the bottom of the Icon Editor window or another appropriate tool.
- Click any of the areas around the edges of your icon in the icon editor which you want transparent. This pours the transparent color into those areas.
- Click the Update button when you are done.
If you want part of an Alpha Version icon to be opaque or completely transparent.
- Select the icon's page in the Icon Editor window.
- Make sure the Solid/Alpha A button is set to Alpha Version.
- Use the eyedropper tool to select the color you want to make transparent or opaque.
- There is an Alpha slider bar on the right side of the Icon Editor window. Grab the slider handle and drag it to the left. The further left you drag the slider the more transparent the color will turn. If you drag it all the way to the left it will be completely transparent.
- Use the paint can tool or another appropriate tool to paint the opaque or transparent color on the icon.
- Click the Update button when you are done.
You will see the changes to existing icons
after you close the
Icon Editor window.
Multistate Icons
Multistate icons are used for kCheckbox, kRadioButton, and kTreelist fields.
If you watch a kCheckbox field closely you will be able to detect 4 different icons as follows:
- Normal - The checkbox is unchecked.
- Hilited and Unchecked - The cursor is over the unchecked checkbox and the mouse button is down. If you hold the mouse button down and move the cursor away from the checkbox you will notice the checkbox change to the Normal state icon.
- Checked - The checkbox is checked.
- Hilited and Checked - The cursor is over the checked checkbox and the mouse button is down. If you hold the mouse button down and move the cursor away from the checkbox you will notice the checkbox change to the Checked state icon.
Click the Run Demo button in the StudioTips Browser window to test the above checkbox and radio button states.
You can create your own multistate icons in the Icon Editor. The steps are as follows:
- Double-click the #ICONS class in your library's System Classes folder. This opens the Icon Editor.
- Click New Icon Page.... Click the Solid & Alpha radio button, name the page (e.g. Multistate 1) and then click the Create button to create the new page.
- Click the Page Options button.
- Check the Multistate Page checkbox.
- Click the Update Page Settings... button.
- Click the Page Icons... button to return to the icons pane. You should now see headings above the columns of icons. The headings map as follows to the 4 different states of the kCheckbox field described earlier.
- Normal column = Normal state
- Checked column = Checked state
- Hilited column = Hilited and Unchecked state
- N/C column = Hilited and Checked state
- N/C/Gray column - Hilited and Checked and Disabled.
- Click the right blue letter A icon button to switch to Alpha Version icons.
- Proceed with creating your own row of multistate icons.
- Set the icon ID for the Normal state icon. Leave the icon ID as zero (0) for the other columns.