Commit Graph

33030 Commits

Author SHA1 Message Date
Vadim Zeitlin
8c26773f2f Don't use _{get,ch}drive() functions in Cygwin builds.
They are not available there when not using MinGW headers, e.g. in 64 bit
builds.

Also simplify the code by using wxHAS_DRIVE_FUNCTIONS instead of complicated
(and sometimes negated) checks for MinGW32 version.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-12 13:14:30 +00:00
Vadim Zeitlin
933c86960d Don't use LCID and WXLCID interchangeably in wxMSW code.
Similarly to the problem with WXDWORD and DWORD, LCID is actually an unsigned
int and not unsigned long in 64 bit Cygwin builds, so it's a different type.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-12 13:14:27 +00:00
Vadim Zeitlin
8b7398889d Add casts from long to LONG to fix 64 bit Cygwin wxMSW build.
In 64 bits, LONG is actually defined as int in Cygwin gcc headers, so is
different from long -- even if both types use identical representation.

Just add the casts to fix this for now, as this is the smallest ABI-preserving
change. Ideally, something better and less ugly would need to be done in the
future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-12 13:14:24 +00:00
Vadim Zeitlin
f825884f74 Don't use DWORD and WXDWORD interchangeably in wxMSW code.
WXDWORD is defined as unsigned long, while DWORD is defined as unsigned int in
64 bit builds using Cygwin gcc, so they are not the same type (although they
do have the same size) and using the latter instead of the former in the
function definition results in errors in this build configuration.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76501 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-12 13:14:20 +00:00
Vadim Zeitlin
dbbe0811c7 Use __WIN64__ instead of MSVC-specific _WIN64 in wxIsPlatform64Bit().
Make the code work correctly for 64 bit builds with other compilers, e.g. gcc.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-12 13:14:14 +00:00
Dimitri Schoolwerth
8848bb8369 Fixed code checking for bit flags.
Use "flag & bitmask" instead of "flag && bitmask" (resulted in LLVM compiler warning: "Use of logical '&&' with constant operand").

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-11 23:16:56 +00:00
Dimitri Schoolwerth
6451d23158 Added support for using OS X' full screen API (available since OS X 10.7).
Added EnableFullScreenView() to have a full screen button in the title bar and also allowing ShowFullScreen() to make use of the newer full screen API.

See #14357.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-11 22:41:13 +00:00
Vadim Zeitlin
1558349361 Improve RTL support in wxStyledTextCtrl.
Use the correct HDC, inheriting the right text orientation, when creating
wxMemoryDC in SurfaceImpl code.

There may still be problems with the actual RTL languages, but at the very
least English text displayed in RTL locale is not mirrored any more.

Closes #16230.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-10 16:16:01 +00:00
Vadim Zeitlin
021bd17d49 Fix crash in generic wxDataViewCtrl::AssociateModel(NULL).
Don't use the possibly dangling pointer.

Closes #16249.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76491 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-10 16:15:52 +00:00
Vadim Zeitlin
d53f93f607 Fix wxRichTextCtrl code compilation with wxUSE_XML==0.
Add missing wxUSE_XML checks.

Closes #16251.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76490 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-10 16:15:46 +00:00
Vadim Zeitlin
47138ac8fa Add wxStyledTextCtrl copy/paste text events.
Add wxEVT_STC_CLIPBOARD_{COPY,PASTE} events, allowing to transform the text
being copied from or pasted into wxStyledTextCtrl.

Closes #16191.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-08 14:43:45 +00:00
Vadim Zeitlin
0acb665006 Remove wxStyledTextEvent::m_text and m_dragText.
These fields were unnecessary and duplicated m_cmdString inherited from the
base class.

Also use base class GetString() instead of the redundant GetText() and
GetDragText() in the code, even though these methods are still kept for
backwards compatibility.

See #16191.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-08 14:43:38 +00:00
Vadim Zeitlin
e532b3f234 Fix harmless warning about using wxCONTROL_CHECKED in ternary operator.
Add wxCONTROL_NONE which is just a symbolic name for 0 and use it in the code
to avoid g++ 4.8 warnings about mixing enum and int in conditional expression.

Closes #16242.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-08 14:43:27 +00:00
Vadim Zeitlin
9ccfe76e43 Compilation fix for PCH-less build of wxMSW.
Include wx/msw/ownerdrawnbutton.h usually included via wx/checkbox.h from the
PCH.

Closes #16241.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-08 14:43:21 +00:00
Vadim Zeitlin
baf28b5fe3 Make wxGetPangoContext() work even without open display.
Use default Pango font map if we don't have any default screen in wxGTK.

Closes #16240.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-07 15:24:50 +00:00
Vadim Zeitlin
5b56498f88 Allow using sizers for laying out wxMDIClientWindow in wxMSW.
Let the user code put wxMDIParentFrame::GetClientWindow() into a sizer and
manage it as any other window, instead of having to do it manually.

Closes #16196.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-06 18:20:38 +00:00
Vadim Zeitlin
dd59bdf40b Define BS_TYPEMASK for the compilers which don't have it.
Fixes compilation with MinGW after wxMSWOwnerDrawnButton introduction.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-06 11:44:07 +00:00
Paul Cornett
a0f10ec1d6 Implement access to a global toplevel GdkWindow in a way that does not require always having an extra GtkWindow.
And don't use "RootWindow" in the name, it is not a root window in the X11 sense.
Also add wxGetPangoContext() to get access to a PangoContext.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-05 15:53:27 +00:00
Vadim Zeitlin
70387b4857 Fix wxMSW owner drawn buttons appearance in "selected" state.
Draw the buttons (i.e. checkboxes and radio buttons) correctly when the space
key is pressed.

See #10137.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-05 14:47:45 +00:00
Vadim Zeitlin
06292da40f Add a TODO comment to wxGTK wxToolBar::FindToolForPosition().
Replace the out of date comment saying that GTK+ doesn't have a function to do
this with a TODO comment mentioning the name of the function which should be
used here.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-05 14:42:40 +00:00
Vadim Zeitlin
8a245f0ec3 Fix handling of multiple and rectangular selections in wxSTC.
Copy and paste rectangular selections in the standard format, this is
especially important under Windows where a (de facto) standard clipboard
format for such selections exists.

Also fix handling of multipaste, i.e. pasting clipboard contents into several
locations at once.

Closes #16221.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-05 14:42:35 +00:00
Vadim Zeitlin
29ff6f3e3b Fix resetting owner drawn radio buttons to normal state.
Ensure that we bring the native button in sync with the real state of the
radio button when we switch to normal state.

Also avoid using BM_GETCHECK for the owner drawn buttons as we don't use
BM_SETCHECK for them (as it's useless).

See #10137.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:13:39 +00:00
Vadim Zeitlin
cc73050b73 Factor out common owner drawn code from wx{Check,Radio}Box.
Create wxMSWOwnerDrawnButton class which contains all of this code.

Currently the methods of this class are (still) implemented in
src/msw/control.cpp.

See #10137.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76459 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:13:28 +00:00
Vadim Zeitlin
f1be272d32 Fix pressed owner-drawn checkbox appearance in wxMSW.
Handle the "pressed" state correctly in wxCheckBox::MSWOnDraw().

See #10137.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:13:22 +00:00
Vadim Zeitlin
81b931f8d1 Fix the size of owner-drawn checkbox and radiobuttons under Vista and later.
The size of the native buttons has changed between XP and Vista, so add
version check to draw the buttons of correct size under all Windows versions.

See #10137.

REBASE: squash with aa5d7c5 Fix the size of owner-drawn check and radio boxes under Vista and later.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:13:17 +00:00
Vadim Zeitlin
fd65d4b4f5 Implement setting foreground colour for wxRadioButton in wxMSW.
Native radio buttons don't support changing their foreground colour, so use
owner drawn buttons if SetForegroundColour() was called, similarly to what was
already done for wxCheckBox.

Closes #10137.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:13:12 +00:00
Vadim Zeitlin
3fc6738025 Refactor owner drawn buttons drawing code in wxMSW.
Move it from wxCheckBox to wxControl to allow reusing this code in other
classes, notably wxRadioButton in the upcoming commits.

See #10137.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:13:07 +00:00
Vadim Zeitlin
34d3e680c8 Use wxArrayInt methods instead of duplicating them.
Just use wxArrayInt::Index() instead of doing a linear search in the array
manually. Also use RemoveAt() + Insert() instead of manually iterating over
the items.

See #16110.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:13:02 +00:00
Vadim Zeitlin
c03557f0be Fix position of the column after drag-move operation in wxGrid.
Fix the logic for finding the correct position to drop the column at when
ending a drag move operation. The old code dropped it one position too far to
the left when it was dropped on the "far" (i.e. right with LTR layout) part of
the target column.

See #16110.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:12:57 +00:00
Vadim Zeitlin
50fe1fadc2 Fix changing column order in wxGrid when some columns are hidden.
Using negative column widths used for hidden columns when updating the column
positions after dragging one of them to a new position totally broke their
display. Fix this by ignoring the hidden columns.

Closes #16110.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76452 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:12:47 +00:00
Vadim Zeitlin
2e8988c3d6 Add wxGridCellRenderer::GetBest{Height,Width}() and use them in wxGrid.
Allow the renderer to specify the best height at the given width (or vice
versa) instead of the best size in both direction which is not defined for
e.g. wxGridCellAutoWrapStringRenderer.

Closes #15943.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:12:42 +00:00
Vadim Zeitlin
07427c4fbd Fix busy cursor handling in modal dialogs under MSW.
Modal dialogs shown during wxBusyCursor effect shouldn't show the busy cursor
as they do accept input, but did in wxMSW (as could be seen in e.g. the
widgets sample after enabling the "Global busy cursor" in the menu and showing
the text entry dialog via "Text|Set Help Hint").

Fix this by explicitly checking for the special case of having a modal dialog
as parent at wxWindow level as doing it in wxDialog simply didn't work as its
WM_SETCURSOR handler wasn't called at all for determining the cursor to use
for its children because they handled WM_SETCURSOR themselves in the global
busy state, without letting DefWindowProc(), which propagates this message
upwards the window hierarchy, to have it at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:12:32 +00:00
Vadim Zeitlin
51871b7b5a Reset icon ref count when deleting the icon in wxMSW balloon icons code.
This avoids the assert which happened when trying to show the next
notification message in SetUpIcon() as the icon was null while the reference
count was positive.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-04 22:12:05 +00:00
Paul Cornett
2eb7668968 build fix for systems lacking vswscanf when wxUSE_UNICODE==0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-03 16:31:41 +00:00
Julian Smart
5b8e5e81b6 Implemented keyboard selection and better cell navigation for tables
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-03 13:07:16 +00:00
Vadim Zeitlin
eeccbf98f4 Don't crash when dismissing expanded ribbon panel.
The parent of wxRibbonPanel is not always a wxRibbonPage, it can also be the
containing wxFrame itself if the panel is a temporarily expanded one created
when the user clicks a panel reduced to a button. So don't rely on the cast of
the parent to wxRibbonPage to always work. This is ugly but at least avoids a
crash.

Closes #16215.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-02 14:19:48 +00:00
Paul Cornett
605e637f47 send changed event when selecting a special directory from wxDirPickerCtrl combobox
closes #16064


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-01 16:57:50 +00:00
Vadim Zeitlin
2fbda42aed Fix wxGetClientDisplayRect() when _NET_WORKAREA is not supported.
Don't intersect the total rectangle with the uninitialized work area one
resulting in an empty rectangle being returned from wxGetClientDisplayRect()
if X11 server doesn't support _NET_WORKAREA (this is the case for at least
Cygwin X11 server).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-30 14:11:01 +00:00
Stefan Csomor
617e17b746 supporting alpha channel correctly from clipboard, closes #16198
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-30 06:59:42 +00:00
Stefan Csomor
012ccdf8a5 adding support for multi-line text in rotated text, fixes #16216
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-29 18:22:54 +00:00
Stefan Csomor
337454f387 fix memory leak for initial empty menubar, see #15666
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-29 14:18:30 +00:00
Vadim Zeitlin
07ff314c13 Make "Close" button affirmative ID in standard dialog button sizer.
This allows to use the Escape key to close a dialog with the "Close" button
only.

Closes #16185.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-28 11:28:35 +00:00
Vadim Zeitlin
d75eb338c2 Fix precision in wxGraphicsContext::{Stroke,Draw}Lines() under MSW.
Use floating point coordinates instead of ints which were used for some
reason, resulting in a loss of precision.

Closes #16187.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:42:04 +00:00
Vadim Zeitlin
ccaebf6520 Add wxThread::MSWGetHandle().
Under MSW a thread has both an ID, returned by wxThread::GetId(), and a
handle, which couldn't be retrieved so far. Add an accessor to do it.

Closes #16170.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76418 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:41:50 +00:00
Vadim Zeitlin
2b7c7464ad Fix wrong wxStatusBar height in wxMSW in some circumstances.
Creating the status bar before the menu bar but associating it with the frame
after creating the menu bar resulted in a status bar of completely wrong height.
Fix this by enforcing the default height on the status bar when it's attached
to the frame.

Closes #10956.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:41:45 +00:00
Vadim Zeitlin
cbe6495307 Allow dropping data outside of item area in wxDataViewCtrl.
Implement this change for the generic and the native GTK versions and document
it.

Closes #16152.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:41:40 +00:00
Vadim Zeitlin
555e57912e Bring wxMSW wxBitmap::SetBitmapXXX(wxBitmap()) in line with wxGTK.
Remove or reset the corresponding bitmap if the provided one is invalid
instead of asserting, this is what wxGTK does and this behaviour seems to be
more useful.

Also document this behaviour as it's now implemented in both wxMSW and wxGTK.

Closes #13569.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:40:05 +00:00
Vadim Zeitlin
ec112197f2 Micro optimization of checking for alpha transparency.
Use faster accessors to the image size.

Closes #16148.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:39:59 +00:00
Vadim Zeitlin
2e079a988d Make wxMSW wxTextCtrl::AdjustSpaceLimit() safe to call in all cases.
Allow calling this function not only from inside DoWriteText(): first, because
the existing code could be doing this (although this is only a concern in 3.0
branch as it was made private in the trunk) and second because it could
actually happen if the text limit was exceeded by user typing in the control.

See #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:39:54 +00:00
Vadim Zeitlin
934ce46464 Don't call AdjustSpaceLimit() explicitly in wxMSW wxTextCtrl any more.
There is no need to do it as this is done by DoWriteText() and
AdjustSpaceLimit() doesn't work correctly if called from outside of it now.
Because of this, also make it private to prevent other accidental calls to it.

Closes #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-27 22:39:49 +00:00