wxUniv build was broken since the base class of wxStatusBar was changed from
wxWindow to wxControl in r66226 because it derived twice from wxInputConsumer
now.
Fix this by simply not inheriting wxStatusBarUniv from wxInputConsumer any
more, it already derives from it via wxControl now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is either unnecessary or doesn't work anyhow (they are always centered on
the parent window) and just results in debug error messages.
Simply don't do anything in wxMessageDialog::Centre() when using task dialog
implementation under MSW.
Closes#12699.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Setting sash size to non default value didn't work correctly and didn't make
much sense anyhow as the sash appearance is platform-dependent and current
code for drawing it doesn't work for arbitrary sizes.
Simply remove the possibility to set the sash size.
Closes#12412.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxControl-provided CreateControl() and MSWCreateControl() methods to
create the status bar instead of duplicating their code in its Create().
Also translate wx styles to MSW ones in overridden MSWGetStyle() now.
In addition to making the code smaller and more clear, this fixes the
non-respect of the styles specified at status bar creation (e.g. border),
see #12655.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxStatusBar is no less a control than wxToolBar and deriving it from wxControl
gives access to convenient native control creation functions under MSW (which
will be used by the next commit).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Attempting to load a resource that couldn't be loaded resulted in
wxXmlResource::Load() returning false for this and _all_the_subsequent_ calls
to it because each call to Load() reattempted to reload all resources,
including the one(s) that failed to load initially.
Instead, try to load just the resource(s) that we should load right now and
ignore all the other ones. Also, don't add entries for the one(s) that we fail
to load.
This fixes the unit test failures in the XRC test case which was affected by
the test checking that XRC couldn't be loaded from garbage that ran before it.
It also makes the code simpler by ensuring that wxXmlResourceDataRecords
elements always have a valid wxXmlDocument associated with them.
Also clean up the code: use wxScopedPtr instead of manually deleting pointers
and reorganize #if checks to be easier to follow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Store the titles of the menu bar menus in the menu objects themselves. This
makes wxMenu::GetTitle() return the expected result for them (which also fixes
the current unit test failures for wxMSW) and makes wxMenuBar code simpler.
This removes the wxMenuInfo class which existed for XTI purposes only but as
it was apparently unfinished and MSW-specific it shouldn't be a big loss.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMenu::GetTitle() returned a string in GTK+ format (i.e. using underscores
instead of ampersands) instead of the expected wx one.
This is, of course, the right thing to do and it also fixes
wxMenuBar::FindMenuItem() as a side effect.
Closes#12672.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Mention in the setup.h comment that wxDynamicLibrary is used in a lot of
places internally and disabling it can result in a loss of a lot of important
functionality.
See #12664.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Extract code common to several wxImage methods creating new images based on an
existing one in a new MakeEmptyClone() method.
Closes#12682.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Since the child pipe was made non-blocking in r65993, it became possible to
write to child process without deadlocking when the pipe became full. However
this still resulted in an error from wxFileOutputStream as it didn't handle
EAGAIN returned from write() any differently than any other error, even though
it is an expected situation in this particular case.
Change Unix wxExecute() to use wxPipeOutputStream which ignores EAGAIN unlike
wxFileOutputStream to fix this.
See #12636.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The column resizing code in wxGrid didn't take account of the fact that the
column positions and indices could be different. Correct it by inserting calls
to wxGrid::GetColAt() and GetColPos() in a new wxGridOperations::GetLineBefore()
method.
Closes#11984.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Deferred initialization code was not MT-safe and just wasn't that useful
anyhow because it is rare to create a wxCSConv object and not use it
afterwards.
Remove the deferred initialization logic and create the real conversion used
by wxCSConv immediately in its ctor.
Also improve the comments by clearly explaining the possible values of
wxCSConv::m_name and m_encoding.
Closes#12630.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Copy the mask pixmap properly in wxX11, otherwise copying masks resulted in
freeing the same pixmap twice and an X error.
This fixes the bitmap unit test for wxX11.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Check for Cairo in configure for wxX11 too.
Fix compilation of wxCairoContext for non-{GTK,MSW} platforms.
Also make wxUSE_CAIRO a "normal" option, i.e. add it to all wx/setup.h files
instead of defining it as 1 unconditionally for wxGTK and 0 for everything
else.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Recent replacement of size_t wxNotebook::m_selection with int
wxBookCtrlBase::m_selection resulted in appearance of many warnings in wxUniv
wxNotebook. Fix them by removing some now unnecessary casts between int and
size_t and adjusting the remaining ones.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This fixes compilation problems with the minimal build of wxGTK and will make
removing palette support in the future simpler.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66088 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This class probably should not be compiled in at all in the minimal build but
in the meanwhile just add #if checks around its button-related parts.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66087 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method was defined in wxBitmapBase which is not used by wxMSW (and wxOS2)
so it wasn't available there. Move the definition of the method inline and
reuse it for all ports, making it part of either wxBitmapBase or wxBitmap as
appropriate.
This is clearly ugly but we still have no good solution for deriving wxBitmap
from wxBitmapBase in wxMSW as it already inherits from MSW-specific wxGDIImage
there.
Also document that ConvertToDisabled() is only available when wxUSE_IMAGE==1.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Define __WXOSX__ for non-GUI build under Darwin. Ensure that the rest of the
code compiles correctly when just __WXOSX__ is defined but neither of
__WXOSX_{CARBON,COCOA,IPHONE}__ is. This ensures that wxBase can actually be
built under Mac.
Move OS X symbols definitions in wx/platform.h after wx/setup.h inclusion as
they rely on __DARWIN__ and wxUSE_GUI values which are both define in that
file now. Still keep them before wx/chkconf.h inclusion which relies on
__WXOSX_XXX__ being defined. Yes, it's a mess and should be cleaned up more
permanently some day.
Also remove some redundancy from wx/osx/{carbon,cocoa}/private.h by factoring
out common parts into wx/osx/core/private.h. Also include this header itself
from wx/osx/private.h directly instead of including it thrice from different
sub-ports headers.
Closes#12660.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMSW wxNotebook implementation used to handle EVT_NOTEBOOK_PAGE_CHANGED event
to update the currently shown page which meant that page changing was broken
if the user code handled and didn't skip this event.
As the other ports don't require the user code to skip this event, don't do
this in wxMSW neither and always update the selected page unconditionally.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow to declare ranges of consecutive IDs in XRC by using the "id[n]" syntax.
Show this functionality in the xrc sample and test it in the new unit test.
Also show and test the "object reference" XRC functionality.
Closes#11431.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function (and the related DoReportError()) doesn't need to modify its
"context" argument so take a const-pointer in it.
See #11431.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Although the tooltip was initially correctly set for all windows associated
with it, it was only updated for the main one if its text changed later. This
resulted in leaving the old tooltip for the composite controls such as
wxComboBox or controls with sub-windows such as wxRadioBox.
Fix this by storing all windows associated with the tooltip (for space
efficiency, only allocate the array if necessary however as it will be empty
in the majority of cases) and apply SetTip() to all of them, not just the main
one.
Closes#12659.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function checks if the pane can be docked at any side. It is useful in
its own right but most importantly is needed to fix compilation broken in
r66005 which used it before it was added.
See #12648.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Simply extract part of the code from evtloopunix.cpp into a reusable
wxPipe::MakeNonBlocking() function to be able to reuse it elsewhere.
See #12636.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The first page added to a wxBookCtrlBase-derived control is always selected,
even if "bSelect" argument of AddPage() was false. This is necessary because
a non-empty book control must always have a selection but the "selection
changed" event generated when doing it is unexpected.
Fix this by not generating any events when the first page is implicitly
selected.
Closes#12075.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxDIB assumed that MSW always uses bitmaps in pre-multiplied pixel format but
this turns out to be wrong: some Windows functions such as ImageList_Draw()
or CreateIconIndirect() apply pre-multiplication internally and so must be
given data in non-pre-multiplied format on input.
This commit adds a possibility to create wxDIB in such format but doesn't use
it anywhere yet, this will be done in subsequent commits.
See #9050.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add default ctor and Init() method to wxMSW private AutoHBITMAP class.
This doesn't change anything for now but will be used by an upcoming commit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGetWindowFromHWND() could crash if it was called for a HWND of a radio
button which was not created by wxWidgets because it blindly dereferenced the
user data associated with the button expecting it to be a pointer to
wxRadioBox and crashed if it was something different. And this actually
happened when using the standard Windows printing dialog which can contain
radio buttons which obviously used their user data field for their own
purposes.
Fix this by maintaining a global hash map with radio buttons HWNDs as keys and
radio boxes as values. This ensures that we can always safely check whether
the given HWND is a radio button in one of our radio boxes or not.
Also change wxSpinCtrl which already did something similar in a different way
(using an array instead or a more efficient hash map) for consistency.
Closes#12083.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Change the signature of GetThemeFont() and GetThemeSysFont() methods of
wxUxThemeEngine to take an artificial wxUxThemeFont::Ptr type instead of
LOGFONT which allows the broken code to compile correctly and even work in
Unicode builds but crashed in ANSI ones under Windows Vista/7 as these
functions expect a LOGFONTW and not LOGFONTA even in non-Unicode build under
these systems.
This generalizes the previous fix/workaround for the same problem in
wxStaticBox so remove it now and use wxUxThemeFont both there and in
wxMenuItem to avoid crashes when using owner-drawn menus in ANSI build.
Closes#12364.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For calling SetValue() and SetAttr() consistently, instead of having the
same code duplicated all over the place.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When determining cell content's size, GetSize() measured the text using
wxDataViewCtrl's font, even though it could be renderer in bold or
italics.
Corrected by setting the attributes - and not only the value - prior to
GetSize() calls, and by using the right font in GetTextExtent() calls.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775