Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 09 OCT 2012 03:48:04PM Jim Vaughan wrote:

I reported this a while back, I think on one of the beta forums as I can find no reference to it on here.

If am using an OI window that has an mdi frame. If I extend that Window over two monitors then the mdi frame is not sized to cover both monitors. It looks like it's fixed at the size of the monitor on which the window was opened.

Any fixes or solutions?

Jim R Vaughan

www.waterloo-software.com


At 09 OCT 2012 05:22PM carl pates wrote:

Hi Jim,

Currently it appears that the MDI client area size is limited by the dimensions of the primary monitor - I don't know of a workaround you can use.

Carl Pates

Sprezzatura

The Sprezzatura Blog

World leaders in all things RevSoft


At 09 OCT 2012 05:29PM Jim Vaughan wrote:

Yeah that's what I suspected. Maybe I need to rewrite the app not to use mdi.

Jim R Vaughan

www.waterloo-software.com


At 09 OCT 2012 07:00PM Jim Vaughan wrote:

The customer just asked me is this fixable, what should tell him?

Jim R Vaughan

www.waterloo-software.com


At 10 OCT 2012 01:15PM Andrew McAuley wrote:

With money, anything is fixable? ;).

The Sprezzatura Group

The Sprezzatura Blog

World leaders in all things RevSoft


At 10 OCT 2012 04:28PM Jim Vaughan wrote:

This fixes the problem on my machine.

EQU SizeDiff To 28

* get mdiframe size

MdiSize = Get_Property("MAIN_TACTIC.MDICLIENT", "SIZE")

* get main window size

MainSize = Get_Property("MAIN_TACTIC", "SIZE")

* if difference is not 28, resize. Note I calculated 28 using my Windows installation.

If MainSize<3> - MdiSize<3> # SizeDiff Then

MdiSize<3> = MainSize<3> - SizeDiff
Call Set_Property("MAIN_TACTIC.MDICLIENT", "SIZE", MdiSize)

End

But SizeDiff probably varies from OS to OS and Theme to Theme. Anyone have any ideas how to calculate SizeDiff?

Jim R Vaughan

www.waterloo-software.com


At 10 OCT 2012 04:56PM Carl Pates wrote:

Jim,

Using the window SIZE property includes the non-client area in your calculations. If you use the CLIENTSIZE property instead you'll take that out of the equation so you won't be at the mercy of visual styling.

i.e. what you could do is calculate the distance of the mdiclient right edge from the right edge of the window's client area at startup and store it - then in your size even recalculate and if there's a difference adjust the mdiclient size.

Carl Pates

Sprezzatura

The Sprezzatura Blog

World leaders in all things RevSoft


At 10 OCT 2012 04:51PM Jim Vaughan wrote:

Ah ha. OK let me give that a go.

Jim R Vaughan

www.waterloo-software.com


At 10 OCT 2012 05:01PM Jim Vaughan wrote:

OK that works. BTW I had just figured out how to calculate the value

* size of (window frame x 2) + (6*2) always have a six pizel border between mdi frame and edge of main window

SizeDiff = (GetSystemMetrics(SM_CXSIZEFRAME$) *2) + 12

but by using CLIENTSIZE it's not needed. The following works

Declare Function Get_Property

MdiSize = Get_Property("MAIN_TACTIC.MDICLIENT", "SIZE")

MainClientSize = Get_Property("MAIN_TACTIC", "CLIENTSIZE")

* 6 pixels between edge of mdiframe and main window edge

If MainClientSize<1> - MdiSize<3> # 12 Then

MdiSize<3> = MainClientSize<1> - 12

Call Set_Property("MAIN_TACTIC.MDICLIENT", "SIZE", MdiSize)

End

Jim R Vaughan

www.waterloo-software.com


At 10 OCT 2012 08:17PM Jim Vaughan wrote:

Everything is now working, Yeah!!! My customer is going to think I am a genius (most of customers think programming is like magic).

Thanks guys (Carl especially) your help as always is very much appreciated.

Jim R Vaughan

www.waterloo-software.com


At 12 OCT 2012 11:13PM Martin Drenovac wrote:

Jim - great article

what / where is GetSystemMetrics from?

Cheers


At 13 OCT 2012 11:37AM Carl Pates wrote:

Martin,

GetSystemMetrics is a Windows API function. It is documented here

Carl Pates

Sprezzatura

The Sprezzatura Blog

World leaders in all things RevSoft

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/9b3a95bbca0046969dbee5cc4.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1