Did you changed the behavior of Component::addToDesktop()?
I'm using it in my code since I want to use native window title bar. Following is the part of my code that works correctly in JUCE 1.23. But in JUCE 1.24, they are shown as a two different window. I'm passing an ResizableWindow for the child component of my native window.
- Code: Select all
//------------------------------------------------------------------------------
// KfcWindowAttrToMacWindowAttr
// Last modified 2005/12/02
//------------------------------------------------------------------------------
static WindowAttributes KfcWindowAttrToMacWindowAttr(unsigned int iAttr)
{
WindowAttributes iMacAttr = kWindowStandardHandlerAttribute;
//iMacAttr |= kWindowMetalAttribute; // Metal!
if (iAttr & kKfcWindowAttrCloseBox) iMacAttr |= kWindowCloseBoxAttribute;
if (iAttr & kKfcWindowAttrHorizontalZoom) iMacAttr |= kWindowHorizontalZoomAttribute;
if (iAttr & kKfcWindowAttrVerticalZoom) iMacAttr |= kWindowVerticalZoomAttribute;
if (iAttr & kKfcWindowAttrCollapseBox) iMacAttr |= kWindowCollapseBoxAttribute;
if (iAttr & kKfcWindowAttrResizable) iMacAttr |= kWindowResizableAttribute;
if (iAttr & kKfcWindowAttrSideTitlebar) iMacAttr |= kWindowSideTitlebarAttribute;
if (iAttr & kKfcWindowAttrNoUpdates) iMacAttr |= kWindowNoUpdatesAttribute;
if (iAttr & kKfcWindowAttrNoActivates) iMacAttr |= kWindowNoActivatesAttribute;
if (iAttr & kKfcWindowAttrOpaqueForEvents) iMacAttr |= kWindowOpaqueForEventsAttribute;
if (iAttr & kKfcWindowAttrNoShadow) iMacAttr |= kWindowNoShadowAttribute;
if (iAttr & kKfcWindowAttrHideOnSuspend) iMacAttr |= kWindowHideOnSuspendAttribute;
if (iAttr & kKfcWindowAttrStandardHandler) iMacAttr |= kWindowStandardHandlerAttribute;
if (iAttr & kKfcWindowAttrHideOnFullScreen) iMacAttr |= kWindowHideOnFullScreenAttribute;
if (iAttr & kKfcWindowAttrInWindowMenu) iMacAttr |= kWindowInWindowMenuAttribute;
if (iAttr & kKfcWindowAttrLiveResize) iMacAttr |= kWindowLiveResizeAttribute;
return iMacAttr;
}
bool CKfcNativeWindow::Create(const String& sName, int iX, int iY, int iWidth, int iHeight, int iAttr, CKfcMenuBar* pMenuBar, CKfcNativeWindow* pParent)
{
bool bRet = false;
OSStatus iErr;
Rect mMacRect;
WindowAttributes iMacAttr;
WindowRef pMacWindow;
int iMacMBarHeight = ::GetMBarHeight();
int iMacWindowTitleHeight = 22; // wow, don't specify it...
mMacRect.left = iX;
mMacRect.top = iMacMBarHeight + iMacWindowTitleHeight + iY;
mMacRect.right = iX + iWidth;
mMacRect.bottom = iY + iHeight;
iMacAttr = KfcWindowAttrToMacWindowAttr(iAttr);
iErr = ::CreateNewWindow(kDocumentWindowClass, iMacAttr, &mMacRect, &pMacWindow);
if ((pMacWindow) && (iErr == noErr)) {
SetNativeHandle(pMacWindow);
InstallEventHandler(this, pMacWindow);
GetChildComponent()->addToDesktop(0, pMacWindow);
GetChildComponent()->setBounds(iX, iY, iWidth, iHeight);
CFStringRef pCFStrCaption = PlatformUtilities::juceStringToCFString(sName);
if (pCFStrCaption) {
::SetWindowTitleWithCFString(pMacWindow, pCFStrCaption);
::CFRelease(pCFStrCaption);
bRet = true;
}
}
return bRet;
}


