realbasic-nug
[Top] [All Lists]

RB 5.5.4b1/Jaguar problem with mouse tracking/coords in doc window

To: realbasic-nug at lists dot realsoftware dot com
Subject: RB 5.5.4b1/Jaguar problem with mouse tracking/coords in doc window
From: David Miller <david dot miller at icscolor dot com>
Date: Thu, 30 Sep 2004 12:04:45 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20040930150010 dot E12354A4705 at lists dot realsoftware dot com>
Recently, I discovered that there's an apparent incompatibility that occurs
ONLY when a built app runs under Jaguar. The same built app is fine under
Panther, and also when compiled for Windows and run under XP, 2000, etc.

I have a document window, which is composite, with many controls embedded in
it, to provide a wizard-style UI. I've had some issues with layering things
in the past to get the look I want, but what I have right now had worked
without a hitch (Panther, Windows).

I have an ImageWell (to provide a smoothly-edged background rectangle), which
is the lowest-numbered object in the composite document window. It's control
number is 0.

There are a few other things on top of the ImageWell, that are contained
within, which (of course) have higher object numbers.

There's a rectangle which is gray (1) that's initially sized very small and
tucked off in a corner of the ImageWell. There's a StaticText (3) which is
contained in the ImageWell and which is initially empty (I fill this with
text when I want to display instructions inside the ImageWell); it takes up
most of the ImageWell's area. There's a PagePanel (22) which is also in the
ImageWell and which sits on top of both, sized slightly smaller than the
StaticText so that I'm able to click on any of these layered elements
(ImageWell, StaticText, PagePanel) to select them. The PagePanel itself has
11 pages, which are filled with mixtures of radio button controls, smaller
StaticTexts, checkboxes, etc.

The reason for doing things this way has been to provide a step-by-step
Wizard interface so that the user can click buttons (below the layered
ImageWell area, at the bottom of the screen) and go back and forward through
the Wizard screens. Some of these are simple (just text), others are more
complex (groups of controls, combined with text). I also use the larger
StaticText which is behind the PagePanel to display text screens that are too
large to fit in the PagePanel (when I do this, I temporarily make the PagePanel
invisible. I can also make the PagePanel visible again and the StaticText
invisible; so that the user sees only one or the other of these at a time).

This all works perfectly in Panther/Windows, but here's what happens in
Jaguar:

I have a function which (when a button elsewhere in the UI is clicked) takes
me to the first Wizard screen. It does this by making the large StaticText
contained in the ImageWell invisible; making the PagePanel visible; and
going to the first page. No problems yet. BUT: if (BEFORE I leave this
function), I update a small StaticText that's on page 1 of the PagePanel,
by setting its .text = "", this is what happens:

>From then on, the top left corner of the parent document window's global
coordinates is realigned with the top left corner of the small StaticText
that's on the first page of the PagePanel, which now effectively behaves
as if it's 0, 0 for all subsequent mouse tracking and (futile) click attempts
in the document window. The entire UI is misaligned with respect to the mouse,
and so (naturally) nothing works. Mouse tracking doesn't even take place
when the mouse is in what it thinks is negative territory (to the left, or
above, the small StaticText whose update had triggered this). The mouse also
doesn't track past the physical right/bottom boundaries of the window, so
what I'm left with is misaligned mouse tracking in a smaller, lower-right
corner area of the parent document window. I've found it impossible to fix
this once it's happened, other than to just quit the app and restart.

This ONLY happens when running in Jaguar. Not Panther; not Windows.

If I simply comment out the line of code which sets the small StaticText to ""
in the function that initially sets up the Wizard, then this problem goes away,
and everything works normally after that. I can live with this because there's
other code that sets text into that PagePanel control while the user is
interacting with it; so obviously, the simple act of doing this isn't the
problem; it's WHEN it occurs, and so this must have something to do with
how RB and Jaguar interact with refreshing/etc when I'm in my Wizard setup
function. (Doing this in the function ends up being "bad"; having it happen
while the app is responding to user clicks in PagePanel controls is "good").

Is there a simple way I can keep this from happening? (Are there any known
issues with Jaguar, control layering and refresh that would cause this?
Searching the mailing lists hasn't turned up anything useful). There are
other things in my UI that are having similar problems in Jaguar, so making
a fix in one place isn't enough to solve all of them. The only way for me
to globally "fix" this is to understand the root of the problem, and how to
avoid it.







-- 
David Miller, Principal Software Engineer

Integrated Color Solutions, Inc.
60 Madison Avenue, Suite 1105-06, NY, NY 10010

david dot miller at icscolor dot com

________________________________________________________________________________________
This email is confidential and legally privileged. The correspondence and 
information herein is intended solely for the addressee/s. Access to this email 
or documents attached to this email by anyone else is unauthorized and illegal.

If you are not the intended recipient, any disclosure, distribution, copying or 
any action taken or omitted to be taken in dependence on it, is prohibited and 
unlawful.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>