Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

OI9.4 - Positioning of form bottom right corner, if 2 different ribbon applications open.

An issue that I can now duplicate in OI9 (Have not tried OI10)

Open application DCT - launch app - run form from ribbon control - form displays then centers (create event calls a center window routine) - close form.

Whilst DCT app and menu still running:

Open application PBC - launch app - run form from ribbon control - form displays then centers (create event calls a center window routine) - close form and close ribbon , just leaves the OI IDE form (original one)



switch to the DCT ribbon menu and run the same form:


Comments

  • edited December 2023
    ....closed PBC now only DCT running.

    all forms behave the same (ones that dont call center-window are off further right and lower)

    exit completely out of DCT then back in - all working.
  • dont seem to be able to duplicate in OI10.2.1

    btw here is our version info:


  • I'm struggling to reproduce this. If I launch two different applications, I can't seem to make one application interfere with the other. When the form appears too low, does a vertical scrollbar appear on the MDICLIENT?
  • does a vertical scrollbar appear on the MDICLIENT?

    No it doesnt.

    I also need a few goes to reproduce it.
    Anyway, at lease I know the cause.
    No user has ever said they encountered it as there would be no reason to have app open twice... then again!!!

    This would occur for us when do dev work for multiple apps.

    If you cant reproduce it, must be caused by something we are doing in our 'pre load housekeeping'. (as per the status bar issue also)

    Thanks for your time.
  • I have had similar occurences in the past in OI 9.4.

    I am sure Kevin fixed something similar (but maybe not the same) to this in his 4.2.x releases before we broke him with 4.2.2.6.

    So side question for @KevinFournier, all those 'layout fixes' you did for the Ribbon Control post initial release of 4.2 before The Great Reversion of 4.2.2.7, would they all be gone or do you suppose that a proper use of LayoutChildControl (which I am not sure I have done yet) would negate the need for them?
  • Indeed, getting the Ribbon to play nice with OI has been quite the journey.

    I tested applications that use LayoutChildControl, which could explain the disparity, but if that's the case, it only proves that you should be using this method if you are not yet doing so. It's the only solution I've found to get pixel perfect placement of controls.
  • Thinking of migration issues:
    If we were to change OI9 to use this method, then the app was migrated to OI10 still using this method, would that cause a problem.
  • It wouldn't break anything. LayoutChildControl does nothing in OI 10 because OI 10 will position the control where we want them... all except for the MDI client control. In OI 10, you have to use the MDISize property to position that control specifically.
  • @KevinFourniew, I was wondering if I could get your opinion on 2 things then.

    1. I started to write a whole version check wrapper around LayoutChildControl so the code would only get triggered for the right versions of the Control (4.2.2.7 or greater). I pulled that back when one of our clients fell over becaus etheir MS APIs are messed up so the Version checking in the SRP Utilities blew up ( we talked about this on another forum post.). You noted the code would be safe to leave in a OI10 converted instance as it would be ignored. Is it safe to have on a OI9 instance that doesn't have a version of the Controls registered to support it?

    2.I am putting my LayoutChildControl code at the end of the Create Event of a localised FW_Main. Reasonable or is there a better place?
  • 1. When you call an OLE method that doesn't exist, nothing happens, other than wasting a bit of CPU time. OI ignores the call.
    2. That is pretty much where we do it in FrameWorks, a few lines before we make the frame visible.
  • Thanks @ KevinFournier for confirming my expectations on both questions.

  • So I have moved my code up a touch based on your note (I had it last thing in the create previously). It is definately better. The LayoutChildControl alleviated most of the issues I was having. What I still get is the symptom similar to what Barry noted, Positioning of form bottom right corner. To be more specific:

    We center our windows on launch via a localised Promoted_CREATE_EVENTS
    SRP_Show_Window(@Window, '', 'C', 'C', True$, '', False$, False$)

    If I open a Form it opens center (or centre for my Australian brothers and sisters). Go off and do some business.
    Minimize the entire OI Application to check emails etc. and then when I maximize again the botom statusbar is gone and when I open a form it is bottom right corner. It is almost like now it thinks the frame is like 8K x 8K!

    I thought I discussed this previously, maybe in the pre 4.2.2.7 days but cant find a mention on the forum. Maybe it was in a email with Don that I also can't find or maybe I am just imagining it.
  • I still can't get the MDIClient to resize in my tests. There must be some other variables to consider. Is this native Windows or a Citrix? What is the DPI set to? Multiple monitors? Getting a copy of OPTO might speed things up as well. If you want to email me a download link with some instructions to recreate, I'd love to get this fixed for you.
  • Thanks @KevinFournier.
    It is Windows . Normally accessed via RDP but I can also replicate it via a mapped drive from my local PC.

    I do have multiple monitors (4 technically) but I am only using 1 (the 'default' screen) and not moving between screens while testing.
    Res is 3440 x 1440. Scaling is 100%

    It might also be worth noting our Frameworks is only V16.0.16 . OI is 9.4.6 and all other SRP tools are the latest I can get my hands on.

    I will organize a link for you since you are willing to have a look :)
  • Fixed in 4.2.3.2. The issue is that the frame window receives a WM_CLOSE message for some reason when the form is launched. Not sure why, but I had logic in there to release control of all controls that were passed to LayoutChildControl, giving size control back to OI. OI is then sizing things based on an older cached state that is no longer accurate, causing things to be sized much too large. I moved the aforementioned logic out of WM_CLOSE and put it elsewhere. I'd be interested in knowing if this fixes Barry's issue as well.
  • Thanks Kevin. Fixed our issue.
    Nice early Christmas present.

    Merry Christmas everyone!


  • The form positioning to bottom right in mdi was fixed iv oi9 v4.2.1.10.
    The latest srpControls install appears to not now include that fix, so had to go back to the working version.
  • @BarryStevens
    With the latest Controls, I had to add some code (as per Kevin's notes) to a localised version of the FW_MAIN_EVENTS Create (right before the frame is set to Visible) to use Kevin's new LayoutChildControl method for the Ribbon Control.


    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! WS. 14/12/23. This Code is to fix the Child Frame with SRP Ribbon Controls v4.2.2.7 and later in OI9. ! It is not needed for OI 10 (see MDISIZE). // Set the desired position of the status bar during CREATE event. It should take care of itself after that StatusSize = Get_Property(@Window:".OLE_FRAME_STATUS", "ORIG_SIZE") Left = "0" ; // Anchor left to client left Top = -StatusSize<4> ; // Use control's original height to determine anchor from bottom Right = "-0" ; // Anchor right zero pixels from client right Bottom = "-0" ; // Anchor bottom zero pixels from client bottom Handle = Get_Property(@Window:".OLE_FRAME_STATUS", "HANDLE") Send_Message(@Window:".OLE_RIBBON", "OLE.LayoutChildControl", Handle, Left:@FM:Top:@FM:Right:@FM:Bottom) // Adjust the MDI client, taking the status bar into account Left = "0" ; // Anchor left to client left Top = "0" ; // Anchor top to pixel just beneath the ribbon bar Right = "-0" ; // Negative Zero means Zero pixels from the right Bottom = -StatusSize<4> ; // Anchor bottom to be just above the status bar Handle = Get_Property(@Window:".MDICLIENT", "HANDLE") Send_Message(@Window:".OLE_RIBBON", "OLE.LayoutChildControl", Handle, Left:@FM:Top:@FM:Right:@FM:Bottom) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Sign In or Register to comment.