From 050d159c4a0fc1fd9db756c3ea0d534dbd784a90 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Mon, 14 Jan 2008 22:17:46 +0000
Subject: [PATCH] added wxTBK_HORZ_LAYOUT (heavily modified patch 1855678)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/toolbook.tex |  4 +++-
 include/wx/toolbook.h      |  3 +++
 src/generic/toolbkg.cpp    | 15 ++++++++++-----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/docs/latex/wx/toolbook.tex b/docs/latex/wx/toolbook.tex
index 2abc168468..dd6d93b0bd 100644
--- a/docs/latex/wx/toolbook.tex
+++ b/docs/latex/wx/toolbook.tex
@@ -41,9 +41,11 @@ wxBookCtrlBase (see \helpref{wxBookCtrl overview}{wxbookctrloverview})\\
 
 \twocolwidtha{5cm}
 \begin{twocollist}\itemsep=0pt
-
 \twocolitem{\windowstyle{wxBK\_DEFAULT}}{Choose the default location for the
 labels depending on the current platform (currently always the top).}
+\twocolitem{\windowstyle{wxTBK\_HORZ\_LAYOUT}}{Shows the text and the icons
+alongside, not vertically stacked (only implement under Windows and GTK 2
+platforms as it relies on \texttt{wxTB\_HORZ\_LAYOUT} flag support).}
 \end{twocollist}
 
 \wxheading{See also}
diff --git a/include/wx/toolbook.h b/include/wx/toolbook.h
index 404933ee50..e54c2e6056 100644
--- a/include/wx/toolbook.h
+++ b/include/wx/toolbook.h
@@ -28,6 +28,9 @@ extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING;
 // Use wxButtonToolBar
 #define wxBK_BUTTONBAR            0x0100
 
+// Use wxTB_HORZ_LAYOUT style for the controlling toolbar
+#define wxTBK_HORZ_LAYOUT          0x8000
+
 // ----------------------------------------------------------------------------
 // wxToolbook
 // ----------------------------------------------------------------------------
diff --git a/src/generic/toolbkg.cpp b/src/generic/toolbkg.cpp
index 3ba71c29ab..960387ef0a 100644
--- a/src/generic/toolbkg.cpp
+++ b/src/generic/toolbkg.cpp
@@ -87,9 +87,14 @@ bool wxToolbook::Create(wxWindow *parent,
                             wxDefaultValidator, name) )
         return false;
 
-    int orient = wxTB_HORIZONTAL;
-    if ( (style & (wxBK_LEFT | wxBK_RIGHT)) != 0)
-        orient = wxTB_VERTICAL;
+    int tbFlags = wxTB_TEXT | wxTB_FLAT | wxBORDER_NONE;
+    if ( (style & (wxBK_LEFT | wxBK_RIGHT)) != 0 )
+        tbFlags |= wxTB_VERTICAL;
+    else
+        tbFlags |= wxTB_HORIZONTAL;
+
+    if ( style & wxTBK_HORZ_LAYOUT )
+        tbFlags |= wxTB_HORZ_LAYOUT;
 
     // TODO: make more configurable
 
@@ -102,7 +107,7 @@ bool wxToolbook::Create(wxWindow *parent,
                     wxID_ANY,
                     wxDefaultPosition,
                     wxDefaultSize,
-                    orient|wxTB_TEXT|wxTB_FLAT|wxNO_BORDER
+                    tbFlags
                  );
     }
     else
@@ -114,7 +119,7 @@ bool wxToolbook::Create(wxWindow *parent,
                     wxID_ANY,
                     wxDefaultPosition,
                     wxDefaultSize,
-                    orient|wxTB_TEXT|wxTB_FLAT|wxTB_NODIVIDER|wxNO_BORDER
+                    tbFlags | wxTB_NODIVIDER
                  );
     }
 
-- 
2.50.0

