]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/window.tex
no more SetAppName/SetVendor in the config classes
[wxWidgets.git] / docs / latex / wx / window.tex
index 0929c65b7f47d18d432de5f5503e4772c4538a92..e26756621098750603cad501fd8d403ac3859352 100644 (file)
@@ -164,6 +164,15 @@ a screen coordinate will be passed out.}
 
 \docparam{pt}{The client position for the second form of the function.}
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{ClientToScreen(point)}}{Accepts and returns a wxPoint}
+\twocolitem{\bf{ClientToScreenXY(x, y)}}{Returns a 2-tuple, (x, y)}
+\end{twocollist}}
+}
+
+
 \membersection{wxWindow::Close}\label{wxwindowclose}
 
 \func{virtual bool}{Close}{\param{const bool}{ force = FALSE}}
@@ -187,6 +196,14 @@ destroy the window using \helpref{wxWindow::Destroy}{wxwindowdestroy}.
 
 Applies to managed windows (wxFrame and wxDialog classes) only.
 
+{\it Note} that calling Close does not guarantee that the window will be destroyed; but it
+provides a way to simulate a manual close of a window, which may or may not be implemented by
+destroying the window. The default implementation of wxDialog::OnCloseWindow does not
+necessarily delete the dialog, since it will simply simulate an wxID\_CANCEL event which
+itself only hides the dialog.
+
+To guarantee that the window will be destroyed, call \helpref{wxWindow::Destroy}{wxwindowdestroy} instead.
+
 \wxheading{See also}
 
 \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp
@@ -225,6 +242,23 @@ You can also use these functions programmatically. A convenience macro is define
 
 \helpref{wxWindow::ConvertPixelsToDialog}{wxwindowconvertpixelstodialog}
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{ConvertDialogPointToPixels(point)}}{Accepts and returns a wxPoint}
+\twocolitem{\bf{ConvertDialogSizeToPixels(size)}}{Accepts and returns a wxSize}
+\end{twocollist}}
+
+Additionally, the following helper functions are defined:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{wxDLG_PNT(win, point)}}{Converts a wxPoint from dialog
+units to pixels}
+\twocolitem{\bf{wxDLG_SZE(win, size)}}{Converts a wxSize from dialog
+units to pixels}
+\end{twocollist}}
+}
+
+
 \membersection{wxWindow::ConvertPixelsToDialog}\label{wxwindowconvertpixelstodialog}
 
 \func{wxPoint}{ConvertPixelsToDialog}{\param{const wxPoint\&}{ pt}}
@@ -248,6 +282,15 @@ Dialogs created using Dialog Editor optionally use dialog units.
 
 \helpref{wxWindow::ConvertDialogToPixels}{wxwindowconvertdialogtopixels}
 
+
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{ConvertDialogPointToPixels(point)}}{Accepts and returns a wxPoint}
+\twocolitem{\bf{ConvertDialogSizeToPixels(size)}}{Accepts and returns a wxSize}
+\end{twocollist}}
+}
+
 \membersection{wxWindow::Destroy}\label{wxwindowdestroy}
 
 \func{virtual bool}{Destroy}{\void}
@@ -327,6 +370,14 @@ Find a child of this window, by identifier.
 
 Find a child of this window, by name.
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{FindWindowById(id)}}{Accepts an integer}
+\twocolitem{\bf{FindWindowByName(name)}}{Accepts a string}
+\end{twocollist}}
+}
+
 \membersection{wxWindow::Fit}\label{wxwindowfit}
 
 \func{virtual void}{Fit}{\void}
@@ -379,6 +430,14 @@ area which may be drawn on by the programmer, excluding title bar, border etc.
 
 \docparam{height}{Receives the client height in pixels.}
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{wxGetClientSizeTuple()}}{Returns a 2-tuple of (width, height)}
+\twocolitem{\bf{wxGetClientSize()}}{Returns a wxSize object}
+\end{twocollist}}
+}
+
 \membersection{wxWindow::GetConstraints}\label{wxwindowgetconstraints}
 
 \constfunc{wxLayoutConstraints*}{GetConstraints}{\void}
@@ -399,7 +458,7 @@ Returns the associated drop target, which may be NULL.
 
 \wxheading{See also}
 
-\helpref{wxWindow::SetDropTarget}{wxwindowsetdroptarget}, 
+\helpref{wxWindow::SetDropTarget}{wxwindowsetdroptarget},
 \helpref{Drag and drop overview}{wxdndoverview}
 
 \membersection{wxWindow::GetEventHandler}\label{wxwindowgeteventhandler}
@@ -487,6 +546,14 @@ if no parent, relative to the whole display.
 
 \docparam{y}{Receives the y position of the window.}
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{GetPosition()}}{Returns a wxPoint}
+\twocolitem{\bf{GetPositionTuple()}}{Returns a tuple (x, y)}
+\end{twocollist}}
+}
+
 \membersection{wxWindow::GetLabel}
 
 \constfunc{virtual wxString\& }{GetLabel}{\void}
@@ -589,6 +656,14 @@ This gets the size of the entire window in pixels.
 
 \docparam{height}{Receives the window height.}
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{GetSize()}}{Returns a wxSize}
+\twocolitem{\bf{GetSizeTuple()}}{Returns a 2-tuple (width, height)}
+\end{twocollist}}
+}
+
 \membersection{wxWindow::GetTextExtent}
 
 \constfunc{virtual void}{GetTextExtent}{\param{const wxString\& }{string}, \param{int* }{x}, \param{int* }{y},
@@ -614,6 +689,17 @@ window with the currently selected font.
 
 \docparam{use16}{If TRUE, {\it string} contains 16-bit characters. The default is FALSE.}
 
+
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{GetTextExtent(string)}}{Returns a 2-tuple,  (width, height)}
+\twocolitem{\bf{GetFullTextExtent(string, font=NULL)}}{Returns a
+4-tuple, (width, height, descent, externalLeading) }
+\end{twocollist}}
+}
+
+
 \membersection{wxWindow::GetTitle}\label{wxwindowgettitle}
 
 \func{virtual wxString}{GetTitle}{\void}
@@ -754,6 +840,14 @@ as the call:
 
 \helpref{wxWindow::SetSize}{wxwindowsetsize}
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{Move(point)}}{Accepts a wxPoint}
+\twocolitem{\bf{MoveXY(x, y)}}{Accepts a pair of integers}
+\end{twocollist}}
+}
+
 \membersection{wxWindow::OnActivate}\label{wxwindowonactivate}
 
 \func{void}{OnActivate}{\param{wxActivateEvent\&}{ event}}
@@ -795,7 +889,7 @@ Note that the ASCII values do not have explicit key codes: they are passed as AS
 values.
 
 Note that not all keypresses can be intercepted this way. If you wish to intercept modifier
-keypresses, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or 
+keypresses, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
 \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
 
 Most, but not all, windows allow keypresses to be intercepted.
@@ -990,7 +1084,7 @@ use the EVT\_KEY\_DOWN macro in an event table definition. Your {\bf OnKeyDown}
 default function to achieve default keypress functionality.
 
 Note that not all keypresses can be intercepted this way. If you wish to intercept special
-keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or 
+keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
 \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
 
 Most, but not all, windows allow keypresses to be intercepted.
@@ -1019,7 +1113,7 @@ use the EVT\_KEY\_UP macro in an event table definition. Your {\bf OnKeyUp} hand
 default function to achieve default keypress functionality.
 
 Note that not all keypresses can be intercepted this way. If you wish to intercept special
-keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or 
+keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
 \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
 
 Most, but not all, windows allow key up events to be intercepted.
@@ -1478,6 +1572,15 @@ Converts from screen to client window coordinates.
 
 \docparam{pt}{The screen position for the second form of the function.}
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{ScreenToClient(point)}}{Accepts and returns a wxPoint}
+\twocolitem{\bf{ScreenToClientXY(x, y)}}{Returns a 2-tuple, (x, y)}
+\end{twocollist}}
+}
+
+
 \membersection{wxWindow::ScrollWindow}\label{wxwindowscrollwindow}
 
 \func{virtual void}{ScrollWindow}{\param{int }{dx}, \param{int }{dy}, \param{const wxRect*}{ rect = NULL}}
@@ -1551,6 +1654,79 @@ calling this function.
 \helpref{wxWindow::Refresh}{wxwindowrefresh},\rtfsp
 \helpref{wxWindow::OnEraseBackground}{wxwindowonerasebackground}
 
+\membersection{wxWindow::SetClientSize}\label{wxwindowsetclientsize}
+
+\func{virtual void}{SetClientSize}{\param{int}{ width}, \param{int}{ height}}
+
+\func{virtual void}{SetClientSize}{\param{const wxSize\&}{ size}}
+
+This sets the size of the window client area in pixels. Using this function to size a window
+tends to be more device-independent than \helpref{wxWindow::SetSize}{wxwindowsetsize}, since the application need not
+worry about what dimensions the border or title bar have when trying to fit the window
+around panel items, for example.
+
+\wxheading{Parameters}
+
+\docparam{width}{The required client area width.}
+
+\docparam{height}{The required client area height.}
+
+\docparam{size}{The required client size.}
+
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{SetClientSize(size)}}{Accepts a wxSize}
+\twocolitem{\bf{SetClientSizeWH(width, height)}}{}
+\end{twocollist}}
+}
+
+\membersection{wxWindow::SetCursor}\label{wxwindowsetcursor}
+
+\func{virtual void}{SetCursor}{\param{const wxCursor\&}{cursor}}
+
+Sets the window's cursor. Notice that setting the cursor for this window does
+not set it for its children so you'll need to explicitly call SetCursor() for
+them too if you need it.
+
+\wxheading{Parameters}
+
+\docparam{cursor}{Specifies the cursor that the window should normally display.}
+
+\wxheading{See also}
+
+\helpref{::wxSetCursor}{wxsetcursor}, \helpref{wxCursor}{wxcursor}
+
+\membersection{wxWindow::SetEventHandler}\label{wxwindowseteventhandler}
+
+\func{void}{SetEventHandler}{\param{wxEvtHandler* }{handler}}
+
+Sets the event handler for this window.
+
+\wxheading{Parameters}
+
+\docparam{handler}{Specifies the handler to be set.}
+
+\wxheading{Remarks}
+
+An event handler is an object that is capable of processing the events
+sent to a window. By default, the window is its own event handler, but
+an application may wish to substitute another, for example to allow
+central implementation of event-handling for a variety of different
+window classes.
+
+It is usually better to use \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler} since
+this sets up a chain of event handlers, where an event not handled by one event handler is
+handed to the next one in the chain.
+
+\wxheading{See also}
+
+\helpref{wxWindow::GetEventHandler}{wxwindowgeteventhandler},\rtfsp
+\helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp
+\helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp
+\helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp
+\helpref{wxEvtHandler}{wxevthandler}
+
 \membersection{wxWindow::SetConstraints}\label{wxwindowsetconstraints}
 
 \func{void}{SetConstraints}{\param{wxLayoutConstraints* }{constraints}}
@@ -1581,7 +1757,7 @@ If the window already has a drop target, it is deleted.
 
 \wxheading{See also}
 
-\helpref{wxWindow::GetDropTarget}{wxwindowgetdroptarget}, 
+\helpref{wxWindow::GetDropTarget}{wxwindowgetdroptarget},
 \helpref{Drag and drop overview}{wxdndoverview}
 
 \membersection{wxWindow::SetFocus}\label{wxwindowsetfocus}
@@ -1657,6 +1833,12 @@ Sets the window's name.
 
 \helpref{wxWindow::GetName}{wxwindowgetname}
 
+\membersection{wxWindow::SetPalette}\label{wxwindowsetpalette}
+
+\func{virtual void}{SetPalette}{\param{wxPalette* }{palette}}
+
+Obsolete - use \helpref{wxDC::SetPalette}{wxdcsetpalette} instead.
+
 \membersection{wxWindow::SetReturnCode}\label{wxwindowsetreturncode}
 
 \func{void}{SetReturnCode}{\param{int }{retCode}}
@@ -1884,6 +2066,15 @@ by wxWindows, or that the current value of the dimension should be used.
 
 \helpref{wxWindow::Move}{wxwindowmove}
 
+\pythonnote{In place of a single overloaded method name, wxPython
+implements the following methods:\par
+\indented{2cm}{\begin{twocollist}
+\twocolitem{\bf{SetDimensions(x, y, width, height, sizeFlags=wxSIZE_AUTO)}}{}
+\twocolitem{\bf{SetSize(size)}}{}
+\twocolitem{\bf{SetPosition(point)}}{}
+\end{twocollist}}
+}
+
 \membersection{wxWindow::SetSizeHints}\label{wxwindowsetsizehints}
 
 \func{virtual void}{SetSizeHints}{\param{int}{ minW=-1}, \param{int}{ minH=-1}, \param{int}{ maxW=-1}, \param{int}{ maxH=-1},
@@ -1913,81 +2104,6 @@ given bounds.
 
 The resizing increments are only significant under Motif or Xt.
 
-\membersection{wxWindow::SetClientSize}
-
-\func{virtual void}{SetClientSize}{\param{int}{ width}, \param{int}{ height}}
-
-\func{virtual void}{SetClientSize}{\param{const wxSize\&}{ size}}
-
-This sets the size of the window client area in pixels. Using this function to size a window
-tends to be more device-independent than \helpref{wxWindow::SetSize}{wxwindowsetsize}, since the application need not
-worry about what dimensions the border or title bar have when trying to fit the window
-around panel items, for example.
-
-\wxheading{Parameters}
-
-\docparam{width}{The required client area width.}
-
-\docparam{height}{The required client area height.}
-
-\docparam{size}{The required client size.}
-
-\membersection{wxWindow::SetPalette}
-
-\func{virtual void}{SetPalette}{\param{wxPalette* }{palette}}
-
-Obsolete - use \helpref{wxDC::SetPalette}{wxdcsetpalette} instead.
-
-\membersection{wxWindow::SetCursor}\label{wxwindowsetcursor}
-
-\func{virtual void}{SetCursor}{\param{const wxCursor\&}{cursor}}
-
-Sets the window's cursor.
-
-\wxheading{Parameters}
-
-\docparam{cursor}{Specifies the cursor that the window should normally display.}
-
-\wxheading{Remarks}
-
-Under Windows, you sometimes need to call ::wxSetCursor in addition to this
-function if you want the cursor to change immediately, because under Windows,
-wxWindows only sets the global cursor when it detects mouse movement.
-
-\wxheading{See also}
-
-\helpref{::wxSetCursor}{wxsetcursor}, \helpref{wxCursor}{wxcursor}
-
-\membersection{wxWindow::SetEventHandler}\label{wxwindowseteventhandler}
-
-\func{void}{SetEventHandler}{\param{wxEvtHandler* }{handler}}
-
-Sets the event handler for this window.
-
-\wxheading{Parameters}
-
-\docparam{handler}{Specifies the handler to be set.}
-
-\wxheading{Remarks}
-
-An event handler is an object that is capable of processing the events
-sent to a window. By default, the window is its own event handler, but
-an application may wish to substitute another, for example to allow
-central implementation of event-handling for a variety of different
-window classes.
-
-It is usually better to use \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler} since
-this sets up a chain of event handlers, where an event not handled by one event handler is
-handed to the next one in the chain.
-
-\wxheading{See also}
-
-\helpref{wxWindow::GetEventHandler}{wxwindowgeteventhandler},\rtfsp
-\helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp
-\helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp
-\helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp
-\helpref{wxEvtHandler}{wxevthandler}
-
 \membersection{wxWindow::SetTitle}\label{wxwindowsettitle}
 
 \func{virtual void}{SetTitle}{\param{const wxString\& }{title}}