From 2259e007898a6ffa793e129845e1fa416b42e6d3 Mon Sep 17 00:00:00 2001
From: Robert Roebling <robert@roebling.de>
Date: Tue, 27 Jul 1999 21:46:34 +0000
Subject: [PATCH]   Corrected some more docs,   Corrected size of spinbutton  
 wxWindow::PopUp() now doesn't return control     to the program until the
 menu disappears as     it is documented and done by wxMSW

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/bitmap.tex   | 10 ++++++++--
 docs/latex/wx/expr.tex     | 22 ++++------------------
 docs/latex/wx/pen.tex      | 10 ++++------
 docs/latex/wx/postscpt.tex |  6 ------
 docs/latex/wx/window.tex   | 16 +++++++++++++++-
 src/gtk/spinbutt.cpp       |  2 +-
 src/gtk/window.cpp         | 17 +++++++++++++++++
 src/gtk1/spinbutt.cpp      |  2 +-
 src/gtk1/window.cpp        | 17 +++++++++++++++++
 9 files changed, 67 insertions(+), 35 deletions(-)

diff --git a/docs/latex/wx/bitmap.tex b/docs/latex/wx/bitmap.tex
index da61ca58e5..a1e0e2dd30 100644
--- a/docs/latex/wx/bitmap.tex
+++ b/docs/latex/wx/bitmap.tex
@@ -43,15 +43,21 @@ Copy constructor.
 \func{}{wxBitmap}{\param{void*}{ data}, \param{int}{ type}, \param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}}
 
 Creates a bitmap from the given data, which can be of arbitrary type.
+Windows only, I think.
 
 \func{}{wxBitmap}{\param{const char}{ bits[]}, \param{int}{ width}, \param{int}{ height}\\
   \param{int}{ depth = 1}}
 
-Creates a bitmap from an array of bits.
+Creates a bitmap from an array of bits. 
+
+Note that the bit depth is ignored on GTK+ and Motif. If you want to create a bitmap 
+from something else than a 1-bit data array, use the \helpref{wxImage}{wximage} class.
 
 \func{}{wxBitmap}{\param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}}
 
-Creates a new bitmap.
+Creates a new bitmap. A depth of -1 indicates the depth of the current screen or
+visual. Some platforms only support 1 for monochrome and -1 for the current colour
+setting.
 
 \func{}{wxBitmap}{\param{const char**}{ bits}}
 
diff --git a/docs/latex/wx/expr.tex b/docs/latex/wx/expr.tex
index 18d0384f60..ad8b3e63db 100644
--- a/docs/latex/wx/expr.tex
+++ b/docs/latex/wx/expr.tex
@@ -287,17 +287,9 @@ typedef enum {
 
 Returns the word value of the expression.
 
-\membersection{wxExpr::WriteLispExpr}\label{wxexprwritelistexpr}
+\membersection{wxExpr::WriteClause}\label{wxexprwriteprologclause}
 
-\func{void}{WriteLispExpr}{\param{ostream\&}{ stream}}
-
-Writes the expression or clause to the given stream in LISP format.
-Not normally needed, since the whole {\bf wxExprDatabase} will usually
-be written at once. Lists are enclosed in parentheses will no commas.
-
-\membersection{wxExpr::WritePrologClause}\label{wxexprwriteprologclause}
-
-\func{void}{WritePrologClause}{\param{ostream\&}{ stream}}
+\func{void}{WriteClause}{\param{FILE *}{ stream}}
 
 Writes the clause to the given stream in Prolog format. Not normally needed, since
 the whole {\bf wxExprDatabase} will usually be written at once. The format is:
@@ -306,7 +298,7 @@ full stop.
 
 \membersection{wxExpr::WriteExpr}\label{wxexprwriteexpr}
 
-\func{void}{WriteExpr}{\param{ostream\&}{ stream}}
+\func{void}{WriteExpr}{\param{FILE *}{ stream}}
 
 Writes the expression (not clause) to the given stream in Prolog
 format. Not normally needed, since the whole {\bf wxExprDatabase} will
@@ -494,15 +486,9 @@ Reads in the given file, returning TRUE if successful.
 Reads a Prolog database from the given string buffer, returning TRUE if
 successful.
 
-\membersection{wxExprDatabase::WriteLisp}\label{wxexprdatabasewritelisp}
-
-\func{bool}{WriteLisp}{\param{ostream\& }{stream}}
-
-Writes the database as a LISP-format file.
-
 \membersection{wxExprDatabase::Write}\label{wxexprdatabasewrite}
 
-\func{bool}{Write}{\param{ostream\& }{stream}}
+\func{bool}{Write}{\param{FILE *}{stream}}
 
 \func{bool}{Write}{\param{const wxString\&}{ filename}}
 
diff --git a/docs/latex/wx/pen.tex b/docs/latex/wx/pen.tex
index 361ab2f26c..8754bae778 100644
--- a/docs/latex/wx/pen.tex
+++ b/docs/latex/wx/pen.tex
@@ -97,9 +97,6 @@ the style is wxDOT, wxLONG\_DASH, wxSHORT\_DASH, wxDOT\_DASH, or wxUSER\_DASH.}
 
 \docparam{pen}{A pointer or reference to a pen to copy.}
 
-\docparam{width}{Pen width. Under Windows, the pen width cannot be greater than 1 if
-the style is wxDOT, wxLONG\_DASH, wxSHORT\_DASH, wxDOT\_DASH, or wxUSER\_DASH.}
-  
 \docparam{style}{The style may be one of the following:
 
 \begin{twocollist}\itemsep=0pt
@@ -121,12 +118,13 @@ the style is wxDOT, wxLONG\_DASH, wxSHORT\_DASH, wxDOT\_DASH, or wxUSER\_DASH.}
 
 \wxheading{Remarks}
 
+Different versions of Windows and different versions of other platforms
+support {\it very} different subsets of the styles above - there is no
+similarity even between Windows95 and Windows98 - so handle with care.
+
 If the named colour form is used, an appropriate {\bf wxColour} structure
 is found in the colour database.
 
-{\it style} may be one of wxSOLID, wxDOT, wxLONG\_DASH, wxSHORT\_DASH and
-wxDOT\_DASH.
-
 \wxheading{See also}
 
 \helpref{wxPen::SetStyle}{wxpensetstyle}, \helpref{wxPen::SetColour}{wxpensetcolour},\rtfsp
diff --git a/docs/latex/wx/postscpt.tex b/docs/latex/wx/postscpt.tex
index b1bd9adda5..425d22d4e7 100644
--- a/docs/latex/wx/postscpt.tex
+++ b/docs/latex/wx/postscpt.tex
@@ -35,11 +35,5 @@ get PostScript printing settings.
 This constructor and the global printer settings are now deprecated;
 use the wxPrintData constructor instead.
 
-\membersection{wxPostScriptDC::GetStream}
-
-\func{ostream *}{GetStream}{\void}
-
-Returns the stream currently being used to write PostScript output. Use this
-to insert any PostScript code that is outside the scope of wxPostScriptDC.
 
 
diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex
index 77a4e88110..26e3a73155 100644
--- a/docs/latex/wx/window.tex
+++ b/docs/latex/wx/window.tex
@@ -1520,7 +1520,8 @@ processed as usually.
 \wxheading{Remarks}
 
 Just before the menu is popped up, \helpref{wxMenu::UpdateUI}{wxmenuupdateui} is called
-to ensure that the menu items are in the correct state.
+to ensure that the menu items are in the correct state. The menu does not get deleted
+by the window.
 
 \membersection{wxWindow::PushEventHandler}\label{wxwindowpusheventhandler}
 
@@ -1597,6 +1598,19 @@ functions so should not be required by the application programmer.
 
 \docparam{child}{Child window to remove.}
 
+\membersection{wxWindow::Reparent}\label{wxwindowreparent}
+
+\func{virtual bool}{Reparent}{\param{wxWindow* }{newParent}}
+
+Reparents the window, i.e the window will be removed from its
+current parent window (e.g. a non-standard toolbar in a wxFrame) 
+and then re-inserted into another (e.g. a wxMiniFrame for a
+floating toolbar). Available on Windows and GTK+.
+
+\wxheading{Parameters}
+
+\docparam{newParent}{New parent.}
+
 \membersection{wxWindow::ScreenToClient}\label{wxwindowscreentoclient}
 
 \constfunc{virtual void}{ScreenToClient}{\param{int* }{x}, \param{int* }{y}}
diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp
index 31a244d6c3..1198df9597 100644
--- a/src/gtk/spinbutt.cpp
+++ b/src/gtk/spinbutt.cpp
@@ -98,7 +98,7 @@ bool wxSpinButton::Create(wxWindow *parent,
     if (new_size.y == -1)
         new_size.y = 30;
 
-    if (!PreCreation( parent, pos, size ) ||
+    if (!PreCreation( parent, pos, new_size ) ||
         !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
     {
         wxFAIL_MSG( _T("wxXX creation failed") );
diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp
index bfdc8bcc81..f43608af41 100644
--- a/src/gtk/window.cpp
+++ b/src/gtk/window.cpp
@@ -2845,6 +2845,15 @@ void wxWindow::ApplyWidgetStyle()
 {
 }
 
+//-----------------------------------------------------------------------------
+// Pop-up menu stuff
+//-----------------------------------------------------------------------------
+
+static void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting  )
+{
+    *is_waiting = FALSE;
+}
+
 static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
 {
     menu->SetInvokingWindow( win );
@@ -2885,6 +2894,11 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
     gs_pop_x = x;
     gs_pop_y = y;
 
+    bool is_waiting = TRUE;
+    
+    gtk_signal_connect( GTK_OBJECT(menu->m_menu), "hide",
+      GTK_SIGNAL_FUNC(gtk_pop_hide_callback), (gpointer)&is_waiting );
+
     gtk_menu_popup(
                   GTK_MENU(menu->m_menu),
                   (GtkWidget *) NULL,          // parent menu shell
@@ -2894,6 +2908,9 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
                   0,                           // button used to activate it
                   0 //gs_timeLastClick         // the time of activation
                 );
+		
+    while (is_waiting) wxYield();		
+
     return TRUE;
 }
 
diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp
index 31a244d6c3..1198df9597 100644
--- a/src/gtk1/spinbutt.cpp
+++ b/src/gtk1/spinbutt.cpp
@@ -98,7 +98,7 @@ bool wxSpinButton::Create(wxWindow *parent,
     if (new_size.y == -1)
         new_size.y = 30;
 
-    if (!PreCreation( parent, pos, size ) ||
+    if (!PreCreation( parent, pos, new_size ) ||
         !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
     {
         wxFAIL_MSG( _T("wxXX creation failed") );
diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp
index bfdc8bcc81..f43608af41 100644
--- a/src/gtk1/window.cpp
+++ b/src/gtk1/window.cpp
@@ -2845,6 +2845,15 @@ void wxWindow::ApplyWidgetStyle()
 {
 }
 
+//-----------------------------------------------------------------------------
+// Pop-up menu stuff
+//-----------------------------------------------------------------------------
+
+static void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting  )
+{
+    *is_waiting = FALSE;
+}
+
 static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
 {
     menu->SetInvokingWindow( win );
@@ -2885,6 +2894,11 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
     gs_pop_x = x;
     gs_pop_y = y;
 
+    bool is_waiting = TRUE;
+    
+    gtk_signal_connect( GTK_OBJECT(menu->m_menu), "hide",
+      GTK_SIGNAL_FUNC(gtk_pop_hide_callback), (gpointer)&is_waiting );
+
     gtk_menu_popup(
                   GTK_MENU(menu->m_menu),
                   (GtkWidget *) NULL,          // parent menu shell
@@ -2894,6 +2908,9 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
                   0,                           // button used to activate it
                   0 //gs_timeLastClick         // the time of activation
                 );
+		
+    while (is_waiting) wxYield();		
+
     return TRUE;
 }
 
-- 
2.50.0

