Commit Graph

52094 Commits

Author SHA1 Message Date
Vadim Zeitlin
86646f2aef Use the correct accelerator for the "Preferences" Apple menu item.
Use the standard Command-, accelerator for the standard "Preferences" item in
the Apple menu.

Closes #12121.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-25 20:46:18 +00:00
Vadim Zeitlin
c8bef6e379 Use the application name in the "About" item of the Apple menu.
To conform to Apple UI guidelines the application name should be included in
the "About" menu item label in the Apple menu.

See #12121.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-25 20:46:11 +00:00
Václav Slavík
fd7c5da65e Add wxImplicitConversionType tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-25 09:43:04 +00:00
Václav Slavík
a52475807e Make wxMin, wxMax and wxClip template functions.
Previously used macro's arguments were evaluated twice, but there were
many occurences of their use in our code that didn't account for this
and used expensive-to-evaluate arguments as if they were functions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65920 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-25 09:43:00 +00:00
Vadim Zeitlin
1f4c7e791b Compilation fix: don't use "environ" under OS X.
The global environ variable is not directly accessible under OS X, use
_NSGetEnviron() instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-25 09:22:19 +00:00
Vadim Zeitlin
b2e04188bd Make wxUString compilable with VC6.
Provide replacements for std::basic_string functionality missing from this
compiler standard library.

Closes #12357.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65917 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 23:06:11 +00:00
Vadim Zeitlin
f73785b104 Fix typo in wxFILTER_NUMERIC documentation.
Replace wxFILTER_SIMPLE_NUMBER with wxFILTER_DIGITS.

Closes #12341.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 23:03:43 +00:00
Vadim Zeitlin
a70d268a1b Add wxDocManager::FindTemplate() method.
This allows to find the template corresponding to the document of the given
class.

Closes #12170.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 23:03:38 +00:00
Vadim Zeitlin
35f82b01cf Don't handle RPC_E_CHANGED_MODE return of OleInitialize() as an error.
This error means that OLE had already been initialized so from our point of
view it counts as a success.

Closes #12516.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 23:03:31 +00:00
Vadim Zeitlin
71f5b0e7da Do nothing in wxMemoryDC::SelectObject() if the bitmap is already selected.
It doesn't make sense to make a copy of the bitmap in order to select it into
wxMemoryDC if it's already selected into it.

See #11640.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:46 +00:00
Vadim Zeitlin
648c1af93d Always create new OLE objects with reference count of 1, not 0.
There are no real changes but ensure that the new objects of classes using
DECLARE_OLE_UNKNOWN() macro are created with valid reference count of 1
instead of being created in phantom state with reference count of 0.

Remove the now unnecessary AddRef() and add the now required DecRef() calls.

See #11566.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:41 +00:00
Vadim Zeitlin
e0b5dc3d63 Fix problems with reference counting in wxActiveXContainer.
Ensure that the IFrameSite object is created with valid (i.e. non-zero)
reference count by calling AddRef() on it immediately after creation and
remove the weird QueryInterface() call which was used to work around this bug.

Closes #11566.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:36 +00:00
Vadim Zeitlin
21e5aa164e Don't consider lack of connection points an error in wxActiveXContainer.
Handle CONNECT_E_NOCONNECTION return value from IConnectionPointContainer::
FindConnectionPoint() as an expected error and don't complain about it.

See #11566.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:29 +00:00
Vadim Zeitlin
58331be29a Don't activate the window when updating its styles in wxMSW.
Add SWP_NOACTIVATE to the flags used by wxWindow::MSWUpdateStyle(). This
allows to change the style of a window without necessarily activating it.

Closes #11560.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:24 +00:00
Vadim Zeitlin
6969b18cc7 Fix wrong wxLogDebug() call in fswatcher sample.
Replace wxLogDebug() with wxLogTrace() as was probably intended. This fixes
the assert which happened when running the sample because of the wrong number
of parameters passed to wxLogDebug().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:18 +00:00
Vadim Zeitlin
5fc3e6d448 Allow specifying the directory to watch on command line of fswatcher sample.
This makes it more convenient to run the sample repeatedly as the directory to
watch can be specified only once instead of having to choose it interactively
after the sample startup every time.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:13 +00:00
Vadim Zeitlin
942f40ca24 Avoid duplicate wxEVT_COMMAND_TREE_SEL_CHANG{ING,ED} events in wxMSW.
When changing the selected item programmatically 2 CHANGING and CHANGED events
were sent because the assumption that comctl32.dll didn't send these events
itself was not correct any more, it does send them at least since XP. However
to avoid the tests for its exact version it's simpler to just ignore the
events it generates and continue sending our own ones.

Closes #11274.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:08 +00:00
Vadim Zeitlin
1da2783c33 Don't grab focus when calling wxTreeCtrl::SelectItem().
The workaround for the unexpected events order introduced in r49588 should
only apply to the situation when the user selects an item in the tree, not
when it's done programmatically as this results in unexpected focus changes
(see #11274).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:41:03 +00:00
Vadim Zeitlin
e4545e0183 Allow to use space to toggle spinning of the cube in OpenGL sample.
Small enhancement to the cube OpenGL sample.

Closes #11545.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65904 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:58 +00:00
Vadim Zeitlin
22993989b4 Don't send wxEVT_COMMAND_TREE_ITEM_MENU event without valid item in wxMSW.
The generic wxTreeCtrl version only sends this event when the mouse is right
clicked on a valid item so do the same in wxMSW version too for consistency.

This is also consistent with wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK event and
avoids strange problems with unexpected wxEVT_COMMAND_TREE_ITEM_MENU events
generated on right double click.

Finally, replace the checks for item validity in the event handler in the
sample with asserts which should loudly complain if it happens to be invalid.

Closes #11226.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:52 +00:00
Vadim Zeitlin
0bb84570ce No real changes, just cleanup week days handling in wxGenericCalendarCtrl.
Use helper GetWeek{Start,End}() functions instead of repeating tests for
wxCAL_MONDAY_FIRST over and over again.

Also replace some occurrences of GetWindowStyle() with shorter and more clear
HasFlag().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65902 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:47 +00:00
Vadim Zeitlin
3c9863aca7 Keep displayed month and year in sync in wxGenericCalendarCtrl.
When the date was constrained to a range in wxGenericCalendarCtrl, the display
of the month in the month combobox could get out of sync with its real value.

Ensure that the correct month is always displayed and also simplify the code
by removing the apparently unnecessarily complex logic in ChangeYear() and
ChangeMonth() functions.

Closes #11060.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:41 +00:00
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
254f9b4c3c Fix conversion of 32 bit ARGB bitmaps to wxImage in wxMSW.
wxDIB::m_hasAlpha can't be trusted when the DIB was loaded from a file so
don't rely on it in wxDIB::ConvertToImage(). Instead, suppose that 32 bpp
bitmaps do have alpha channel and only get rid of it at the end of conversion
if it turns out that all alpha values were 0.

Closes #10133.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:22 +00:00
Vadim Zeitlin
c8ecb454c6 Don't hard code "open" verb in wxMSW wxLaunchDefaultApplication().
Don't choose the verb explicitly and let ShellExecuteEx() choose the default
one. In the vast majority of cases this will do the same thing but if some
file type doesn't have an "open" verb the new version will still open it
correctly using its default verb while the old version failed.

See #10707.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:17 +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
fab8784c71 Treat wxToolbook symmetrically with others in the notebook sample.
Use wxToolbook as the default notebook type if the other ones are not
available.

Closes #12610.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65895 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:40:01 +00:00
Vadim Zeitlin
448ca22809 Don't reserve space for hidden controller in wxBookCtrl.
Even when the controller was hidden, space was still allocated for it by
wxBookCtrl. Fix this by only reserving extra space when the controller is
shown.

Closes #12609.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 22:39:55 +00:00
Vadim Zeitlin
5995a84fcf Set wxKeyEvent::m_rawFlags to hardware key code in wxGTK.
The raw flags were previously unused in wxGTK but hardware key code is an
important information which may be useful to the application, so pass it in
the flags (this is rather symmetric with passing lParam in it under MSW as
lParam contains the scan code, among other things).

Also document the meaning of raw key code and flags in all the major ports.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 14:34:45 +00:00
Vadim Zeitlin
21567b0960 Output header to the same directory as the .cpp file in wxrc.
If "-o" option is given, generate the output header file in the same directory
as the .cpp file and not in the current directory.

Closes #4054.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 14:34:22 +00:00
Vadim Zeitlin
7c4e16e698 Use wxChoicebook instead of wxNotebook in the xrc sample.
wxNotebook was unusable with so many pages under all platforms and completely
unusable under Mac. Replace it with wxChoicebook which allows to select any
page quickly instead of having to do it sequentially (or not being able to do
it at all under Mac).

Another possibility could be to use wxTreebook and organize the pages in
categories, similarly to how it is done in the widgets sample.

Closes #3699.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 14:34:12 +00:00
Vadim Zeitlin
85edc04591 Rearrange xrc sample controls in alphabetical order.
Several new pages were added in random positions, rearrange them to be in
alphabetical order.

Also remove wxToolBar from "The Rest" page as it is shown in one of the other
pages now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 14:34:05 +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
c5d7b7d20b Don't use non-existent icon in XRC sample.
appicon.xpm was removed so use another icon in the controls demo in the sample
instead, it doesn't matter which one we use anyhow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 18:56:37 +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
fe97acf0e3 Don't assume any particular default size for XRC image lists.
Let the image list deduce its size from the first bitmap in it. This is better
than the old behaviour of using the standard icon size as it allows to omit
the size from the image lists provided they contain the bitmaps of the same
size.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 18:56:13 +00:00
Vadim Zeitlin
814bfbb9c0 Correct wxDialog::SetAffirmativeId() documentation.
The return value of ShowModal() is the affirmative id and not wxID_OK, of
course.

See ##11413 (specifically comment 5).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65883 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 18:56:06 +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
ec2c85bf79 Construct paths using wxFileName in wxHTML help.
Use wxFileName instead of more complicated and error-prone manipulations with
strings.

Closes #12602.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:10:05 +00:00
Vadim Zeitlin
7f75598947 Use rpmbuild to build the RPMs in "make rpm" target.
In recent versions of rpm rpmbuild must be used for building the RPMs instead
of rpm itself.

See #12567.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65880 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:09:57 +00:00
Vadim Zeitlin
b3706b40d2 Add more headers to "make dist" and remove .mo files.
Add wx/persist headers to the list of files used by "make dist" and remove the
message catalogs which shouldn't be part of the source distribution.

See #12567.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65879 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:09:49 +00:00
Vadim Zeitlin
f5ee20ccd3 Include wxscintilla library in wxGTK RPM.
Include libwxscintilla.a for static linking.

See #12567.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:09:43 +00:00
Vadim Zeitlin
7a2c0dd904 Generate the full list of wxBase headers paths in wxGTK.spec.
Instead of hardcoding the list of wxBase headers path, build it automatically
from the list of their base names which is generated by bakefile and so is
always up to date.

See #12567.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:09:39 +00:00
Vadim Zeitlin
a2d2cb04ee Force the use of GNOME printing support and wxMediaCtrl in wxGTK RPMs.
Explicitly enable the use of GNOME printing and media control to ensure that
RPMs are always created with these features enabled.

See #12567.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:09:34 +00:00
Vadim Zeitlin
bae3556dbf Remove "release" suffix from wx-config links used in RPMs.
We don't distinguish debug and release builds under Unix any more in 2.9 and
don't use "release" and "debug" suffixes in full wx-config names. Remove these
suffixes from the wx-config links created by RPM post-installation step.

See #12567.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65875 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:09:27 +00:00
Vadim Zeitlin
1bcde56c8d Document that wxProcess::GetOutputStream() can't be used after CloseOutput().
As closing the output stream makes it unusable, it is destroyed as well and so
GetOutputStream() returns NULL after calling CloseOutput().

Closes #12605.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:09:21 +00:00
Robert Roebling
e3d358bbe4 wxDataViewCtrl::Expand() only works on items whose parents are already
expanded. The attached patch fixes this by expanding all ancestors of the
 item before expanding the item itself. Closes #12585: wxDataviewCtrl::Expand() needs to expand all ancestors

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-23 14:03:18 +00:00