Commit Graph
128 Commits
Author SHA1 Message Date
Robin Dunn 99a001dd43 Changed how the stock objects (wx.RED, wx.RED_PEN, wx.RED_BRUSH, etc.)
are initialized.  They are now created as a wrapper object that
initializes itself on first use (when an attribute of the object is
requested.)  This was needed because of similar delayed initialization
functionality that was implemented in wxWidgets, but the end result is
cleaner for wxPython as well, and allowed me to remove some ugly code
under the covers.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-04-18 21:49:48 +00:00
Robin Dunn 369ac260a9 Sometimes we do need to allow recursion of callbacks
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-14 01:28:22 +00:00
Robin Dunn a7a0141800 Changes to how overridable C++ methods are virtualized for Python.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37369 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-02-07 03:56:44 +00:00
Robin Dunn 1ea8df6e6b Changes needed to be able to build with SWIG 1.3.24, 1.3.27 as well as
the upcoming 1.3.28, using #if statements on SWIG_VERSION.

Adjustments to ownership of SWIG objects, add some destructors and
explicitly disown non-window objects when their ownership is
transfered to a C++ object.

Since all window objects are owned by their parent, or by themselves,
always set their thisown attribute to False.

Explicitly set thisown to False after any Destroy() methods are
called, so SWIG doesn't try to destroy them again.

Etc.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37205 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-01-29 02:33:00 +00:00
Robin Dunn 02b800ce7c Merged modifications from the 2.6 branch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-12-30 23:02:03 +00:00
Robin Dunn 15c892875c Don't set mac.textcontrol-use-mlte any longer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-05-25 01:41:15 +00:00
Robin Dunn ea19c9a899 Ensure that Python is initialized before doing any locking in
wxPyBeginBlockThreads and wxPyEndBlockThreads as these can be
triggered after Python has been finalized in embedding situations.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-05-11 17:06:22 +00:00
Robin Dunn f3c2a60b95 Roll wxPyMake_wxSizer into wxPyMake_wxObject.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-05-02 23:42:16 +00:00
Robin Dunn 10c3910e9b init wxApp->argc and wxApp->argv even when wx has already been initialized
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-04-29 19:00:31 +00:00
Robin Dunn 69ac96fd0d Better handling of the refcount of the wx.App object, so it now
destroyed when expected and also resets the current instance pointer
returned by wx.GetApp().


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-04-11 19:14:34 +00:00
Robin Dunn c6d4dac5f4 corrected DSM
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-04-04 15:45:59 +00:00
Robin Dunn bd07485ce3 Add extern "C" to DllMain
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-04-04 15:32:17 +00:00
Robin Dunn bdd9b1ad47 Use MLTE by default for wxPython
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-04-03 23:54:12 +00:00
Robin Dunn 2809785e15 Put the Python executable pathname in wxTheApp->argv[0] so the
stackwalker won't freak out at trying to find program addresses inside
of .py files!


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-04-02 01:55:41 +00:00
Robin Dunn 822e03eeff Don't use the PyGILState_* APIs with Python 2.3, it causes a problem
with Boa's debugger.  :-(


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32791 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-03-12 21:03:18 +00:00
Robin Dunn 6e6b35578d Use the PyGILState_* APIs on Python >= 2.3
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-03-09 22:28:52 +00:00
Robin Dunn 43d6e3cae1 Move wxPyCallback back to derive from wxObject
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-03-08 00:41:35 +00:00
Robin Dunn d02ea46cad Add copy ctor for wxPyCBInputStream and use it to prevent double
deletion of the wxInputStream passed to wxFSFile


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-03-03 19:56:42 +00:00
Robin Dunn ac03a19f93 wxPyCallback needs to derive from wxEvtHandler now since the
wxObjectEventFunction typedef changed.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-02-18 19:28:16 +00:00
Robin Dunn 94fd5e4dc1 Allow the OOR reference to be saved without doing an INCREF. This
solves the circular reference problem with wx.Timer.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-12-20 22:50:29 +00:00
Robin Dunn 27c9e43cc0 Instead of always using the Python default encoding for converting
string and unicode objects to/from wxStrings.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-12-15 21:15:28 +00:00
Robin Dunn f464a4f2af Added wxPyInputStream dtor. Use PyLong_FromLongLong iff needed for wxFileOffset
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-11-19 19:28:46 +00:00
Robin Dunn ab897a69db Reset LC_NUMERIC to "C" for Python < 2.4. This fixes Python's float parser.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-11-12 18:12:49 +00:00
Vadim Zeitlin 588066b7a3 replaced wxStream::GetSize() with GetLength() (still keep the former but it will be deprecated) (second part of patch 1063498)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-11-10 21:10:30 +00:00
Robin Dunn db301e681f Tweak unicode --> string conversion helper so UnicodeDecodeError is
raised when appropriate instead ofg just catching everything and
raising TypeError


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-10-15 19:28:34 +00:00
Robin Dunn ae13f29275 * Don't reset LC_NUMERIC if on Python 2.4
* Always save the tstate


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-10-15 00:54:53 +00:00
Robin Dunn 9fd1fa4b1a check for wxHAS_HUGE_FILES
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-10-09 01:26:43 +00:00
Robin Dunn 1c97259a91 A better fix for GetXWindow that can handle both the wx widgets and
the native widgets.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-30 01:17:18 +00:00
Robin Dunn 3bc06221f0 off_t --> wxFileOffset changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-29 16:42:36 +00:00
Robin Dunn ce102f9d50 Corected GetXWindow macro for wxGTK port. (Bug# 1033681)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-24 16:18:37 +00:00
Robin Dunn 4519a2d911 More True/False fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-24 00:11:19 +00:00
Robin Dunn 0320aeddcd ensure that the wxString gets all the wide chars
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29087 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-10 21:36:25 +00:00
Robin Dunn 6f845b2215 Only initialize wxWidgets once
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-08-26 17:07:46 +00:00
Robin Dunn 450c7f34c0 more dbg flags (but it's still comment out by defult)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-08-03 21:17:06 +00:00
Robin Dunn 6d450e1a20 Since the wxPyMake_wxObject typemap is also used for constructors we
need to allow it to use the $owner value to specify if the thisown
attribute shoudl be set to true.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-30 20:12:14 +00:00
Robin Dunn fe5e444a73 Changes needed to accomodate wxTheClipboard now being a macro for wxClipboard::Get
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-21 22:37:35 +00:00
Robin Dunn 3afe2fd691 Fix a couple warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-11 22:46:47 +00:00
Robin Dunn ab1f7d2aa9 All the Window and GDI (pen, bitmap, etc.) classes and also many
toplevel functions will now check that a wx.App object has already
been created and will raise a wx.PyNoAppError exception if not.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-01 21:38:05 +00:00
Robin Dunn 6186384153 comments and cleanup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-28 20:40:12 +00:00
Robin Dunn 89c876de1c wxGTK now uses gtk_init_check so wxPython can raise an exception if
there is no DISPLAY available or other initializaion problem.

wx.GetKeyState now has an implementation for wxGTK and is able to
detect the up/down or toggle state of modifier and toggle keys.

The LC_NUMERIC locale is now reset back to "C" (compatibility) when
running on wxGTK to work around the fact that GTK requires the locale
to be set to the system settings but Python depends on LC_NUMERIC
remaining compatible with "C".


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-21 00:23:50 +00:00
Robin Dunn a31507415d wx.InitAllImageHandlers is now an empty function that does nothing but
exist for backwards compatibility.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27320 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-17 19:16:17 +00:00
Robin Dunn 14af60da8b It's now wx._core
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-27 19:36:16 +00:00
Robin Dunn 9c605df769 Use GetHandle for Mac too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-15 19:27:54 +00:00
Robin Dunn 98bc3dcf46 simplify how the XWindow is extracted for GetHandle
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26766 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-14 05:57:47 +00:00
Robin Dunn 3eb1aad7ec Check for errors after unicode conversions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-06 05:37:20 +00:00
Robin Dunn 70e45c91bb The reinit of the stock objects shoudl not happen when wxPython is
embedded in a C++ wx application


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-04-01 19:23:12 +00:00
Robin Dunn 27b60fafb8 Don't use PyThreadState_Swap to get the current tstate, block threads
only if the current tstate is not the one expected.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-03-28 16:59:56 +00:00
Robin Dunn da32eb53cb Changed (again) how the GIL is aquired and the tstate restored. This
time it's simpler, better, and handles the case where there is a wx
calback/event while the GIL has been released by a non-wxPython
extension module.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26324 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-03-24 23:09:59 +00:00
Robin Dunn b7c75283f2 Lindsay Mathieson's newest wxActiveX class has been wrapped into a new
extension module called wx.activex.  Lots of demo and lib updates to
go along with it.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-03-23 05:29:50 +00:00
Robin Dunn dd346b947b Added wx.PlatformInfo which is a tuple containing strings that
describe the platform and build options of wxPython.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-03-10 18:53:01 +00:00