Commit Graph

1261 Commits

Author SHA1 Message Date
Vadim Zeitlin
cc26010927 Add support for stretchable spaces to wxToolBar.
Stretchable spaces consume all extra toolbar space not allocated to the fixed
size items. They can in particular be used to right-align (some) toolbar tools.

Add and document the new API, change the sample to show it and implement it
for MSW, GTK and OS X/Cocoa.

Also refactor MSW background erasing/repainting code to avoid duplicated calls
to DrawThemeBackground(), call it from a new helper MSWEraseRect() function.

Note that we may want to add support for "invisible" separators, IOW
non-stretchable spaces. This could be easily done for MSW after the changes in
this commit and is supported natively by GTK+ and Cocoa so implementing this
would be trivial if there is any interest.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-10 03:04:19 +00:00
Vadim Zeitlin
2600776164 No changes, just slightly simplify the tool insertion code.
Added a helper DoInsertNewTool() function to avoid code duplication and ensure
that we never forget to delete a new tool if inserting it into the toolbar
failed.

Also explicitly document that the tool passed to the public InsertTool() is
not owned by the toolbar and so must be deleted by the caller if its insertion
failed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-10 02:59:02 +00:00
Vadim Zeitlin
156c705738 Document that wxTrap() now traps [almost] always.
Don't mention the words "release mode" as there is no such thing now, instead
refer to wxDEBUG_LEVEL explicitly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62839 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-09 13:45:41 +00:00
Kevin Ollivier
ebf7d5c40a Add OSX prefix, and be clear that this is OS X only API to avoid any expectation that this API may work elsewhere.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-09 05:25:32 +00:00
Vadim Zeitlin
af7e24c33e Make wxPORTRAIT and wxLANDSCAPE elements of wxPrintOrientation enum.
Change wxPrintData::SetOrientation() to take wxPrintOrientation instead of
int.

Closes #11393.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62823 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-08 16:35:47 +00:00
Vadim Zeitlin
c2ebca9b9c Document wxListCtrl::FindItem() return value.
In particular mention that it returns -1 if no items were found.

Closes #11523.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-07 15:26:31 +00:00
Kevin Ollivier
efb2fa41ff Add wxTLW::SetModified to allow apps to set the TLW's dirty state. On Mac this gives us the dot in the close button, not implemented elsewhere yet.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-07 01:54:21 +00:00
Vadim Zeitlin
e01a788ee0 Add support for MSW unique volume names to wxFileName.
Recognize the paths starting with "\\?\Volume{GUID}" under MSW and provide a
way to test for them.

Closes #8874.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62782 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-05 17:31:00 +00:00
Václav Slavík
384a14ff32 Documented that wxCriticalSection can be used before wxInitialize(), as a global object.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-05 09:05:45 +00:00
Bryan Petty
0678e935b1 Forward-port of r62758 (Added wxHtmlEasyPrinting name accessor and modifier).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-01 20:23:29 +00:00
Vadim Zeitlin
874dbd3a4a Allow calling wxStrchr() with a narrow string and wide character.
Calls to wxStrchr(char-string, wide-char) would previously fail if wide
character couldn't be converted to a single character in the current locale
encoding. Change it to simply return NULL in this case as it's a safe and
useful generalization: a narrow string will never contain a wide character not
representable in the current locale.

Add wxUniChar::GetAsChar() to help with implementing this.

Closes #11487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-28 14:37:03 +00:00
Vadim Zeitlin
aeef0d188c No changes, just remove unnecessary UTF-8 bytes.
The patch of #11187 (applied in r61884) unnecessarily used +U2019 which can't
be converted to latin1, remove it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-28 03:37:36 +00:00
Vadim Zeitlin
cfbc15ee04 Allow changing horizontal alignment of numeric cells in wxGrid.
wxGridCellAttr didn't provide any way to query its alignment attributes
without falling back to the (always defined) default alignment so the code in
wxGridCellNumberRenderer and similar classes simply always used right
alignment,

Add a new wxGridCellAttr::GetNonDefaultAlignment() function which allows to
retrieve the alignment defined in the attribute and use it to use right
alignment by default but allow overriding it.

Add a test to the sample showing a non right-aligned numeric cell.

Incidentally fix a long-standing bug in wxGridCell{DateTime,Enum}Renderers
which used wxRIGHT instead of wxALIGN_RIGHT and so were not aligned properly
even by default.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-27 01:47:38 +00:00
Vadim Zeitlin
ba0185b557 Add symbolic constant wxALIGN_INVALID and use it instead of -1 in wxGrid.
wxGridCellAttr was using literal -1 to indicate "no alignment" which wasn't
immediately obvious, use a new wxALIGN_INVALID (which has the same value)
instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-27 01:47:30 +00:00
Vadim Zeitlin
64932e4105 No changes, just avoid overriding GetNativeFontInfoDesc() in wxMSW wxFont.
wxFont::GetNativeFontInfoDesc() and GetNativeFontInfoUserDesc() were
overridden just to ensure that the font is realized but it makes sense to do
it in wxFontRefData::GetNativeFontInfo() itself as detecting the face name
won't work if the font is not realized anyhow. And then we don't need these
functions at all as the only thing they do is checking that the font is valid
when they are called but this can be done in the base class itself as this
should happen in all ports (document that this is the case).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-26 02:34:01 +00:00
Vadim Zeitlin
7d4911333f Document that throwing exceptions from wxTimer::Notify() is unsupported.
Currently exceptions thrown from this function are not passed to wxApp::
OnExceptionInMainLoop() (unlike exceptions thrown from timer event handlers).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-22 11:24:03 +00:00
Stefan Neis
1dd35cd656 Fixed Cut&Paste error in wxTextCtrl::ChangeValue documentation (fixes #11469).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62696 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-22 11:00:42 +00:00
Jaakko Salli
eb23d11e00 Added a new documentation overview section 'Caveats When Not Using C++ RTTI', describing possible problems with Bind() and wxAny when C++ RTTI is disabled.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-21 11:39:32 +00:00
Jaakko Salli
7db064f60f Added typeinfo.h which implements wxTypeId, using C++ RTTI if available. wxAny and Unbind<>() code are updated to use it. Added and updated related unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-19 19:27:24 +00:00
Vadim Zeitlin
fde702ea51 Fix typo in Bind() documentation: s/binded/bound/
Closes #11450.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-17 14:47:56 +00:00
Vadim Zeitlin
869aa92d4d Explicitly document event types for EVT_CLOSE().
Closes #11445.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62671 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-17 14:47:44 +00:00
Robert Roebling
d7bb29260e Revert wxFlexGridSizer constr. change
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-15 09:40:30 +00:00
Vadim Zeitlin
c0a9fe92fa Implement support for wxSL_<DIR> in wxGTK, show them better in the sample.
Support wxSL_{LEFT,TOP,RIGHT,BOTTOM} in wxGTL version of wxSlider.

Make the display of the orientations in the slider page of the widgets sample
more clear.

Also document wxSL_<DIR> meaning better.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-14 23:15:27 +00:00
Vadim Zeitlin
e098940880 Minor corrections to wxSL_LABELS definition and documentation.
Use parentheses around the macro expansion to ensure that code like "whatever
& ~wxSL_LABELS" still works as expected.

Be more explicit in wxSL_LABELS description and mark wxSL_MIN_MAX_LABELS and
wxSL_VALUE_LABEL as being new in 2.9.1.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-14 23:14:27 +00:00
Robert Roebling
7aab7176f1 Restore ability to create wxFlexGridSizer with 2 params (number of columns and vertical gap)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62651 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-14 21:50:50 +00:00
Robert Roebling
6d6f99cb41 Document wxSL_MIN_MAX_LABELS and wxSL_VALUE_LABEL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-14 14:25:54 +00:00
Robert Roebling
fe45d6ffd5 Typo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-14 11:03:17 +00:00
Robert Roebling
8ddda15ba5 Implement and document wxDataViewTreeCtrl::IsContainer(), use it in the sample to not add items to non-containers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-13 14:14:44 +00:00
Vadim Zeitlin
0ddf0ac696 Make wxSizeEvent::GetSize() description more precise.
Mention that it returns the new total (and not client) size of the window.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-12 13:13:09 +00:00
Vadim Zeitlin
869bc90db7 Add wxBase64Decode(void*,size_t,wxString) overload.
We had wxBase64Decode(void*,size_t,const char*,size_t) as well as
wxBase64Decode(const char*,size_t) and wxBase64Decode(wxString) already but
not a version taking the buffer and wxString, complete the set of overloads
now.

This allows the unit test to compile in STL build (where there is no implicit
conversion from wxString to const char *).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-11 14:38:40 +00:00
Václav Slavík
e3c3dfb409 added a note about XRCID() and EVT_*_RANGE macros (see bug #11431)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-11 10:22:57 +00:00
Vadim Zeitlin
62265c2c67 Allow custom wxDataViewCtrl renderers to easily use attributes.
Set up the DC passed to wxDataViewCustomRenderer::Render() to use the font and
colour defined by the item attribute by default so that any calls to
RenderText() from it will use them automatically.

Also added public wxDataViewCustomRenderer::GetAttr() to allow retrieving the
attribute explicitly in Render().

The column using custom renderer in the dataview sample now works as expected
in the generic version; the native ones will be corrected in the upcoming
commits.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:41:11 +00:00
Vadim Zeitlin
80093617fe No changes, just correct a recurring typo in "Override".
Two "r"s should be enough for anybody.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-09 01:57:42 +00:00
Václav Slavík
b9b2c695ff document that wxMessageDialog API additions appeared in 2.9.0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-08 11:35:58 +00:00
Vadim Zeitlin
80842e1632 Document wxDocument::SetDocumentSaved().
While this function is usually called by wx itself it may be useful to call it
explicitly in some particular situations, as documented in the function
description, so make it officially public.

Closes #11396.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-03 14:12:14 +00:00
Vadim Zeitlin
74d9b8fbd6 Make public and document wxDataView{Index,Virtual}ListModel::GetCount().
This method is useful for getting the number of items in the control and
should be part of the public API instead of being marked as internal.

Closes #11380.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 15:58:19 +00:00
Vadim Zeitlin
7fadac8872 Make wxDataViewModel::GetAttr() and GetAttrByRow() const.
This is an incompatible change but having to use a non-const model pointer to
call a clearly logically const version was simply too ugly so change it while
we still can.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-24 21:42:04 +00:00
Vadim Zeitlin
43c64cc6c9 Create model and column in wxDataViewTreeCtrl::Create(), not ctor.
Old code created the tree model and its unique built-in column only in
wxDataViewTreeCtrl ctor but not in Create(), meaning that the behaviour was
very different depending on whether you used base class ctor call or Create()
in a derived class. This was confusing and completely inconsistent with wx API
in which using the default ctor and Create() is supposed to always have
exactly the same effect as using non-default ctor so change this to create the
model in Create() so that it's always done.

Slightly update the documentation and also add wxDataViewTreeCtrl::Init() for
consistency.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-24 21:41:44 +00:00
Vadim Zeitlin
b372f20e7e Add wxDataViewModel::HasValue().
This method allows to simply test whether we have a value at the given row and
column or not (as it happens for container items unless they too have columns).

Currently this method is not virtual and is not used by the implementations
yet but it might make sense to make it virtual and allow overriding it in the
future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-24 01:03:24 +00:00
Vadim Zeitlin
795dac4c86 Add wxDataViewModel::ChangeValue() and use it in wxDVC implementation.
ChangeValue() is a trivial wrapper calling both SetValue() and ValueChanged().
It allows to replace many calls to SetValue() immediately followed by
ValueChanged() with a single function call which is significantly shorter and
less error-prone (e.g. most of the existing code didn't test SetValue() return
code at all).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-23 23:49:16 +00:00
Vadim Zeitlin
6b8ef0b35d Merge SOC2009_FSWATCHER branch into trunk.
Merges everything from the branch with only some minor changes, mostly renamed
wxUSE_FSWATCHER_{INOTIFY,KQUEUE} to wxHAS_{INOTIFY,KQUEUE}.

Add wxFileSystemWatcher and related classes.

Also introduces wxEventLoopSource.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 11:35:43 +00:00
Vadim Zeitlin
464c1f9467 Add or fix descriptions of return values from SetFont/XXXColour().
Add the same kind of description to SetBackground/ForegroundColour() as in
SetFont() and fix typo in the latter.

Closes #11352.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-21 09:44:07 +00:00
Vadim Zeitlin
3427bc784e Document wxRendererNative::DrawTitleBarBitmap() and use it properly.
Comment and document the (non obvious) requirement for the PNG image handler
to be enabled when using this function under OS X. In fact, document the
entire function itself which was forgotten previously.

Do enable PNG image handler when using DrawTitleBarBitmap() in the sample.

Closes #11345.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-19 08:59:25 +00:00
Mattia Barbon
1058f65203 Copy wxPerl notes from the LaTeX documentation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-18 17:47:01 +00:00
Vadim Zeitlin
c937bcac0f Add ellipsization support to wxDataViewCtrl.
Implemented ellipsization in the generic, GTK and both OS X Carbon and Cocoa
versions but it currently doesn't work well in GTK as it changes the item
alignment unconditionally, this will need to be fixed later.

The behaviour for the columns is currently inconsistent between ports too:
under MSW they (natively) use wxELLIPSIZE_END, under GTK -- wxELLIPSIZE_NONE
and under OS X the same ellipsization mode as the column contents, i.e.
wxELLIPSIZE_MIDDLE by default.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 21:35:26 +00:00
Vadim Zeitlin
355ce7adea Rename wxEllipsizeFlags elements to avoid confusion with wxEllipsizeMode.
We shouldn't use the same "wxELLIPSIZE_" prefix for two different enums, so
use wxELLIPSIZE_FLAGS one for wxEllipsizeFlags (they should be used less often
than wxEllipsizeMode so it's better to keep the short prefix for the latter).

Also add wxELLIPSIZE_FLAGS_NONE flag.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 21:32:51 +00:00
Jaakko Salli
23d74d894d Fix incorrect wxComboBox dropdown and closeup event macro names in doxygen docs (closes #11340)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 13:54:56 +00:00
Jaakko Salli
e607eac25c Changed 'bool recursively' to 'int flags' argument (with default value of wxPG_RECURSE) in wxPropertyGrid Set(Property)BackgroundColour() and Set(Property)TextColour() member functions.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 16:39:19 +00:00
Vadim Zeitlin
c27181d1a1 Replace wxValidator::SetBellOnError() with SuppressBellOnError().
SetBellOnError() erroneously inversed the value of its parameter. Fixing it to
behave correctly could silently break the existing code which might work
around this bug already because it always behaved like this (ever since it was
added 10.5 years ago). So instead simply deprecate this function and add a new
SuppressBellOnError() one which behaves as expected.

Closes #11318.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 14:44:22 +00:00
Vadim Zeitlin
b68d34f34c Correct typo in wxDocument::OnSaveModified() description.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 14:44:13 +00:00