Vadim Zeitlin [Wed, 8 Feb 2012 02:09:55 +0000 (02:09 +0000)]
Use wxSTC_INVALID_POSITION in wxStyledTextCtrl documentation.
Comments -- copied from the generated header file -- used INVALID_POSITION
which is not actually defined, replace it with wxSTC_INVALID_POSITION that is
defined.
Robin Dunn [Wed, 8 Feb 2012 00:20:38 +0000 (00:20 +0000)]
Following the theory that something lame is better than nothing at all, provide a very generic implementation of the ctor wxRegion::wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle) by drawing the polygon into a bitmap and using that to create the region.
Vadim Zeitlin [Tue, 7 Feb 2012 21:38:31 +0000 (21:38 +0000)]
Avoid CRT deprecation warnings for MSVC build using makefiles too.
Define _CRT_SECURE_NO_DEPRECATE, _CRT_NON_CONFORMING_SWPRINTFS and
_SCL_SECURE_NO_WARNINGS when using makefiles to build the library too for
consistency with the project files.
These defines are only needed for VC8 and later but should do no harm for the
previous versions.
Vadim Zeitlin [Tue, 7 Feb 2012 21:38:09 +0000 (21:38 +0000)]
Rebake all project files to reflect MSVC deprecation warnings defines.
Rebake all the projects after the changes of r70182, even if they're only
really needed for the library itself, the other project files should
correspond to the bakefiles contents too.
Vadim Zeitlin [Tue, 7 Feb 2012 13:02:32 +0000 (13:02 +0000)]
Fix infinite loop in wxHtmlEasyPrinting page break code.
The code didn't handle cells higher than the page height correctly and entered
an infinite loop when trying to adjust page breaks in their presence, e.g.
when trying to print a very tall image.
Vadim Zeitlin [Mon, 6 Feb 2012 13:28:34 +0000 (13:28 +0000)]
Fix handling of positional parameters in wxPrintf() and related.
Handle positional parameter specifications in wxFormatConverter to ensure that
e.g. "%N$s" are correctly transformed to "%N$S" if needed. This fixes the use
of positional parameters under OS X.
Vadim Zeitlin [Sun, 5 Feb 2012 15:45:03 +0000 (15:45 +0000)]
Don't set PAGESETUPDLG::hDevNames and hDevMode when using PSD_RETURNDEFAULT.
If the page setup dialog is used to retrieve the default information, hDevMode
and hDevNames fields must not be set, otherwise PageSetupDlg() function simply
fails because of incorrect parameters passed to it.
Vadim Zeitlin [Sun, 5 Feb 2012 14:18:37 +0000 (14:18 +0000)]
Fix huge performance problem in wxStdInputStream when using MSVC8/9.
Our overridden xsgetn() method was never called when using these compilers
because they used their own, non-standard, _Xsgetn_s() instead. Because of
this the stream was always read character by character which was very
inefficient.
Fix the problem by overriding _Xsgetn_s() for these compilers and explicitly
forwarding it to xsgetn().
Vadim Zeitlin [Sun, 5 Feb 2012 14:18:33 +0000 (14:18 +0000)]
Take void** client data in wxSingleChoiceDialog ctor and not char**.
The client data is supposed to be untyped, there is really no reason (other
than compatibility with C conventions of 40 years ago) to use char** here.
So don't do it and provide the versions taking "void**" keeping "char**" ones
for backwards compatibility only.
Also deprecate GetSelectionClientData() that returned char* and add a new
GetSelectionData() returning void* instead.
Vadim Zeitlin [Sun, 5 Feb 2012 14:18:28 +0000 (14:18 +0000)]
Preserve focus when window is minimized and restored in wxMSW.
Add specific code to save and restore the focus when the window is minimized
and restored in wxMSW as the existing code in WM_ACTIVATE handler wasn't
enough because this event was generated too late when minimizing the window
(when it was already minimized and so the focus had been already lost) and too
early when restoring it (so the window was still minimized and restoring focus
failed).
This is still not perfect as we do in our code something Windows would be
expected to do automatically but for whatever reason, it doesn't do it for
wxWidgets programs, and this manual workaround at least prevents the annoying
total focus loss.
Vadim Zeitlin [Sun, 5 Feb 2012 14:18:25 +0000 (14:18 +0000)]
Ensure that the progress dialog parent is activated at the end under MSW.
The progress dialog parent was supposed to become the new foreground window
when the progress dialog was closed, but this didn't happen because
m_parentTop was never set when the native progress dialog implementation was
used under MSW. Fix this by explicitly calling the new SetTopParent() from its
ctor.
Vadim Zeitlin [Sun, 5 Feb 2012 01:20:03 +0000 (01:20 +0000)]
Fix initial state of radio toolbar tools in wxGTK.
The last radio group item was initially checked under wxGTK instead of the
first one, as under the other platforms. Fix this by correcting the check for
the first radio group item which was inversed in wxToolBar::DoInsertTool().
Vadim Zeitlin [Sun, 5 Feb 2012 01:20:00 +0000 (01:20 +0000)]
Never refresh controls from EVT_PAINT handler in wxPropertyGrid.
Refreshing the controls after finishing repainting the grid results in an
infinite stream of paint events, so don't do this, especially as this doesn't
seem to have any bad consequences under wxGTK which was the only major
platform where this behaviour was enabled.
Also rename wxPG_REFRESH_CONTROLS_AFTER_REPAINT to just wxPG_REFRESH_CONTROLS
and keep the control refreshing code for wxGTK only in a couple of places
outside of EVT_PAINT handler to be on the safe side.
Vadim Zeitlin [Fri, 3 Feb 2012 17:27:21 +0000 (17:27 +0000)]
Check string length correctly in wxFileSystem::URLToFileName().
Check that the string is long enough before accessing its first and second
characters to fix a crash when an empty or one-character string was passed to
wxFileSystem::URLToFileName().
Vadim Zeitlin [Fri, 3 Feb 2012 17:27:13 +0000 (17:27 +0000)]
Fix speed regression in wxFileHistory::AddFileToHistory().
Avoid full normalization including wxPATH_NORM_LONG when adding files to
wxFileHistory as this can take a very long time when using network paths under
Windows.
Vadim Zeitlin [Fri, 3 Feb 2012 00:21:45 +0000 (00:21 +0000)]
Fix bug with mouse wheel scrolling wxStyledTextCtrl in long running programs.
In long running programs the wxEvent time stamp could wrap around resulting in
all mouse wheel events being ignored in wxStyledTextCtrl as the comparison of
the (positive) time until which all the subsequent events were supposed to be
blocked and the (now negative) current event time stamp would be always false.
Fix this by using wxStopWatch::TimeInMicro() to avoid wraparound instead of
wxEvent::GetTimestamp().
Also rename the variable to have a more clear name as the original code wasn't
easy to understand.
Steve Lamerton [Thu, 2 Feb 2012 20:32:08 +0000 (20:32 +0000)]
Disable navigation sounds in wxWebViewIE. This brings the backend into line with the other backends. Also add a general method for changing INTERNETFEATURELIST settings.
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.