Hopefully I can explain an issue with this upgrade.
A form's design visible property is set as 'normal' , then when it is then run from mdi_child the mdi client area resizes to the top of the monitor showing the form and then sizes back to normal.
If the same form's design visible property is set to hidden, then this issue does not occur.
Very annoying especially on a slower pc (faster PC would be a flash longer that the normal flash issue we are seeing)
It sounds like you are talking about the flicker I mentioned. The reason the flicker occurs is because OI is trying to size the MDICLIENT based on its cached information, and then the Ribbon responds by correcting it. I've tried ways to eliminate this, like setting the official SIZE property, but this doesn't work correctly when called from outside the presentation server. I can't ask Revelation to fix this because MDI is no longer supported by Microsoft or Revelation.
I'll look into an event based approached instead the puts the onus on the developer to reposition all controls when needed.
When you select a menu item where the form’s visible property is set as 'normal' , then when it is then run from mdi_child the mdi client area resizes to the top of the monitor showing the form and then sizes back to normal. On a slow pc the flasher is in slow motion
The non Flasher:
When you select a menu item where the form’s visible property is set as HIDDEN , then when it is then run from mdi_child the form displays with no flash
HardFlash:
When you open a form, say form1, then open another form, says form2, then click on form1 the MDI covers the whole of the ribbon (as below). Then close form 2 and the MDI returns to normal size exposing the ribbon as normal.
Whole new approach. Follow this checklist carefully.
1. You no longer need to subclass the MDICLIENT for this to work, however, you do still need to use the MDISize property. 2. Set the Form's Visible property to Hidden in the Form Designer. 3. To show Maximized, set VISIBLE property to 3 In your CREATE event. 4. To show Normal, set SIZE property to form's current SIZE in your CREATE event. Seems redundant, but it prevents a visual artefact. Example: Set_Property(@Window, "SIZE", Get_Property(@Window, "SIZE"))
This should now avoid flickering and resizing when messing around with MDI children. Of course, if there are still issues, let me know.
----------
For those interested in the challenges under the hood. All OI 10 windows have a single child called the FrameClient. It is the parent of all OI controls, except one: MDICLIENT. In a Frame window, FrameClient and MDICLIENT are siblings. There are technical reasons why MDICLIENT cannot be a child of FrameClient. However, in my tests, I think I've discovered that Revelation is trying to pretend like MDICLIENT is a child of FrameClient such that when you resize FrameClient, it repositions MDICLIENT relative to its own new position. However, MDICLIENT still thinks it's a child of the Window, so when you resize the form or close an MDI child window, it resizes itself relative to the window, not the FrameClient. This is what causes all the flickering: OI is moving the MDICLIENT to a position that obscures the ribbon, and I have to move it back.
If I set the MDICLIENT SIZE property directly, everything works except for when the form is first displayed. This one time, the MDICLIENT is placed relative to the FrameClient, not the window, no matter how hard I tried otherwise. The 4 steps above ensure that the FrameClient is sized where the Ribbon wants it well before the MDICLIENT is sized where the Ribbon wants it. Once those conditions are met, OI seems to be happy and the flickering goes away.
BTW forgot to tell you I am running 10.2.4 (update - tried with 10,2,3 same results) The flashing is fixed. BUT 2 issues that were fixed in v4.2.6.8 have come back.
here is the code change where the ole.MDISIZE was not beeing done (but worked in 4.2.6.8 without it)
if SRP_Is64Bit() then *CtrlId = @Window:".MDICLIENT" * Handle = Get_Property(CtrlId, "HANDLE") * Send_Message(@Window:".OLE_SUBCLASS", "OLE.Subclass", Handle, CtrlId)
Result issue 2: First programatic load of a form "Invoice hours' , close form, mdi now 'normal' (not the statusbar issue) and forms opened from the menu load normal, albeit the mdi is too big.
if i remove the auto run of the invoice_hours form, I still get the blue section at the top and the only way i can get rid of it is to click on the top right restore button, running and closing a form does not do it.
@KevinFournier I sent you an email with the source code that creates the form so that you can check to see if everything is done in the right sequence, even though the code - created by Chris Meyer & Mark Boorman - (so I might be able to answer all questions immediatley) has been running for years. I just wonder why you are not getting the same issue with your testing as I assume your main mdiform would be created similar.
I put back in the Set_Property_only(@Window:".OLE_RIBBON", "OLE.MDISize", Size) bit and gave you the resultant screen shot and a Screenshot of how it looks in OI9 similar to the working OI10 one with version 4.2.6.8
Comments
A form's design visible property is set as 'normal' , then when it is then run from mdi_child the mdi client area resizes to the top of the monitor showing the form and then sizes back to normal.
If the same form's design visible property is set to hidden, then this issue does not occur.
Very annoying especially on a slower pc (faster PC would be a flash longer that the normal flash issue we are seeing)
I'll look into an event based approached instead the puts the onus on the developer to reposition all controls when needed.
The flasher:
When you select a menu item where the form’s visible property is set as 'normal' , then when it is then run from mdi_child the mdi client area resizes to the top of the monitor showing the form and then sizes back to normal.
On a slow pc the flasher is in slow motion
The non Flasher:
When you select a menu item where the form’s visible property is set as HIDDEN , then when it is then run from mdi_child the form displays with no flash
HardFlash:
When you open a form, say form1, then open another form, says form2, then click on form1 the MDI covers the whole of the ribbon (as below). Then close form 2 and the MDI returns to normal size exposing the ribbon as normal.
Whole new approach. Follow this checklist carefully.
1. You no longer need to subclass the MDICLIENT for this to work, however, you do still need to use the MDISize property.
2. Set the Form's Visible property to Hidden in the Form Designer.
3. To show Maximized, set VISIBLE property to 3 In your CREATE event.
4. To show Normal, set SIZE property to form's current SIZE in your CREATE event. Seems redundant, but it prevents a visual artefact. Example: Set_Property(@Window, "SIZE", Get_Property(@Window, "SIZE"))
This should now avoid flickering and resizing when messing around with MDI children. Of course, if there are still issues, let me know.
----------
For those interested in the challenges under the hood. All OI 10 windows have a single child called the FrameClient. It is the parent of all OI controls, except one: MDICLIENT. In a Frame window, FrameClient and MDICLIENT are siblings. There are technical reasons why MDICLIENT cannot be a child of FrameClient. However, in my tests, I think I've discovered that Revelation is trying to pretend like MDICLIENT is a child of FrameClient such that when you resize FrameClient, it repositions MDICLIENT relative to its own new position. However, MDICLIENT still thinks it's a child of the Window, so when you resize the form or close an MDI child window, it resizes itself relative to the window, not the FrameClient. This is what causes all the flickering: OI is moving the MDICLIENT to a position that obscures the ribbon, and I have to move it back.
If I set the MDICLIENT SIZE property directly, everything works except for when the form is first displayed. This one time, the MDICLIENT is placed relative to the FrameClient, not the window, no matter how hard I tried otherwise. The 4 steps above ensure that the FrameClient is sized where the Ribbon wants it well before the MDICLIENT is sized where the Ribbon wants it. Once those conditions are met, OI seems to be happy and the flickering goes away.
Hopefully.
I will test and report back
BTW forgot to tell you I am running 10.2.4 (update - tried with 10,2,3 same results)
The flashing is fixed. BUT 2 issues that were fixed in v4.2.6.8 have come back.
here is the code change where the ole.MDISIZE was not beeing done (but worked in 4.2.6.8 without it)
if SRP_Is64Bit() then
*CtrlId = @Window:".MDICLIENT"
* Handle = Get_Property(CtrlId, "HANDLE")
* Send_Message(@Window:".OLE_SUBCLASS", "OLE.Subclass", Handle, CtrlId)
ClientSize = Get_Property(@Window, "CLIENTSIZE")
StatusBarSize = Get_Property(@Window:".OLE_STATUS", "SIZE")
Size = ""
Size<1> = 0
Size<2> = 0
Size<3> = ClientSize<1>
Size<4> = ClientSize<2> - StatusBarSize<4>
*$debug
Set_Property_only(@Window:".OLE_RIBBON", "OLE.MDISize", Size)
end
Result issue 1:
srp status bar hidden by the MDI
Result issue 2:
First programatic load of a form "Invoice hours' , close form, mdi now 'normal' (not the statusbar issue) and forms opened from the menu load normal, albeit the mdi is too big.
and here is the form:
if i remove the auto run of the invoice_hours form, I still get the blue section at the top and the only way i can get rid of it is to click on the top right restore button, running and closing a form does not do it.
removing this code avoids the blue section bit.
ClientSize = Get_Property(@Window, "CLIENTSIZE")
StatusBarSize = Get_Property(@Window:".OLE_STATUS", "SIZE")
Size = ""
Size<1> = 0
Size<2> = 0
Size<3> = ClientSize<1>
Size<4> = ClientSize<2> - StatusBarSize<4>
Set_Property_only(@Window:".OLE_RIBBON", "OLE.MDISize", Size)
I sent you an email with the source code that creates the form so that you can check to see if everything is done in the right sequence, even though the code - created by Chris Meyer & Mark Boorman - (so I might be able to answer all questions immediatley) has been running for years.
I just wonder why you are not getting the same issue with your testing as I assume your main mdiform would be created similar.
I put back in the Set_Property_only(@Window:".OLE_RIBBON", "OLE.MDISize", Size) bit and gave you the resultant screen shot and a Screenshot of how it looks in OI9 similar to the working OI10 one with version 4.2.6.8