Respect styles translated to WS_EX_XXX in wxMSW wxCheckBox and wxRadioButton.
Take into account the window styles that translate to extended Windows styles
at MSW level.
Also override MSWGetStyle() in these classes, just as in most (all?) other
ones, for consistency instead of doing wx-to-MSW styles translation directly
in Create().
Notice that as a side effect of this change, border styles now work for
wxCheckBox which wasn't the case before. It's not clear if this is really
wanted but OTOH there doesn't seem to be any real reason to forbid them
neither.
Allow wxWrapSizer to request more size than it used previously.
The code in wxWrapSizer::CalcMin() ensured that the sizer never requested more
space than what it had been already given which, while clearly done
intentionally, seems to be wrong because it can never end up with enough space
for all its rows/columns unless it is set to up to expand in the containing
sizer.
In other words, the old code could return the size which was not enough to
show the sizer contents fully which is against CalcMin() contract.
Change this by simply removing the check for the new minimal size being less
than the old one. This allows the wrap sizer demo in the layout sample to work
correctly whereas before the sizer contents was completely invisible initially.
A valid RECT pointer must be passed to DoVerb(OLEIVERB_INPLACEACTIVATE) but
r72027 (see #14209) broke this and passed it NULL resulting in an instant
crash.
Revert this part of the change and do pass out window client area.
The values of m_ourFirst and m_ourLast were inversed in wxPluginLibrary ctor.
Fix this and explain in a comment that "first" and "last" here refer to the
order in the linked list and not the chronological order.
Fix wrong configure test for abi::__forced_unwind in previous commit.
The previous commit was accidental and contained an initial version of the
patch which didn't test for NPTL abi::__forced_unwind correctly and just
tested whether cxxabi.h header was available.
Tighten the check to work on the other systems and check for __forced_unwind
existence itself.
Also check for cxxabi.h before testing for __cxa_demangle as there is no need
to try to compile another test program if we already know that this entire
header is unavailable anyhow.
Rethrow abi::__forced_unwind in wxThread code under Unix.
We must always rethrow the special abi::__forced_unwind exception when
handling exception in threads under Linux as the NPTL simply terminates the
process at first opportunity if this exception is not rethrown.
See http://udrepper.livejournal.com/21541.html for more details.
Add public (but not documented) wxCheckBox::MSWMakeOwnerDrawn().
It can be useful to explicitly make a check box owner drawn, so make the
private MakeOwnerDrawn() public and add "MSW" prefix to it to allow doing this
from the user code.
Fix and enhance support for client data in wxRibbonButtonBar.
Add the possibility to retrieve the client data associated with a button and
not only set it (which wasn't very useful on its own).
Also allow having both typed (owned) and untyped (not owned) client data, as
in the other wxWidgets controls.
To avoid confusion between two different kinds of data, remove "client_data"
argument from the functions adding buttons and provide separate methods with
distinct names for setting and getting client data.
Fix alpha handling in Scintilla when not using wxGraphicsContext.
When using raw bitmap data access classes such as wxAlphaPixelData we must
destroy them to ensure that the changes done via them are committed to the
bitmap before drawing the bitmap.
Just add an extra block (the diff should be viewed ignoring white space to see
the only significant change) to ensure that wxAlphaPixelData is destroyed
before DrawBitmap() is called.
Make it possible to TAB-navigate among wxStaticBox children.
As wxStaticBox can now contain child windows, derive it from
wxNavigationEnabled<> to allow TAB-navigating among them. Without this, it was
impossible to switch focus from keyboard to any of the controls inside
wxStaticBox.
These functions also change the rectangle right/bottom position, unlike
Set{Right,Bottom}() that change its width/height respectively. This is not
very logical but impossible to change for compatibility reasons, so at least
document it clearly.
Add wxStyledTextCtrl::SelectNone() to the template header file too.
This method was only added to the generated include/wx/stc/stc.h but not to
src/stc/stc.h.in from which it is created in r72490, do update the latter file
too now.
Fix incorrect code sorting pages by their widths in wxRibbon.
The "sneaky obj array trickery" wasn't very sneaky but was just plain wrong
and misused object array of pages in a way that was invalid and didn't crash
just because of sheer luck.
Rewrite this code to use a temporary wxVector of pages that can be sorted
independently of the main m_pages array. This is 100% safe and also more
clear.
Update wxGTK.spec to work with openSUSE build server.
Changes from Marcin Wojdyr fixing issues for different RPM-using systems:
- added all necessary BuildRequires fields
- for openSuse wxGTK-gl package is named libwx_gtk*_gl... (it's
enforced that package with one shared lib has name matching the
library name)
- added missing '%dir's - on some distros rpms didn't built without it
- Fedora, Suse and Mandriva have all different set of known Groups,
I've changed group from 'X11/Libraries' to 'System/Libraries' -- it's
defined at least in Suse and Mandriva. (in recent distro releases
Group can be skipped, so it's becoming irrelevant).
- removed 'Packager' field and dots ending Summary field - AFAIR these
were errors on Opensuse
- added '= %{version}' to Provides
- for Redhat5 use GCC4.4 (build crashed with default 4.2)
Let wxWindow::Fit[Inside]() work even for windows without children.
The best [virtual] size of the window is usually determined by its children
but it's also possible to have a min size constraint set on the window sizer
so set the window to its best size in Fit() independently of whether it has
children or not.
No changes, just silence some MSVC 11 static analyzer warnings.
This is an aborted attempt to make wxWidgets code compile without warnings
when using MSVC 11 /analyze option, as it was supposed to have become much
better. Unfortunately it still produces way too many false positives to be
really useful, in particular NULL pointer detection is completely broken as
even the code such as (from object.cpp):
wxClassInfo *info = sm_first;
while (info)
{
if ( info->m_next == this )
...
}
provokes tons of warnings about "info" being NULL inside the loop which is
clearly impossible.
So this commit just fixes a few obvious warnings, mostly about variable
shadowing but also a couple about possibly passing NULL to memcpy().
No real changes, just slightly simplify wxSVGFileDCImpl code.
Move m_graphics_changed check inside NewGraphics() itself instead of checking
whether it's true each time before calling it, it is better to both test the
flag and reset it inside this function rather than do the first part in the
caller and the second one in the callee.
Also rename the function to NewGraphicsIfNeeded() to make its meaning more
clear.
Preserve size of wxGrid rows/columns when hiding and showing them back.
Previously, if a wxGrid row or column was hidden by setting its size to 0, its
original size was lost. Change this so that it's preserved now and can be
restored by setting the size to the special -1 value later.
Allow using horizontal cursor navigation keys in non-readonly wxComboCtrl.
Don't intercept Left/Right/Home/End keys until the control is read-only,
otherwise they're more useful for navigating in its text part than in its
drop-down.
Relax wxMessageDialog style checks, assume wxOK by default.
Don't complain if neither wxOK nor wxYES[_NO] are specified but just assume
wxOK by default. This allows the code calling wxMessageBox() with just an icon
flag to continue to work in the same way in 2.9 as it did in 2.8.
Add wxBITMAP_PNG() macro similar to wxBITMAP() but for PNG images.
Just as wxBITMAP() provides a portable way of loading bitmaps from either
Windows BMP resources or embedded XPM data depending on the platform,
wxBITMAP_PNG() hides the difference between loading bitmaps from PNG resources
under Windows and embedded PNG data elsewhere.
Also add wxBITMAP_PNG_FROM_DATA() macro which always loads PNG data from
memory: it's needed anyhow as part of wxBITMAP_PNG() implementation and some
people may prefer to always use it under all platforms.
Finally modify the image sample to demonstrate loading PNG images from both
resources and memory. This involved creation of a new Windows .rc file for it
and copying its data files to Resources bundle directory under OS X.
Add wxBitmap::NewFromPNGData() for creating bitmaps from PNG data.
This simple function can be used to create a wxBitmap from the raw image data
in PNG format. It is just a thin wrapper around wxImage load functions under
almost all platforms but has two advantages:
1. It can be implemented natively for some platforms (currently only OS X).
2. It can be used in a single expression as it doesn't require creating a
temporary wxMemoryInputStream and this will be required by wxBITMAP_PNG()
macro that will be added soon.
Don't ignore invalid files entered into wxFileDirPickerCtrlBase.
File/directory picker controls with wxFLP_FILE_MUST_EXIST/wxDIRP_DIR_MUST_EXIST
style simply ignored any value entered by user if it didn't correspond to an
existing file/directory. This meant that the program didn't use the value that
was shown on the screen resulting in very confusing UI -- e.g. a program could
complain that no value was entered when actually it was and just corresponded
to a non-existing file.
As we can't prevent the entry of arbitrary strings in the text field of the
file picker control, stop pretending that we can validate it and just update
the control value, and send the corresponding event, whenever the text control
value changes.
Extract "Close" button creation from wxInfoBarGeneric into new function.
Such buttons may be needed in other places and it's not obvious to create
them, so add a new public wxBitmapButton::NewCloseButton() method to allow
creating them easily.
Change wxMSW-specific wxLoadUserResource() to accept standard RT_XXX types.
Resource types can be either strings for custom types or integers casted to a
TCHAR* for the standard ones. Using wxString for the resource type prevented
us from using the latter as any attempt to initialize wxString for such a
pseudo-string resulted in an immediate crash.
Change wxLoadUserResource() resource type parameter type to wxChar* to avoid
this and allow passing standard resource types, such as RT_RCDATE, to this
function directly.
Don't initialize alpha twice when loading wxImage from resources.
Calling InitAlpha() when we already had loaded alpha from the resource data
results in an assert. Fix this by only initializing alpha if don't have it
yet.
Fix setting colours for the edit control part of wxComboBox.
Recognize this control as part of wxComboBox and so handle WM_CTLCOLOR for it.
To do this, override ContainsHWND() in wxComboBox and use it, on the parent
window, in wxControl::DoMSWControlColor(), if we fail to find the window
directly.
Recent changes (r71308) optimizing away setting the text of the text entry if
it didn't really change completely broke the generic text hints implementation
as e.g. clearing the hint didn't change anything because the entry was already
logically empty anyhow.
Fix this by simply comparing the new value with the real value of the entry
returned by DoGetValue() and not GetValue() that takes hints into account.
libnotify 0.4.5 included in Ubuntu Lucid (10.04) can be used for implementing
wxNotificationMessage too, there is only a minor difference with 0.7 API. So
while we stick check for 0.7 initially, accept lower versions too if 0.7 is
not available.
Simplify and correct setting of initial directory for wxFilePickerCtrl.
Create wxFileDialog with correct initial directory and default file name from
the very beginning instead of updating it later. This makes the code simpler
and also actually makes it work as the initial directory setting was
overwritten by setting the default path later even if it didn't contain any
directory component.
Fix wxKeyEvent::GetKeyCode() descripotion: it doesn't depend on locale.
GetKeyCode() will always return valid key codes for Latin-1 symbols but won't
do it for other non-ASCII Unicode characters even if they are representable in
the current locale.
Do not use wxIsprint() in EVT_CHAR example in the documentation.
This is incorrect as wxIsprint() is locale-dependent and only really works as
expected in UTF-8 locales (which are never used under Windows). Instead, just
test for control characters directly.
Don't try to determine the clicked item ourselves in wxMSW wxListBox.
This doesn't work when the listbox is scrolled as the result of a click to
make the selected item fully visible and results in the index of the item
being off by 1 in the generated event which is a pretty serious problem.
Fix it by simply retrieving the item from the listbox itself, without doing
any hit testing. This seems to give the correct result in all cases and also
makes the code much simpler as we don't have to use 2 different ways of
finding the item depending on whether it was selected using the keyboard or
the mouse and makes it unnecessary to keep track of how the selection was done
completely, i.e. reverts r64498 which is not needed any more.
Don't use StringFormat::GenericTypographic() in MSW wxGraphicsContext.
Using this string format results in very condensed strings when using small
fonts. The results of GDI+ font rendering are still pretty bad even without it
but they are at least slightly better.
Use a single global StringFormat in all wxMSW wxGraphicsContext code.
Instead of creating StringFormat in DrawText() and Get[Partial]TextExtent[s],
create it once and simply use it from both functions.
This might be slightly more efficient as we don't waste time recreating it but
the main advantage is that it ensures that these functions use the same string
format and no discrepancies between them are possible.
Output the values of all USE_XXX options to build.cfg file in MSW builds.
USE_RTTI, USE_AUI, USE_PROPGRID, USE_RIBBON, USE_RICHTEXT, USE_STC and USE_XRC
options were not output to the build configuration file, unlike the rest of
them.
Do output those ones as well now for consistency.
Also sort the options corresponding to different wx libraries alphabetically.
Document wxWindow InheritsBackgroundColour() and UseBgCol() methods.
These functions were present in the interface header but didn't have their own
documentation and somehow inherited the documentation of the first function in
the same section which didn't make any sense for them. Do document them now.
Without it, the hidden faces are shown resulting in wrong display of both the
cube and the penguin, at least with Mesa (but it also seems to be the correct
thing to do according to OpenGL documentation).