]> git.saurik.com Git - wxWidgets.git/commitdiff
No changes, just added comments summarizing the use of style bits.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 10 May 2010 21:09:50 +0000 (21:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 10 May 2010 21:09:50 +0000 (21:09 +0000)
Add comments allowing to see more clearly the styles allocation.

Please make sure to amend them if you change any style values in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
include/wx/dialog.h
include/wx/frame.h
include/wx/toplevel.h

index b3819c09aaf8f812390f2028d1addcd0d79742d7..88e0bd99794392727952679d926c863c311cf00a 100644 (file)
@@ -1557,12 +1557,40 @@ enum wxBorder
  * Some styles are used across more than one group,
  * so the values mustn't clash with others in the group.
  * Otherwise, numbers can be reused across groups.
- *
- * From version 1.66:
- * Window (cross-group) styles now take up the first half
- * of the flag, and control-specific styles the
- * second half.
- *
+ */
+
+/*
+    Summary of the bits used by various styles.
+
+    High word, containing styles which can be used with many windows:
+
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+      |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+      |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  \_ wxFULL_REPAINT_ON_RESIZE
+      |  |  |  |  |  |  |  |  |  |  |  |  |  |  \____ wxPOPUP_WINDOW
+      |  |  |  |  |  |  |  |  |  |  |  |  |  \_______ wxWANTS_CHARS
+      |  |  |  |  |  |  |  |  |  |  |  |  \__________ wxTAB_TRAVERSAL
+      |  |  |  |  |  |  |  |  |  |  |  \_____________ wxTRANSPARENT_WINDOW
+      |  |  |  |  |  |  |  |  |  |  \________________ wxBORDER_NONE
+      |  |  |  |  |  |  |  |  |  \___________________ wxCLIP_CHILDREN
+      |  |  |  |  |  |  |  |  \______________________ wxALWAYS_SHOW_SB
+      |  |  |  |  |  |  |  \_________________________ wxBORDER_STATIC
+      |  |  |  |  |  |  \____________________________ wxBORDER_SIMPLE
+      |  |  |  |  |  \_______________________________ wxBORDER_RAISED
+      |  |  |  |  \__________________________________ wxBORDER_SUNKEN
+      |  |  |  \_____________________________________ wxBORDER_{DOUBLE,THEME}
+      |  |  \________________________________________ wxCAPTION/wxCLIP_SIBLINGS
+      |  \___________________________________________ wxHSCROLL
+      \______________________________________________ wxVSCROLL
+
+
+    Low word style bits is class-specific meaning that the same bit can have
+    different meanings for different controls (e.g. 0x10 is wxCB_READONLY
+    meaning that the control can't be modified for wxComboBox but wxLB_SORT
+    meaning that the control should be kept sorted for wxListBox, while
+    wxLB_SORT has a different value -- and this is just fine).
  */
 
 /*
index bcdbeecaee700e42d208f458857c93b55d56d23a..d8eba543a14a98cdb413cbf0fbc95fd165c59947 100644 (file)
@@ -23,6 +23,8 @@ class WXDLLIMPEXP_FWD_CORE wxDialog;
 class WXDLLIMPEXP_FWD_CORE wxButton;
 class WXDLLIMPEXP_FWD_CORE wxScrolledWindow;
 
+// Also see the bit summary table in wx/toplevel.h.
+
 #define wxDIALOG_NO_PARENT      0x0001  // Don't make owned by apps top window
 
 #ifdef __WXWINCE__
index 80c563728f26e0173a70142b56771b9623bde452..e39c17f22e3fd531e041860fd0830537c7a07cf3 100644 (file)
@@ -34,6 +34,8 @@ class WXDLLIMPEXP_FWD_CORE wxToolBar;
 // ----------------------------------------------------------------------------
 
 // wxFrame-specific (i.e. not for wxDialog) styles
+//
+// Also see the bit summary table in wx/toplevel.h.
 #define wxFRAME_NO_TASKBAR      0x0002  // No taskbar button (MSW only)
 #define wxFRAME_TOOL_WINDOW     0x0004  // No taskbar button, no system menu
 #define wxFRAME_FLOAT_ON_PARENT 0x0008  // Always above its parent
index cce46ab1cb405deda4fa4bb65b1562418f55519b..99e7a99345199516fc850bbe7981a97b1474a156 100644 (file)
@@ -32,6 +32,38 @@ class WXDLLIMPEXP_FWD_CORE wxTopLevelWindowBase;
 // constants
 // ----------------------------------------------------------------------------
 
+/*
+    Summary of the bits used (some of them are defined in wx/frame.g and
+    wx/dialog.h and not here):
+
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+    |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
+    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+      |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
+      |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  \_ wxDIALOG_NO_PARENT
+      |  |  |  |  |  |  |  |  |  |  |  |  |  |  \____ wxFRAME_NO_TASKBAR
+      |  |  |  |  |  |  |  |  |  |  |  |  |  \_______ wxFRAME_TOOL_WINDOW
+      |  |  |  |  |  |  |  |  |  |  |  |  \__________ wxFRAME_FLOAT_ON_PARENT
+      |  |  |  |  |  |  |  |  |  |  |  \_____________ wxFRAME_SHAPED
+      |  |  |  |  |  |  |  |  |  |  \________________
+      |  |  |  |  |  |  |  |  |  \___________________ wxRESIZE_BORDER
+      |  |  |  |  |  |  |  |  \______________________ wxTINY_CAPTION_VERT
+      |  |  |  |  |  |  |  \_________________________ wxTINY_CAPTION_HORIZ
+      |  |  |  |  |  |  \____________________________ wxMAXIMIZE_BOX
+      |  |  |  |  |  \_______________________________ wxMINIMIZE_BOX
+      |  |  |  |  \__________________________________ wxSYSTEM_MENU
+      |  |  |  \_____________________________________ wxCLOSE_BOX
+      |  |  \________________________________________ wxMAXIMIZE
+      |  \___________________________________________ wxMINIMIZE
+      \______________________________________________ wxSTAY_ON_TOP
+
+
+    Notice that the 8 lower bits overlap with wxCENTRE and the button selection
+    bits (wxYES, wxOK wxNO, wxCANCEL, wxAPPLY, wxCLOSE and wxNO_DEFAULT) which
+    can be combined with the dialog style for several standard dialogs and
+    hence shouldn't overlap with any styles which can be used for the dialogs.
+ */
+
 // style common to both wxFrame and wxDialog
 #define wxSTAY_ON_TOP           0x8000
 #define wxICONIZE               0x4000