X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90805926b75bcdc8466b1736df4413c7581cdc30..0967b57b85518167b93f64ccecb5a1b5dc2b2c51:/wxPython/docs/wxPythonManual.html diff --git a/wxPython/docs/wxPythonManual.html b/wxPython/docs/wxPythonManual.html index 5d898ca4fc..02459a305b 100644 --- a/wxPython/docs/wxPythonManual.html +++ b/wxPython/docs/wxPythonManual.html @@ -3,12 +3,294 @@
- +This is a guide to the wxPython GUI toolkit, written by a Python programmer for his fellow Python programmers. It began as a -simple translation of the wxWindows documentation (which is written +simple translation of the wxWidgets documentation (which is written for C++ programmers), and evolved from there. And while there's nothing wrong with C++...
Okay, you got me there. I hate C++. That's why I use Python. If you -like C++, go read the wxWindows documentation. If you'd rather read a +like C++, go read the wxWidgets documentation. If you'd rather read a guide that's written with Python programmers in mind, keep reading this one. If you like it, feel free to send me freshly roasted coffee beans, dark chocolate, and large denomination currency. Better yet, buy huge quantities of my wxPython book (written with Robin Dunn) and send one to each of your friends, relatives, and coworkers.
wxPython is a GUI toolkit for the Python programming language. It allows Python programmers to create programs with a robust, highly functional graphical user interface, simply and easily. It is implemented as a Python extension module (native code) that wraps the -popular wxWindows cross platform GUI library, which is written in C++.
-Like Python and wxWindows, wxPython is Open Source, which means that +popular wxWidgets cross platform GUI library, which is written in C++.
+Like Python and wxWidgets, wxPython is Open Source, which means that it is free for anyone to use and the source code is available for anyone to look at and modify. And anyone can contribute fixes or enhnacments to the project.
@@ -126,19 +408,19 @@ or unix-like systems, and Macintosh OS X.Since the language is Python, wxPython programs are simple, easy to write and easy to understand.
To make use of wxPython, you currently need one of the following setups.
-wxWindows is a C++ framework providing GUI (Graphical User Interface) +
wxWidgets is a C++ framework providing GUI (Graphical User Interface) and other facilities on more than one platform. Version 2 currently supports all desktop versions of MS Windows, Unix with GTK+, Unix with Motif, and MacOS. An OS/2 port is in progress.
-wxWindows was originally developed at the Artificial Intelligence +
wxWidgets was originally developed at the Artificial Intelligence Applications Institute, University of Edinburgh, for internal use, and was first made publicly available in 1992. Version 2 is a vastly improved version written and maintained by Julian Smart, Robert @@ -169,9 +451,9 @@ Roebling, Vadim Zeitlin, Vaclav Slavik and many others.
platforms related to Microsoft Windows, including 16-bit and 32-bit variants, unless otherwise stated. All trademarks are acknowledged.wxWindows was developed to provide a cheap and flexible way to +
wxWidgets was developed to provide a cheap and flexible way to maximize investment in GUI application development. While a number of commercial class libraries already existed for cross-platform development, none met all of the following criteria:
@@ -181,13 +463,13 @@ development, none met all of the following criteria:Since wxWindows was started, several other free or almost-free GUI +
Since wxWidgets was started, several other free or almost-free GUI frameworks have emerged. However, none has the range of features, flexibility, documentation and the well-established development team -that wxWindows has.
-As open source software, wxWindows has benefited from comments, ideas, +that wxWidgets has.
+As open source software, wxWidgets has benefited from comments, ideas, bug fixes, enhancements and the sheer enthusiasm of users. This gives -wxWindows a certain advantage over its commercial competitors (and +wxWidgets a certain advantage over its commercial competitors (and over free libraries without an independent development team), plus a robustness against the transience of one individual or company. This openness and availability of source code is especially important when @@ -201,16 +483,16 @@ toolkits such as Motif, GTK+ and MFC.
overstated, since GUI application development is very time-consuming, and sustained popularity of particular GUIs cannot be guaranteed. Code can very quickly become obsolete if it addresses the wrong -platform or audience. wxWindows helps to insulate the programmer from -these winds of change. Although wxWindows may not be suitable for +platform or audience. wxWidgets helps to insulate the programmer from +these winds of change. Although wxWidgets may not be suitable for every application (such as an OLE-intensive program), it provides access to most of the functionality a GUI program normally requires, plus many extras such as network programming, PostScript output, and HTML rendering; and it can of course be extended as needs dictate. As a bonus, it provides a far cleaner and easier programming interface than the native APIs. Programmers may find it worthwhile to use -wxWindows even if they are developing on only one platform. -It is impossible to sum up the functionality of wxWindows in a few +wxWidgets even if they are developing on only one platform.
+It is impossible to sum up the functionality of wxWidgets in a few paragraphs, but here are some of the benefits:
To set a wxPython application going, you will need to derive an App class and override App.OnInit.
An application must have a top-level Frame or Dialog window. Each @@ -281,37 +563,37 @@ Help.
GUI applications aren't all graphical wizardry. You'll also need lists and hash tables. But since you're working with Python, you should use the ones Python provides (list, tuple, dict), rather than -the wxWindows versions. Same goes for the database related classes. +the wxWidgets versions. Same goes for the database related classes. The basic rule of thumb is this: If you can do it directly in Python, you probably should. If there is a reason not to use a Python data -type, wxPython will provide a wrapper for the wxWindows class.
+type, wxPython will provide a wrapper for the wxWidgets class.You will undoubtedly need some platform-independent file functions, and you may find it handy to maintain and search a list of paths using PathList. There's a miscellany of operating system and other functions.
See also Classes by Category for a list of classes.
In addition to the core wxWindows library, a number of further +
In addition to the core wxWidgets library, a number of further libraries and utilities are supplied with each distribution.
[Need to list these.]
[This section needs to be reviewed.]
Classes: wx.App
-The OnInit method defined for a class derived from wx.App will usually create a top window as a bare minimum.
OnInit must return a boolean value to indicate whether processing @@ -365,8 +647,8 @@ if __name__ == '__main__': main()
The application normally shuts down when the last of its top level windows is closed. This is normally the expected behaviour and means that it is enough to call Close() in response to the "Exit" menu @@ -385,11 +667,11 @@ created by the time OnExit finishes.
[Need examples of objects needing cleanup to keep app from crashing.]
Classes: wx.Sizer, wx.GridSizer, wx.FlexGridSizer, wx.BoxSizer, wx.StaticBoxSizer, wx.NotebookSizer, wx.CreateButtonSizer
-wxPython provides a set of powerful classes to work with dates and times. Some of the supported features of the DateTime class are:
-There are 3 main classes: except DateTime itself which represents an absolute moment in time, there are also two classes - TimeSpan and DateSpan which represent the intervals of time.
@@ -748,8 +1030,8 @@ date is a holiday or not and DateTimeWorkDays which is a derivation of this class for which (only) Saturdays and Sundays are the holidays. See more about these classes in the discussion of the holidays.DateTime stores the time as a signed number of milliseconds since the Epoch which is fixed, by convention, to Jan 1, 1970 - however this is not visible to the class users (in particular, dates prior to the @@ -772,8 +1054,8 @@ country, and even region, dependent). Future versions will probably have Julian calendar support as well and support for other calendars (Maya, Hebrew, Chinese...) is not ruled out.
While there is only one logical way to represent an absolute moment in the time (and hence only one DateTime class), there are at least two methods to describe a time interval.
@@ -801,14 +1083,14 @@ in the program, you should probably use TimeSpan instead of DateSpan in situations when you do need to understand what 'in a month' means (of course, it is just DateTime.Now() + DateSpan.Month()).Many different operations may be performed with the dates, however not all of them make sense. For example, multiplying a date by a number is an invalid operation, even though multiplying either of the time span classes by a number is perfectly valid.
Here is what can be done:
-Although the time is always stored internally in GMT, you will usually work in the local time zone. Because of this, all DateTime constructors and setters which take the broken down date assume that @@ -877,8 +1159,8 @@ job. I.e. you would just write
printf("The time is %s in local time zone", dt.FormatTime().c_str()); printf("The time is %s in GMT", dt.FormatTime(wxDateTime::GMT).c_str());DST (a.k.a. 'summer time') handling is always a delicate task which is better left to the operating system which is supposed to be configured by the administrator to behave correctly. Unfortunately, when doing @@ -894,17 +1176,17 @@ the future.
The time zone handling methods use these functions too, so they are subject to the same limitations.
[TODO]
Not done yet.
wxPython provides the following predefined ID constants:
ID_ABORT ID_ABOUT @@ -964,8 +1246,8 @@ ID_UNDO ID_YES ID_YESTOALL
The source document is named wxPythonManual.txt and can be found by clicking the link at the bottom of this page (assuming you are viewing the html file). It is written using a fantastic formatting convention @@ -973,11 +1255,11 @@ called reStructuredText. The wxPythonManual.html file is created using the Docutils utilities, which can turn reStructuredText documents into html, xml, pdf, and even OpenOffice files.
Some items in the source text file look like this:
-.. This is text from the wxWindows documentation that needs to be +.. This is text from the wxWidgets documentation that needs to be translated into something appropriate for the wxPython version. The two dots followed by uniformly indented text turns this paragraph into a reStructuredText comment, so it doesn't appear @@ -991,8 +1273,8 @@ to you and will show my gratitude by adding your name to the list of contributors. (Contributors who also send me gifts of coffee, chocolate, or currency will have their names listed in bold.)
Individuals who contributed to this documentation (in order by last name):
This document began as a translation of the wxWindows documentation. +
This document began as a translation of the wxWidgets documentation. As such, it adheres to the same license, which is provided here:
wxWindows Free Documentation Licence, Version 3 @@ -1072,9 +1354,5 @@ As such, it adheres to the same license, which is provided here: