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
\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.
\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.
\func{}{wxBitmap}{\param{const char}{ bits[]}, \param{int}{ width}, \param{int}{ height}\\
\param{int}{ depth = 1}}
\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}}
\func{}{wxBitmap}{\param{int}{ width}, \param{int}{ height}, \param{int}{ depth = -1}}
+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}}
\func{}{wxBitmap}{\param{const char**}{ bits}}
Returns the word value of the expression.
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:
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:
\membersection{wxExpr::WriteExpr}\label{wxexprwriteexpr}
\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
Writes the expression (not clause) to the given stream in Prolog
format. Not normally needed, since the whole {\bf wxExprDatabase} will
Reads a Prolog database from the given string buffer, 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}
\membersection{wxExprDatabase::Write}\label{wxexprdatabasewrite}
-\func{bool}{Write}{\param{ostream\& }{stream}}
+\func{bool}{Write}{\param{FILE *}{stream}}
\func{bool}{Write}{\param{const wxString\&}{ filename}}
\func{bool}{Write}{\param{const wxString\&}{ filename}}
\docparam{pen}{A pointer or reference to a pen to copy.}
\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
\docparam{style}{The style may be one of the following:
\begin{twocollist}\itemsep=0pt
+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.
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
\wxheading{See also}
\helpref{wxPen::SetStyle}{wxpensetstyle}, \helpref{wxPen::SetColour}{wxpensetcolour},\rtfsp
This constructor and the global printer settings are now deprecated;
use the wxPrintData constructor instead.
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.
\wxheading{Remarks}
Just before the menu is popped up, \helpref{wxMenu::UpdateUI}{wxmenuupdateui} is called
\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}
\membersection{wxWindow::PushEventHandler}\label{wxwindowpusheventhandler}
\docparam{child}{Child window to remove.}
\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}}
\membersection{wxWindow::ScreenToClient}\label{wxwindowscreentoclient}
\constfunc{virtual void}{ScreenToClient}{\param{int* }{x}, \param{int* }{y}}
if (new_size.y == -1)
new_size.y = 30;
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") );
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( _T("wxXX creation failed") );
+//-----------------------------------------------------------------------------
+// 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 );
static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
{
menu->SetInvokingWindow( win );
gs_pop_x = x;
gs_pop_y = 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
gtk_menu_popup(
GTK_MENU(menu->m_menu),
(GtkWidget *) NULL, // parent menu shell
0, // button used to activate it
0 //gs_timeLastClick // the time of activation
);
0, // button used to activate it
0 //gs_timeLastClick // the time of activation
);
+
+ while (is_waiting) wxYield();
+
if (new_size.y == -1)
new_size.y = 30;
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") );
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{
wxFAIL_MSG( _T("wxXX creation failed") );
+//-----------------------------------------------------------------------------
+// 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 );
static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
{
menu->SetInvokingWindow( win );
gs_pop_x = x;
gs_pop_y = 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
gtk_menu_popup(
GTK_MENU(menu->m_menu),
(GtkWidget *) NULL, // parent menu shell
0, // button used to activate it
0 //gs_timeLastClick // the time of activation
);
0, // button used to activate it
0 //gs_timeLastClick // the time of activation
);
+
+ while (is_waiting) wxYield();
+