Vadim Zeitlin [Thu, 2 Feb 2012 14:26:06 +0000 (14:26 +0000)]
Fix initial wxRadioBox buttons positions in wxMSW.
We only updated the button positions when the radio box was moved or resized
after being created but didn't do it initially, so a radio box created with
fixed position and size didn't lay out its buttons correctly. Do lay them out
immediately after creating the radio box to fix this.
Vadim Zeitlin [Thu, 2 Feb 2012 14:19:34 +0000 (14:19 +0000)]
Add wxFontDialog ctor not taking wxFontData to wxOSX.
wxFontDialog should have ctor and Create() overload taking just wxWindow
parent in addition to the one taking parent and wxFontData used to initialize
the dialog but it didn't have them in wxOSX, do add them now.
Vadim Zeitlin [Tue, 31 Jan 2012 13:09:07 +0000 (13:09 +0000)]
Don't document wxVector<>::reverse_iterator.
Documenting just this class but not iterator (and const_iterator) is
inconsistent but documenting all of them is too much mostly useless work as
all iterators (of the same category) have the same interface anyhow. So just
remove the documentation of reverse_iterator for now.
Vadim Zeitlin [Tue, 31 Jan 2012 13:09:04 +0000 (13:09 +0000)]
Remove dummy Lithuanian translations.
All non-translated strings were "translated" as their English originals in
lt.po. This was just a artefact of the software used for translation and
wrong, so remove all these dummy translations.
Vadim Zeitlin [Wed, 25 Jan 2012 00:05:15 +0000 (00:05 +0000)]
Update wxCommandProcessor after saving wxDocument.
Surprisingly, wxCommandProcessor::MarkAsSaved() method was never called by
wxDocument so saving the document didn't update wxCommandProcessor dirty
status.
Do add a call to MarkAsSaved() now, this allows wxCommandProcessor to track
its status correctly (and actually more correctly than the dirty status of the
document which becomes "dirty" after doing and undoing an operation after
saving it, unlike wxCommandProcessor::IsDirty() which correctly returns false
in this case).
Vadim Zeitlin [Wed, 25 Jan 2012 00:05:09 +0000 (00:05 +0000)]
Don't compare invalid iterators in wxCommandProcessor::IsDirty().
Check that m_lastSavedCommand is valid before comparing it with
m_currentCommand as comparing invalid iterators results in an assert in STL
build (and probably should also result in an assert in non-STL build too for
consistency).
Also move IsDirty() implementation out of line to make it easier to modify it
further in the future and because there is no real reason to keep it inline.
Vadim Zeitlin [Tue, 24 Jan 2012 22:17:47 +0000 (22:17 +0000)]
Fix setting frame icon when using non-standard icon sizes in wxMSW.
Set the closest (and larger, if possible) icon if the icon of exactly the
system icon size is not available. This fixes setting the icons when using
custom DPI settings under MSW as the standard icon size may be different from
the standard 32*32 in this case.
This also improves wxIconBundle::GetIcon() to make its behaviour when the icon
with exactly the given size is not found more flexible as a side effect.
Vadim Zeitlin [Mon, 23 Jan 2012 14:42:53 +0000 (14:42 +0000)]
Fix wxButtonToolBar compilation after adding new wxFont ctor overload.
The new wxFont ctor added in r70445 resulted in ambiguity when using
wxFont(int, wxFontFamily, wxFontStyle, int) ctor mixing the type-safe values
for the 2nd and 3rd arguments with "untyped" int for the 4th one. Fix this by
avoiding the use of this ctor as it seems impossible to do it in any other
way.
Vadim Zeitlin [Mon, 23 Jan 2012 13:59:52 +0000 (13:59 +0000)]
Add a property to configure file property dialog kind.
Add wxPG_FILE_DIALOG_STYLE allowing to pass wxFileDialog style that should be
used by the given wxFileProperty. This notably allows to have file properties
accepting not yet existing files, as is needed when using them for the file
names to be saved, not opened.
Vadim Zeitlin [Mon, 23 Jan 2012 11:28:21 +0000 (11:28 +0000)]
Add wxFont ctor taking a single flags argument instead of style/weight/...
Currently this ctor just does the same thing as the existing ctors in a
different way but it will be extended to support wxFONTFLAG_STRIKETHROUGH in
the next commits.
Vadim Zeitlin [Mon, 23 Jan 2012 11:28:16 +0000 (11:28 +0000)]
Fix wxAffineMatrix2D::Translate() to multiply on the left.
The affine transform was previously multiplied by the translation matrix on
the right but this was incompatible with both the MSW version of the same
method and all the other methods of the generic version.
So multiply the transform by the translation on the left, as everywhere else.
Vadim Zeitlin [Mon, 23 Jan 2012 11:28:12 +0000 (11:28 +0000)]
Fix incorrect scroll positions used in SetScrollbars().
SetScrollbars() passed its input positions expressed in scroll units to
CalcUnscrolledPosition() which takes positions in pixels. This was definitely
wrong so don't do this and perform the conversion from scroll units to pixels
in SetScrollbars() itself for clarity instead.
It's not clear what concrete bugs, if any, does this fix as the calculated
positions are almost never used anyhow but the old code was obviously
incorrect and the new version has a chance of not being wrong so it's already
an improvement.
Vadim Zeitlin [Mon, 23 Jan 2012 11:28:01 +0000 (11:28 +0000)]
Avoid warnings about mismatched format string in wxMSW wxClipboard code.
Cast the string offsets to "unsigned" explicitly, even though they can be 64
bit (whereas unsigned is 32 bits) under Win64, the strings we operate with
here shouldn't be more than 4GiB long.
Vadim Zeitlin [Sun, 22 Jan 2012 00:58:05 +0000 (00:58 +0000)]
Create wxStaticText with correct label directly in wxTextSizerWrapper.
This is shorter and arguably more clear than doing it in two steps as we did
before and also works in wxUniv, unlike creating wxStaticText with empty label
and setting it later.
Vadim Zeitlin [Sat, 21 Jan 2012 17:03:52 +0000 (17:03 +0000)]
Fix reparenting generic wxSpinCtrl.
The existing Reparent() implementation was wrong as it reparented spin control
subwindows under the new parent but left the main window itself under the old
one. Fix this by just not overriding Reparent() at all, the inherited version
works just fine for this control.
Vadim Zeitlin [Fri, 20 Jan 2012 23:18:29 +0000 (23:18 +0000)]
Update the message catalog charset expected by the unit test.
The charset of the message catalog files changed to UTF-8 in r70411 but the
unit test still expected ISO-8859-1. Update the unit test too to make it pass
again.
Vadim Zeitlin [Fri, 20 Jan 2012 22:11:55 +0000 (22:11 +0000)]
Fix time zone in wxDateTime::UNow().
The internal wxDateTime representation is in the UTC, so use
wxGetUTCTimeMillis() in UNow(), using wxGetLocalTimeMillis() made it
inconsistent with Now() and wrong.
Vadim Zeitlin [Fri, 20 Jan 2012 22:11:51 +0000 (22:11 +0000)]
Ensure wxCharTypeBuffer data is NUL-terminated after extend() call.
As wxCharTypeBuffer ctor taking the length NUL-terminates the buffer, it may
be expected that extend() does the same but it did not. Do add the NUL at the
end for consistency, even though it's not really needed for the existing code
using extend() in wxWidgets itself.
Vadim Zeitlin [Fri, 20 Jan 2012 22:11:47 +0000 (22:11 +0000)]
Fix documentation of wxConfig::Read(float*) overload.
Grouping methods using "//@{" and "//@}" apparently doesn't work and
completely wrong documentation is used in this case, so document the two
overloads separately, as it's done for the other methods.
Vadim Zeitlin [Fri, 20 Jan 2012 22:11:44 +0000 (22:11 +0000)]
Add error checking when retrieving client data from wxMSW wxListBox.
Verify if retrieving client data failed which might happen if the index
is invalid for example. This makes code more robust and also consistent with
wxChoice.
Vadim Zeitlin [Fri, 20 Jan 2012 22:11:39 +0000 (22:11 +0000)]
Check that an error really occurred when getting wxChoice data in wxMSW.
We could wrongly return NULL client data if -1 was stored as client data in
wxChoice because it's the same value as CB_ERR and we always interpreted it as
an error, while it may not be one if GetLastError() doesn't indicate it.
Vadim Zeitlin [Fri, 20 Jan 2012 22:11:32 +0000 (22:11 +0000)]
Destroy modeless wxGenericAboutDialog when it is closed.
Don't leave the wxGenericAboutDialog object alive when non-modal about dialog
(as can be used under GTK and OS X) is closed. This is wasteful and, worse,
resulted in the program not exiting after such a dialog was shown because it
counted as a remaining open top level window.
This also fixes the same bug in wxGTK when using GTK+ 2.4.
MS and Apple guidelines mention ellipses should generally be used when a command needs additional information from the user before the operation can execute. This is not the case for showing an about dialog so the ellipses have been removed.
Vadim Zeitlin [Fri, 20 Jan 2012 12:30:08 +0000 (12:30 +0000)]
Try to avoid truncation of the message in wxMSW wxMessageDialog.
Use (documented but undefined) TDF_SIZE_TO_CONTENT flag under Windows Vista/7
to reduce the chance that Windows truncates or ellipsizes the message text if
it can't wrap it.
Truncation can still happen for very long words but there doesn't seem to be
any drawbacks to using TDF_SIZE_TO_CONTENT and it does avoid truncation in at
least some cases.
This also improves the situation for wxRichMessageDialog and wxProgressDialog.
Vadim Zeitlin [Wed, 18 Jan 2012 23:12:03 +0000 (23:12 +0000)]
Skip EVT_RIGHT_UP event in wxHtmlWindow if it wasn't handled.
This fixes generation of EVT_CONTEXT_MENU for mouse clicks in wxHtmlWindow
under MSW: it wasn't generated before because we always ate the right mouse
clicks.
Vadim Zeitlin [Wed, 18 Jan 2012 19:42:58 +0000 (19:42 +0000)]
Avoid needless second string conversion when adding files to memory FS.
Create the buffer holding the result of conversion instead of converting
twice, once to only get the length of the result and the second time to get
the data.
Vadim Zeitlin [Wed, 18 Jan 2012 17:26:23 +0000 (17:26 +0000)]
Don't auto-link with 3rd party libraries in DLL build using MSVC.
It's unnecessary to link with these libraries as they're already embedded
inside our DLLs and the functions from them can't be used anyhow as they're
not declared as DLL-exported in the libraries headers.
Václav Slavík [Tue, 17 Jan 2012 14:05:17 +0000 (14:05 +0000)]
Replace wxDataViewCtrl::StartEditor() with EditItem().
This is more consistent with other wxDVC methods (taking column pointer
as its argument) and other DVC-like classes where the name EditLabel()
is used for similar purposes.