Confusion & Wisdom


oi10tab1
This again is going to be more of a memory for me, but it will still be useful for those of you working with the OpenInsight (OI) 10 Alpha.  I’m a back to working on an application for one of our Value Added Resellers (VAR) and I’ve been trying to build a dynamic toolbar because the system is mostly operated by touch screen operators.

The current menu is three levels deep and the toolbar is limited in space.  I therefore wanted to have a double toolbar with one row of static buttons and a row below which would change depending on which top level button (menu item) is clicked.  The obvious way to achieve this is a panel with a row of buttons and a tab control.

Now the Tab Control in OI 10 is located under the Containers sub category in the Toolbox.  I therefore thought “Great, I’ll drop the buttons on the tab and all will be good.”  However, the current Tab Control has been specifically designed to operate like the current OI9 Tab Control.  This uses paging Forms and you simply drop the controls on the appropriate page, rather than the tab control.  Dropping them onto the Tab Control is actually impossible because it jumps to page one all of the time.  Nevertheless, thinking that the tab control was an intelligent container, I blindly pressed on, getting myself into a state of confusion.

Five minutes later and Carl put me right.  He explained that the current Tab Control has been written to work exactly like the current one so that people’s upgraded applications will not break – that’s the Wisdom and I really glad that Revelation are thinking about supporting existing application, rather than blindly building new controls for new applications.

All I needed to do was:

  1. Drop the tab control on my form and make it shallow so that only the buttons show.
  2. Drop the buttons (or whatever controls) onto the appropriate pages and where I need them to show on the tab control.
  3. Then the bit I was missing.  The buttons will most likely display under the tab control.  So, click on the button, right mouse click and choose ‘Bring to Front’.
  4. Finally, slide the Tab Control over the buttons to contain them – or give the appearance to contain them.
  5. Add the usual tab control code used in OI9 and you are done.

So, what about a brand new tab control that works as a container and that has pagination, or whatever?  Well, don’t hold your breath, but watch this space.

A few minutes later and I have my working dynamic toolbar.  Now I just need to add some glyph images, some code to launch the associated forms and I’m done :D.

 

Advertisements

Running two instances of OI10


OK, so this posting is more as a reminder for me going forward than anything else.  Last weekend I was working with the OI10 Alpha and I wanted to copy things from one instance of OI10 to another. However, I was blocked because I was only permitted to use one engine and it was being used by the first instance of OI.  I thought that this might have been a restriction but I reported it anyway.

It turns out that this is another setting in the new .rxi file that is used by OpenInsight when first launched.  I have a couple of .rxi files on my system, so the first challenge was to work out which one I needed to change.  This is pretty easy to work out, you just follow these rules:

  1. If the RX switch is used in the shortcut, you’ll use that .rxi file.
  2. If none is defined then OI10 will look for a .rxi file with the same name as the application that you are loading with the /AP switch.
  3. If there is no application defined using the /AP switch, then Oi10 assumes SYSPROG and it’ll use that .rxi file.

So, after a quick check, I’m using SYSPROG, or the SYSPROG.rxi file in my bin32 folder under the OI installation.

I initially guessed that my issue was the <singleInstance> entry which was set to 1, but Carl quickly put me straight and told me that heading will shortly be changed.  In the meantime, he’s told me to look at the <serverName> entry in my .rxi file.  Because I have a serverName set, I am effectively trying to use the same engine as the first instance and Oi behaves correctly and stops the session.  All I need to do is clear the entry by setting it to nothing and then OI will launch as many instances as my license count permits.

Starting OI10 is fully documented in the ‘OpenInsight 10 Presentation Server Object Model’ documentation.  This is a work in progress document that is already into 272 pages but today has been yet another reminder of the numerous options that the guys are exposing to developers when launching OpenInsight.

Consider the .rxi file as a more powerful OInsight.ini file and you won’t go far wrong.  Just don’t do what I did and blindly dive in.  Please take some time to better understand the .rxi files as noted on Carl’s OI10 blog and also in the paperwork when eventually published and released.

For now, I’ll be back into my OI10 Alpha project later today for more learning.

 

 

TRACKINGSIZE


This one is more of a reminder to myself for when I take another look at my CRM system interface in a few weeks time but whilst working on a clients interface (a personal project), I needed to set the size of my MDIChild windows.

I’d set the option to Window’s ‘Frame’ option to ‘Thin’ and it displays just fine in test mode when the window runs on its own.  However, Windows overrides this when it is run as an MDIChild window and the frame becomes thick and the window is therefore sizeable.

I search around for a solution but needed the help of our resident OI Guru (thanks Carl) to point me in the right direction.  The cursor still displays with the arrows over the frame but I’ll look at that later.  For now, the code below (lifted straight form the OI help files) sorts me out just fine.

*/ -----------------------------------------------------------------------------
*/ 16/09/2016 - MDP
*/ Set the frame to not allow the users to change the size

    CurSize = Get_Property(@Window, "SIZE")

    MinW = CurSize<3>
    MinH = CurSize<4>
    MaxW = CurSize<3>
    MaxH = CurSize<4>

    x = Set_Property(@Window,"TRACKINGSIZE",MinW:@FM:MinH:@FM:MaxW:@FM:MaxH)

*/ -----------------------------------------------------------------------------

RETURN 0