Thread View: comp.sys.mac.oop.macapp3
1 messages
1 total messages
Started by SIGMUND
Fri, 01 Jan 1993 20:30
TWindow, a problem and a bug
Author: SIGMUND
Date: Fri, 01 Jan 1993 20:30
Date: Fri, 01 Jan 1993 20:30
84 lines
3350 bytes
3350 bytes
From: sigmund@nora.hd.uib.no
To: MACAPP3TECH$@applelink.apple.com
Cc: achiqui@roman.uib.no
Dear MacAppers,
Working with multiple monitors connected has revealed a problem with MacApp
3.0.1 and also what I believe are a couple of bugs.
The problem:
Members of TWindow: Center and Zoom, are two large functions that call
this->GetMaxIntersectedDevice. That means they are hardcoded to be
directed to the device that has the largest area in common with the window.
One of my windows needs to be directed towards the device with a video
board connected, and we can imagine occasions where a window should be
directed to the deepest device, or the main device.
It would be better if there was a "GetPreferredDevice" function that Center
and Zoom would call instead. TWindow::GetPreferredDevice could simply call
GetMaxIntersectedDevice, and subclasses could call something else.
The first bug:
TWindow::Center doesn't work if GetMaxIntersectedDevice returns any other
device than the main screen. As theFrame is calculated, Center only pays
attention to the device's size, not its position. As a result the window
is placed on the main device, in a position where it would have been
centered on the correct device.
The second bug:
TWindow::Center doesn't really trust GetMaxIntersectedDevice to account for
menubar and adds GetMBarHeight to theFrame.top. This compensates for bug
#1 when dealing with the main device, but when bug #1 is corrected, the
window will be placed 20 pixels (at least here in Norway) too low on any
device.
I would suggest the following fix to both bugs in TWindow::Center, where
theFrame.top and theFrame.left are calculated.
Take this:
if (horizontally)
theFrame.left = (screenSize.h - contentSize.h + fContentRegionInset.h)
/ 2;
if (forDialog)
// Put it in the top third of the screen
theFrame.top = ((screenSize.v - contentSize.v + fContentRegionInset.v)
/ 3)
+
GetMBarHeight();
else if (vertically)
theFrame.top = ((screenSize.v - contentSize.v + fContentRegionInset.v)
/ 2)
+
GetMBarHeight();
And change to this:
if (horizontally)
theFrame.left = (screenSize.h - contentSize.h + fContentRegionInset.h)
/ 2
+
screenRect.left;
if (forDialog)
// Put it in the top third of the screen
theFrame.top = (screenSize.v - contentSize.v + fContentRegionInset.v) /
3
+ screenRect.top;
else if (vertically)
theFrame.top = (screenSize.v - contentSize.v + fContentRegionInset.v) /
2
+ screenRect.top;
This works for me, but please correct me if I am wrong or if anybody has a
better solution.
Regards,
Sigmund Tveit
Humanistisk Datasenter
Norway
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads