Vadim Zeitlin [Tue, 8 Nov 2011 11:02:05 +0000 (11:02 +0000)]
Move GDK_META_MASK definition in the header in which it is also used.
The code using GDK_META_MASK was moved to wx/gtk/private/event.h from
gtk/window.cpp but the fallback definition of GDK_META_MASK for GTK+ < 2.10
remained in window.cpp.
Move it to the header as well now so that it can be compiled with GTK+ < 2.10
again.
Vadim Zeitlin [Tue, 8 Nov 2011 11:01:58 +0000 (11:01 +0000)]
Add missing stdio.h include to wxGTK assert dialog code.
As we use FILE for saving the assert message to a file, we must include
<stdio.h> (which is not included from any other header, at least not under
Solaris).
Václav Slavík [Tue, 8 Nov 2011 10:53:49 +0000 (10:53 +0000)]
Use Enter and Space for cell editing in generic wxDVC too.
If the normal Enter or Space processing (sending activate event or doing
activatable editing respectively) isn't handled by the control, use
these keys to trigger inline editing too, as F2 does.
This makes the Windows control more similar to OS X and GTK+ ones and
makes discovering editability easier.
Vadim Zeitlin [Sun, 6 Nov 2011 12:06:43 +0000 (12:06 +0000)]
Use current time, not the Epoch for time zone determination.
When deducing the time zone from struct tm tm_gmtoff field, query tm for the
current time and not the Epoch as the DST rules -- and hence the time zone
offset -- could have changed since 1970. This is notably the case for Ireland
which used a different time zone from 1968 to 1971.
Notice that GetTimeZone() still must return the time zone without taking DST
into account, so we explicitly compensate for DST if it's in effect.
Vadim Zeitlin [Sat, 5 Nov 2011 11:24:04 +0000 (11:24 +0000)]
Allow reusing the same wxWindowID more than 254 times.
Extend the id reference count storage to use an overflow hash map for the ids
used more than 254 times. This allows to use the same id an arbitrarily large
number of times.
Vadim Zeitlin [Sat, 5 Nov 2011 11:23:51 +0000 (11:23 +0000)]
Fix format string in wxLog::LogLastRepeatIfNeeded().
We used a format string without any format specifiers in it in a call to
wxString::Printf() which always had a parameter resulting in an assert failure
about a mismatch between the string and parameter count.
Fix this by using a separate Printf() call for this case.
Vadim Zeitlin [Sat, 5 Nov 2011 11:23:48 +0000 (11:23 +0000)]
Use correct direction in wxDataObject::IsSupported() in wxOSX dnd code.
Before calling wxDataObject::SetData() we must check whether the object
supports this format using IsSupported(Set) instead of just IsSupported()
which does the test in the "Get" direction.
Vadim Zeitlin [Sat, 5 Nov 2011 11:23:44 +0000 (11:23 +0000)]
Don't read beyond the end of input buffer when decoding UTF-16.
wxMBConvStrictUTF8::FromWChar() didn't update the input length correctly when
encountering a surrogate while decoding UTF-16 and could read beyond the end
of the input buffer in this case.
Fix this by simply adjusting the input length when a surrogate is read.
Vadim Zeitlin [Sat, 5 Nov 2011 10:28:48 +0000 (10:28 +0000)]
Rename lineAnchor in Scintilla code to avoid shadowing warning.
Local variable "lineAnchor" in Editor::SetRectangularRange() was shadowing the
member variable Editor::lineAnchor, resulting in warnings from some compilers
(AIX xlC, Sun CC).
Rename it to "lineAnchorRect", just as it was done in the latest Scintilla
sources, to avoid them.
Vadim Zeitlin [Fri, 4 Nov 2011 17:41:20 +0000 (17:41 +0000)]
Correct the misleading example of using id ranges in XRC documentation.
"range[end]" is the last id in the range, inclusive, not the first id after it
so any loops iterating over all ids in the range should cover it as well.
Vadim Zeitlin [Fri, 4 Nov 2011 17:40:49 +0000 (17:40 +0000)]
Simplify wxIdRange code by using new XRCID_Assign() function.
Only traverse the id hash once in XRCID_Assign() instead of using
RemoveXRCIDEntry() to delete the old entry (which usually doesn't exist so
this traversed the entire hash) followed by XRCID_Lookup() to create a new one.
Vadim Zeitlin [Fri, 4 Nov 2011 12:02:07 +0000 (12:02 +0000)]
Fix choice of tree item icon for the selected state in wxMSW.
The logic for selecting the item icon was broken when selected image was
specified as it was not taken into account as fallback for selected expanded
state so selected icon was used only for collapsed items.
Fix this by using the selected icon if it is specified and selected expanded
one is not.
Vadim Zeitlin [Wed, 2 Nov 2011 19:08:54 +0000 (19:08 +0000)]
Improvements to German translation.
- Changed phrasing of some texts
- Replaced words by more commonly used ones
- Translated untranslated words and sentences
- Used clear translation for vague expressions
- Used common translation for multiply used terms like "save"
Vadim Zeitlin [Wed, 2 Nov 2011 19:08:46 +0000 (19:08 +0000)]
Punctuation fixes in German translation.
- Fixed some menu entries which where using '$' instead of '&'
- Added missing punctuation marks to equal the original text
- Removed unneeded and double characters
Vadim Zeitlin [Mon, 31 Oct 2011 19:41:06 +0000 (19:41 +0000)]
Make wxTreeListEvent dynamically creatable.
This is unfortunately required by wxEvent::Clone() support unit test so
provide the default ctor in this class even though it doesn't make any sense
in normal use.
Vadim Zeitlin [Mon, 31 Oct 2011 14:24:49 +0000 (14:24 +0000)]
Compilation fix for AIX: fix the name of wxGetservBuf ctor.
The ctor was wrongly called so wxGetservBuf class couldn't be compiled,
breaking compilation under AIX and any other systems with 4 argument
getservbyname_r().
Fixed dropdown height of wxChoice and wxComboBox controls.
When using comctl32.dll versions prior to 6.0 (e.g. with Win2k or no manifest file) the dropdown height of a wxChoice and wxComboBox would show all but one item and a vertical scrollbar was always visible. Fixed by reintroducing code that adds 1 to the total number of items. The code got dropped in r60553, added a comment to it in the hope that it will not be lost again.
Vadim Zeitlin [Sun, 30 Oct 2011 19:48:50 +0000 (19:48 +0000)]
Avoid too many sash position changed events when splitter is resized.
We could call SetSashPositionAndNotify() twice in a row which was probably
unexpected and possibly wasteful, if the user code did anything non trivial in
response to this event.
Just call it once after we're certain which sash position do we want to set.
Vadim Zeitlin [Sun, 30 Oct 2011 19:48:48 +0000 (19:48 +0000)]
Fix the check for second window becoming too small in wxSplitterWindow.
There was a strange check for the second pane size in OnSize() which hardcoded
5 pixels as minimal pane size in the check and 40 pixels as the minimal size
to set. This resulted in strange behaviour when the second pane size would
decrease to 6 pixels smoothly and then jump back to 40 pixels when the
splitter window was resized and also was ugly at the code level.
Get rid of this code and simply call AdjustSashPosition() to ensure that the
sash position remains valid as the splitter is resized.
Vadim Zeitlin [Sun, 30 Oct 2011 19:48:44 +0000 (19:48 +0000)]
Make the initial sash position work in splitter sample.
The initial splitter size must be set correctly when using gravity with
wxSplitterWindow as otherwise the sash would jump on first resize -- which was
exactly what happened in the splitter sample.
Add a SetSize() call to the sample with the comment explaining why is it
needed and also actually make it stick as the cached last size was not updated
before the splitter was split before.
This variable seemed to be redundant with m_requestedSashPosition being set to
INT_MAX so harmonise the code to always check for the latter and get rid of
the former.
There should be no observable changes in behaviour.
Vadim Zeitlin [Sun, 30 Oct 2011 19:48:34 +0000 (19:48 +0000)]
No changes, just remove wxSplitterWindow::{Set,Get}NeedUpdating().
GetNeedUpdating() was never used at all while SetNeedUpdating() was used only
once while m_needUpdating variable was being changed directly in other places
making the code difficult to follow.
Just use the member variable directly and remove the accessors.
Julian Smart [Sun, 30 Oct 2011 17:28:03 +0000 (17:28 +0000)]
Fixed problem with the size of paragraphs not needing layout not being taken into account when calculating overall box size.
Should fix the problem with lines becoming insensitive to mouse clicks after adding a couple of shorter lines.
Vadim Zeitlin [Sun, 30 Oct 2011 16:41:34 +0000 (16:41 +0000)]
Fix splitting message into title in body in MSW wxProgressDialog.
If the message doesn't contain any new lines, it should be used as the body,
not the title as having title without body doesn't make sense and looks
strange.
Vadim Zeitlin [Sun, 30 Oct 2011 16:22:30 +0000 (16:22 +0000)]
Don't replace non default wxMessageDialog labels with default translations.
The code translating the button labels of wxMessageBox to the application
language was overeager and replaced even the custom labels with the
translations of the default ones.
This shouldn't be done, of course, so simply check that no custom labels had
been set before translating.
This dtor doesn't seem to do anything useful as the base class dtor already
destroys all window children anyhow and removing it is reported to fix some
crashes in wxAUI (which is surprising and probably hides some other bug...).
Vadim Zeitlin [Sun, 30 Oct 2011 14:19:47 +0000 (14:19 +0000)]
Fix assert in generic wxListCtrl icon view when using images.
Don't assume that the item image is a valid index in m_small_image_list as we
may be in icon view which doesn't use small images at all.
For now restrict this code to the report view mode as apparently the cached
line height is not supposed to be used in other modes even though it's not
clear whether this is really the case and so, perhaps, this code should also
be used when in small icons view mode.
Vadim Zeitlin [Sun, 30 Oct 2011 10:08:18 +0000 (10:08 +0000)]
Allow customization of the locations where persistent settings are stored.
Make it possible to set a non-default wxPersistenceManager to use and allow
overriding of GetConfig() and GetKey() methods by making them virtual and
documenting them.
This can be notably used to allow porting of the existing code to use
wxPersistenceManager while keeping compatibility with the old settings.
Vadim Zeitlin [Thu, 27 Oct 2011 22:26:10 +0000 (22:26 +0000)]
Add _PTR WX_DECLARE_HASH_SET variants to fix warnings about operator->().
Macros from WX_DECLARE_HASH_SET family could declare an operator->() which
could never be called because it returned a pointer to a non-object (e.g. a
pointer or a primitive type).
Fix this in the same way as for WX_DECLARE_ARRAY macros by adding (badly but
consistently) named _PTR variants of the macros to allow defining the versions
without operator->().
This fixes tons of warnings when building wx with Sun CC.
Vadim Zeitlin [Thu, 27 Oct 2011 21:10:51 +0000 (21:10 +0000)]
Use WX_XXX_ARRAY_PTR macro variants for arrays of pointers.
Arrays of pointers must not overload operator->() as it is not used with them
and is, in fact, unusable, provoking a warning from Sun CC every time such
array is declared. Use the special _PTR-suffixed versions to avoid this.
Vadim Zeitlin [Thu, 27 Oct 2011 21:10:48 +0000 (21:10 +0000)]
Don't make wxQsort() extern "C" nor use any special convention for it.
It doesn't make sense to require passing C functions to wxQsort() that we
define in a C++ library. We also don't need any special calling convention
here.
Notice that the only existing uses of wxQsort() inside wxWidgets itself were
not actually extern "C" and one of them didn't even use the correct calling
convention.
Also avoid using non-wx-prefixed CMPFUNCDATA identifier in a public header,
rename it to wxSortCallback instead.
Finally make wxQsort() documentation slightly more useful.
Vadim Zeitlin [Thu, 27 Oct 2011 21:10:43 +0000 (21:10 +0000)]
Explicitly declare environ variable.
While POSIX and SUS both mandate this variable existence, they don't say that
it needs to be declared anywhere and it actually doesn't seem to be declared
under Solaris when using Sun CC and so using it resulted in compilation errors.
Vadim Zeitlin [Thu, 27 Oct 2011 21:10:40 +0000 (21:10 +0000)]
Always include locale.h to get LC_ALL declaration.
For some reason locale.h was only included in !wxUSE_STD_STRING case but we
actually always need it as we use LC_ALL in this file and at least in Sun CC
build it wasn't included from anywhere else so include it from here to fix the
build.
Vadim Zeitlin [Thu, 27 Oct 2011 21:10:33 +0000 (21:10 +0000)]
Replace remaining occurrences of _T() with wxT().
Use wxT() everywhere for consistency and to fix compilation with Sun CC for
which _T() is not defined as it clashes with a symbol with the same name in
standard headers.