From e0f43372fdc59f1d419654656723e34146c02121 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 2 Mar 2006 20:09:02 +0000 Subject: [PATCH] add 'no-sheet dialog style svn: r2347 --- collects/mred/private/mrtop.ss | 6 ++++-- src/mred/wxs/wxs_panl.cxx | 10 +++++++++- src/mred/wxs/wxs_panl.xc | 5 +++++ src/wxmac/include/base/common.h | 2 +- src/wxmac/src/mac/wx_frame.cc | 3 ++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/collects/mred/private/mrtop.ss b/collects/mred/private/mrtop.ss index 0125da8011..8a8d420579 100644 --- a/collects/mred/private/mrtop.ss +++ b/collects/mred/private/mrtop.ss @@ -137,7 +137,9 @@ (check-dimension cwho height) (check-init-pos-integer cwho x) (check-init-pos-integer cwho y) - (check-style cwho #f '(no-resize-border no-caption no-system-menu mdi-parent mdi-child toolbar-button hide-menu-bar float metal) + (check-style cwho #f '(no-resize-border no-caption no-system-menu + mdi-parent mdi-child + toolbar-button hide-menu-bar float metal) style) (when (memq 'mdi-child style) (when (memq 'mdi-parent style) @@ -212,7 +214,7 @@ (check-label-string cwho label) (check-top-level-parent/false cwho parent) (for-each (lambda (x) (check-dimension cwho x)) (list width height x y)) - (check-style cwho #f '(no-caption resize-border) style))) + (check-style cwho #f '(no-caption resize-border no-sheet) style))) (rename [super-on-subwindow-char on-subwindow-char]) (private-field [wx #f]) (override diff --git a/src/mred/wxs/wxs_panl.cxx b/src/mred/wxs/wxs_panl.cxx index bc931529ed..b2d3d1fbdf 100644 --- a/src/mred/wxs/wxs_panl.cxx +++ b/src/mred/wxs/wxs_panl.cxx @@ -1022,8 +1022,13 @@ static void dialogMenu(wxDialogBox *XTMAC_UNUSED(d)) #endif } +#ifndef wxNOT_AS_SHEET +# define wxNOT_AS_SHEET 0 +#endif + static Scheme_Object *dialogStyle_wxNO_CAPTION_sym = NULL; static Scheme_Object *dialogStyle_wxMAXIMIZE_sym = NULL; +static Scheme_Object *dialogStyle_wxNOT_AS_SHEET_sym = NULL; static void init_symset_dialogStyle(void) { REMEMBER_VAR_STACK(); @@ -1031,12 +1036,14 @@ static void init_symset_dialogStyle(void) { dialogStyle_wxNO_CAPTION_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("no-caption")); wxREGGLOB(dialogStyle_wxMAXIMIZE_sym); dialogStyle_wxMAXIMIZE_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("resize-border")); + wxREGGLOB(dialogStyle_wxNOT_AS_SHEET_sym); + dialogStyle_wxNOT_AS_SHEET_sym = WITH_REMEMBERED_STACK(scheme_intern_symbol("no-sheet")); } static int unbundle_symset_dialogStyle(Scheme_Object *v, const char *where) { SETUP_VAR_STACK(1); VAR_STACK_PUSH(0, v); - if (!dialogStyle_wxMAXIMIZE_sym) WITH_VAR_STACK(init_symset_dialogStyle()); + if (!dialogStyle_wxNOT_AS_SHEET_sym) WITH_VAR_STACK(init_symset_dialogStyle()); Scheme_Object *i INIT_NULLED_OUT, *l = v; long result = 0; while (SCHEME_PAIRP(l)) { @@ -1044,6 +1051,7 @@ static int unbundle_symset_dialogStyle(Scheme_Object *v, const char *where) { if (0) { } else if (i == dialogStyle_wxNO_CAPTION_sym) { result = result | wxNO_CAPTION; } else if (i == dialogStyle_wxMAXIMIZE_sym) { result = result | wxMAXIMIZE; } + else if (i == dialogStyle_wxNOT_AS_SHEET_sym) { result = result | wxNOT_AS_SHEET; } else { break; } l = SCHEME_CDR(l); } diff --git a/src/mred/wxs/wxs_panl.xc b/src/mred/wxs/wxs_panl.xc index edf0097d1e..ffd8e1b3b3 100644 --- a/src/mred/wxs/wxs_panl.xc +++ b/src/mred/wxs/wxs_panl.xc @@ -60,9 +60,14 @@ static void dialogMenu(wxDialogBox *XTMAC_UNUSED(d)) #endif } +#ifndef wxNOT_AS_SHEET +# define wxNOT_AS_SHEET 0 +#endif + @BEGINSYMBOLS dialogStyle > > PRED BUNDLE @SYM "no-caption" : wxNO_CAPTION @SYM "resize-border" : wxMAXIMIZE +@SYM "no-sheet" : wxNOT_AS_SHEET @ENDSYMBOLS @INCLUDE wxs_espc.xci diff --git a/src/wxmac/include/base/common.h b/src/wxmac/include/base/common.h index 51c6eadb35..2490756926 100644 --- a/src/wxmac/include/base/common.h +++ b/src/wxmac/include/base/common.h @@ -75,7 +75,7 @@ typedef short int WXTYPE; #define wxMINIMIZE_BOX 0x00000800 #define wxMAXIMIZE_BOX 0x00001000 #define wxTOOLBAR_BUTTON 0x00002000 -#define wxTINY_CAPTION_VERT 0x00004000 +#define wxNOT_AS_SHEET 0x00004000 #define wxRESIZE_BOX wxMAXIMIZE_BOX #define wxNO_RESIZE_BORDER 0x00800000 #define wxHIDE_MENUBAR 0x01000000 diff --git a/src/wxmac/src/mac/wx_frame.cc b/src/wxmac/src/mac/wx_frame.cc index f9e8861002..a4f3a622c3 100644 --- a/src/wxmac/src/mac/wx_frame.cc +++ b/src/wxmac/src/mac/wx_frame.cc @@ -107,7 +107,8 @@ wxFrame::wxFrame // Constructor (for frame window) if (cStyle & wxMDI_CHILD) { // hack : MDI_CHILD means dialog box #ifdef OS_X - if (parentFrame && parentFrame->GetSheetParent()) { + if (parentFrame && parentFrame->GetSheetParent() + && !(cStyle & wxNOT_AS_SHEET)) { WXGC_IGNORE(this, cSheetParent); cSheetParent = parentFrame->GetSheetParent(); windowClass = kSheetWindowClass;