mCarbonPane and mBottomRight
mCarbonPane and mBottomRight
- Subject: mCarbonPane and mBottomRight
- From: Marc Poirier <email@hidden>
- Date: Thu, 20 Feb 2003 19:45:03 +0100 (CET)
Hi. I don't like the fact that AUCarbonViewBase::CreateCarbonView resizes
the mCarbonPane control after calling CreateUI. I understand that it is
doing a convenience with the whole mBottomRight thing, but it's annoying
if you actually did SizeControl(mCarbonPane, etc, etc) yourself during
CreateUI to then have it redone at the end of CreateCarbonView.
I have an idea. Instead of doing this:
err = CreateUI (mXOffset, mYOffset);
// we should only resize the control if a subclass has embedded
// controls in this AND this is done with the EmbedControl call below
// if mBottomRight is STILL equal to zero, then that wasn't done
// so don't size the control
if (mBottomRight.h != 0 && mBottomRight.v != 0)
SizeControl(mCarbonPane, short(mBottomRight.h - mXOffset), short(mBottomRight.v - mYOffset));
CreateCarbonView could do this:
SizeControl(mCarbonPane, 0, 0);
err = CreateUI (mXOffset, mYOffset);
// we should only resize the control if a subclass has embedded
// controls in this AND this is done with the EmbedControl call below
// if mBottomRight is STILL equal to zero, then that wasn't done
// so don't size the control
Rect paneBounds;
GetControlBounds(mCarbonPane, &paneBounds);
// only resive mCarbonPane if it has not already been resized during CreateUI
if ( (paneBounds.top == panebounds.bottom) && (paneBounds.left == panebounds.right) )
{
if (mBottomRight.h != 0 && mBottomRight.v != 0)
SizeControl(mCarbonPane, short(mBottomRight.h - mXOffset), short(mBottomRight.v - mYOffset));
}
What do you think? As it is now, I just have to avoid using
AUCarbonViewBase::EmbedControl altogether, which is unfortunate.
Thanks for listening,
Marc
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.