Hi All,
I updated the TWindow class to support the kEventWindowBoundsChanging
carbon event. The changes will call the GetDynamicResizeLimits or
GetDynamicMoveBounds methods as appropriate to constrain the window
bounds changes.
The relevant code changes are included below.
Steve
Index: macapp.16/MacApp/Libraries/Framework/UWindow.cpp
===================================================================
RCS file: /home1/frmwrks/clubmacapp/cvs/macapp.16/MacApp/Libraries/
Framework/UWindow.cpp,v
retrieving revision 1.7
diff -r1.7 UWindow.cpp
7a8
> 08/27/04 SPG Added support for kEventWindowBoundsChanging carbon event.
656,658c657,659
< // We can't tell if any changing will be required so we just the
fMustxxx these false here. If
< // the developer sets them true then we respect them or if the
developer calls the
< // corresponding functions we set them.
---
> fMoveBounds(CRect_AC::kZeroRect),
> fResizeLimits(CRect_AC::kZeroRect),
>
670c671
< //fIsActive(false),
---
> // fIsActive(false),
682a684,686
> // We can't tell if any changing will be required so we just the
fMustxxx these false here.
> // If the developer sets them true then we respect them or if the
developer calls the
> // corresponding functions we set them.
760a765,767
> fMoveBounds(inWindow.fMoveBounds),
> fResizeLimits(inWindow.fResizeLimits),
>
773c780
< //fIsActive(inWindow.fIsActive),
---
> // fIsActive(inWindow.fIsActive),
4183a4191
> { kEventClassWindow, kEventWindowBoundsChanging },
4441a4450,4473
> break;
>
> case kEventWindowBoundsChanging:
> {
> CWindowBoundsChangingEvent_AC changingEvent(event);
>
> UInt32 attr = changingEvent.GetAttributes();
> CRect_AC curBounds = changingEvent.GetCurrentBounds();
> CRect_AC prevBounds = changingEvent.GetPreviousBounds();
>
> CRect_AC newBounds = curBounds;
>
> if (attr & kWindowBoundsChangeUserResize) {
> CRect_AC resizeBounds = GetDynamicResizeLimits();
> if (!resizeBounds.Contains(curBounds))
> newBounds = prevBounds;
> } else if (attr & kWindowBoundsChangeUserDrag) {
> CRect_AC moveBounds = GetDynamicMoveBounds();
> if (!moveBounds.Contains(curBounds))
> newBounds = prevBounds;
> }
>
> changingEvent.SetCurrentBounds(newBounds);
> }
Index: macapp.16/MacApp/Libraries/Framework/UWindow.h
===================================================================
RCS file: /home1/frmwrks/clubmacapp/cvs/macapp.16/MacApp/Libraries/
Framework/UWindow.h,v
retrieving revision 1.3
diff -r1.3 UWindow.h
5a6
> 08/27/04 SPG Added get/set accessors for move bounds rect.
717a719
> CRect_AC GetMoveBounds() const { return fMoveBounds; }
739a742
> void SetMoveBounds(const CRect_AC& inMoveBounds) { fMoveBounds =
inMoveBounds; }
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macapp-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden