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:
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
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.
btw here is our version info:
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 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?
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.
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.
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?
2. That is pretty much where we do it in FrameWorks, a few lines before we make the frame visible.
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.
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 :)
Nice early Christmas present.
Merry Christmas everyone!
The latest srpControls install appears to not now include that fix, so had to go back to the working version.
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) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!