It is currently 21 April 2025, 23:02 Advanced search

Customizing the UI and Widgets

Questions and answers on how to best use Instant Developer

Re: Customizing the UI and Widgets

Postby johntalbott » 9 July 2014, 14:50

g.lanzi wrote:In order to have it works in a generic way you can use the Book's reflection and a proper objects' nomenclature.


This is exactly what I want to do. I understand how to reference an individual object (by name) within a book per your code in the ClinicalStudy.SetSectionsVisibility.

But I can't find anything in the documentation that shows:

1. How to reference a collection of Books, Reports, Sections or Boxes
2. How to identify the box that has focus

Here is the pseudocode for what I'd like to do:

MyBoxCollection = MyReport.MySection.Boxes
IDBox MyBox = New()

For Each MyBox in MyBoxCollection
{

If MyBox.Focus = True
{
MyBox.VisualStyle = ActiveBoxStyle
}
Else
{
MyBox.VisualStyle = NormalBoxStyle
}
}

Can you point me to some documentation or a code example?
johntalbott
 
Posts: 141
Joined: 16 March 2014, 21:33

Re: Customizing the UI and Widgets

Postby johntalbott » 14 July 2014, 20:35

Is it possible to get a response regarding my last post?


Thanks
johntalbott
 
Posts: 141
Joined: 16 March 2014, 21:33

Re: Customizing the UI and Widgets

Postby g.lanzi » 15 July 2014, 6:49

In order to navigate trough the boox structure you can use the Get[object] and Get[Objects]Count method of the various element, something like the lines below:
Code: Select all
// ****************************************
// Describe what this procedure is used for
// ****************************************
public void NewWebApplication.ExampleBookProc()
{
  IDBook idbook = new()
  for (int r = 0; r < idbook.reportCount(); r = r + 1)
  {
    IDReport idr = idbook.getReport(r)
    for (int s = 0; s < idr.sectionCount(); s = s + 1)
    {
      IDSection ids = idr.getSection(s)
      for (int b = 0; b < ids.boxCount(); b = b + 1)
      {
         IDBox idb = ids.getBox(b)
         if (idb.visualStyle == Red)
         {
           // to something
           
         }
      }
    }
  }
}


You can find out all the available methods and properties by taking a look inside the libraries, in the Components libraries -> Book Reflection folder. To resume: yo uhave all the normal methods and properties set of the book objects that you can handle in the designer (http://doc.instantdeveloper.com/eng/?ARTID=B7894CC4-2F58-42F6-A74C-95014034AABF&LANG=eng ) plus the one that you can use when you write code using a book object (http://doc.instantdeveloper.com/eng/?ARTID=79552CD5-9043-A234-9A00-5DBB0BB89C3D&LANG=eng ).
Giuseppe Lanzi
Director of Support services
Pro Gamma S.p.A.
User avatar
g.lanzi
Pro Gamma
Pro Gamma
 
Posts: 3503
Joined: 29 September 2010, 10:24
Location: Bologna

Previous

Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 13 guests