Tips   >   Misc   >   Component Store

Component Store

The F3 Components Store is where you get window and report objects when designing windows and reports.

You can modify the existing classes and design objects in the F3 Component Store, or add your own objects and classes. You can even add your own class group/icon to show up in the Component Store's first level toolbar.

To modify the Component Store you need to get inside of it.

  1. Double-click any window or report class in the F2 Browser.
  2. Press F3 to open the Component Store.
  3. Right-click anywhere on the Component Store > select Show Component Store in Browser.
  4. Press F2 to open the Browser.
  5. Select the Component Library in the F2 Browser.

There are a number of different things you can do with the Component Library. Read the other topics in this section for further instructions.

When you finish making your modifications to the Component Library click the Hide Comps.lbs button in the F2 Browser.

Warning

When a new version of Omnis Studio is released, it's a bit of a hassle saving and moving your previous Component Store to the newer version. Be careful on how much time you invest into customizing the Component Store.

Modifying Existing Components

With the Component Library open in your F2 Browser:

  1. Click on the Name column header a couple times until the _Field Components window class sorts to the top section of the list.
  2. Double-click the _Field Components window class to open it up. You will see all the window field components which you can drag out of the Component Store onto your design window.
  3. Click on any window object. Press F6 to look at/change the object's properties.

You can modify the object's properties to suit your preference. You can double-click on the object and modify it's $event method, add you own $construct method, etc.

You can also duplicate a window object to create two flavours of the same object. The objects are listed in the Component Store in field order, so you should renumber the duplicate component to be next in order to the one you duplicated. That way they'll show up next to each other in the Component Store.

The duplicate object will have the same tooltip name in the Component Store, that is the type of object which it is, so you can only tell them apart by their order in the Component Store.

To test what you've done.

  1. Close the _Field Components window class
  2. Click the Hide Comps.lbs button in the F2 Browser.
  3. Open any window in design mode.
  4. Press F3 to open the Component Store.
  5. Drag and drop the object you modified and confirm that the changes you made now show up in the object you just dragged from the Component Store.

Congratulations you just modified the Component Store to your own preferences! You can do the same thing for _Report Components, etc.

Warning

When a new version of Omnis Studio is released, it's a hassle saving and moving your previous Component Store objects to the newer version. Be careful on how much time you invest into modifying existing objects in the Component Library. I recommend that you add your own components to a separate class. That way you can quickly copy and paste them into a newer version of Omnis Studio when it is released. Uniquely name or describe your classes so they'll sort together in the list.

Adding your own Classes

With the Component Library open in the F2 Browser:

  1. Drag and drop any class from your own library onto the Component Library.
  2. Press F6 to open the Property Manager.
  3. Optionally you can set the $iconcomponent property for your class to some unique icon.
  4. Right-click on the class, select Component Store Type..., set to Template.

To test what you've done.

  1. Click the Hide Comps.lbs button in the F2 Browser.
  2. Select a library and then click the Class Wizard button in the F2 Browser.
  3. Click the respective class which you added as a template to the Component Library.
  4. Click the Templates button in the F2 Browser.
  5. Select the template class which you added, enter the class name near the bottom of the F2 Browser and click the Create button. A copy of the template class will be added to the selected library.

Adding your own Design Objects

To add your own Design objects (window or report objects) to the Component Library.

With the Component Library open in the F2 Browser:

  1. Drag and drop any window class from your own library onto the Component Library, or create a new one in the Component Library and add some window objects to it. A quick way to create your own design components is to right-click on _Field Components in the Components Library and > select Duplicate.
  2. Press F6 to open the Property Manager.
  3. Set the $name property. The name you assign will be the tooltip in the Component Store.
  4. Set the $iconcomponent property for the window class to some unique icon. It will be the icon that shows up in the Component Store's window objects toolbar.
  5. Right-click on the class, select Component Store Type..., set to Design objects.
  6. Set the properties on any of the window objects inside the window class.

To test what you've done.

  1. Click the Hide Comps.lbs button in the F2 Browser.
  2. Open any window in design mode.
  3. Press F3 to open the Component Store. Your icon/name class should be in the Component Store's toolbar. When you click on it, your design objects should be displayed in the Component Store.
Tip

I recommend adding your own design objects vs. modifying existing components. When a newer version of Omnis Studio is released, you simply copy and paste your own field components classes from the Component Library in the older version to the Component Library in the newer version. Doing this is a lot easier than hunting through the _Field Components and _Report Components classes and copy/pasting the individual objects from the older version to the newer version.

Adding your own Group

You can add your own Group to the Component Store, so that it will show up with it's own icon in the Component Store's main toolbar.

With the Component Library open in your F2 Browser:

  1. Add/create a new class in the Component Library. (any class will work)
  2. Right-click on the new class > select Template.
  3. F6 to open the Property Manager.
  4. Select $componenticon and select any icon by clicking on the droplist arrow.
  5. Set the $desc property to something like, My Group/1715~. The word(s) preceeding the / (backslash) will be the group name, the number between the / and ~ is the iconid of the icon which will be displayed in the Component Store toolbar.
  6. Add/create additional classes (must be of the same class type) to include in your group. Set their $desc property to My Group/1715~

To test what you've done.

  1. Click the Hide Comps.lbs button in the F2 Browser.
  2. Open any window in design mode.
  3. By Omnis Studio magic the My Group icon 1715 appears at the end of the Component Store toolbar.
  4. Click on the My Group icon in the toolbar. Your classes should show up in the Component Store with their own icons and tooltip names.

Super Components

If you are using multiple libraries and storing your superclasses in the main library, you will have discovered that creating subclasses of your superclasses in the other libraries is a bit of a pain.

You right-click on the superclass and select Create subclass, and then name it. But then have to drag the subclass to the destination library, change the $superclass property to include the source library name, and then go back to the source library and delete the extra copy.

Supercomponents solves the problem and makes it really easy to create subclasses in any library! All you do is set the $issupercomponent property of the superclass to kTrue.

After you have set the $issupercomponent property to kTrue, you can create a subclass of your supercomponent in any library as follows:

  1. Select the target library or folder for the subclass in the F2 Browser.
  2. Click the Class Wizard button.
  3. Click the type of class you wish to create.
  4. Click the Subclasses button. Omnis Studio will display all of the supercompoent classes it finds in the open libraries.
  5. Select a supercomponent, enter the subclass class name, and click the Create button.

    Omnis Studio creates a subclass of the supercomponent you selected in the target library or folder you selected. Easy, eh?!