wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.75k stars 1.69k forks source link

[wxMac] frame style not respecting wxCLOSE_BOX etc #5957

Closed wxtrac closed 2 years ago

wxtrac commented 20 years ago

Issue migrated from trac ticket # 5957

component: old wxOSX/Carbon port | priority: normal

2003-06-12 23:35:21: ryanwilcox created the issue


wxFrame (and other objects that call MacCreateRealWindow) were not respecting the following styles:

- wxCLOSE_BOX
- wxMINIMIZE_BOX
- wxMAXIMIZE_BOX

This patch solves several problems:

PROBLEM 1: Investigation showed that the existing logic wasn't allowing these attributes/styles to be set separately. This patch reworks that logic, making it possible to set attributes separately.

PROBLEM 2: The window class was being determined by a check for minimize and maximize boxes, but not close boxes. This patch checks for wxCLOSE_BOX as well, as it was found that trying to set a kWindowCloseBoxAttribute as an attribute of a kPlainWindowClass isn't allowed. (Reference: MacWindows.h, Window Attributes section)

PROBLEM 3:

Added a wxCHECK_RET to make sure that noErr was returned by ::(Mac)CreateNewWindow (if an error is returned ,a null window ptr is created - and while that would be caught further up in the framework, the added
CHECK_RET gives programmers a more exact idea as to what their problem is).

wxtrac commented 20 years ago

2003-06-12 23:35:21: ryanwilcox uploaded file toplevel.patch (1.3 KiB)

patch for toplevel.cpp to impliment above changes

wxtrac commented 20 years ago

2003-07-11 21:10:42: @csomor commented


Thanks for the nice patch :-)

Stefan