? vcl/.DS_Store ? vcl/aqua/.DS_Store ? vcl/aqua/inc/.DS_Store ? vcl/aqua/inc/salframe.hOLD.h ? vcl/aqua/source/.DS_Store ? vcl/aqua/source/window/.DS_Store ? vcl/aqua/source/window/salframe.cxxOLD.cxx ? vcl/inc/.DS_Store ? vcl/inc/salframe.hxxOLD.hxx ? vcl/source/.DS_Store ? vcl/source/window/.DS_Store ? vcl/source/window/window.cxxOLD.cxx Index: vcl/aqua/inc/salframe.h =================================================================== RCS file: /cvs/gsl/vcl/aqua/inc/salframe.h,v retrieving revision 1.15.112.17 diff -u -r1.15.112.17 salframe.h --- vcl/aqua/inc/salframe.h 30 Dec 2006 19:28:58 -0000 1.15.112.17 +++ vcl/aqua/inc/salframe.h 7 Mar 2007 21:22:00 -0000 @@ -84,7 +84,10 @@ BOOL mbGraphics; // is Graphics used? BOOL mbFullScreen; // is Window in FullScreen? AquaSalInstance* mpSalInstance; - + + BOOL mbDialog; //is the window a dialog? + ThemeBrush mnBackgroundBrush; //brush for the background of the window + public: AquaSalFrame(); Index: vcl/aqua/source/window/salframe.cxx =================================================================== RCS file: /cvs/gsl/vcl/aqua/source/window/salframe.cxx,v retrieving revision 1.46.112.50 diff -u -r1.46.112.50 salframe.cxx --- vcl/aqua/source/window/salframe.cxx 26 Feb 2007 22:23:23 -0000 1.46.112.50 +++ vcl/aqua/source/window/salframe.cxx 7 Mar 2007 21:22:00 -0000 @@ -107,6 +107,8 @@ mnMaxWidth(0), mnMaxHeight(0), mbGraphics(FALSE), + mbDialog(FALSE), + mnBackgroundBrush(0), mpMenu(NULL) { maSysData.nSize = sizeof( SystemEnvData ); @@ -126,6 +128,8 @@ mnMaxWidth(0), mnMaxHeight(0), mbGraphics(FALSE), + mbDialog(FALSE), + mnBackgroundBrush(0), mpSalInstance(pSalInstance), mpMenu(NULL) { @@ -169,10 +173,12 @@ if ( mpGraphics ) delete mpGraphics; - + if (mrWindow) { - HideWindow(mrWindow); + if(mbDialog) HideSheetWindow(mrWindow); + else HideWindow(mrWindow); + DeinstallAndUnregisterAllEventHandler(); ReleaseWindow(mrWindow); } @@ -305,7 +311,8 @@ if(bVisible) { - ShowWindow(mrWindow); + if(mbDialog) ShowSheetWindow(mrWindow, mpParent->mrWindow); + else ShowWindow(mrWindow); if(!bNoActivate) SelectWindow(mrWindow); //ActivateWindow(mrWindow, true); @@ -319,8 +326,10 @@ SetRootMenu(pAquaSalMenu->mrMenuRef); } } - else - HideWindow(mrWindow); + else { + if(mbDialog) HideSheetWindow(mrWindow); + else HideWindow(mrWindow); + } } // ----------------------------------------------------------------------- @@ -439,7 +448,7 @@ void AquaSalFrame::SetPointer( PointerStyle ePointerStyle ) { - fprintf(stderr, ">*>_> %s\n",__func__); + //fprintf(stderr, ">*>_> %s\n",__func__); } // ----------------------------------------------------------------------- @@ -714,6 +723,10 @@ { fprintf(stderr, ">*>_> %s\n",__func__); //TODO: implement + + //if a brush is defined we use it + if(mnBackgroundBrush!=0) + SetThemeWindowBackground (mrWindow, mnBackgroundBrush, true); } SalBitmap* AquaSalFrame::SnapShot() @@ -1605,7 +1618,7 @@ fprintf(stderr, "SAL_FRAME_STYLE_TOOLWINDOW\n"); if (style & SAL_FRAME_STYLE_INTRO) fprintf(stderr, "SAL_FRAME_STYLE_INTRO\n"); - + fprintf(stderr, "%d\n", style); fprintf(stderr, "==============================\n"); } @@ -1656,11 +1669,59 @@ } else nWindowAttributes &= ~(kWindowResizableAttribute | kWindowLiveResizeAttribute | kWindowCollapseBoxAttribute | kWindowFullZoomAttribute); + + + //override previous attributes + if(nSalFrameStyle & SAL_FRAME_STYLE_ALERT) { + //Alert + windowClass =kMovableAlertWindowClass; + nWindowAttributes=kWindowStandardHandlerAttribute; + mnBackgroundBrush=kThemeBrushAlertBackgroundActive; + } + if(nSalFrameStyle & SAL_FRAME_STYLE_SHEET) { + //sheet + windowClass =kSheetWindowClass; + nWindowAttributes=kWindowStandardHandlerAttribute; + SetWindowModality (mrWindow, kWindowModalityNone, pParent); + mbDialog=true; + mnBackgroundBrush=kThemeBrushSheetBackgroundTransparent; + } + if(nSalFrameStyle & SAL_FRAME_STYLE_APP_MODAL) { + //app modal window + windowClass =kMovableModalWindowClass; + nWindowAttributes=kWindowStandardHandlerAttribute; + +// if( nSalFrameStyle & SAL_FRAME_STYLE_CLOSEABLE ) +// nWindowAttributes |= kWindowCloseBoxAttribute; +// else +// nWindowAttributes &= ~kWindowCloseBoxAttribute; + } + if(nSalFrameStyle & SAL_FRAME_STYLE_TOOLWINDOW) { + //toolwindow + windowClass =kUtilityWindowClass; + nWindowAttributes=kWindowStandardHandlerAttribute; + //Closeable + if( nSalFrameStyle & SAL_FRAME_STYLE_CLOSEABLE ) + nWindowAttributes |= kWindowCloseBoxAttribute; + else + nWindowAttributes &= ~kWindowCloseBoxAttribute; + //resizeable + if( nSalFrameStyle & SAL_FRAME_STYLE_SIZEABLE ) + nWindowAttributes |= (kWindowResizableAttribute | kWindowLiveResizeAttribute); + } + } Rect aContentRect; GetOptimalWindowSize(&aContentRect); - + +// if(nSalFrameStyle & SAL_FRAME_STYLE_DIALOG) { +// Rect parentRect; +// GetWindowBounds (pParent, kWindowStructureRgn, &parentRect); +// aContentRect.left=parentRect.right-parentRect.left-(aContentRect.right-aContentRect.left)/2; +// fprintf(stderr, "parentRect.right %d parentRect.left %d\n", parentRect.right, parentRect.left); +// } + // Directly connect the frame with the window in contrast to Win32 where frame and // window will be connected in the WM_CREATE message handler OSStatus rc = CreateNewWindow(windowClass, nWindowAttributes, &aContentRect, &mrWindow); @@ -1668,6 +1729,11 @@ if (rc != noErr) throw runtime_error("System window creation failed"); + if(nSalFrameStyle & SAL_FRAME_STYLE_DIALOG) { + //SetThemeWindowBackground (mrWindow,kThemeBrushSheetBackgroundTransparent, true); +// SetWindowModality (mrWindow, kWindowModalityNone, pParent); + } + UpdateFrameGeometry(); // Store window handle Index: vcl/inc/salframe.hxx =================================================================== RCS file: /cvs/gsl/vcl/inc/salframe.hxx,v retrieving revision 1.30 diff -u -r1.30 salframe.hxx --- vcl/inc/salframe.hxx 1 Nov 2006 15:28:55 -0000 1.30 +++ vcl/inc/salframe.hxx 7 Mar 2007 21:22:00 -0000 @@ -131,6 +131,11 @@ #define SAL_FRAME_STYLE_OWNERDRAWDECORATION ((ULONG)0x00000040) // dialogs #define SAL_FRAME_STYLE_DIALOG ((ULONG)0x00000080) + //other types of dialogs for MacOS X //81 and 82 ??? + #define SAL_FRAME_STYLE_SHEET ((ULONG)0x00000100) + #define SAL_FRAME_STYLE_ALERT ((ULONG)0x00000200) + #define SAL_FRAME_STYLE_APP_MODAL ((ULONG)0x00000400) + // partial fullscreen: fullscreen on one monitor of a multimonitor display #define SAL_FRAME_STYLE_PARTIAL_FULLSCREEN ((ULONG)0x08000000) // system child window Index: vcl/source/window/window.cxx =================================================================== RCS file: /cvs/gsl/vcl/source/window/window.cxx,v retrieving revision 1.248.2.3 diff -u -r1.248.2.3 window.cxx --- vcl/source/window/window.cxx 2 Feb 2007 11:08:40 -0000 1.248.2.3 +++ vcl/source/window/window.cxx 7 Mar 2007 21:22:01 -0000 @@ -825,19 +825,30 @@ if( nStyle & WB_NOSHADOW ) nFrameStyle |= SAL_FRAME_STYLE_NOSHADOW; + nFrameStyle |= SAL_FRAME_STYLE_DIALOG; switch (mpWindowImpl->mnType) { - case WINDOW_DIALOG: - case WINDOW_TABDIALOG: - case WINDOW_MODALDIALOG: - case WINDOW_MODELESSDIALOG: - case WINDOW_MESSBOX: - case WINDOW_INFOBOX: - case WINDOW_WARNINGBOX: - case WINDOW_ERRORBOX: - case WINDOW_QUERYBOX: - nFrameStyle |= SAL_FRAME_STYLE_DIALOG; + case WINDOW_DIALOG: fprintf(stderr, "\t...WINDOW_DIALOG\n"); + case WINDOW_TABDIALOG: fprintf(stderr, "\t...WINDOW_TABDIALOG\n"); + break; + case WINDOW_MODELESSDIALOG: fprintf(stderr, "\t...WINDOW_MODELESSDIALOG\n"); + //nFrameStyle &= ~SAL_FRAME_STYLE_DIALOG; + break; + case WINDOW_MODALDIALOG: fprintf(stderr, "\t...WINDOW_MODALDIALOG\n"); + nFrameStyle |= /*SAL_FRAME_STYLE_SHEET;//*/SAL_FRAME_STYLE_APP_MODAL; + break; + case WINDOW_MESSBOX: fprintf(stderr, "\t...WINDOW_MESSBOX\n"); + case WINDOW_QUERYBOX: fprintf(stderr, "\t...WINDOW_QUERYBOX\n"); + nFrameStyle |= SAL_FRAME_STYLE_SHEET; + break; + case WINDOW_INFOBOX: fprintf(stderr, "\t...WINDOW_INFOBOX\n"); + case WINDOW_WARNINGBOX: fprintf(stderr, "\t...WINDOW_WARNINGBOX\n"); + case WINDOW_ERRORBOX: fprintf(stderr, "\t...WINDOW_ERRORBOX\n"); + nFrameStyle |= SAL_FRAME_STYLE_ALERT; + break; + //nFrameStyle |= SAL_FRAME_STYLE_DIALOG; default: + nFrameStyle &= ~SAL_FRAME_STYLE_DIALOG; break; }