ComponentOne Query 8.0
Tutorial 7 - Customizing the User Interface with Scripts

In this tutorial, you will learn how to customize C1QueryFrame user interface even further. Using C1QRender script, you can change the display layout completely. In this tutorial we will write a script making a query look as a formula with parentheses instead of the default row outline. User interaction with such query remains fully functional although its layout is completely changed.

  1. Repeat steps 1–8 of Tutorial 2 - Using C1Query Schema Designer, or just copy the Tutorial 2 project to a new location. Schema and code are not important for this tutorial. All we want to show here is how to customize user interface with a script. You can do it with any project containing a C1QueryFrame control. We suggest the one from Tutorial 2, but that does not really matter.

  2. Set the ManualRender property of the C1QueryFrame1 control to True, to enable C1QRender script. See Script attribute: RenderScript for details about defining display layout through scripting.

  3. Press the right mouse button over the C1QueryFrame1 control and select Load Templates from the context menu. Select the TEMPLATE.TPL file supplied in the tutorial directory.

Run the Program and Observe the Following:

Now, this is a really new look and feel! Add some conditions (pressing the right mouse button invokes the control’s menu) and you will see that they now look like parts of a formula, with parentheses and logical operations:

Try editing constant values, applying queries, and so on. You see that the control’s functionality did not change although it now has a completely different display layout.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback