Vadim Zeitlin [Sun, 16 Aug 2009 23:13:55 +0000 (23:13 +0000)]
Use CF socket manager in GUI OS X applications.
wxSocketManagerMac was never created under OS X since wxSocket code
refactoring as wxGUIAppTraits::GetSocketManager() wasn't overridden.
Doing this required an extra nasty hack with a global variable in the base
library which is used just to pass the socket manager pointer from the net
library to the core one without creating a dependency between them but this
seems unfortunately unavoidable.
Vadim Zeitlin [Sun, 16 Aug 2009 23:13:45 +0000 (23:13 +0000)]
Virtualize wxSocketImpl creation by routing it via wxSocketManager.
This is necessary to create different kinds of sockets for the console and GUI
applications under OS X: unlike Unix which use different socket managers for
the console and GUI programs but still use the same data structures in both
cases as X11 and derived toolkits APIs are very similar, Core Foundation
sockets don't have anything in common with their console counterparts and so
we need to use different wxSocketImpl versions too.
A side effect of this commit is that now we need to force linking of
src/msw/sockmsw.cpp when using sockets: this wasn't necessary before because
it contained wxSocketImpl method definition but now that there are no more
direct dependencies on it, MSVC linker simply discards the object file unless
we force it to link with it.
Notice that this commit doesn't change anything yet, it simply refactors the
code to use wxSocketManager::CreateSocket() instead of wxSocketImpl::Create()
in preparation for the next change.
It may be useful to change the directory where it is generated to allow the
users to find it more quickly. Also allow changing the crash report base name
for completeness.
Vadim Zeitlin [Tue, 11 Aug 2009 18:16:39 +0000 (18:16 +0000)]
Create compressed debug report file outside of temporary directory.
Otherwise the compressed file is deleted when the temporary directory is (it
doesn't happen if temporarily files are left because an error occurred while
the report generation but perversely enough no useful information was left if
no errors happened).
Vadim Zeitlin [Tue, 11 Aug 2009 10:54:40 +0000 (10:54 +0000)]
Another compilation fix after wxFlexGridSizer ctors change.
wxFlexGridSizer ctor was even used incorrectly even in layout sample itself,
once again the code was supposed to create 3*3 sizer, not 3-column sizer with
3 pixel vertical gap.
Changed ctors to be more explicit and to use a 5 pixel gap in both directions.
Vadim Zeitlin [Mon, 10 Aug 2009 11:18:23 +0000 (11:18 +0000)]
Update wxFlexGridSizer ctors to match (new) wxGridSizer ones.
Confusing wxFlexGridSizer(int cols, int vgap = 0, int hgap = 0) was removed as
well as corresponding wxGridSizer ctor overload. New ctor overloads taking gap
as wxSize were added.
Vadim Zeitlin [Mon, 10 Aug 2009 11:18:09 +0000 (11:18 +0000)]
Made wxWindow::HasScrollbar() do what it says.
Added wxWindow::CanScroll() with the old HasScrollbar() meaning but changed
HasScrollbar() to check for the scrollbar existence instead of just checking
if it might exist.
Vadim Zeitlin [Thu, 6 Aug 2009 00:01:43 +0000 (00:01 +0000)]
Don't pop explicitly changed status messages.
Calls to SetStatusText() in between Push/PopStatusText() were simply lost
before, now the text explicitly changed by SetStatusText() is preserved by the
next call to PopStatusText().
This required adding a new virtual method, called DoUpdateStatusText(), which
is now implemented in all the derived classes instead of overriding
SetStatusText() (on the bright side, it doesn't need to do any checks already
done in the base class any more).
Also fix PushStatusText() to actually show the text being pushed at all under
wxMSW as a side effect.
And further reduce code duplication between wxStatusBarBase and the derived
classes.
Vadim Zeitlin [Thu, 6 Aug 2009 00:00:47 +0000 (00:00 +0000)]
Add test for Push/PopStatusText().
Allow to interactively push and pop status messages for the selected field.
This shows that currently PushStatusText() is completely broken under wxMSW
as it never shows the text being pushed at all because it is "optimized" away
due to an incorrect comparison with the old value (which turns out to be the
new one)
Vadim Zeitlin [Thu, 6 Aug 2009 00:00:39 +0000 (00:00 +0000)]
Provide saner UI for setting status bar fields.
Instead of asking the user to enter N values in a row (which is really
annoying even for N=2 already), allow to select the status bar to set the
value for and only show a single dialog asking for the value of this pane.
Vadim Zeitlin [Wed, 5 Aug 2009 17:25:27 +0000 (17:25 +0000)]
wxSplitterWindow mouse capture improvements and cleanup.
- Handle mouse-capture-lost event to abort dragging mode.
- Remember mouse and sash position on buttondown event and use them as
absolute reference during dragging. Avoid delta values from one mousemove to
the next as this may introduce a skew during dragging and especially when
coordinate clipping occurs.
- Clear the requested sash position when dragging in live mode.
- Draw the tracker at correct coordinates - taking into account the width of
the pen used to draw the tracker.
- The old code did not clearly distinguish between live vs. tracking mode in
some places.
Vadim Zeitlin [Wed, 5 Aug 2009 17:25:14 +0000 (17:25 +0000)]
Generate scroll events for key presses in wxScrolledWindow.
Don't duplicate the existing wxScrolledWindow::CalcScrollInc() logic in
HandleOnChar(), simply generate scrolling events from it, this simplifies the
code and ensures that it is more correct.
Vadim Zeitlin [Wed, 5 Aug 2009 17:24:50 +0000 (17:24 +0000)]
Cleaned up low level OS X sources.
The low level files are those which are used by wxUniversal and so shouldn't
contain native controls implementations -- moved them from OSX_LOWLEVEL_SRC to
OSX_CARBON_COCOA_SRC.
Also removed the now unnecessary check for __WXUNIVERSAL__ in src/osx/accel.cpp.
Vadim Zeitlin [Mon, 3 Aug 2009 20:37:03 +0000 (20:37 +0000)]
Correct week day returned from wxCalendarCtrl::HitTest() on header click.
A combination of a wx bug in conversion from native control week days to
wxDateTime week days and a bug of native control itself when the first week
day is not Monday resulted in the day being off by one it did start with
Monday. The new code works correctly in both Monday and Sunday cases, at least
until the bug in comctl32.dll is corrected.
Vadim Zeitlin [Mon, 3 Aug 2009 20:10:31 +0000 (20:10 +0000)]
Always use MCHITTESTINFO of minimal size.
This struct has gained additional fields under Vista which are not supported under previous versions. We don't use these fields but just using a bigger struct makes functions using it fail under pre-Vista systems, so don't do this.
Vadim Zeitlin [Sun, 2 Aug 2009 00:59:31 +0000 (00:59 +0000)]
Check indices validity better in wxGridStringTable.
Calling GetValue(-1, -1) could crash as the code naively only checked upper boundary (and didn't use unsigned which would have made the extra check unnecessary but it's too late for this now).
Václav Slavík [Fri, 31 Jul 2009 18:48:34 +0000 (18:48 +0000)]
compilation fix: only one wxInitialize form may have default argument values. It doesn't make sense to specify only argc>0, so removed default values and added default wxInitializer ctor.
Václav Slavík [Thu, 30 Jul 2009 07:09:43 +0000 (07:09 +0000)]
Use wxInitializer in wxEntryReal() instead of directly calling wxEntryStart() without refcounting. This makes it possible to write hybrid CLI/GUI wx applications.
It was left uninitialized before resulting in the key being closed on access because the check for being opened in a mode with enough permissions failed even for Read.
Long version is constructed by concatenating "Version " with the short version but can be overridden for the platforms which use it (currently MSW and OS X).
Use Ok/Cancel dialog instead of Yes/No one in CheckFit().
This has the advantage of being able to close the dialog with "Esc" and also allows us to not specify the label for the "Cancel" button at all and use the default one, which is especially important under MSW where the label returned by wxGetStockLabel(wxID_CANCEL) is actually not the same string as is used in the native message boxes (they don't define an accelerator for the cancel button).
Set all parent frame icons for print preview frame.
Using SetIcon(GetIcon()) resulted in ugly scaled icons being used for small icons while using SetIcons(GetIcons()) correctly reuses all parent frame icons in the child one.