Commit Graph

14228 Commits

Author SHA1 Message Date
Vadim Zeitlin
69060f4f0c No real changes, just inline wxDIB::Create().
After removing wxDIB::m_hasAlpha in the previous commit, this method became
completely trivial so put it inline in the header.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65900 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:34 +00:00
Vadim Zeitlin
20af6fd5d3 Remove wxDIB::m_hasAlpha from wxMSW.
This field can't be set reliably as we don't know if LoadImage() Windows
function loaded an 0RGB or an RGB bitmap so remove it completely to avoid the
risk of using it wrongly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:27 +00:00
Vadim Zeitlin
164db92c14 Add support for specifying child process cwd and env to wxExecute().
Add an optional wxExecuteEnv parameter to wxExecute() which allows to specify
the initial working directory and custom environment for the child process.

Closes #12163.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:11 +00:00
Vadim Zeitlin
40730ad17d Make it easier to define custom wxSizerXmlHandler subclasses.
No real changes but refactor wxSizerXmlHandler to make it easier to derive
from it by adding virtual IsSizerNode() and DoCreateSizer() methods. To add
support for a custom sizer class you only need to override them in
wxSizerXmlHandler subclass now.

Also document wxSizerXmlHandler which was not documented at all previously.

Closes #11845.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65889 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 14:33:58 +00:00
Vadim Zeitlin
8ec22772d0 Make wxXmlResourceHandler::IsOfClass() static.
This simple helper function doesn't use any wxXmlResourceHandler data as it's
just a trivial wrapper for wxXmlNode::GetAttribute().

Making it static allows, in particular, to call it from const member functions
of wxXmlResourceHandler-derived classes (making it "const" itself would
achieve this too, of course, but it just doesn't need to be non-static).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 14:23:56 +00:00
Vadim Zeitlin
9b307a69b3 Add wxIcon::GetSize() to wxIcon in wxOSX.
This fixes the compilation errors under OS X after r65884 due to the lack of
this method there.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 21:47:22 +00:00
Vadim Zeitlin
4689441b05 Add XRC handler for wxToolbook.
Closes #11615.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 18:56:28 +00:00
Vadim Zeitlin
df191bfe39 Added wxThread::OnKill() and OnDelete() callbacks.
Call OnXXX() from wxThread::Kill() and Delete() respectively to allow the
thread being terminated perform some cleanup.

Closes #9046.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65882 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:10:12 +00:00
Vadim Zeitlin
6becc1e617 Added "rest" argument to wxString::Before{First,Last}().
This allows to search the string just once, in BeforeXXX(), when both the
parts of the string before and after some character are needed instead of
having to do it twice in both BeforeXXX() and AfterXXX().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-22 14:17:37 +00:00
Vadim Zeitlin
53dfbfa5c9 Add missing comparison operator declarations in wxString::iterator.
Fix compilation in !wxUSE_UNICODE_UTF8 case after r65857.

Modify the second declaration of wxString::iterator class which was not
updated by the previous commit in the same way, i.e. add declaration of
comparison operators taking const_iterator to iterator class.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-21 19:51:40 +00:00
Vadim Zeitlin
bdb40fa63e Implement comparisons between wxString::iterator and const_iterator.
Only comparisons between const_iterator and iterator worked before (because of
implicit conversion from the latter to the former), implement the ones in the
other direction explicitly now.

Closes #12594.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-21 19:22:33 +00:00
Vadim Zeitlin
53cdd2c11d Add XRC handler for wxCommandLinkButton.
Added a handler for wxCommandLinkButton class and a demo of it in the xrc sample.

Closes #12593.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-20 23:11:20 +00:00
Peter Cawley
140091e55c Improve support for ribbon panel sizers: panels with sizers should now automatically minimise at small sizes, and behave properly when popping up from a minimised state.
Patch by johnr in trac issue #12580.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-20 17:49:42 +00:00
Vadim Zeitlin
02a4d0b7a0 Change wxSP_XXX flags values to avoid clashes with wxTE_XXX.
wxSP_ARROW_KEYS conflicted with wxTE_AUTO_URL (which was probably not
important in practice as URLs don't appear in spin controls anyhow) and wxSPWR
conflicted with wxTE_NOHIDESEL (which could conceivably be a problem).

Change their values to reuse the bits of wxTE_CHARWRAP and wxTE_RICH2 neither
of which definitely makes sense for a spin control.

Closes #11461.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-18 23:43:25 +00:00
Vadim Zeitlin
35f8d83dbb Fix wxSTC compilation without wxUSE_DRAG_AND_DROP after r65827.
Correct the changes of r65827 to also compile with wxUSE_DRAG_AND_DROP==0
(especially important for the ports without dnd support such as wxX11 and
wxDFB).

Also do the changes in the correct files, i.e. src/stc/stc.{h,cpp}.in and not
in the generated files themselves to prevent them from being overwritten the
next time gen_iface.py is ran.

Finally keep backwards compatibility as SetDragAllowMove(bool) is a public
method so preserve its old semantics and add a new SetDragFlags() instead of
silently breaking the existing code using SetDragAllowMove().

See #11709.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65840 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-17 18:17:30 +00:00
Vadim Zeitlin
820ec9bbc2 Correctly initialize wxGtkPrintNativeData members.
In particular, create a valid GtkPrintOperation object instead of using an
uninitialized pointer to it in wxGtkPrintDialog::ShowModal(), resulting in
crashes or, at best, GTK errors.

Closes #12483.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-16 18:11:15 +00:00
Vadim Zeitlin
676184202d Restore text drag-and-drop in wxSTC broken by Scintilla 2 update.
Drag and drop in wxStyledTextCtrl was broken, apparently since upgrade to
Scintilla 2. Restore it by using the correct wxDrag_XXX constants instead of
boolean values in the code for wxEVT_STC_START_DRAG events generation.

Closes #11709.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-16 18:11:06 +00:00
Vadim Zeitlin
817b7b0e87 Add wxHAS_3STATE_CHECKBOX symbol.
This symbol is defined for the ports that support wxCHK_3STATE style. While
most of the ports do support it, a couple still do not and having this symbol
makes it more convenient to exclude 3-state-checkbox-specific code, like in
CheckBoxTestCase.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65825 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-16 18:10:51 +00:00
Vadim Zeitlin
f254e2424a Improve validation of wxCheckBox styles.
Detect when incompatible styles are used (this required changing the value of
wxCHK_2STATE to be non-null) and sanitize the styles (after asserting) in this
case.

Put the validation code in wxCheckBoxBase instead of having slightly different
versions of it in port-specific wxCheckBox implementations.

Add a unit test checking that the expected asserts are indeed generated.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65824 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-16 18:10:42 +00:00
Vadim Zeitlin
e6777e6575 Add wx{Pen,Brush}::Is[Non]Transparent() methods and use them.
Using GetStyle() == wx{PEN,BRUSH}STYLE_TRANSPARENT doesn't work for
uninitialized pen or brush objects so add convenient helpers which do work for
them.

Use the new helper functions everywhere instead of explicitly checking for
style. This makes the code shorter and more clear and also fixes some bugs (at
least those in GTK printing code).

Notice that this patch removes the main reason for explicitly initializing
m_pen and m_brush in wxGTKDCImpl ctor but this initialization still can't be
removed, at least for the latter, as doing this somehow breaks GetPixel(). It
would be nice to understand why and do remove this initialization so that a
newly created DC doesn't have any non-default pen nor brush.

Closes #12522.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-15 23:46:46 +00:00
Vadim Zeitlin
bce926c580 Add "GTK" prefix to wxChoice::{Dis,En}ableEvents() methods in wxGTK.
This is more than a cosmetic change: adding "GTK" prefix in wxComboBox and not
doing it in wxChoice in r64436 broke the event generation for wxComboBox as it
didn't override wxChoice methods any longer but defined its own (useless) ones.

Using the same name for the methods in both classes notably fixes unexpected
event generation from wxComboBox::SetSelection().

Closes #12568.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-15 23:46:32 +00:00
Vadim Zeitlin
5b1985a920 Check for task dialog availability even under Vista and later.
Task dialogs are not always available under Vista and later Windows versions
because we might not be using the right (i.e. 6+) version of comctl32.dll.

Improve the check for task dialog availability and fall back to the classic
message box if we can't use it.

Closes #12553.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-15 23:46:19 +00:00
Jaakko Salli
ec31b41de3 Fix non-PCH builds
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-15 15:49:00 +00:00
Jaakko Salli
76c722f697 Added the missing DLL export declaration for wxNumericPropertyValidator
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65807 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-15 15:18:40 +00:00
Jaakko Salli
026767c6ae Added wxNumericPropertyValidator, which is a custom wxTextValidator with more accurate filtering of inappropriate input for wxIntProperty, wxFloatProperty and wxUIntProperty (fixes #12563).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65806 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-15 15:15:27 +00:00
Julian Smart
5ad9ae3a29 Fixed #12566 (assert on deletion) due to inconsistent commit
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-14 18:06:02 +00:00
Vadim Zeitlin
20d88ec692 Move wxList::Member() to pseudo-template base list class.
Member() should be available in all list classes, not just specially crafted
list of wxObjects (wxList).

See #3616.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-10 12:48:36 +00:00
Jaakko Salli
ed8b46bba3 When wxPGProperty is un-attached from wxPropertyGrid, keep its 'default' cell references invalid/NULL (fixes #12552)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-10 09:34:29 +00:00
Julian Smart
8995db52f3 Don't use wxDC in header
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-06 21:27:07 +00:00
Julian Smart
bec80f4f4a Eliminated redundant wxRichTextAnchoredObject class; refactored XML I/O code
so that objects can stream themselves; added a wxXmlDocument-based method
of writing XML, though this turned out to be much slower than writing directly
so the direct approach is retained and is the default (can be changed with wxRICHTEXT_USE_XMLDOCUMENT_OUTPUT).
Loading and saving new attributes implemented. Added custom properties to objects.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65779 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-06 20:22:03 +00:00
Julian Smart
2d55af1dfa More efficient access to name and value
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-06 13:15:24 +00:00
Vadim Zeitlin
93f6e00d7b Destroy the in-place edit control in wxGenericListCtrl dtor.
If the in-place text control was still alive when wxGenericListCtrl was
destroyed, it resulted in asserts from wxWindow dtor about child windows still
being alive, so explicitly destroy it from wxListMainWindow dtor.

As this required a slightly different behaviour from wxListTextCtrlWrapper::
EndEdit(), replace its bool argument with an enum one which can take more than
2 values. Not using bool values when calling it also made the code more clear.

Finally, added a unit test verifying that the in-place control is indeed
destroyed correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-05 13:38:05 +00:00
Julian Smart
30f6914ba1 Added a flag suppressing node content conversion when saving to XML.
This helps improve the extremely poor performance of XML saving if
you have, for example, hex data that does not need conversion.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-05 06:17:22 +00:00
Julian Smart
6ffb5e91ea Exports fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-04 12:25:27 +00:00
Julian Smart
f5b7586bfe Removed redundant GetEditableWindow on GTK+
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-04 09:27:52 +00:00
Julian Smart
2477747881 wxRTC no longer derives from wxTextCtrlBase; added wxRichTextAttr deriving from wxTextAttr
with CSS-like attributes for future developments; removed image-specific attributes object


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-04 08:37:31 +00:00
Vadim Zeitlin
2c5c9c27de Disable the use of __thread with MinGW.
__thread keyword doesn't work correctly with at least some MinGW builds and in
particular TLS unit tests failed with the official 4.4 version.

Disable the use of __thread with MinGW entirely for now to be sure that the
generated code behaves correctly. In the future we should white list the known
good versions of MinGW and/or use run-time test for __thread support in
configure instead of compile-time one only.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-03 17:16:15 +00:00
Tim Kosse
864186dd39 Connect to events only if using native implementation instead of using event table. Closes #12469
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-02 09:39:58 +00:00
Vadim Zeitlin
df53be12c5 Add non-vararg wxFileTypeInfo ctor and various setters.
This allows to create wxFileTypeInfo objects in a more readable even if more
verbose way.

This should also incidentally fix the unit tests compilation with VC6 which
seems to have some existential troubles with the vararg ctor in debug DLL
build (only). Using the non-vararg ctor should hopefully make it happy and let
the unit tests pass with this compiler.

Also document wxFileTypeInfo class which wasn't documented at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-01 13:05:42 +00:00
Vadim Zeitlin
323d36e452 Add wxHAS_BITMAPTOGGLEBUTTON and test for it in the unit test.
Not all ports define wxBitmapToggleButton class currently, so add a special
symbol which is defined only if this class is indeed available and test for it
in the unit test for this class.

This fixes the tests compilation under wxX11.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-01 13:05:36 +00:00
Stefan Csomor
4a473abaf2 opening ATSU Font info for Ulrich Telle's wxPDFContext
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 17:30:48 +00:00
Vadim Zeitlin
51b729af92 Add default value for GetPopupMenuSelectionFromUser() position argument.
Let the menu be popped up at the system-determined position, just as it can
already be done with PopupMenu() itself.

Closes #12530.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:33:53 +00:00
Vadim Zeitlin
37513b6715 Correct handling of %hs and %ls in our wxPrintf() implementation.
The strings corresponding to %hs and %ls are always narrow/wide independently
of the build so using wxArgNormalizedString which is defined differently in
different builds doesn't make sense in wxPrintf().

Instead, simply expect the parameter of the appropriate matching type for
these conversion specifications. Any conversions to it, if necessary, had been
already done before by wxFormatString.

This fixes some VsnprintfTestCase::BigToSmallBuffer() unit test failures.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:35 +00:00
Vadim Zeitlin
e2dd624761 Fix handling of asterisks in wxPrintf() implementation.
Count the number of asterisks before modifying the string we use to do this,
otherwise we were off by one for the format specifications containing two of
them.

This really fixes the handling of asterisks (used for width/precision) in
wxPrintf() format string, it wasn't done correctly by r60120 but now
VsnprintfTestCase::Asterisk() test does pass.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:28 +00:00
Vadim Zeitlin
ce00f59b5b No changes whatsoever, just remove trailing whitespace.
There are no real changes in this commit but it removes all trailing white
space from our source files. This avoids problems when applying patches and
making diffs and it would be nice to prevent it from reappearing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:44:45 +00:00
Vadim Zeitlin
6255fac96f Use Unix EOL format for the new files.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:31:57 +00:00
Vadim Zeitlin
7132641de7 Include correct headers from richtextimagedlg.*.
Include or forward declares the classes used by the header to make it
self-contained. Do not include wx/wx.h from the source file to make compiling
it faster when not using PCH.

This fixes compilation under Unix after SOC2010_RTC_IMAGES branch merge.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:31:04 +00:00
Vadim Zeitlin
00fe363361 Remove interface/implementation #pragmas from richtextimagedlg.*.
These pragmas are not necessary and may actually be harmful, no idea why were
they added in the first place to a new file.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:30:58 +00:00
Vadim Zeitlin
cdaed652d7 Merge of SOC2010_RTC_IMAGES branch.
Added floating images and image property dialog to wxRichTextCtrl, by Mingquan
Yang as part of GSOC 2010. Also changed image block creation to use a memory
stream instead of creating a temporary file.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 10:27:07 +00:00
Vadim Zeitlin
a65b84f434 Add EVT_RIBBONBAR_TAB_LEFT_DCLICK event.
Generate a special event when a ribbon bar is double clicked.

Closes #12399.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 13:46:35 +00:00