]> git.saurik.com Git - wxWidgets.git/commitdiff
wxPerl documentation updates
authorMattia Barbon <mbarbon@cpan.org>
Fri, 23 Nov 2001 22:08:45 +0000 (22:08 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Fri, 23 Nov 2001 22:08:45 +0000 (22:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/dataform.tex
docs/latex/wx/dataobj.tex
docs/latex/wx/dc.tex
docs/latex/wx/fildrptg.tex
docs/latex/wx/layout.tex
docs/latex/wx/locale.tex
docs/latex/wx/menu.tex
docs/latex/wx/print.tex
docs/latex/wx/regex.tex
docs/latex/wx/statusbr.tex

index 3b9991e1400f9728698a1c0adb5922a0d71cc813..292c086835c72856acff686d70dc3f152fd97b8a 100644 (file)
@@ -70,6 +70,8 @@ Constructs a data format object for one of the standard data formats or an
 empty data object (use \helpref{SetType}{wxdataformatsettype} or 
 \helpref{SetId}{wxdataformatsetid} later in this case)
 
 empty data object (use \helpref{SetType}{wxdataformatsettype} or 
 \helpref{SetId}{wxdataformatsetid} later in this case)
 
+\perlnote{In wxPerl this function is named {\tt newNative}.}
+
 \membersection{wxDataFormat::wxDataFormat}\label{wxdataformatwxdataformat}
 
 \func{}{wxDataFormat}{\param{const wxChar }{*format}}
 \membersection{wxDataFormat::wxDataFormat}\label{wxdataformatwxdataformat}
 
 \func{}{wxDataFormat}{\param{const wxChar }{*format}}
@@ -77,6 +79,8 @@ empty data object (use \helpref{SetType}{wxdataformatsettype} or
 Constructs a data format object for a custom format identified by its name 
 {\it format}.
 
 Constructs a data format object for a custom format identified by its name 
 {\it format}.
 
+\perlnote{In wxPerl this function is named {\tt newUser}.}
+
 \membersection{wxDataFormat::operator $==$}\label{wxdataformatoperatoreq}
 
 \constfunc{bool}{operator $==$}{\param{const wxDataFormat\&}{ format}}
 \membersection{wxDataFormat::operator $==$}\label{wxdataformatoperatoreq}
 
 \constfunc{bool}{operator $==$}{\param{const wxDataFormat\&}{ format}}
index 5a62f8532eef6079fb72e1144dce42fd26f9c145..8292bb58baf6e813bfcfcc691cbf915938b66217 100644 (file)
@@ -155,6 +155,10 @@ Destructor.
 Copy all supported formats in the given direction to the array pointed to by 
 {\it formats}. There is enough space for GetFormatCount(dir) formats in it.
 
 Copy all supported formats in the given direction to the array pointed to by 
 {\it formats}. There is enough space for GetFormatCount(dir) formats in it.
 
+\perlnote{In wxPerl this method only takes the {\tt dir} parameter. 
+In scalar context it returns the first format,
+in list context it returns a list containing all the supported formats.}
+
 \membersection{wxDataObject::GetDataHere}\label{wxdataobjectgetdatahere}
 
 \constfunc{virtual bool}{GetDataHere}{\param{const wxDataFormat\&}{ format}, \param{void }{*buf} }
 \membersection{wxDataObject::GetDataHere}\label{wxdataobjectgetdatahere}
 
 \constfunc{virtual bool}{GetDataHere}{\param{const wxDataFormat\&}{ format}, \param{void }{*buf} }
index 95d44545bea119197df7d9e05f3509cf2f4f1d99..5bb946f363f2b0ea638dbcb09bb1d511e0a5aa6c 100644 (file)
@@ -525,7 +525,7 @@ Gets the rectangle surrounding the current clipping region.
 rectangle are returned as a tuple.}
 
 \perlnote{This method takes no arguments and returns a four element list
 rectangle are returned as a tuple.}
 
 \perlnote{This method takes no arguments and returns a four element list
-{\tt ( \$x, \$y, \$width, \$height )}}
+{\tt ( x, y, width, height )}}
 
 \membersection{wxDC::GetFont}\label{wxdcgetfont}
 
 
 \membersection{wxDC::GetFont}\label{wxdcgetfont}
 
@@ -609,7 +609,7 @@ implements the following methods:\par
 \indented{2cm}{\begin{twocollist}
 \twocolitem{{\bf GetSize()}}{Returns a Wx::Size}
 \twocolitem{{\bf GetSizeWH()}}{Returns a 2-element list
 \indented{2cm}{\begin{twocollist}
 \twocolitem{{\bf GetSize()}}{Returns a Wx::Size}
 \twocolitem{{\bf GetSizeWH()}}{Returns a 2-element list
-  {\tt ( \$width, \$height )}}
+  {\tt ( width, height )}}
 \end{twocollist}
 }}
 
 \end{twocollist}
 }}
 
@@ -650,7 +650,7 @@ See also \helpref{wxFont}{wxfont}, \helpref{wxDC::SetFont}{wxdcsetfont}.
 
 \perlnote{In wxPerl this method is implemented as 
   {\bf GetTextExtent( string, font = undef )} returning a four element
 
 \perlnote{In wxPerl this method is implemented as 
   {\bf GetTextExtent( string, font = undef )} returning a four element
-  array {\tt ( \$width, \$height, \$descent, \$externalLeading )}
+  array {\tt ( width, height, descent, externalLeading )}
 }
 
 \membersection{wxDC::GetTextForeground}\label{wxdcgettextforeground}
 }
 
 \membersection{wxDC::GetTextForeground}\label{wxdcgettextforeground}
@@ -669,7 +669,7 @@ Gets the current text foreground colour (see \helpref{wxDC::SetTextForeground}{w
 Gets the current user scale factor (set by \helpref{SetUserScale}{wxdcsetuserscale}).
 
 \perlnote{In wxPerl this method takes no arguments and returna a two element
 Gets the current user scale factor (set by \helpref{SetUserScale}{wxdcsetuserscale}).
 
 \perlnote{In wxPerl this method takes no arguments and returna a two element
- array {\tt ( \$x, \$y )}}
+ array {\tt ( x, y )}}
 
 \membersection{wxDC::LogicalToDeviceX}\label{wxdclogicaltodevicex}
 
 
 \membersection{wxDC::LogicalToDeviceX}\label{wxdclogicaltodevicex}
 
index 3c92446d98967e0e2d8e59cc8917d89820926f35..dfcf44d4588b16ee051cdff8d75029bd2198c55e 100644 (file)
@@ -50,3 +50,5 @@ Override this function to receive dropped files.
 
 Return TRUE to accept the data, FALSE to veto the operation.
 
 
 Return TRUE to accept the data, FALSE to veto the operation.
 
+\perlnote{In wxPerl there is just an array reference in place of {\tt nFiles}
+and {\tt files}.}
index ac9f3bffc3a1dca9e80acdd0d0a81ae50a70f83c..018b1f3064d7377d103e9d17abb853b797f715db 100644 (file)
@@ -28,9 +28,9 @@ not be changed.
 
 \perlnote{In wxPerl the constraints are accessed as
 \begin{verbatim}
 
 \perlnote{In wxPerl the constraints are accessed as
 \begin{verbatim}
-  my( \$constraint ) = Wx::LayoutConstraints->new();
-  \$constraint->centreX->AsIs();
-  \$constraint->centreY->Unconstrained();
+  constraint = Wx::LayoutConstraints->new();
+  constraint->centreX->AsIs();
+  constraint->centreY->Unconstrained();
 \end{verbatim}
 }
 
 \end{verbatim}
 }
 
index 4f529eb69a39f8a4868aa70bc82d1a3a5cc39bdb..121ef3feb54db3796302f0f65a2413d07745dcd5 100644 (file)
@@ -6,16 +6,36 @@ generalization of the C locale concept.
 In wxWindows this class manages message catalogs which contain the translations
 of the strings used to the current language.
 
 In wxWindows this class manages message catalogs which contain the translations
 of the strings used to the current language.
 
-\perlnote{In wxPerl the {\tt Wx} module exports a '\_' function
-that corresponds to the '\_' C++ macro.
+\perlnote{In wxPerl you can't use the '\_' function name, so
+the {\tt Wx::Locale} module can export the {\tt gettext} and 
+{\tt gettext\_noop} under any given name. 
 \begin{verbatim}
 \begin{verbatim}
-  use Wx qw(_);
+  # this imports gettext ( equivalent to Wx::GetTranslation
+  # and gettext_noop ( a noop )
+  # into your module
+  use Wx::Locale qw(:default);
 
   # ....
 
 
   # ....
 
-  print _( ``Panic!'' );
+  # use the functions
+  print gettext( ``Panic!'' ); 
 
 
-  my( \$button ) = Wx::Button->new( \$window, -1, _( ``Label'' ) );
+  button = Wx::Button->new( window, -1, gettext( ``Label'' ) );
+\end{verbatim}
+If you need to translate a lot of strings, then adding gettext( ) around
+each one is a long task ( that is why \_( ) was introduced ), so just choose
+a shorter name for gettext:
+\begin{verbatim}
+  #
+  use Wx::Locale 'gettext' => 't',
+                 'gettext_noop' => 'gettext_noop';
+
+  # ...
+
+  # use the functions
+  print t( ``Panic!!'' );
+
+  # ...
 \end{verbatim}
 }
 
 \end{verbatim}
 }
 
@@ -371,6 +391,8 @@ struct WXDLLEXPORT wxLanguageInfo
 
 {\it Language} should be greater than wxLANGUAGE\_USER\_DEFINED.
 
 
 {\it Language} should be greater than wxLANGUAGE\_USER\_DEFINED.
 
+\perlnote{In wxPerl Wx::LanguageInfo has only one method:\par
+Wx::LanguageInfo->new( language, canonicalName, WinLang, WinSubLang, Description )}
 
 
 \membersection{wxLocale::GetCanonicalName}\label{wxlocalegetcanonicalname}
 
 
 \membersection{wxLocale::GetCanonicalName}\label{wxlocalegetcanonicalname}
index cbcd3148adcd9434efc7c73ba5e58bbee909235f..33946872fee8f9430838c52a48e7bc3fc31d09cb 100644 (file)
@@ -236,7 +236,7 @@ optionally, the (sub)menu it belongs to.
 
 \perlnote{In wxPerl this method takes just the {\tt id} parameter;
 in scalar context it returns the associated {\tt Wx::MenuItem}, in list
 
 \perlnote{In wxPerl this method takes just the {\tt id} parameter;
 in scalar context it returns the associated {\tt Wx::MenuItem}, in list
-context it returns a two element list ( item, submenu )}
+context it returns a 2-element list ( item, submenu )}
 
 \wxheading{Parameters}
 
 
 \wxheading{Parameters}
 
index 088dca0e5f67988af2bc3d0ab9d6f1aa7bd4080a..b498836b50cba8bef7cb51e4bb3fd46af1177801 100644 (file)
@@ -760,6 +760,10 @@ it should be designed to take no parameters (other than the self
 reference) and to return a tuple of four integers.
 }
 
 reference) and to return a tuple of four integers.
 }
 
+\perlnote{When this method is overridden in a derived class,
+it must not take any parameters, an return a 4-element list.
+}
+
 \membersection{wxPrintout::GetPageSizeMM}\label{wxprintoutgetpagesizemm}
 
 \func{void}{GetPageSizeMM}{\param{int *}{w}, \param{int *}{h}}
 \membersection{wxPrintout::GetPageSizeMM}\label{wxprintoutgetpagesizemm}
 
 \func{void}{GetPageSizeMM}{\param{int *}{w}, \param{int *}{h}}
@@ -768,6 +772,9 @@ Returns the size of the printer page in millimetres.
 
 \pythonnote{This method returns the output-only parameters as a tuple.}
 
 
 \pythonnote{This method returns the output-only parameters as a tuple.}
 
+\perlnote{In wxPerl this method takes no arguments and returns a
+2-element list {\tt ( w, h )}}
+
 \membersection{wxPrintout::GetPageSizePixels}\label{wxprintoutgetpagesizepixels}
 
 \func{void}{GetPageSizePixels}{\param{int *}{w}, \param{int *}{h}}
 \membersection{wxPrintout::GetPageSizePixels}\label{wxprintoutgetpagesizepixels}
 
 \func{void}{GetPageSizePixels}{\param{int *}{w}, \param{int *}{h}}
@@ -781,6 +788,9 @@ previewing is to be supported.
 
 \pythonnote{This method returns the output-only parameters as a tuple.}
 
 
 \pythonnote{This method returns the output-only parameters as a tuple.}
 
+\perlnote{In wxPerl this method takes no arguments and returns a
+2-element list {\tt ( w, h )}}
+
 \membersection{wxPrintout::GetPPIPrinter}\label{wxprintoutgetppiprinter}
 
 \func{void}{GetPPIPrinter}{\param{int *}{w}, \param{int *}{h}}
 \membersection{wxPrintout::GetPPIPrinter}\label{wxprintoutgetppiprinter}
 
 \func{void}{GetPPIPrinter}{\param{int *}{w}, \param{int *}{h}}
@@ -792,6 +802,9 @@ this by a scaling factor to take the preview DC size into account.
 
 \pythonnote{This method returns the output-only parameters as a tuple.}
 
 
 \pythonnote{This method returns the output-only parameters as a tuple.}
 
+\perlnote{In wxPerl this method takes no arguments and returns a
+2-element list {\tt ( w, h )}}
+
 \membersection{wxPrintout::GetPPIScreen}\label{wxprintoutgetppiscreen}
 
 \func{void}{GetPPIScreen}{\param{int *}{w}, \param{int *}{h}}
 \membersection{wxPrintout::GetPPIScreen}\label{wxprintoutgetppiscreen}
 
 \func{void}{GetPPIScreen}{\param{int *}{w}, \param{int *}{h}}
@@ -803,6 +816,9 @@ this by a scaling factor to take the preview DC size into account.
 
 \pythonnote{This method returns the output-only parameters as a tuple.}
 
 
 \pythonnote{This method returns the output-only parameters as a tuple.}
 
+\perlnote{In wxPerl this method takes no arguments and returns a
+2-element list {\tt ( w, h )}}
+
 \membersection{wxPrintout::HasPage}\label{wxprintouthaspage}
 
 \func{bool}{HasPage}{\param{int}{ pageNum}}
 \membersection{wxPrintout::HasPage}\label{wxprintouthaspage}
 
 \func{bool}{HasPage}{\param{int}{ pageNum}}
index 012a03ee1da0731bc1f93f5fdef5a316e813ea2e..175fcd0aa4772d6eda1090d876343dfdf7518678 100644 (file)
@@ -80,7 +80,7 @@ enum
 Flags for regex matching to be used with \helpref{Matches()}{wxregexmatches}.
 
 These flags are mainly useful when doing several matches in a long string
 Flags for regex matching to be used with \helpref{Matches()}{wxregexmatches}.
 
 These flags are mainly useful when doing several matches in a long string
-to prevent erroneous matches for \verb|'^'| and {\tt '\$'}:
+to prevent erroneous matches for {\tt '^'} and {\tt '\$'}:
 
 \begin{verbatim}
 enum
 
 \begin{verbatim}
 enum
index 6985cc883ecb21dcf2afd47be4f807868f769f79..976d90ddc7ef0ba5266fe19b11b30d1b88e8a9a0 100644 (file)
@@ -111,6 +111,9 @@ TRUE if the field index is valid, FALSE otherwise.
 
 \helpref{wxRect}{wxrect}
 
 
 \helpref{wxRect}{wxrect}
 
+\perlnote{In wxPerl this function returns a {\tt Wx::Rect} if the field
+  index is valid, {\tt undef} otherwise.}
+
 \membersection{wxStatusBar::GetFieldsCount}\label{wxstatusbargetfieldscount}
 
 \constfunc{int}{GetFieldsCount}{\void}
 \membersection{wxStatusBar::GetFieldsCount}\label{wxstatusbargetfieldscount}
 
 \constfunc{int}{GetFieldsCount}{\void}