X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/818e52c20151ce0c22aa752ccbab94f1ae7afc99..81108288e63c2558a3a5faf79182a46e1b42d9a6:/docs/latex/wx/window.tex

diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex
index add8503f92..6c371edf25 100644
--- a/docs/latex/wx/window.tex
+++ b/docs/latex/wx/window.tex
@@ -9,6 +9,10 @@ before the window itself is deleted.
 \helpref{wxEvtHandler}{wxevthandler}\\
 \helpref{wxObject}{wxobject}
 
+\wxheading{Include files}
+
+<wx/window.h>
+
 \wxheading{Window styles}
 
 The following styles can apply to all windows, although they will not always make sense for a particular
@@ -141,7 +145,8 @@ relative to the panel.
 
 \func{void}{Clear}{\void}
 
-Clears the window by filling it with the current background colour.
+Clears the window by filling it with the current background colour. Does not
+cause an erase background event to be generated.
 
 \membersection{wxWindow::ClientToScreen}
 
@@ -159,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}}
@@ -220,6 +234,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}}
@@ -243,6 +274,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}
@@ -298,30 +338,6 @@ Enable or disable the window for user input.
 
 \helpref{wxWindow::IsEnabled}{wxwindowisenabled}
 
-\membersection{wxWindow::FakePopupMenu}\label{wxwindowfakepopupmenu}
-
-\func{virtual bool}{FakePopupMenu}{\param{wxMenu* }{menu}, \param{int }{x}, \param{int }{y}}
-
-A replacement for wxWindow::PopupMenu for cases where the PopupMenu implementation
-does not work correctly, in particular on Motif platforms.
-
-\wxheading{Parameters}
-
-\docparam{menu}{Menu to pop up.}
-
-\docparam{x}{Required x position for the menu to appear.}
-
-\docparam{y}{Required y position for the menu to appear.}
-
-\wxheading{Remarks}
-
-This is a cut-down version of PopupMenu using a dialog and listbox; pull-right menus
-are not supported.
-
-\wxheading{See also}
-
-\helpref{wxMenu}{wxmenu}, \helpref{wxWindow::PopupMenu}{wxwindowpopupmenu}
-
 \membersection{wxWindow::FindFocus}\label{wxwindowfindfocus}
 
 \func{static wxWindow*}{FindFocus}{\void}
@@ -346,6 +362,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}
@@ -398,6 +422,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}
@@ -418,7 +450,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}
@@ -488,12 +520,10 @@ Returns the identifier of the window.
 Each window has an integer identifier. If the application has not provided one,
 an identifier will be generated.
 
-TODO: perhaps there should be a default identifier for each class, rather
-choosing one, which could clash with other ones.
-
 \wxheading{See also}
 
-\helpref{wxWindow::SetId}{wxwindowsetid}
+\helpref{wxWindow::SetId}{wxwindowsetid}\rtfsp
+\helpref{Window identifiers}{windowids}
 
 \membersection{wxWindow::GetPosition}
 
@@ -508,6 +538,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}
@@ -610,6 +648,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},
@@ -635,6 +681,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}
@@ -726,14 +783,6 @@ default resource table will be used.}
 
 TRUE if the operation succeeded, otherwise FALSE.
 
-\wxheading{Remarks}
-
-TODO
-
-\wxheading{See also}
-
-TODO
-
 \membersection{wxWindow::Lower}\label{wxwindowlower}
 
 \func{void}{Lower}{\void}
@@ -783,6 +832,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}}
@@ -824,7 +881,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.
@@ -898,7 +955,7 @@ the control(s) in question.
 Called when the user has tried to close a a frame
 or dialog box using the window manager (X) or system menu (Windows).
 
-{\bf Note:} This is an obsolete function retained for backward compatibility.
+{\bf Note:} This is an obsolete function.
 It is superceded by the \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow} event
 handler.
 
@@ -908,10 +965,6 @@ If TRUE is returned by OnClose, the window will be deleted by the system, otherw
 attempt will be ignored. Do not delete the window from within this handler, although
 you may delete other windows.
 
-\wxheading{Remarks}
-
-Derive your own class to handle this message. The default handler returns TRUE.
-
 \wxheading{See also}
 
 \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp
@@ -1023,7 +1076,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.
@@ -1052,7 +1105,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.
@@ -1413,7 +1466,12 @@ the commandInt member of the event to check the selected menu identifier.
 
 \wxheading{See also}
 
-\helpref{wxMenu}{wxmenu}, \helpref{wxWindow::FakePopupMenu}{wxwindowfakepopupmenu}
+\helpref{wxMenu}{wxmenu}
+
+\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.
 
 \membersection{wxWindow::PushEventHandler}\label{wxwindowpusheventhandler}
 
@@ -1506,6 +1564,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}}
@@ -1566,13 +1633,98 @@ Sets the background colour of the window.
 The background colour is usually painted by the default\rtfsp
 \helpref{wxWindow::OnEraseBackground}{wxwindowonerasebackground} event handler function.
 
+Note that setting the background colour does not cause an immediate refresh, so you
+may wish to call \helpref{wxWindow::Clear}{wxwindowclear} or \helpref{wxWindow::Refresh}{wxwindowrefresh} after
+calling this function.
+
 \wxheading{See also}
 
 \helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour},\rtfsp
 \helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp
 \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp
+\helpref{wxWindow::Clear}{wxwindowclear},\rtfsp
+\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.
+
+\wxheading{Parameters}
+
+\docparam{cursor}{Specifies the cursor that the window should normally display.}
+
+\begin{comment}
+\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.
+\end{comment
+
+\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}}
@@ -1603,7 +1755,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}
@@ -1660,13 +1812,10 @@ Each window has an integer identifier. If the application has not provided one,
 an identifier will be generated. Normally, the identifier should be provided
 on creation and should not be modified subsequently.
 
-TODO: perhaps there should be a default identifier for each class, rather
-choosing one, which could clash with other ones.
-
 \wxheading{See also}
 
-\helpref{wxWindow::GetId}{wxwindowgetid}
-
+\helpref{wxWindow::GetId}{wxwindowgetid},\rtfsp
+\helpref{Window identifiers}{windowids}
 
 \membersection{wxWindow::SetName}\label{wxwindowsetname}
 
@@ -1682,6 +1831,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}}
@@ -1909,6 +2064,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},
@@ -1938,81 +2102,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}}
