Commit Graph

14058 Commits

Author SHA1 Message Date
Jaakko Salli
f1156cbb0d Added wxAny::HasSameType()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-18 13:30:47 +00:00
Jaakko Salli
94cd7b004d Use placement new when storing value in wxAnyValueBuffer. This should allow using any data type, regardless whether it is Plain Old Data or copyable or not.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-18 13:18:22 +00:00
Vadim Zeitlin
9655ec028f Allow specifying non default port for wxFTP connections.
Add a wxFTP::Connect() overload taking a port number.

Also specify the default port (21) explicitly if resolving "ftp" service name
failed.

Closes #12145.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-17 22:30:31 +00:00
Václav Slavík
2ab514cad4 Make the wxArrayString(int) ctor explicit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-17 13:04:21 +00:00
Václav Slavík
5e30622919 Add wxTranslations::GetAvailableTranslations().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64597 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-16 14:09:32 +00:00
Jaakko Salli
109e2ca434 Added wxIsPod<>. Use it in wxAny instead of wxIsMovable<>.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-14 15:12:37 +00:00
Jaakko Salli
1ac5cfc7c9 Added wxComboCtrl::SetTextCtrlStyle()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-13 09:59:32 +00:00
Vadim Zeitlin
c70da1a243 Fix processing of events for MRU entries #10 and more in docview.
We only handled events for wxID_FILE1..wxID_FILE9 range but there can be more
than 9 entries in the MRU list. Handle events for as many of them as there are
correctly.

This required adding a fallback handler for all menu events and checking if
the id of the menu item is in the MRU range inside it. Also move this to
wxDocManager itself from wxDocParentFrameAnyBase as it's common for all kinds
of frames anyhow.

Closes #12141.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-12 18:21:42 +00:00
Jaakko Salli
8d2c70414c Added wxPropertyGrid::DedicateKey(), which prevents specific key presses from being eaten by editor controls. This is useful for customizing keyboard navigation. Also added utility function wxPGFindInVector<>(), which is used in the new code, and also in some other places.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-12 09:30:57 +00:00
Robert Roebling
f6cb92b81f Implemented wxDataViewColumn for wxOSX/Cocoa
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64552 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-10 12:43:09 +00:00
Robert Roebling
fb0165dfff Suppress warning about double->int conversion
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64550 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-10 11:53:32 +00:00
Robert Roebling
5d9e160561 Make wxDataViewCtrl::GetColumnPosition() return the index under MSW as per GTK and the docs (fixes #12129), give immediate visual feedback after calling e.g. wxDataViewColumn::SetHidden(true) under MSW, also per GTK+ and as I'd expect. Make GTK+ control emit header click events also for non-reorderable columns. Add a few tests for wxDataViewColumn::SetHidden() and wxDataViewCtrl::GetColumnPosition()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64549 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-10 11:47:18 +00:00
Vadim Zeitlin
dca0afc73c Add missing Init() call to one of wxListBox ctors in wxMSW.
Overloaded ctor taking wxArrayString didn't call Init() so the wxListBox
fields were not initialized. Fix it by adding the Init() call.

Closes #12138.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64548 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-10 10:40:21 +00:00
Jaakko Salli
49ddcdf95f wxAny CheckType() member functions should be const
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-09 20:22:08 +00:00
Francesco Montorsi
a5664fd6ef Increase interoperability between wxPoint and wxRealPoint introducing constructors which convert between the two classes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-09 18:03:27 +00:00
Francesco Montorsi
a0e9a5dfde Implement wx-prefixed macros versions of DECLARE_EVENT_TABLE, BEGIN_EVENT_TABLE* and END_EVENT_TABLE macros.
Implement compatibility aliases for non-prefixed macro names.
Require a final semicolon where possible.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-09 14:28:08 +00:00
Francesco Montorsi
b19b28c8fc Implement wx-prefixed macros versions of DECLARE/IMPLEMENT*CLASS macros.
Implement compatibility aliases for non-prefixed macro names.
Require a final semicolon where possible.
Correct a recurring error in the docs: IMPLEMENT/DECLARE_CLASS are alias to the DYNAMIC macros, not to the ABSTRACT macros.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-09 13:55:48 +00:00
Francesco Montorsi
e4431849b4 Implement wx-prefixed macros versions of DECLARE/IMPLEMENT_APP_* macros.
Implement compatibility aliases for non-prefixed macro names.
Require a final semicolon where possible.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-09 13:23:13 +00:00
Francesco Montorsi
8b655c806b add to wxRealPoint the same operators already available for wxPoint and wxSize
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64514 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 15:45:12 +00:00
Francesco Montorsi
30b10ed1ac get rid of wxMimeTypesManager::ReadMailcap and wxMimeTypesManager::ReadMimeTypes from old include files and from the docs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 11:37:10 +00:00
Vadim Zeitlin
c07b0669cf Don't send selection events for an already selected item in wxMSW wxListBox.
Remember the last item for which a listbox notification event had been sent
and don't send it again if the user clicks on an already selected item. This
is consistent with wxGTK behaviour and generally makes more sense: why should
we send an event if the selection didn't really change?

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:58:13 +00:00
Vadim Zeitlin
f2eb4ad226 Use mouse position to find the item for selection events in wxMSW listbox.
Using LB_GETCARETINDEX doesn't work when the mouse is used to make selection
because it always returns the index of the last item, even if the mouse is
clicked below it, on an area without any listbox items. So use the mouse
position to find the item in this case but still use LB_GETCARETINDEX to find
the item when the keyboard is used.

This required adding a flag to wxListBox storing the kind of the last input
message that it received as there doesn't seem to be any way to determine how
the message was generated otherwise.

This code will be refactored/improved further in the next two commits.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:58:05 +00:00
Vadim Zeitlin
096d544752 No changes, just refactor wxListBox initialization in wxMSW.
Extract member fields initialization in Init() method instead of duplicating
it in default ctor and Create().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:57:59 +00:00
Vadim Zeitlin
53f60d4ab6 Refactor listbox event sending code to avoid duplication.
wxMSW wxListBox implementation contained the same code as the private
LBSendEvent() function in lboxcmn.cpp, so make this function a (protected)
member of wxListBoxBase and reuse it instead.

Also change its and CalcAndSendEvent() return type to bool to be able to
return whether the event was processed or not.

As the result of this refactoring, the "is selected" flag is now set correctly
for the selection events under MSW (it was always off before).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:57:53 +00:00
Vadim Zeitlin
bbdee10d5f Fix recently broken forwarding of events between event handlers.
After the recent changes to the event processing logic, forwarding an event
from one event handler to another one stopped working correctly because the
per-event "process here only" flag prevented it from following the event
handler chain after forwarding. This notably broke keyboard navigation in
wxComboCtrl under MSW in wx itself and probably quite a few of other things in
user code.

Fix this by replacing the boolean flag with a pointer to the handler to which
the processing of this event should be restricted. This allows the full
processing to still take place if an event is forwarded to another handler.
So wxEvent::ShouldProcessHereOnly() is now called ShouldProcessOnlyIn() and
takes a wxEvtHandler parameter.

This made appear a problem in wxScrollHelperEvtHandler code that was hidden by
the bug above: the events were still processed multiple times in it. To fix
this, also add wxEvent::DidntHonourProcessOnlyIn() and take it into account in
the base class code. Did I mention that wxScrollHelperEvtHandler must die?

Add another unit test checking that forwarding works correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 11:58:31 +00:00
Jaakko Salli
db3d75435a In wxComboPopupEvtHandler::OnMouseEvent(), when need to relay event to drop-down button, call HandleButtonMouseEvent() directly, if possible. This is less confusing for the platform-specific wxComboCtrl implementations, and fixes issue where the drop-down button could remain in pressed state after the mouse button was lifted.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-01 15:01:59 +00:00
Jaakko Salli
063155781d For clarity: wxComboPopupExtraEventHandler -> wxComboPopupEvtHandler (there is nothing particularly extra about it)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-01 14:17:32 +00:00
Vadim Zeitlin
76e1326add Update AUI floating windows position and not just size on resize.
When a window is resized, its position can change as well as its size but it
wasn't updated before. Do it now.

Closes #11421.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 14:59:18 +00:00
Vadim Zeitlin
6c4da6d611 Translate strings used in doc-view printing code.
Simply use _() instead of wxT() for the user-visible strings.

Closes #12110.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 14:59:03 +00:00
Vadim Zeitlin
951201d81c Add wxString::FromDouble() and FromCDouble().
wxString::FromCDouble() is needed inside wxWidgets itself to format numbers
independently of the current locale. FromDouble() was added for symmetry with
ToDouble/ToCDouble() functions.

Use std::locale for the implementation if available and manual wxLocale-based
fallback otherwise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 11:55:48 +00:00
Vadim Zeitlin
105993f7b6 Make wxString::ToCXXX() methods always available.
We use these methods inside wxWidgets itself and so want to always have them,
even when wxUSE_XLOCALE==0. Provide replacement manual implementations for
this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 11:55:41 +00:00
Francesco Montorsi
ed0dd9c1f0 implement * and / operators for wxPoint, not only wxSize.
Add to their documentation a note about the fact that the real operators are not class members but rather global functions.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 23:28:14 +00:00
Vadim Zeitlin
f68e16c5fc Add <span> tag and limited support for CSS styles to wxHTML.
Parse "style" attributes of the HTML tags and honour those of them that can be
mapped to the HTML 3 attributes.

Also add a handler for <span> tag.

Closes #10631.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 23:12:25 +00:00
Vadim Zeitlin
8325504f4b Activate the view of a newly created document.
This appears to be necessary under Mac where views are top level windows and
should do no harm elsewhere.

Also factor out the activation code in a new wxDocManager::ActivateDocument()
method to avoid duplicating it.

Closes #11417.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:05:44 +00:00
Vadim Zeitlin
b99017ce20 Store page setup data in wxDocManager.
Printing of documents from wxDocManager always used default page setup data,
allow the user to configure it now.

Add wxDocManager::m_pageSetupDialogData and add a handler for wxID_PRINT_SETUP
command to it.

Closes #11394.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:05:39 +00:00
Robert Roebling
dec7b5a808 Use GTKXXX notation for some more wxGTK specific methods for consistency
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 17:45:40 +00:00
Paul Cornett
375efc1fce Remove pizza backing window.
When it is present, no-window widgets sometimes don't get expose events for
reasons I could not determine. And it is dubious that it improved scrolling
performance on modern hardware anyway, and almost certainly doesn't help now
that GTK+ is using "client side windows".


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 06:38:28 +00:00
Vadim Zeitlin
6305f044a1 Add "filter changed" event to wxFileCtrl.
Generate an event when the selection in the filter combobox of wxFileCtrl
changes.

Closes #12099.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-29 10:35:47 +00:00
Vadim Zeitlin
384859f8c6 Add wxConfig::Read(float *) overload.
This uses Read(double *) but casts the result to float after checking that it
is in the correct range.

Closes #12100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-29 10:35:38 +00:00
Jaakko Salli
735a300a96 Fixed wxComboCtrl::SetButtonPosition() on Vista/Win7 by marking the drop-down button as 'non-standard' when its size or position is changed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-27 14:51:07 +00:00
Jouk Jansen
9015d579c8 use wxToggleButtonXmlHandler::DoCreateBitmapToggleButton on supoorted platforms only
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-27 13:45:06 +00:00
Robert Roebling
c2246a3881 Applied patch, fixes #12090: wxGTK cursor handling revamp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-26 17:37:55 +00:00
Vadim Zeitlin
81fb185e4f Fix setting the fonts for wxMSW wxTextCtrl with wxTE_RICH(2) style.
Using WM_SETFONT seemed to work with rich edit controls but in fact it
doesn't, it only changes the font used by the control initially apparently but
it can be reset later.

Use EM_SETCHARFORMAT which is more reliable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-25 21:15:24 +00:00
Vadim Zeitlin
d25a864d0a Added wxMessageQueue::Clear().
This method can be called from the posting thread to remove any still pending
requests if they became unnecessary.

Closes #10905.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-22 16:14:16 +00:00
Vadim Zeitlin
86417abf07 Fix for user input processing in wxProgressDialog.
Yield for input event processing before updating the dialog instead of doing
it after this as the latter apparently doesn't always work.

Closes #10645.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-22 16:14:11 +00:00
Robert Roebling
65887bd0f1 Second try to get wxDataViewChoiceByIndex and its name right, hopefully fixes #11970: wxDataViewChoiceRenderer set/get methods should use the current selection
index not a string

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-21 20:13:49 +00:00
Vadim Zeitlin
f2b504977d Always define SIZEOF_WCHAR_T if it's not defined under Windows.
The assumption that SIZEOF_EVERYTHING_ELSE is defined when SIZEOF_INT is is
wrong. While wxWidgets configure does define all SIZEOF_XXX at once,
SIZEOF_INT could also be defined in some third party headers (e.g. Python.h)
and we still need to define the other ones.

In particular, doing this fixes the problem with SIZEOF_WCHAR_T not being
defined during wxPython build.

Closes #12013.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64373 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-21 12:52:12 +00:00
Vadim Zeitlin
ebfee17940 Simplify and correct MSW selection of background brush for children painting.
Check for the transparency of the window background in MSWGetBgBrush() itself
and let MSWGetBgBrushForChild() just return the brush to be used.

This required adding a MSW-specific hack to wxPanel to allow inheriting
background of wxNotebook by its children which is slightly ugly but is exactly
what we need to do in this case and makes the rest of the code much simpler.

Also add a possibility to set the background of the page containing the
control being tested to the widgets sample to test for background inheritance.
This shows problems with wxSlider and wxRadioBox backgrounds but they're not
new with this patch.

Closes #12057.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-21 12:51:20 +00:00
Stefan Csomor
afd5d91cae support compiling for iphone
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-20 17:58:38 +00:00
Stefan Csomor
55a0f1e303 adding support for iphone
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64357 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-20 16:36:16 +00:00