element contents in bold in wxHTML.
+- Added wxGrid::{Set,Get}{Row,Col}Sizes() methods (Andrey Putrin).
+- Add support for wxSP_WRAP in the generic version of wxSpinCtrlDouble.
+- Add alignment flags support to wxSpinCtrl[Double] (Andrew Radke).
+- Added wxGetSelectedChoices() replacing wxGetMultipleChoices() (Kolya Kosenko).
+- Check whether document fits into page horizontally in wxHtmlPrintout, see the
+ new CheckFit() method for more information.
+- Allow reading GIFs with incorrectly specified animation size.
+- Return number of frames in animated GIF from wxGIFHandler::GetImageCount().
+- Improved anchors handling in wxHTML.
+
+wxGTK:
+
+- Support for markup and ellipsization in wxStaticText (Francesco Montorsi).
+- Ellipsize long strings in wxStatusBar (Francesco Montorsi)
+- Native implementation for wxHyperlinkCtrl (Francesco Montorsi).
+- Native keyboard navigation implementation.
+- Added wxCB_SORT support to wxComboBox (Evgeniy Tarassov).
+- Don't overwrite primary selection with clipboard and vice versa.
+- Implemented support for underlined fonts in wxStaticText.
+- wxTopLevelWindow::SetSizeHints size increments now work.
+- wxTopLevelWindow::GetSize() returns the size including the WM decorations.
+- wxTopLevelWindow::GetClientSize() returns 0x0 when the window is minimized.
+- Added support for colour cursors (Pascal Monasse).
+- Pass current control text to EVT_TEXT handler for wxSpinCtrl (John Ratliff).
+- Added gtk.tlw.can-set-transparency system option.
+- Added support for GTK+ print backend
+- Fix changing font/colour of label in buttons with images (Marcin Wojdyr).
+- Fix wxDC::Blit() support for user scale and source offset (Marcin Wojdyr).
+
+wxMac:
+
+- Better IconRef support (Alan Shouls).
+- Fix duplicate (empty) help menu in non-English programs (Andreas Jacobs).
+- Allow accelerators to be used with buttons too (Ryan Wilcox).
+- Support resource forks in wxCopyFile() (Hank Schultz).
+- Implement wxLocale::GetInfo() using CFLocale.
+- Native wxCollapsiblePane implementation.
+
+wxMSW:
+
+- Fix many problems with selection in multi-selection wxTreeCtrl (Jonathan Liu).
+- Fixed infinite loop in wxThread::Wait() in console applications.
+- Return the restored window size from GetSize() when window is minimized.
+- wxCheckListBox now looks more native, especially under XP (Marcin Malich).
+- wxCheckListBox now also supports use of client data (Marcin Malich).
+- Allow tooltips longer than 64 (up to 128) characters in wxTaskBarIcon
+- Fix centering wxFileDialog and allow positioning it.
+- Allow centering wxMessageDialog on its parent window (troelsk).
+- Use vertical scrollbar in wxMessageDialog if it's too big to fit on screen.
+- Show resize gripper on resizable dialogs (Kolya Kosenko).
+- Implement support for display enumeration under WinCE (Vince Harron).
+- Use different Win32 class names in different wx instances (Thomas Hauk).
+- Support multiline labels for wxCheckBox and wxToggleButton.
+- Print preview is now rendered in the resolution used by printer and
+ accurately represents what will be printed. This fixes wxHtmlEasyPrinting
+ preview inaccuracies on Windows; on other platforms, native preview
+ should be used.
+- Implement wxFileName::SetTimes() for directories (Steve Lamerton).
+- Added wxToolTip::SetMaxWidth() and improved default wrapping (Joachim Hönig).
+- Changed default toolbar bitmaps size from obsolete 16x15 to 24x24 used
+ by modern apps.
+- Ellipsize long strings in wxStatusBar (Francesco Montorsi)
+- Fix spurious repaint when changing tooltip text (Jonathan Liu).
+- Fix wxSP_WRAP and wxSP_ARROW_KEYS in wxSpinCtrlDouble (Andrew Radke).
+
+wxX11:
+
+- Added mouse wheel support (David Hart).
+- Make Enter key activate the default button (David Hart).
+
+wxDFB:
+
+- Implement wxBitmap ctor from XBM data.
+
+i18n:
+-----
+
+- Slovak translations added (Ivan Masár).
+
+
+2.8.10:
+-------
+
+All:
+
+- wxHashMap::insert() doesn't update the value if it didn't insert the element
+ any more (Marcin Malich).
+- Correct bug in wxTimeSpan::Format() for negative spans.
+- Correct several bugs in wxList using end() iterators (Suzumizaki-Kimitaka).
+- Added Vietnamese translation (Tran Ngoc Quan).
+- Updated Slovenian translation (Martin Srebotnjak).
+- Corrected Serbian locale name (Cody Precord).
+- Fix wxURL::GetInputStream() for URLs with special characters in credentials
+ (Robert Wruck).
+- Fix wxURI::GetUser() for URIs without password.
+- Correct wxDateTime DST computation for 2006 and later (Christopher Barker).
+
+All (GUI):
+
+- wxRTC: fixed input that uses Alt on Mac OS X, for example Polish Pro input.
+ Also fixed a bug whereby e.g. Croatian keys didn't work, by moving more code
+ to key down handler.
+- wxRTC: fixed a problem with HTML list generation.
+- wxRTC: no longer deletes a character when content is selected before
+ pressing Delete.
+- wxRTC: fixed inability to select no superscript and no subscript in
+ formatting dialog.
+- wxRTC: fixed centering and right-justification when combined with left
+ indentation.
+- wxRTC: fixed lack of right margin when centering or right-justifying.
+- wxRTC: fixed wrong descent when wrapping lines with different font sizes.
+- wxRTC: fixed wrapping problem for long lines.
+- wxRTC: all buffer margins now respected.
+- wxRTC: Added wxRE_CENTRE_CARET to centre the caret line vertically.
+- Fixed wxHTML's pagebreaks computation in tables (D.J.Stauffer).
+- Fixed wxHtmlWindow::SelectionToText() to correctly insert newlines after
+ single-cell paragraphs.
+- Fixed wxHTML's line breaks handling in blocks broken in 2.8.8 (#10120).
+- wxHTML: don't include extra whitespace in table cells.
+- Implemented wxWindow::DragAcceptFiles() on all platforms.
+- Added wxAUI_MGR_LIVE_RESIZE flag to wxAuiManager and made it the default on
+ wxMac with CoreGraphics where sash drawing isn't implemented.
+- Use bitmap mask in wxSplashScreen.
+- Translate "(c)" and "(C)" to the real copyright sign in wxAboutBox.
+- Fix painting of highlight border for merged cells in wxGrid (K. Jones).
+- Fix handling of long lines in wxGridCellAutoWrapStringRenderer.
+
+All (Unix):
+
+- Return false from wxSingleInstanceChecker::IsAnotherRunning() if an error
+ occurred while opening or reading the lock file (Lauri Nurmi).
+
+wxMSW:
+
+- Fixed bug with using non default encoding in wxTextCtrl in ANSI build.
+- Restored generation of events for accelerators when there is no menu bar.
+- Fixed wxArtProvider::GetSizeHint() to return 16x16 for wxART_FRAME_ICON.
+- Fixed toolbar buttons so that they don't disappear temporarily when clicked
+ if the event handler causes window update.
+- Fix display enumeration under WinCE (Vince Harron).
+- Fix best size calculation for wxNotebook with multiple rows (Alex McCarthy).
+- Correct coordinates of wxDropFilesEvent (Dmitriy Maksimov).
+- Fix handling of abandoned mutexes in wxMutex (David Heffernan).
+- Avoid warnings about deprecated localtime with MSVC8/9 (Chris Stankevitz).
+- Fixed invisible CHM tooltip text bug when window text colour is black.
+- Automatically adjust toolbar's tool size if the provided bitmaps
+ don't fit into the default size.
+- Don't generate EVT_LISTBOX_DCLICK events with incorrect indices.
+- Don't reuse the double click handled by activation event handler for toggling
+ the item in wxTreeCtrl.
+
+
+wxMSW/CE:
+
+- Don't hardcode the menu bar height (Michele Spighi).
+
+wxGTK:
+
+- Fixed printing to use fonts sizes adjustment consistent with wxMSW.
+- Make colours used by list, tree and status bar controls more consistent with
+ the system theme settings (Tim Kosse).
+- Worked around bug in GTK+ < 2.14 where enabling some controls such
+ as wxButton didn't re-enable sensitivity until the mouse was moved.
+
+wxOS2:
+
+- Added implementation for wxSingleInstanceChecker contributed by Lauri Nurmi
+
+
+2.8.9
+-----
+
+All:
+
+- Optimize wxString::Replace() for single character arguments.
+- Updated Hindi translation (Priyank Bolia).
+- Use tr1::unordered_{map,set} for wxHash{Map,Set} implementation if available
+ in STL build; in particular do not use deprecated hash_{map,set} which
+ results in a lot of warnings from newer g++ (Jan Van Dijk and Pete Stieber).
+
+All (GUI):
+
+- Added support for reading alpha channel in BMP format (Kevin Wright).
+- Fixed help viewer bug whereby the splitter sash in wxHtmlHelpWindow could
+ go underneath the left-hand pane, permanently, after resizing the
+ help window.
+- Fixed wxHTML default font size for printing to be 12pt regardless of the
+ platform, instead of depending on GUI toolkit's screen configuration.
+- Support wxDP_ALLOWNONE style in generic wxDatePickerCtrl version.
+- Set wxKeyEvent::m_uniChar correctly in the events generated by generic
+ wxListCtrl (Mikkel S).
+- Fix changing size of merged cells in wxGrid (Laurent Humbertclaude).
+- Fixed wrapping bug in wxRichTextCtrl when there were images present;
+ now sets the cursor to the next line after pressing Shift+Enter.
+- Fixed Cmd+Back, Cmd+Del word deletion behaviour in wxRichTextCtrl.
+- Fix crash when reading malformed PCX images.
+- Fix bug with wrong transparency in GIF animations (troelsk).
+- Store palette information for XPM images in wxImage (troelsk).
+- Fixed selection bugs and auto list numbering in wxRichTextCtrl.
+- Significantly optimize wxGrid::BlockToDeviceRect() for large grids (kjones).
+- Introduced new wxAuiToolBar class for better integration and look-and-feel.
+- Fix a crash in wxAuiFrameManager when Update() was called in between mouse-up
+ and mouse-down events
+- wxAUI: added various NULL-ptr asserts.
+- Fixed problem with Floatable(false) not working in wxAuiFrameManager.
+- Fixed maximize bug in wxAUI.
+- Allow period in link anchors in wxHTML.
+- Fixed memory corruption in wxHTML when parsing "&;" in the markup.
+- Fixed event type in EVT_GRID_CMD_COL_MOVE and EVT_GRID_COL_MOVE.
+- wxGrid doesn't steal focus when hiding editor any more (Tom Eckert).
+
+All (Unix):
+
+- MIME types reading fixed when running under GNOME, reading .desktop
+ files and also the default application list.
+- Added filesys.no-mimetypesmanager system option so that applications that
+ must load an XRC file at program startup don't have to incur the
+ mime types manager initialization penalty.
+
+wxMSW:
+
+- Potentially incompatible change: wxExecute() arguments are now quoted if they
+ contain spaces and existing quotes are escaped with a backslash. However, to
+ preserve compatibility, the argument is unchanged if it is already quoted.
+ Notice that this behaviour will change in wxWidgets 3.0 where all arguments
+ will be quoted, please update your code now if you are affected and use only
+ wxWidgets 2.8.9 or later.
+- Fix keyboard support in wxSpinCtrl broken in 2.8.8.
+- Compile fix for WinCE in window.cpp (no VkKeyScan in Windows CE).
+- Support disabling items before adding them to the menu (Christian Walther).
+- Allow to call SetFont(wxNullFont) to reset the font to default.
+- Implement UUID::operator==() and !=() (SQLAware Corporation).
+- Fixed long standing (introduced in 2.6.3) bug which resulted in always
+ creating a DIB and not DDB in wxBitmap(const wxImage&) ctor.
+- Fix the bug with wxFileDialog not being shown at all if the default file name
+ was invalid.
+- Fix hang in keyboard navigation code with radio buttons under Windows 2000.
+- Implement wxWinINetInputStream::GetSize() (spicerno).
+- Always copy "has alpha" flag when copying bitmaps (SQLAware Corporation).
+
+wxGTK:
+
+- Fixed masking of disabled bitmaps in wxMenuItem and wxStaticBitmap.
+- Fixed generation of events for an initially empty wxDirPickerCtrl.
+- Fixed detection of Meta key state so that NumLock isn't misdetected
+ as Meta (requires GTK+ 2.10).
+- Fix changing font/colour of label in buttons with images (Marcin Wojdyr).
+
+wxMac:
+
+- Fixed a glitch where clicking on a scrollbar (but not moving the scrollbar)
+ would cause the window to scroll.
+
+
+2.8.8
+-----
+
+All:
+
+- Fixed bug with parsing some dates in wxDateTime (Bob Pesner).
+- Fixed bug with parsing negative time zones in wxDateTime::ParseRfc822Date().
+- Initialize current line in wxTextBuffer ctor (Suzuki Masahiro).
+- Improved performance of XML parsing (Francesco Montorsi).
+- Fix wxDateTime::ParseRfc822Date() to handle missing seconds (Joe Nader).
+
+All (GUI):
+
+- Added wxWindow::GetNextSibling() and GetPrevSibling().
+- Support wxGRID_AUTOSIZE in wxGrid::SetRow/ColLabelSize() (Evgeniy Tarassov).
+- Ensure that wxGrid::AutoSizeColumn/Row() never sets column/row size
+ smaller than the minimal size.
+- Added parameter to wxScrolledWindow XRC handler.
+- wxRichTextCtrl performance has been improved considerably.
+- Several wxRichTextCtrl style, paste and undo bugs fixed.
+- Added wxRichTextCtrl superscript and subscript support (Knut Petter Lehre).
+- wxNotebook RTTI corrected, so now wxDynamicCast(notebook, wxBookCtrlBase)
+ works.
+- When focus is set to wxScrolledWindow child, scroll it into view.
+- Improve wximage::ResampleBox() (Mihai Ciocarlie).
+- Implemented ScrollList() in generic wxListCtrl (Tim Kosse).
+- SaveAs in docview takes into account path now.
+- Fixed wxXmlResource::GetText() to convert data to current locale's
+ charset in ANSI build.
+- wxGrid now indicates focus by using different colour for selection
+ and hiding cell cursor when it doesn't have focus.
+- Added alpha support to wxImage::Paste() (Steven Van Ingelgem)
+- Use current date when opening popup in generic wxDatePickerCtrl.
+- Remove associated help text from wxHelpProvider when a window is destroyed.
+- Added wxSizerFlags::ReserveSpaceEvenIfHidden() and
+ wxRESERVE_SPACE_EVEN_IF_HIDDEN sizer flag.
+- Added wxWindow::ClientToWindowSize() and WindowToClientSize() helpers.
+- Added wxSizer::ComputeFittingClientSize() and ComputeFittingWindowSize().
+- Fixed wxSizer::SetSizeHints() to work when the best size decreases.
+- Fixed crash in wxHtmlHelpController if the help window is still open.
+- Fixed generic art provider to scale bitmaps down to client-specific
+ best size if needed.
+- Made wxSpinCtrl::Reparent() in MSW and generic versions (Angelo Mottola).
+- Fixed timing of malformed animated GIFs in wxHTML (Gennady Feller).
+- Fixed incorrect layout width caching in wxHTML (Jeff Tupper).
+- wxHTML: preserve TAB characters when copying content to clipboard.
+- Set focus to wxCalendarCtrl when it is clicked.
+- Don't clear the list control when wxLC_[HV]RULES style is toggled.
+- Don't crash when Ctrl-Shift-T is pressed in empty wxStyledTextControl.
+
+All (Unix):
+
+- Fixed shared libraries to not depend on GStreamer when built with
+ --enable-media; only wxMedia library depends on it now.
+- wxLaunchDefaultBrowser() now uses xdg-open if available.
+- Don't close UDP socket if an empty datagram is received (Mikkel S)
+- Honour locale modifiers such a "@valencia" in system locale (Tim Kosse)
+
+wxMSW:
+
+- Fix rare bug with messages delivered to wrong wxSocket (Tim Kosse).
+- Fix setting icons when they have non-default (16*16 and 32*32) sizes.
+- Fixed wxLocale::GetInfo to use the C locale.
+- Don't enable disabled windows when showing them (Harry McKame).
+- Fix assert when using owner-drawn menu items with the newest (Vista) SDK.
+- Fixed wxTextCtrl to not process clipboard events twice if there's
+ a custom wxEVT_COMMAND_TEXT_* event handler.
+- Fix wxComboBox to not lose the current value if it was programmatically set
+ to a value not in a list of choices on popup close (Kolya Kosenko)
+- Switching wxListCtrl to report mode from another one now uses full row
+ highlight, just as if the control were created in report mode initially.
+- Use correct index of the right-clicked column in wxListCtrl in the
+ corresponding event even when the control is scrolled horizontally.
+- Implement wxRadioBox::Reparent() correctly (Vince Harron).
+- Make context sensitive help work for the text part of wxSpinCtrl.
+- wxFileType::GetCommand() now looks at Explorer associations and CurVer
+ for increased reliability and conformance to user expectations.
+- Fixed double Init() call in wxTopLevelWindow causing a memory leak on
+ SmartPhone.
+- Fixed rendering of borders for wxTextCtrl with wxTE_RICH(2) style when
+ using Windows XP's Classic UI theme.
+- Text controls with wxTE_RICH style now also generate wxClipboardTextEvents.
+- Fixed wxEVT_COMMAND_TEXT_ENTER generation in wxSpinCtrl.
+- Fixed wxSpinCtrl::GetClientSize() to return sensible value and not just
+ spin button's client size.
+- Fixed IMPLEMENT_APP() to be compatible with the -WU flag of Borland C++
+ compiler (Matthias Bohm).
+- Correct size calculation for toolbars containing controls under pre-XP
+ systems (Gerald Giese)
+
+wxGTK:
+
+- Return false from wxEventLoop::Dispatch() if gtk_main_quit() was called and
+ so the loop should exit (Rodolfo Schulz de Lima).
+- Implement wxListBox::EnsureVisible() (Andreas Kling)
+- Fixed wxCURSOR_HAND to map to GDK_HAND2 and not GDK_HAND1, for consistency
+ with other applications.
+- Fix wxNotebook::GetPage{Text,Image}() when they were called from the page
+ change event handler for the first added page (Mikkel S).
+- Fixed wxBitmapButton to use focus and hover bitmaps correctly.
+- Fixed race condition which could cause idle processing to stop without
+ processing all pending events.
+- wxAcceleratorTable now works with buttons too.
+
+wxMac:
+
+- Fixed cursor for wxBusyCursor and wxContextHelp.
+- Fixed wxListCtrl to respect items' non-default fonts.
+- wxListCtrl::SetColumnWidth() now supports wxLIST_AUTOSIZE.
+- Fixed handling of transparent background in borderless wxBitmapButton.
+
+
+2.8.7
+-----
+
+All:
+
+- Fixed bug with default proxy destruction in wxURL (Axel Gembe).
+
+wxMSW:
+
+- Correct (harmless) warnings given for forward-declared DLL-exported classes
+ by mingw32 4.2 (Tim Stahlhut).
+
+wxGTK:
+
+- Added gtk.window.force-background-colour wxSystemOptions option to work around
+ a background colour bug in the gtk-qt theme under KDE.
+- Implemented wxGetClientDisplayRect() correctly for wxGTK and X11-based ports.
+
+
+2.8.6
+-----
+
+All:
+
+- Fixed another bug in wxFileConfig when deleting entries (Axel Gembe)
+- Added Portuguese translation (Antonio Cardoso Martins)
+
+
+2.8.5
+-----
+
+All (GUI):
+
+- Added colour normalization to PNM image handler (Ray Johnston)
+- Fixed selecting part of word from right to left in wxHTML (Michael Hieke)
+- Selecting text in wxHTML with character precision was made easier, it's
+ enough to select half of a character (Michael Hieke)
+- Significantly improved startup times of XRC-based applications using
+ embedded resources on Unix (requires resources recompilation)
+- Fixed freeing of "static" alpha data in wxImage (Axel Gembe)
+- Don't invalidate the font in SetNativeFontInfo[Desc]() if the string is
+ invalid, to conform to the documented behaviour (Langhammer)
+- Fixed wxXPMHandler::SaveFile for images with more than 92 colors.
+
+wxMSW:
+
+- Correct problem with page setup dialog when using landscape mode
+- Added msw.font.no-proof-quality system option, see manual for description
+- Fix appearance of notebook with non-top tabs under Windows Vista
+- Fixed bug with symbol resolving in wxStackWalker (Axel Gembe)
+- Fixed showing busy cursor for disabled windows and during wxExecute()
+- Set the string of wxEVT_COMMAND_CHECKLISTBOX_TOGGLED events (Luca Cappa)
+- Fix problems with timers on SMP machines in wxAnimationCtrl (Gennady)
+
+wxGTK:
+
+- Setting foreground colour of single line wxTextCtrl now works
+- More work on setting defaults in GNOME print dialogs.
+- Also made landscape printing work as per wxMSW.
+- Add support for clipping in GNOME print backend.
+- Speed up wxBitmap::Rescale()
+- Add right button event for wxToolbar's tools (Tim Kosse)
+- Don't unconditionally add wxCAPTION style to wxMiniFrame
+- Generate wxEVT_COMMAND_LIST_END_LABEL_EDIT event even if label didn't change
+- Fix WX_GL_STEREO attribute handling (Tristan Mehamli)
+- Fix wxThread::SetPriority() when the thread is running (Christos Gourdoupis)
+- Fixed off by 1 bug in wxDC::GradientFillLinear() (Tim Kosse)
+
+
+2.8.4
+-----
+
+All:
+
+- Fix bug in wxFileConfig when recreating a group (Steven Van Ingelgem)
+- Fix wxStringOutputStream::Write() in Unicode build when the argument
+ overlaps UTF-8 characters boundary
+- Account for lines without newline at the end in wxExecute()
+
+All (Unix):
+
+- Handle socket shutdown by the peer correctly in wxSocket (Tim Kosse)
+
+All (GUI):
+
+- Allow status bar children in XRC (Edmunt Pienkowski)
+- Fix memory leak in wxWizard when not using sizers for the page layout
+- Added wxListCtrl::SetItemPtrData()
+- wxHTML: Apply table background colour between the cells too (Michael Hieke)
+
+wxMSW:
+
+- Corrected wxStaticBox label appearance when its foreground colour was set:
+ it didn't respect font size nor background colour then (Juan Antonio Ortega)
+- Don't lose combobox text when it's opened and closed (Kolya Kosenko)
+- Corrected GetChecked() for events from checkable menu items (smanders)
+- Fixed popup menus under Windows NT 4
+- Fixed bug in wxThread::Wait() in console applications introduced in 2.8.3
+- Support right-aligned/centered owner drawn items in wxListCtrl (troelsk)
+- Compilation fixed with WXWIN_COMPATIBILITY_2_6==0
+- Fix wxComboCtrl colours under Windows Vista (Kolya Kosenko)
+
+wxGTK:
+
+- Fix infinite loop when adding a wxStaticText control to a toolbar
+- Fix wxNO_BORDER style for wxRadioBox (David Hart)
+- Fix wxTextCtrl::GetLineText() for empty lines (Marcin Wojdyr)
+
+wxMac:
+
+- Fix wxComboBox::SetSelection(wxNOT_FOUND) (Adrian Secord)
+
+wxUniv:
+
+- Fix wxTextCtrl::SetSelection(-1, -1) to behave as documented (Anders Larsen)
+- Fix wxComboBox::SetSelection(wxNOT_FOUND)
+- Fix setting background colour for controls with transparent background
+
+
+2.8.3
+-----
+
+All:
+
+- Shut down the sockets gracefully (Sergio Aguayo)
+- Fix extra indentation in wxHTML_ALIGN_JUSTIFY display (Chacal)
+
+wxMac:
+
+- Corrected top border size for wxStaticBox with empty label (nusi)
+
+wxMSW:
+
+- Fixed wxFileName::GetSize() for large files
+
+wxGTK:
+
+- Fixed handling of accelerators using PageUp/Down keys
+
+
+2.8.2
+-----
+
+All:
+
+- Added wxSizerFlags::Shaped() and FixedMinSize() methods.
+- Added wxCSConv::IsOk() (Manuel Martin).
+- Added wxDateTime::GetDateOnly().
+- Made wxTextFile work with unseekable files again (David Hart).
+- Added wxCONFIG_USE_SUBDIR flag to wxFileConfig (Giuseppe Bilotta).
+- Added wxSearchCtrl::[Get|Set]DescriptiveText.
+- Fixed detection of number of processors under Linux 2.6
+- Fixed Base64 computation in wxHTTP (p_michalczyk)
+- Fix handling of wxSOCKET_REUSEADDR in wxDatagramSocket (troelsk)
+
+Unix Ports:
+
+- Fixed crash in wxGetUserName() in Unicode build
+
+wxMSW
+
+- Fix lack of spin control update event when control lost focus.
+- Corrected drawing of bitmaps for disabled menu items.
+
+wxGTK
+
+- Fix hang on startup when using GTK+ options in Unicode build
+
+wxMac
+
+- Fix position of the centered windows (didn't take menu bar size into account)
+- Added support for the wxFRAME_FLOAT_ON_PARENT style.
+
+wxX11:
+
+- Don't crash in wxWindow dtor if the window hadn't been really Create()d.
+
+wxUniv:
+
+- Fixed wxComboBox always sorted.
+
+
+2.8.1
+-----
+
+All:
+
+- Fix compilation with wxUSE_STL=1.
+- wxGrid::GetBestSize() returns same size the grid would have after AutoSize().
+- Added wxTreeCtrl::CollapseAll[Children]() and IsEmpty() (Francesco Montorsi).
+- Several RTL-related positioning fixes (Diaa Sami).
+- Fix wxConfig::DeleteGroup() for arguments with trailing slash (David Hart).
+- Fix memory leak in wxGrid::ShowCellEditControl() (Christian Sturmlechner).
+
+wxMSW:
+
+- Fixed compilation with Borland C++ in Unicode mode but without MSLU.
+- Show taskbar icon menu on right button release, not press.
+
+wxGTK:
+
+- Don't crash if command line is not valid UTF-8 (Unicode build only).
+
+wxUniv:
+
+- It is now possible to set background colour of wxStaticText.
+
+
+2.8.0
+-----
+
+All:
+
+- Added wxSearchCtrl (Vince Harron).
+- wxCSConv("UTF-16/32") now behaves correctly, i.e. same as wxMBConvUTF16/32.
+- wxArrayString::Alloc() now works as reserve() and doesn't clear array contents.
+- Fixed long standing bug in wxFileConfig groups renaming (Antti Koivisto).
+- New option wxFS_READ | wxFS_SEEKABLE for wxFileSystem::OpenFile() to return
+ a stream that is seekable.
+- Fixed bug in wxCalendarCtrl::HitTest() when clicking on month change arrows.
+- Added wxWindow::GetWindowBorderSize() and corrected wxTreeCtrl::GetBestSize().
+ for a control with borders (Tim Kosse).
+
+wxMSW:
+
+- Fixed version script problems when using configure with cygwin/mingw32.
+- Use system default paper size for printing instead of A4.
+- Fix (harmless) assert in virtual list control under Vista.
+- Fix colours when converting wxBitmap with alpha to wxImage (nusi).
+
+wxGTK:
+
+- Allow dynamically changing most of text control styles.
+- Enable use of libgnomeprintui by default in configure.
+
+
+2.7.2
+-----
+
+All:
+
+- Added wxFFile overload to wxFileName::CreateTemporaryFileName().
+- Added GetTempDir() to wxFileName and wxStandardPaths.
+- Added wxTar streams.
+- Added wxFilterFSHandler and wxArchiveFSHandler.
+- Added wxString::ToLongLong() and ToULongLong().
+
+All (GUI):
+
+- wxMemoryDC constructor now optionally accepts a wxBitmap parameter,
+ calling SelectObject itself if a valid bitmap is passed.
+- Reverted wxBuffered[Paint]DC to pre 2.7.1 state, added
+ wxAutoBufferedPaintDC and wxAutoBufferedPaintDCFactory.
+- Renamed wxProgressDialog::UpdatePulse() to just Pulse().
+- Added wxCollapsiblePane (Francesco Montorsi).
+- Added wxSimpleHtmlListBox (Francesco Montorsi).
+- Printing framework fixes by Robert J. Lang. Bugs fixed,
+ wxPrinterDC::GetPaperRect() and other functions added to allow
+ easier printing implementation, and the documentation updated.
+- Many enhancements to wxRichTextCtrl including URL support,
+ formatting and symbol dialogs, print/preview, and better list
+ formatting.
+- Support for loading TGA files added (Seth Jackson).
+- Added wxTB_RIGHT style for right-aligned toolbars (Igor Korot).
+- wxHtmlWindow now generates events on link clicks (Francesco Montorsi).
+- wxHtmlWindow now also generates wxEVT_COMMAND_TEXT_COPY event.
+
+Unix Ports:
+
+- Added autopackage for wxGTK and an example of using autopackage for a wx
+ program (Francesco Montorsi).
+
+wxGTK:
+
+- More RTL work.
+- Support wxALWAYS_SHOW_SB.
+- Speed up MIME types loading. Only the GNOME database should be loaded under
+ GNOME etc. For this, the code queries the X11 session protocol.
+- wxCaret redraw problem during scrolling fixed.
+
+
+2.7.1
+-----
+
+All:
+
+- Added wxDir::FindFirst() (Francesco Montorsi).
+- Added wxPlatformInfo class (Francesco Montorsi).
+- Added wxLocale::IsAvailable() (Creighton).
+- Added Malay translations (Mahrazi Mohd Kamal).
+- Added reference counting for wxVariant.
+- For consistency, all classes having Ok() method now also have IsOk() one, use
+ of the latter form is preferred although the former hasn't been deprecated yet.
+- Added wxFileName::Is(Dir|File)(Writ|Read|Execut)able() (Francesco Montorsi).
+- Added wxFileName::GetSize() and GetHumanReadableSize() (Francesco Montorsi).
+- Added wxSizer::Replace (Francesco Montorsi).
+- wxXmlDocument can now optionally preserve whitespace (Francesco Montorsi).
+- Added wxBookCtrl::ChangeSelection() and wxTextCtrl::ChangeValue() to provide
+ event-free alternatives to SetSelection() and SetValue() functions; see the
+ "Events generated by the user vs programmatically generated events" paragraph
+ in the "Event handling overview" topic for more info.
+
+All (GUI):
+
+- Support for right-to-left text layout (started by Diaa Sami during Google Summer of
+ Code, with a lot of help from Tim Kosse and others).
+- wxAnimationCtrl added (Francesco Montorsi).
+- Added wxAboutBox() function for displaying the standard about dialog.
+- Added wxID_PAGE_SETUP standard id.
+- Added wxSize::IncBy() and DecBy() methods.
+- Added wxTextCtrl::IsEmpty().
+- Added file type parameter to wxTextCtrl::LoadFile, wxTextCtrl::SaveFile for
+ consistency with wxRichTextCtrl.
+- wxRichTextCtrl: fixed range out-by-one bug to be consistent with wxTextCtrl API,
+ fixed some attribute bugs and added wxRichTextStyleComboCtrl.
+- Added wxWindow::IsDoubleBuffered().
+- Added wxHL_ALIGN_* flags to wxHyperlinkCtrl (Francesco Montorsi).
+- Added wxGauge::Pulse() and wxProgressDialog::UpdatePulse() (Francesco Montorsi).
+
+wxMSW:
+
+- Implemented wxComboBox::SetEditable().
+- wxSemaphore::Post() returns wxSEMA_OVERFLOW as documented (Christian Walther)
+- Fixed a bug whereby static controls didn't use the correct text colour if the
+ parent's background colour had been set (most noticeable when switching to a
+ high-contrast theme).
+- Respect wxBU_EXACTFIT style in wxToggleButton (Alexander Borovsky).
+
+wxMac:
+
+- Add parameter to the --enable-universal_binary configure option for the path
+ to the SDK.
+
+wxGTK:
+
+- Automatically use stock items for menu items with standard ids.
+- Setting cursor now works for all controls.
+- Implemented right-to-left support.
+- Implemented left indentation and tab stops support in wxTextCtrl (Tim Kosse).
+- Fixed wxHTML rendering of underlined text of multiple words (Mart Raudsepp).
+
+wxUniv:
+
+- Added wxTLW::UseNativeDecorations() and UseNativeDecorationsByDefault().
+
+
+2.7.0
+-----
+
+All:
+
+- Added positional parameters support to wxVsnprintf() (Francesco Montorsi).
+- wx(F)File, wxTextFile and wxInputStreams recognize Unicode BOM now.
+- Many fixes for UTF-16/32 handling in Unicode builds.
+- wxLaunchDefaultBrowser() now supports wxBROWSER_NEW_WINDOW flag.
+- Added wxStandardPaths::GetResourcesDir() and GetLocalizedResourcesDir()
+- Added wxStandardPaths::GetDocumentsDir() (Ken Thomases).
+- Added wxStringTokenizer::GetLastDelimiter(); improved documentation.
+- Fixed wxTextFile in Unicode build.
+- Added possibility to specify dependencies for a wxModule.
+- Speed improvements to wxRegEx when matching is done in a loop such as
+ during a search and replace.
+- Fix regerror and regfree name conficts when built-in regex and system regex
+ are both used in the same program.
+- Basic authentication supported added to wxHTTP.
+- wxCondition::WaitTimeout() now returns correct value when timeout occurs.
+- Fixed occasional wxThread cleanup crash.
+- Bug in wxLogStream::DoLogString in Unicode builds fixed.
+- Added support for memo fields to wxODBC.
+- Fixed Unicode builds using SunPro compiler by defining__WCHAR_TYPE__.
+- wxFileName now also looks for TMPDIR on Unix.
+- Fixed build error in list.h with VC++ 2005.
+- Fixed wxODBC buffer overflow problem in Unicode builds.
+- Fixed wxSocketBase::InterruptWait on wxBase.
+- Important code cleanup (Paul Cornett).
+- Added support for wxLongLong in wx stream classes (Mark Junker).
+- wxSOCKET_REUSEADDR can be used with wxSocketClient.
+- Overloaded Connect() and SetLocal() methods for binding to local address/port.
+- Albanian translation added (Besnik Bleta).
+- Assert messages now show the function in which assert failed.
+- wxApp::OnAssertFailure() should now be used instead the old wxApp::OnAssert().
+- Fixed several bugs in wxDateTime::ParseDate().
+- The WXK*PRIOR and WXK*NEXT constants are now aliases for WXK*PAGEUP
+ and WXK*PAGEDOWN. If you have switch statements that use both
+ constants from a set then you need to remove the PRIOR/NEXT
+ versions in order to eliminate compiler errors.
+- Fixed bug where wxDateTime::Now() would sometimes return an incorrect value
+ the first time it was called.
+- Added wxString::rbegin() and rend().
+- Added wxString::EndsWith().
+- wxSocket::_Read continues reading from socket after exhausting pushback buffer.
+ Previously, only the buffer would be returned, even if more data was requested.
+- Added wxPowerEvent (currently MSW-only).
+- Make wx-config compatible with Bourne shells.
+- Fixed wxDb::Open(wxDbConnectInf) when using connection string (Hellwolf Misty).
+- Fixed crash in wxDb::Open() in Unicode build (Massimiliano Marretta).
+- Fixed wxTimeSpan::Format() for negative time spans.
+- Optionally count repeating wxLog messages instead of logging all (Lauri Nurmi).
+
+All (GUI):
+
+- New AUI (Advanced User Interface) library for docking windows and much more.
+- Added wxComboCtrl and wxOwnerDrawnComboBox (Jaakko Salli).
+- Added wxTreebook (uses a wxTreeCtrl to control pages).
+- Added wxColour/Dir/File/Font/PickerCtrls (Francesco Montorsi).
+- Added wxDC::GradientFillLinear/Concentric().
+- Added wxHyperlinkCtrl (Francesco Montorsi).
+- Added clipboard events (wxEVT_COMMAND_TEXT_COPY/CUT/PASTE).
+- Allow to reorder wxGrid columns by drag-and-drop (Santiago Palacios).
+- Added wxRadioBox::SetItemToolTip().
+- Added support for CMYK JPEG images loading (Robert Wruck).
+- Added wxListCtrl::GetSubItemRect() and subitem hit testing (Agron Selimaj).
+- Added wxKeyEvent::GetModifiers().
+- Added wxDialog::SetEscapeId().
+- wxItemContainerImmutable::FindString unified (affects wxRadioBox, wxListBox,
+ wxComboBox and wxChoice).
+- wxWindow::Fit() now works correctly for frames and dialogs too.
+- Added access to the border size between pages and controller in book
+ based controls (wxBookCtrlBase::Get/SetInternalBorder).
+- Added initial wxRichTextCtrl implementation.
+- All book based controls (notebook, treebook etc.) share now the same
+ options for orientation (wxBK_TOP, wxBK_DEFAULT, ...) instead of duplicated
+ wxLB_TOP, wxNB_TOP, wxCHB_TOP, wxTBK_TOP.
+- Added parent window parameter to wxHelpController constructor
+ and added SetParentWindow/GetParentWindow.
+- wxMultiChoiceDialog uses now wxCheckListBox if possible, wxListBox if not.
+- Added wxBitmapButton::SetHoverBitmap().
+- Access to titles through Get/SetTitle is available now only for top level
+ windows (wxDialog, wxFrame).
+- Fixed memory leak of pending events in wxEvtHandler.
+- Added wxRadioBox::IsItemEnabled/Shown().
+- Added space after list item number in wxHTML.
+- Implemented and handling in wxHTML (based on patch
+ by Sandro Sigala).
+- Added caption parameter to wxGetFontFromUser and wxGetColourFromUser.
+- Added wxGetMouseState function.
+- Added wxHtmlHelpWindow, wxHtmlHelpDialog and wxHtmlModalHelp classes,
+ allowing HTML help to be embedded in an application.
+- wxCalendarCtrl positioning and hit-testing fixes for dimensions other than
+ best size.
+- wxCalendarCtrl colour schema changed and adjusted to system settings.
+- wxImage::Mirror() and GetSubBitmap() now support alpha (Mickey Rose).
+- More checking of image validity before loading into wxImage.
+- Added wxImage::ConvertToGreyscale.
+- Added ability to use templates with static event tables
+ with BEGIN_EVENT_TABLE_TEMPLATEn() macros.
+- Added play, pause, and state change events to wxMediaCtrl.
+- Added double-buffering to wxVListBox and fixed a scrolling issue.
+- Added wxToolbook (uses a wxToolBar to control pages).
+- Added SetSheetStyle to wxPropertySheetDialog and allowed it to
+ behave like a Mac OS X settings dialog.
+- Added XRC tag for wxToolBar elements and for wxToolBar itself.
+- Fixed centering of top level windows on secondary displays.
+- Implemented wxDisplay::GetFromWindow() for platforms other than MSW.
+- UpdateUI handler can now show/hide the window too (Ronald Weiss).
+- More than one filter allowed in wxDocTemplate filter.
+- Added wxListBox::HitTest().
+- Added wxDisplay::GetClientArea().
+- Indices and counts in wxControlWithItems derived API are unsigned.
+- Added support for links to wxHtmlListBox; use code has to override
+ wxHtmlListBox::OnLinkClicked() to take advantage of it.
+- Added an easier to use wxMenu::AppendSubMenu().
+- wxString <-> wxColour conversions in wxColour class (Francesco Montorsi).
+- Fixed bug with ignoring blank lines in multiline wxGrid cell labels.
+- Added wxTextAttr::Merge() (Marcin Simonides).
+- Added wxTB_NO_TOOLTIPS style (Igor Korot).
+- Added wxGenericDirCtrl::CollapsePath() (Christian Buhtz).
+- Added wxTreeCtrl::ExpandAllChildren() (Christian Buhtz)
+- Fixed 64-bit issue in wxNotebook causing segfaults on Tru64 Unix.
+- Made it possible to associate context help to a region of a window.
+- Added support for tabs in wxRichTextCtrl (Ashish More).
+- Fixed problem with zoom setting in print preview.
+- Moved wxRichTextCtrl from the advanced library to its own.
+- wxNB_HITTEST_* flags renamed to wxBK_HITTEST_* to serve all book controls.
+- Added wxTopLevelWindow::SetTransparent and CanSetTransparent, with
+ implementations (so far) for wxMSW and wxMac.
+- Allow customizing individual grid lines appearance (Søren Lassen).
+- Fixed middle click events generation in generic wxTreeCtrl (Olly Betts).
+- Added wxEVT_MOUSE_CAPTURE_LOST event that must be handled by all windows
+ that CaptureMouse() is called on.
+
+wxMSW:
+
+- Fixed crash with ownerdrawn menu items accelerators (Perry Miller).
+- wxFileDialog respects absence of wxCHANGE_DIR flag under NT (Brad Anderson).
+- Switching page of a hidden notebook doesn't lose focus (Jamie Gadd).
+- Removed wxImageList *GetImageList(int) const.
+- Fixed MDI context menu problem.
+- Removed __WIN95__ define.
+- Create msw/rcdefs.h in setup.h's directory, which can be included by
+ resource files. It containts platform/compiler specific defines (such as
+ target cpu) which can be used in #ifs in .rc files.
+- Add support for Win64 manifests and VC++ 8 automatic manifests (see the
+ wxMSW faq for details).
+- New TARGET_CPU=amd64 (or 'ia64') option for the makefile.vc files which
+ puts 64-bit builds in their own directory and adds /machine:amd64 or ia64
+ to the link command.
+- wxStatusBar::GetFieldRect now returns correct values under XP.
+- wxStatusBar no longer corrupts surrounding windows on resize.
+- Enable wxListCtrl in report mode to be able to use images in other
+ columns, if ComCtl32 >= 470.
+- Fixed problem where using SetValue and wxTE_RICH2 would cause control to
+ show.
+- Numpad special keys are now distinguished from normal keys.
+- Fixed GDI leak in wxStaticBitmap when setting images after
+ initial construction.
+- Menu codes now stripped before measuring control labels.
+- MFC sample now compiles in Unicode mode.
+- Fixed SetScrollbar thumb size setting bug (set orientation before triggering
+ events).
+- Fixed icon to cursor conversion problem for bitmaps with masks.
+- Fixed wxToolBar background colour problem for some video cards.
+- wxGenericDirCtrl now shows volume name.
+- Added XP theme support for DrawHeaderButton, DrawTreeItemButton.
+- Made the wxActiveXContainer class public and documentated.
+- Added a Windows Media Player 9/10 backend for wxMediaCtrl.
+- Multiline notebook tab label change now resizes the control
+ correctly if an extra row is removed or added.
+- Fixed a crash when dismissing wxPrintDialog under VC++ 7.1.
+- Fixed out by one error in wxTextCtrl::GetStyle.
+- Fixed problem with getting input in universal/unicode build of wxMSW.
+- Link oleacc.lib conditionally.
+- Drag and drop now works inside static boxes.
+- Fall back to unthemed wxNotebook if specified orientation not available.
+- wxListCtrl and wxTreeCtrl now resize their standard font if the user
+ changes the system font.
+- wxDisplay doesn't require multimon.h now and is enabled by default (Olly Betts).
+- Fixed wxChoice/wxComboBox slow appending and infinite recursion
+ if its size is set within a paint handler (for example when embedded in a
+ wxHtmlWindow). [Now reverted due to problems in W2K and below.]
+- wxDC::GetTextExtent() width calculation is more precise for italics fonts now.
+- Warning fixes for VC++ 5.0 (Igor Korot).
+
+wxGTK:
+
+- Fixed handling of font encoding in non-Unicode build
+- wxEVT_MENU_CLOSE and wxEVT_MENU_OPENED for popup menus are now generated.
+- Implemented wxCURSOR_BLANK support.
+- wxSlider generates all scroll events now and not only wxEVT_SCROLL_THUMBTRACK.
+- Fixed a host of bugs in wxMediaCtrl as well as added a GStreamer 0.10
+ implementation.
+- Improved configure checks for GStreamer. You may also now specify
+ --enable-gstreamer8 to force configure to check for GStreamer 0.8.
+- Fixed problem with choice editor in wxGrid whereby the editor
+ lost focus when the combobox menu was shown.
+- Fixed focusing with mnemonic accelerator keys on wxStaticText which
+ is now able to focus on wxComboBox and possibly other controls
+ previously unable to be focused before.
+- Enabled mnemonics and the corresponding accelerator keys for
+ wxStaticBox and wxRadioBox.
+- Fixed problem trying to print from a preview, whereby wrong printer
+ class was used.
+- Worked around pango crashes in strncmp on Solaris 10.
+- Polygon and line drawing speeded up if there is no scaling.
+- Fixed problems with CJK input method.
+- Implemented ScrollLines/Pages() for all windows (Paul Cornett).
+- Support underlined fonts in wxTextCtrl.
+- Support all border styles; wxListBox honours the borders now.
+- wxWindow and wxScrolledWindow now generate line, page and thumb-release scroll events.
+- Added file preview support in file dialogs.
+- Implemented SetLineSize and GetLineSize for wxSlider.
+
+wxMac:
+
+- Fixed problem with clipboard support for custom data flavors.
+- Fixed focus handling for generic controls in carbon-cfm.
+- Fixed a printing crash bug, for example using File->Print and changing
+ Popup from 'Copies & Pages' to e.g. 'Layout'.
+- Improved support for help and application menu items.
+- Added default implementations for wxTextCtrl::Replace and wxTextCtrl::Remove.
+- Added support for 10.4 context menu.
+- Added support for wxFRAME_EX_METAL and wxDIALOG_EX_METAL styles.
+- Added wxNotebook::HitTest support.
+- Corrected idle wake-up.
+- Corrected wxExecute.
+- Now makes use of full printer resolution.
+- Corrected CGImage handling in wxBitmap.
+- Now uses simple hide/show transition for top-level windows.
+- Uses reasonable temporary path for wxFileName::CreateTempFileName.
+- Added support for default key handling (escape, enter, command-period) even
+ if there is no control on the frame or dialog that has the focus.
+- Fixed joystick bugs including a link error and a crash if no joysticks
+ were found.
+- Removed an errorneous assertion from wxDir.
+- Uses CoreFoundation based and thread-safe implementation for message boxes
+ under Mach-O.
+- wxBitmapButton is created as a content icon if wxBORDER_NONE is
+ specified, otherwise as a bevel button.
+- Mouse event ids set correctly (fixing problems with Connect in particular).
+- Fixed wxZipInputStream read error on wxSocketInputStream which signals the
+ end of file with an error.
+- Xcode wxWidgets and minimal sample project files updated to create Universal
+ binaries.
+- Fix for setting wxMenuBar more than once.
+- wxListBox minimum size bug fixed.
+- Fixed wxNotebook off-by-one bug in HitTest.
+- Fixed joystick GetXMin/Max bug.
+- Fixed Unix domain socket problem in wxIPC.
+- Fixed non-detection of process termination on Intel Macs by
+ polling for process termination in a separate thread.
+
+wxCocoa:
+
+- wxDirDialog is now native (Hiroyuki Nakamura).
+
+wxWinCE:
+
+- Pressing build-in joystick on WinCE phones fires wxEVT_JOY_BUTTON_DOWN event.
+- Native wxCheckListBox implementation.
+- All wxTopLevelWindows resizes accordingly to SIP visibility.
+- ::wxGetUserName() implemented.
+- wxDisplay enumeration support.
+- Fixed wxFileDialog breakage on WinCE due to incorrect structure size.
+- New wxSystemOption "wince.dialog.real-ok-cancel" to switch between WinCE
+ guidelines with Ok-only dialogs and dialogs using wxButtons.
+- Checkable items in wxToolMenuBarTool supported.
+- Fixed date formatting and mktime.
+- Fixed getting standard folder paths on WinCE.
+- Support for backspace key on Smartphone.
+- Made both windows wxMediaCtrl Windows backends compilable with wxWinCE - it
+ is recommended that you use wxMEDIABACKEND_WMP10 on this platform
+ directly, however.
+- Added support for the context menu event (wxContextMenuEvent)
+ and added platform-specific wxWindow::EnableContextMenu.
+- Fixed wxGenericFileDialog to work with WinCE.
+- Fixed compilation and menubar disappearance on Windows Mobile 5.
+- Fixed wxDatePickerCtrl usage.
+
+wxUniv:
+
+- Send wxEVT_SCROLL_XXX events from wxSlider (Danny Raynor).
+- Implemented wxToggleButton (David Bjorkevik).
+- Label in Toolbar tools implemented (Danny Raynor).
+
+wxX11:
+
+- Invisible text problem fixed.
+- Bitmap clipping with masks and scaling improved.
+- Fixed a crash bug in the generic timer.
+- Implemented child process termination notifications (David Björkevik)
+
+Unix:
+
+- NO_GCC_PRAGMA is not used any more, remove checks for it if you used it.
+
+wxMGL:
+
+- Fixed NUM_LOCK having no effect.
+- Fixed wxFileExists (affecting wxImage::LoadFile).
+
+
+2.6.2
+-----
+
+All:
+
+- Fixed wxScopeGuard to work with VC++, documented it.
+- Fixed proxy handling in wxURL.
+- Added wxEVT_MEDIA_LOADED event for wxMediaCtrl.
+- Added new methods to wxMediaCtrl (wxURI version of Load, ShowPlayerControls).
+- Added wxZipFSHandler::Cleanup() (Stas Sergeev).
+- Added wxImage::RotateHue() and RGB <-> HSV conversions (John Anderson).
+- Fixed compilation with IBM xlC compiler.
+- wxABI_VERSION, see 'Backward Compatibility' topic overview in the manual.
+- Added wxLongLong::ToDouble().
+- Added wxDateTime::[Make]FromTimezone(), fixed several TZ-related bugs.
+- Fixed bug in wxStreamBuffer::Read(wxStreamBuffer *) (Paul Cornett).
+- Fixed wxListbook and wxChoicebook internal layout.
+
+All (GUI):
+
+- Added wxStaticText::Wrap()
+- wxChoice and wxComboBox::GetSelection() now returns completed selection,
+ added a new GetCurrentSelection() function having the old behaviour.
+- Added wxXmlResource::Unload().
+- Possibility of modeless wxWizard dialog (with presentation in sample).
+- Fixed a rare crash due to malformed HTML in wxHTML (Xavier Nodet).
+- Ctrl+mouse wheel changes zoom factor in print preview (Zbigniew Zagórski).
+- Cross-compile now supported for wxGTK, wxX11 and wxMotif.
+- Cygwin compilation of wxX11, wxGTK and wxMotif now supported.
+- Now reads "help" parameter for all windows (context help text).
+- wxWizard adapts to PDA-sized screens.
+- Unicode fixes for IPC and a new IPC sample (Jurgen Doornik).
+
+wxMSW:
+
+- wxMSW now builds with (beta of) MSVC 8 (a.k.a. 2005).
+- Separators are now correctly shown in the toolbars under Windows XP.
+- Fixed multiline tooltips handling.
+- Fixed wxSlider::GetSelEnd() (Atilim Cetin).
+- Fixed accelerators of menu items added to already attached submenus.
+- Position of wxEVT_MOUSEWHEEL events is now in client, not screen, coordinates.
+- Handle absence of wxListCtrl column image better (Zbigniew Zagórski).
+- Fixed asynchronous playback of large sound files in wxSound.
+- Added wxDynamicLibrary::GetSymbolAorW().
+- Fixed default size of wxStaticText controls with border being too small.
+- Fixed bugs with wxStatusBar positioning (with or withour sizers) (Jamie Gadd).
+- Mouse move events are now generated for all static controls (Jamie Gadd).
+- Fixed nested static box display and splitter sash on some themes (Jamie Gadd).
+- Made wxJoystick::GetProductName() more useful (John Ratliff).
+- Native spline drawing implementation (Wlodzimierz ABX Skiba).
+
+wxGTK:
+
+- ShowFullScreen() shows the window if it was still hidden (rpedroso).
+- Implemented wxTopLevelWindow::RequestUserAttention() (Mart Raudsepp).
+- Base library is now binary compatible when built with wxGTK and wxMotif.
+- wxTextCtrl::XYToPosition, PositionToXY and GetLineLength calls are now
+ instantaneous in case of GTK 2.x multi-line controls (Mart Raudsepp).
+- Added support for left, centre and right text alignment attributes under
+ GTK+2 multi-line text controls (Mart Raudsepp).
+- Various wxFont improvements for GTK 2.x builds (Mart Raudsepp).
+- Changed order of child deletion in window destructor and
+ removed focus handlers to avoid spurious events (David Surovell).
+- Fixed domain socket handling.
+
+wxMac:
+
+- First implementation of native HIToolbar support.
+- Added text control context menu (ported from wxMSW).
+- More CoreGraphics implementation improvements.
+- Various text control bug fixes.
+- Automatic menu management improved.
+- Fixed crash when wxRadioButton is deleted from a group of radio buttons,
+ due to dangling cycle pointers.
+- Native spline drawing implementation for CoreGraphics (Robert J. Lang).
+- Made wxDialog::IsModal meaning the same as other ports (true only when
+ showing modally).
+
+wxOS2
+
+- Adjustments for building with Open Watcom C++.
+
+wxUniv:
+
+- Window creation now honours wxVSCROLL.
+- Standalone scrollbars generate events of correct type (Jochen Roemmler).
+
+wxMotif:
+
+- Base library is now binary compatible when built with wxGTK and wxMotif.
+- wxMotif can now display Japanese text under Japanese locale.
+- Fixed button size in common dialogs.
+- Made wxFileDialog translatable.
+- All top level windows should now have a border unless the wxNO_BORDER
+ flag has been specified.
+- Improved wxNotebook support for sizers. It requires the wxNotebook to
+ be created with a "sensible" initial width.
+- Made wxDialog::IsModal meaning the same as other ports (true only when
+ showing modally).
+
+wxMGL:
+
+- Fixed crash on exit.
+- Fixed drawing problems when windows are resized.
+
+wxX11:
+
+- Various wxFont improvements for unicode builds (Mart Raudsepp).
+
+
+2.6.1
+-----
+
+All:
+
+- Added wxLaunchDefaultBrowser.
+- Added wxPLURAL() macro in addition to _() (Jonas Rydberg)
+
+All (GUI):
+
+- Fixed potential infinite loop when adjusting wxScrolledWindow scrollbars.
+- Radio in menus do not send menu event for selections of already selected item.
+- Fixed wrong positioning of marks and enumerations in lists of wxHTML.
+- wxImage::Rotate90 respects alpha channel.
+- Added wxEVT_SCROLL_CHANGED as synonym for wxEVT_SCROLL_ENDSCROLL.
+- Replaced artwork for some cursors, icons and toolbar buttons.
+- Fixed sizing problem in generic wxCalendarCtrl for short day abbreviations.
+- Fixed wxWindow::DoGetBestSize to keep original best size.
+- PNM now supports ASCII and raw grey formats.
+- wxGrid focus and edit key improvements.
+
+wxMSW:
+
+- Fixed erroneous selection of content in wxComboBox when within a wxStaticBox
+ (checking for selection caused by WM_STYLECHANGED).
+- Added deferred positioning to wxRadioBox, wxSlider and wxSpinCtrl and thereby
+ eliminated some refresh glitches when resizing.
+- Eliminated further refresh glitches caused by wxRadioBox (to nearby controls)
+ by refreshing parent when the radio box moves.
+- Added ability set the system option "msw.staticbox.optimized-paint" to 0 to
+ allow a panel to paint graphics around controls within a static box.
+- Refresh exposed areas when resizing, using WM_WINDOWPOSCHANGED.
+- Worked around an apparent bug in deferred window positioning (moving a
+ window from (x, y) to (a, b) and back to (x, y) misses the last step) by
+ checking window positions against corresponding sizer state, if any.
+- A control's text colour now reflects the system colour setting.
+- Fixed wxFileName::GetLongPath() to behave correctly during the first call too.
+- Fixed alpha blitting to take into account source position.
+- Setting foreground colour for wxCheckBox now works when using XP themes too.
+- wxStaticBox label can use custom foreground colour.
+- Now uses newer font MS Shell Dlg 2 if possible.
+- Compiles again with WIN64.
+- Winelib compilation now works.
+- When converting a wxIcon to a bitmap check if the icon has an alpha
+ channel and set the bitmap to use it.
+- wxSlider now also sends wxEVT_SCROLL_CHANGED when using mouse wheel
+- Miscellaneous wxMediaCtrl improvements.
+- wxTopLevelWindow::ShowFullScreen logic error fixed.
+- Fixed wxScrollBar background colour bug.
+- Fixed problems with paper sizes being ignored.
+- wxNotebook refresh problem fixed.
+- DDE fixed for Unicode.
+- Fixed ownerdrawn multiline buttons.
+- wxCheckListBox item background fixed.
+- Fixed error when trying to read a value from key not accessible for writing.
+- Fixed keyboard cue visibility issues under Windows 2000/XP
+
+wxWinCE:
+
+- Fixed wxFileName::CreateTempFileName.
+
+wxGTK:
+
+- Added support for wxSTAY_ON_TOP (GTK 2.4+).
+- Fixed wxTextCtrl::SetStyle for overlapping calls.
+- Fixed scrollbar border colour.
+- Added bitmap support in menus.
+
+wxMac:
+
+- Added support for launching 'APPL' bundles with wxExecute (usually they have a
+ .app extension and are the ones that reside in the Applications folder).
+- Fixed a bug in wxGetKeyState where shift and some other keys were returning an
+ incorrect state.
+- Fixed toolbar colour bug on Tiger.
+- Fixed visual problems caused by removal of About menu item.
+- Window menu now added automatically.
+- Configure fixed for wxBase compilation.
+- Modified function key support fixed.
+- wxTopLevelWindow::Maximize improvements.
+
+wxX11:
+
+- Menu problems fixed.
+- wxScrolledWindow scrolls any child windows.
+- Fixed a font memory leak.
+- Multiple wxTimers now work correctly.
+
+
+2.6.0
+-----
+
+All:
+
+- wxPathExists deprecated, use wxDirExists instead.
+- Configure: --enable-std_iostreams, --enable-std_string are now the default.
+
+All (GUI):
+
+- Fixed ~wxStatusBar and ~wxToolBar which tried to check
+ non-existent wxFrameBase RTTI, causing a crash if not in a frame.
+
+wxMSW:
+
+- Fixed static box border when the label is empty.
+- Fixed SetBackgroundColour() to change only label background, not entire box.
+- wxHelpController is now aliased to wxCHMHelpController.
+
+wxWinCE:
+
+- Fixed device origin setting and clipping region setting.
+
+wxGTK:
+- New configure syntax for specifying the GTK+ version.
+ --with-gtk Use GTK 2.x, no fallback
+ --with-gtk=1 Use GTK 1.2, no fallback
+ --with-gtk=2 Use GTK 2.x, no fallback
+ --with-gtk=any Use any available GTK
+- wxMenuItem::SetText() takes care of hotkeys, too.
+- Reworked text wrapping for wxStaticText.
+
+wxMac:
+- Implemented most of the wxFileType and wxMimeTypesManager functions
+
+2.5.5
+-----
+
+All:
+
+- wxURI::GetUser() only returns the user name now, use GetUserInfo() to get
+ user and password as in 2.5.4; wxURI::GetPassword() added.
+- Added wxDebugReport class.
+- Added wxTempFileOutputStream by Stas Sergeev.
+- Fixed wxDateTime::SetToWeekDayInSameWeek(Sun, Monday_First).
+- Added WXK_SPECIAL keycodes for special hardware buttons.
+- Fixed bug with wxFile::Seek(-1, wxFromCurrent).
+- Added wxString/C array constructors to wxArrayString.
+- Added wxMemoryInputStream(wxMemoryOutputStream&) constructor (Stas Sergeev)
+
+All (GUI):
+
+- Added GetIcon, GetBitmap to wxImageList. wxGenericImageList's original
+ GetBitmap is renamed GetBitmapPtr.
+- Added XPM data constructor to wxImage.
+- Added style parameter to wxBufferedDC to allow buffering just the client, or
+ the whole virtual area.
+- Restored ability to set a custom splitter sash size with SetSashSize.
+- Fixed wxScrolledWindow sizer behaviour so that the virtual size
+ isn't used to set the window size.
+- Added wxTE_BESTWRAP (based on patch by Mart Raudsepp).
+- wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED is now only sent once at the end of
+ splitter dragging and not after each CHANGING event (Jacobo Vilella Vilahur).
+- Added wxImage::IsTransparent().
+
+Unix:
+
+- Fixed build on Linux/AMD64.
+
+wxMSW:
+
+- Added "orient" parameter to wxMDIParentFrame::Tile().
+- wxTextCtrl with wxTE_RICH2 style now uses RichEdit 4.1 if available.
+- fix handling Alt-key events in wxComboBox (reported by Joakim Roubert).
+- wxWindow::Refresh() refreshes the window children as well.
+- Improved static box and radio box refresh and background colour
+ handling (Jamie Gadd).
+
+wxGTK:
+
+- Improved wxSystemSettings::GetMetric() to work better with X11 (Mart Raudsepp).
+- Corrected wxListBox selection handling.
+- Corrected default button size handling for different themes.
+- Corrected splitter sash size and look for different themes.
+- Fixed keyboard input for dead-keys.
+- Added support for more wrapping styles (Mart Raudsepp).
+- GTK2.4+ wxFileDialog reimplemented to support non-modal usage better,
+ and fix all known bugs (Mart Raudsepp).
+
+wxMac:
+
+- Added wxFRAME_EX_METAL, wxDIALOG_EX_METAL for metallic-look windows.
+
+wxPalmOS:
+
+- Native wxRadioBox implementation.
+
+wxWinCE:
+
+- Added wxNB_FLAT for flat-look notebooks on Windows CE.
+- Titlebar OK button on PocketPC now sends command set by SetAffirmativeId.
+ You can also override wxDialog::DoOK if you need more flexibility.
+- Dialog size now takes into account SIP or menubar.
+- Panels more naturally white on PocketPC.
+- wxDIALOG_EX_CONTEXTHELP ignored on WinCE since it interferes
+ with correct titlebar style.
+- Frames have Ctrl+Q accelerator set automatically, as per the
+ PocketPC guidelines
+- Documented issues in manual under wxWinCE topic.
+- Made (Un)RegisterHotKey WinCE-aware.
+- Sends wxEVT_HIBERNATE event.
+- Now fakes wxEVT_ACTIVATE_APP to be symmetrical with wxEVT_HIBERNATE.
+- Added wxTE_CAPITALIZE for CAPEDIT controls.
+- wxDialog::GetToolBar can be used if you need to add buttons
+ to the dialog's toolbar.
+
+2.5.4
+-----
+
+All:
+
+- wxEvent and derived classes don't have public members any more, you must
+ use accessors methods now (Mart Raudsepp)
+- new classes for reading and writing ZIP files (M.J.Wetherell)
+- large files support for wxFFile (M.J.Wetherell)
+- classes in the manual are now cross-referenced (Zbigniew Zagórski)
+- Norwegian (Bokmål) translation added (Hans F. Nordhaug)
+- wxDynamicLibrary::HasSymbol() added
+- added wxEXEC_NODISABLE flag to be used with wxExecute(wxEXEC_SYNC)
+- added wxTextInputStream::operator>>(wchar_t) for compilers which support this
+- added wxURI, a class for dealing with Uniform Resource Identifiers
+- changed wxURL to inherit from wxURI and provide assignment and comparison
+- implemented wxConvUTF7 (modified patch from Fredrik Roubert)
+- added versions of MB2WC and WC2MB for wxMBConv that works for embedded null chars
+- Unicode support in wxODBC is now fully implemented
+- A new data type specific to wxWidgets called SQL_C_WXCHAR has been introduced.
+ SQL_C_WXCHAR should be used rather than SQL_C_CHAR to ensure transparent
+ behaviour between Unicode and non-unicode builds
+- BLOB example added to samples/db (thanks to Casey O'Donnell)
+- use wxStream::GetLength() instead of deprecated GetSize()
+- wxGetOsDescription() is now more precise (Olly Betts)
+- XRC supports system fonts and colours (Ray Gilbert)
+- Added flags argument to wxKill/wxProcess::Kill to kill child processes.
+- Added wxPrintFactory classes so that it is possible to add a new
+ print system backend at run-time. This was required by the new GNOME
+ printing stuff in the GTK port.
+- Deprecated print setup dialog.
+- Added support to the wxODBC classes for Firebird 1.5 database
+- The samples/db sample program now includes an optional example of using a BLOB
+ datatype (if BLOB support is enabled and supported by the database)
+- added wxDynamicLibrary::ListLoaded()
+- wxGetPowerType() and wxGetBatteryState() addition
+- wxSystemSettings::GetSystem*() members deprecated and replaced with
+ wxSystemSettings::Get*()
+- wxWindowBase::DoGetBestSize now includes the difference (if any) between
+ the client size and total size of the window. Code that sets the
+ client size using the best size, or that added extra space to sizers
+ to compensate for this bug may need to be changed.
+- Changed calculation of scrolling area to not clip away some bits
+ due to a rounding error.
+- Changed GetVirtualSize() to return client size by default until
+ SetVirtualSize() gets called. From then on it will only return that.
+- Various changes to how wxListCtrl and wxTreeCtrl react to right
+ mouse clicks and left mouse click for starting a drag operation.
+- "Alt" key (VK_MENU) now results in WXK_ALT keyboard event, not WXK_MENU
+- wxFFile::ReadAll() now takes an optional wxMBConv parameter
+- wxCommandProcessor::MarkAsSaved() and IsDirty() added (Angela Wrobel)
+- added wxStackWalker and related classes (Win32 and some Unix versions only)
+
+
+All (GUI):
+
+- added wxMediaCtrl
+- added wxDatePickerCtrl
+- wxHtmlWindow now supports background images given in tag
+- wxSplitterWindow now supports gravity parameter (Zbigniew Zagórski)
+- recursive wxSizer::GetItem returns item of given window, sizer or nth index
+- wxLayoutConstraints now use best size, not current size, for AsIs() condition
+- wxSizer::Add/Insert etc. now returns pointer to wxSizerItem just added and this
+ item remembers its wxRect area (Brian A. Vanderburg II)
+- wxBookCtrl renamed to wxBookCtrlBase, wxBookCtrl is reserved for most native
+ book control (for now wxChoicebook for MSSmartphone, wxNotebook for others).
+ Necessary event macros, types and styles mapped accordingly.
+- new wxBrush::IsHatch() checking for brush type replaces IS_HATCH macro
+- wxProgressDialog accepts smooth gauge again (wxPD_SMOOTH style)
+- wxProgressDialog new style: wxPD_CAN_SKIP which provides skipping some parts
+ of the progress (with new "Skip" button in dialog)
+- wxGenericListCtrl::SetItemState(-1) now changes the state of all items as
+ in wxMSW version (Gunnar Roth)
+- added wxImage::InitAlpha()
+
+Unix:
+
+- wxPuts() now correctly outputs trailing new line in Unicode build
+
+wxGTK:
+
+- Added printing support by way of using libgnomeprint. The library
+ now checks at runtime, if the library is installed and will use it
+ if it is. Otherwise, it will fall back to the old PostScript printing
+ code, from which the Pango drawing code was removed.
+- Implemented/improved wxDC::DrawRotatedText()
+- fixed wxFileDialog::SetWildcard()
+- native file dialog is now used if available (Zbigniew Zagorski)
+- implemented wxTextCtrl::Freeze() and Thaw(). The GtkTextBuffer
+ is not a valid one during frozen state. Get a pointer to it right
+ after wxTextCtrl creation if you really need to. (Mart Raudsepp)
+- Changed calls to GTK+ 2.4.x functions so that the code checks at
+ runtime, which library version is installed so that these functions
+ are only called with GTK+ 2.4.x installed and should yield linker
+ errors otherwise.
+- wxTextCtrl text insertion efficiency fixed. (Mart Raudsepp)
+- Added wxRawBitmap support
+- Corrected Input method handler code (for Chinese etc.) and its
+ interaction with wxWidgets' events.
+- wxTE_AUTO_URL implemention for wxGTK2 multiline wxTextCtrls (Mart Raudsepp)
+
+wxMac:
+
+- Vertical sliders oriented consistent with MSW/GTK (0 at top) (Kevin Hock)
+- wxDynamicLibrary::GetDllExt() now returns ".bundle", not ".dylib"
+- wxDynamicLibrary::GetSymbol() now prepends underscore to the symbol name
+- wxJoystick now works on OSX
+
+wxMSW:
+
+- fixed enhanced metafiles loading from files (Andreas Goebel)
+- wxRadioButtons no longer have to be consecutive in a group
+- fixed spurious selection of combobox text during resize
+- pass correct tool id (and not always -1) to EVT_TOOL_RCLICKED() handler
+- added wxRegKey::Export(file)
+
+wxWinCE:
+- Added support for MS Handheld PC 2000. This was done before 2.5.4,
+ but not mentioned anywhere.
+- Added (preliminary) support for sockets
+
+wxUniv:
+
+- wxBU_... button align flags support
+- vertical notebook orientation support
+- 3rd state support for checkboxes
+- wxLB_SORT and wxCB_SORT now cause case-insensitive sorting
+
+wxPalmOS:
+
+- William Osborne has won and new port was born
+ (see: "wxPalmOS porting challenge")
+- polishing of the port (unnecessary 2.4 API compatibility, removed
+ all wxMSW specific code which was base for the new port)
+- enumeration of available volumes
+- native wxPrefConfig around Preferences database
+- native wxProgressDialog implementation
+- native wxColourDialog implementation
+- native wxSystemSettings colours
+- native wxButton implementation
+- native wxCheckBox implementation
+- native wxSlider implementation
+- native wxToggleButton implementation
+- native wxRadioButton implementation
+- native wxStaticText implementation
+- native wxDatePickerCtrl implementation
+
+
+2.5.3
+-----
+
+All:
+
+- support for large (>2 Gb) files in wxFile (Tim Kosse)
+- number of fixes to wxPluginManager (Rick Brice, Hans Van Leemputten)
+- fixed memory leak in wxURL when using a proxy (Steven Van Ingelgem)
+- fixed bug in wxDateTime::Set(jdn) when DST was in effect
+- fixed fatal bug in wxString when wxUSE_STL==1 (Kurt Granroth)
+- support msgids in charsets other than C and languages other than English
+ (based on patch by Stefan Kowski)
+- added wxMicroSleep() and wxMilliSleep() replacing deprecated wxUsleep()
+- basic UDP sockets support (Lenny Maiorani)
+- fixed wxDateTime::GetWeekDayName() for some dates (Daniel Kaps)
+- deprecated wxDateTime::SetToTheWeek() in favour of SetToWeekOfYear()
+- active mode support in wxFTP (Randall Fox)
+- sped up wxHTTP and wxFTP
+- added wxStringInput/OutputStreams
+- added wxFileConfig::Save(wxOutputStream)
+- fixed wxString's behaviour with inserted null characters
+
+All (GUI):
+
+- added wxWindow::MoveBefore/AfterInTabOrder() to change tab navigation order
+- added wxTaskBarIcon::CreatePopupMenu which is now the recommended way
+ of showing a popup menu; calling wxTaskBarIcon::PopupMenu directly
+ is discouraged
+- added ..._CMD_...(id) variants for wxGrid event table entry macros
+- added wxWindow::Navigate for programmatic navigation to the next control
+- wxTextCtrl::OnChar now inserts a tab character if wxTE_PROCESS_TAB is set
+- added wxKeyEvent::GetUnicodeKey()
+- added wxKeyEvent::CmdDown() and wxMouseEvent::CmdDown()
+- implemented wxListCtrl::FindItem() for non-MSW (Robin Stoll)
+- added status bar fields styles support (Tim Kosse)
+- added convenience functions wxSizer::AddSpacer() and
+ wxSizer::AddStretchSpacer() (as well as Prepend and Insert variants)
+- added samples/splash
+- added support for stock buttons
+- added wxTopLevelWindow::RequestUserAttention()
+- support for comma in contrib gizmo wxLEDNumberCtrl (Grant Likely)
+- recursive wxSizer::Show for subsizer and return value if element was found
+- added wxChoicebook control
+- smoother time estimation updates in wxProgressDialog (Christian Sturmlechner)
+- the XRC contrib library was moved to the core
+- wx(Choice/List/Note)book controls send CHANG(ED/ING) events in SetSelection
+- it is now possible to create a wxFont with given size in pixels (d2walter)
+- added wxTopLevelWindow::IsActive()
+- wxSystemSettings::GetMetric now returns -1 for metrics that are not
+ supported, instead of zero.
+- IMPLEMENT_DYNAMIC_CLASS2 macro compilation fixed (Serge Bakkal)
+
+Unix:
+
+- wxTaskBarIcon now supports freedesktop.org System Tray protocol
+- security fixes to wxSingleInstanceChecker
+- wx-config script was modified to allow choosing from multiple installed
+ builds of wxWidgets and to return flags/libs for selected libraries only
+- wx-config has new --version-full option
+
+wxCocoa:
+
+- added Unicode compatibility layer for OSX 10.2
+- fixed so that wxCocoa runs in OSX 10.2
+- Tooltips now supported
+- wxSound now supported
+- wxDisplay now supported
+- Some stock cursors now supported
+
+wxMac:
+
+- fixed MLTE text control GetLineText and GetLineLength on OSX
+- added OSX wxTaskBarIcon implementation for the OSX Dock
+- added Unicode compatibility layer for OSX 10.2
+- wxGetKeyState now works with nearly all wx key codes
+
+wxGTK:
+
+- wxGTK uses GTK+ 2.x by default now, you have to pass --disable-gtk2 to
+ configure if you want to use GTK+ 1.2
+- fixed many rendering artifacts and wrong colours with lots of GTK+ themes
+- implemented wxColourDialog as native dialog
+- implemented wxTextCtrl::HitTest() (GTK+ >= 2)
+- implemented wxTextCtrl::ScrollLines() and ScrollPages for GTK+ 2.x
+- wxTreeCtrl::GetCount() counts root as well now (compatible with MSW)
+- added support for wxCHK_3STATE style (GTK2 only)
+- implemented text underlining under GTK2
+- implemented wxFRAME_NO_TASKBAR style (GTK >= 2.2)
+- implemented support for wxSYS_DCLICK_?, wxSYS_DRAG_? and wxSYS_CURSOR_?
+ in wxSystemSettings::GetMetric (Mart Raudsepp)
+- implemented wxTopLevel::IsMaximized() for GTK+2 and WMs that implement
+ freedesktop.org's wm-spec (Mart Raudsepp)
+- wxEVT_CONTEXT_MENU is now generated for right mouse press, not release
+- implemented alpha channel support in wxBitmap
+- added native GTK+2 wxArtProvider implementation with ability to load
+ icons from icon theme in addition to recognized stock art
+- fixed crash on 64 bit platforms (Paul Cornett)
+
+wxMotif:
+
+- added support for wxCHK_3STATE style (3 state checkbox)
+
+wxMSW:
+
+- fixed UNC paths handling in wxFileSystem (Daniel Nash)
+- set wxKeyEvent::m_uniChar in Unicode build
+- support for alpha channel in toolbar bitmaps (Jurgen Doornik)
+- wxFileDialog can now be moved and centered (Randall Fox)
+- restored (and improved) possibility to use wx with MFC broken in 2.5.2
+- fixed wxTextCtrl::SetMaxLength for rich edit controls
+- fixed flat style for toolbars under XP, Windows Classic style
+- fixed truncation of transferred data in wxConnection under unicode build
+- wxChoice and wxComboBox dropdown background can be set now too (Adrian Lupei)
+- fixed wxMaximizeEvent generation in wxFrame
+- don't send duplicate EVT_COMBOBOX events whenever selection changes any more
+- implemented support for selecting printer bin (Steven Van Ingelgem)
+- fixed wxListCtrl::SetSingleStyle() which was broken since a few releases
+- fixed print setup problem (always uses default printer) in Unicode build
+
+wxUniv/X11:
+
+- fixed fatal crash when opening a menu
+
+wxWinCE:
+
+- added native WinCE driven smartphone wxTextCtrl implementation using spinners
+- added native WinCE driven smartphone wxChoice implementation using spinners
+- added automated but customizable handling of native WinCE driven smartphone menus
+- fixed wxRadioBox and wxStaticBox
+
+wxHTML:
+
+- added support for nested index entries and index entries pointing to more
+ than one page to wxHtmlHelpController
+
+
+2.5.2
+-----
+
+All:
+
+- Hindi translation added (Dhananjaya Sharma)
+- Brazilian Portuguese translation added (E. A. Tacao)
+- wxDynamicCast() now uses static_cast internally and so using it
+ with anything not deriving from wxObject will fail at compile time (instead
+ of run-time) now
+- when wxUSE_STL == 1 and STL provides quasi-standard hash_map/hash_set,
+ wxHashMap/wxHashSet are just typedefs for them. This makes impossible
+ to forward declare these classes.
+
+All (GUI):
+
+- wxHtmlWindow now delays image scaling until rendering,
+ resulting in much better display of scaled images
+- Added UpdateSize to wxSplitterWindow to allow layout while hidden
+- implemented Freeze/Thaw() for wxGenericTreeCtrl (Kevin Hock)
+- support for KOI8-U encoding added (Yuriy Tkachenko)
+- The old wxADJUST_MINSIZE behaviour is now the default behaviour for
+ sizer items that are windows. This means that GetAdjustedBestSize
+ will now be called by default to determine the minimum size that a
+ window in a sizer should have. If you want to still use the initial
+ size (and not the BestSize) then use the wxFIXED_MINSIZE flag. When
+ windows are added to a sizer their initial size is made the window's
+ min size using SetSizeHints, and calls to wxSizer::SetItemMinSize
+ are also forwarded to SetSizeHints for window items.
+- added wxRegEx::GetMatchCount()
+- it is now possible to display images in wxHtmlListBox
+
+wxMSW:
+
+- wxWindow::Freeze()/Thaw() can now be nested
+- Added wxSP_NO_XP_THEME style to wxSplitterWindow to switch off
+ XP theming (some applications look bad without 3D borders)
+- wxMenuBar::GetLabelTop() doesn't include '&'s in the label any more
+- wxRegConf couldn't read global settings without admin privileges and didn't
+ even try to do it by default -- now it does
+- wxTaskBarIcon must be explicitly destroyed now, otherwise the application
+ won't exit even though there are no top level windows
+- wxFileName::GetModificationTime() works with opened files too now
+- wxDC::GetClippingBox() now works even for clipping regions created by Windows
+- fixed wxFileDataObject in Unicode build (Alex D)
+- subindented paragraphs support (Tim Kosse)
+
+wxGTK:
+
+- added support for wxTE_RIGHT and wxTE_CENTRE styles under GTK2 (Mart Raudsepp)
+
+wxMotif:
+
+- removed wxMenuItem::DeleteSubMenu()
+- wxButtons use Motif default size, which is smaller than it used to be
+ and closer to wxMSW/wxGTK look. This can be disabled by setting
+ motif.largebuttons system option to 1 (see wxSystemOptions).
+
+wxUniv/X11:
+
+- implemented DrawRoundedRectangle() (clawghoul)
+
+wxHTML:
+
+- improved tables and lists layout algorithms (Tim Kosse)
+- handling fix (Xavier Nodet)
+
+Unix:
+
+- fixed priorities of mailcap entries (David Hart)
+- added "wx-config --libs=std, " syntax (i.e. support for "std")
+
+wxODBC:
+
+- Full Unicode support is now available
+- BLOB support is working
+
+
+2.5.1
+-----
+
+All:
+
+- event table macros now do some minimal type safety checks (Michael Sögtrop)
+- added wxGzipInput/OutputStream, bug fixes in wxZlibStreams (M.J.Wetherell)
+- wxDateTime::ParseDateTime() implemented (Linus McCabe)
+- wxHTTP::GetResponse() added (David Nock)
+- added conversions to/from UTF 16/32 LE/BE (Andreas Pflug)
+- added wxTextInputStream::ReadChar() (M.J.Wetherell)
+- added translation to Afrikaans (Petri Jooste)
+- Spanish translations updated (Javier San Jose)
+- added gettext plural forms support to wxLocale (Michael N. Filippov)
+- wxFileName::Normalize(wxPATH_NORM_ALL) doesn't lower filename case any more
+- wxFileName::Normalize(wxPATH_NORM_ENV_VARS) now works
+- check if file exists in wxFileConfig::DeleteFile() (Christian Sturmlechner)
+- when wxUSE_STL == 1 wxHashTable will not be implemented using wxHashMap
+ (as in 2.5.0).
+- added some extra convenience functions to wxRect such as
+ GetBottomRight (Hajo Kirchhoff)
+- changed built-in regex library to a Unicode-compatible version based
+ on TCL sources (Ryan Norton, M. J. Wetherell)
+- added extra convenience functions to wxPoint for adding a
+ wxSize (Wlodzimierz Skiba)
+- intermediate wxIPaddress class added to prepare for
+ wxIPV6address (Ray Gilbert)
+- added overloaded constructors and Create() methods taking wxArrayString
+ for wxChoice, wxComboBox, wxListBox, wxRadioBox, wxCheckListBox,
+ wxSingleChoiceDialog, wxMultipleChoiceDialog
+- renamed wxWave class to wxSound
+
+All (GUI):
+
+- added 3-state checkboxes for MSW/Mac (Dimitri Schoolwerth)
+- added some support for C++ exceptions in the library (do read the manual!)
+- added wxListCtrl::GetViewRect()
+- added wxTextCtrl::MarkDirty()
+- wxToolBar::ToggleTool() now works for radio buttons (Dag Ågren)
+- wxListCtrl now sends an END_LABEL event if editing was cancelled, too
+- bug in wxRect ctor from two [out of order] wxPoints fixed (Steve Cornett)
+- status text is now restored after wxMenu help is shown in it
+- bug in wxWindow::RemoveEventHandler() fixed (Yingjun Zhang)
+- make it possible to use wxRTTI macros with namespaces (Benjamin I. Williams)
+- wxColourDatabase API now uses objects instead of pointers
+- added resolution option to JPEG image handler (Jeff Burton)
+- added wxCalendarEvent::SetDate, wxCalendarEvent::SetWeekDay
+- wxGenericDirCtrl now accepts multiple wildcards
+- added focus event forwarding to wxGrid (Peter Laufenberg)
+- fixed scrollbar problem in wxGrid (not showing scrollbars
+ when sizing smaller) (Shane Harper)
+- dbbrowse demo fixed for Unicode (Wlodzimierz Skiba)
+- added wxStatusBar support to XRC (Brian Ravnsgaard Riis)
+- wxMenu::Append and etc. return a pointer to the wxMenuItem that was
+ added or inserted, or NULL on failure.
+- using a -1 (wxID_ANY) for menu or toolbar item IDs will now generate new id
+- added option to generate C++ headers to wxrc utility (Eduardo Marques)
+- added wxDC::DrawPolyPolygon() for MSW/PS (Carl-Friedrich Braun)
+- wxBufferedDC now allows to preserve the background and is documented
+- added wxDC::GetPartialTextExtents
+
+wxMSW:
+
+- wxWidgets now builds under Win64
+- fixed DDE memory leaks
+- fixed wxTE_*WRAP styles handling
+- wxTextCtrl::GetValue() works with text in non default encoding
+- changed wxCrashReport to generate minidumps instead of text files
+- wxRadioButtons are now checked when they get focus (standard behaviour)
+- several fixes to owner drawn menu items (Christian Sturmlechner)
+- wxGauge now supports full 32 bit range (Miroslav Rajcic)
+- make it possible to give focus to the notebook tabs (Hajo Kirchhoff)
+- MDI child frames are not always resizable any more (Andrei Fortuna)
+- fixed enumerating of entries/groups under '/' in wxRegConfig
+- added wxSYS_ICONTITLE_FONT (Andreas Pflug)
+- added wxPATH_NORM_SHORTCUT to wxFileName
+- wxComboBox::GetValue within a wxEVT_COMMAND_TEXT_UPDATED event
+ should now pass the correct value even if the handler for
+ wxEVT_COMMAND_COMBOBOX_SELECTED changed the selection
+- wxFileDialog now returns correct filter index for multiple-file dialogs
+- added wxTextCtrl::HitTest()
+- experimental wxURL implementation using WinInet functions (Hajo Kirchhoff)
+- fixed several bugs in wxNotebook with wxNB_MULTILINE style
+- accelerators are now initially hidden if appropriate (Peter Nielsen)
+- background colour of a wxComboBox may now be set
+- fixed wxListCtrl::GetItemText/BackgroundColour()
+- Esc can now be used to close menus in the dialogs (Hartmut Honisch)
+- Added msw.remap system option so colourful toolbar buttons
+ aren't mangled if you set it to 0. The default is 1
+- Toolbar buttons are now centred if the bitmap size is smaller
+ than the specified default size
+- Fixed a bug in wxSpinCtrl::DoGetBestSize that would make wxSpinCtrl too tall
+
+wxGTK:
+
+- fixes to wxTextCtrl scrolling under GTK2 (Nerijus Baliunas)
+- fix for crash when using user-dashed lines (Chris Borgolte)
+- fixed wxChoice::Delete() in presence of client data
+- allow calling wxWindow::SetFont if window not yet created
+- use same average character width as other ports when calculating dialog units
+- fixed mouse wheel handling under GTK2 (Hugh Fisher)
+- wxNotebook::HitTest() implemented (Daniel Lundqvist)
+- memory leaks fixes in wxFileDialog (John Labenski)
+- don't drop click events from triple clicks (Frode Solheim)
+
+wxMac:
+
+- use same average character width as other ports when calculating dialog units
+- implemented handling of mouse wheel
+- fix for long file names (longer than 32 characters) in file dialogs
+- use Unix sockets for Mach-o builds
+
+wxMotif:
+
+- look for Motif 2.1 headers before Motif 1.2 ones in configure
+
+wxHTML:
+
+- wxHtmlHelpController now supports compressed MS HTML Help files (*.chm)
+ on Unix (Markus Sinner)
+
+Unix:
+
+- added XFree86 resolution changing using xf86vidmode extensions (Ryan Norton)
+- implemented asynchronous playback in wxSound and added SDL backend in
+ addition to existing OSS one
+- it is now possible to send PostScript to any output stream (Zoltan Kovacs)
+
+
+2.5.0
+-----
+
+All:
+
+- It is now possible to build several smaller libraries instead of single
+ huge wxWidgets library; wxBase is now dependency of GUI ports rather then
+ separately compiled library
+- added wxDateSpan::operator==() and !=() (Lukasz Michalski)
+- added wxFileName::GetForbiddenChars() (Dimitri Schoolwerth)
+- use true/false throughout the library instead of TRUE/FALSE
+- wxStopWatch::Start() resumes the stop watch if paused, as per the docs
+- added wxDirTraverser::OnOpenError() to customize the error handling
+- added wxArray::SetCount()
+- wxFile, wxFFile, wxTextFile and wxTempFile now all use UTF-8 encoding
+ by default in Unicode mode
+- bug in wxDateTime with timezones on systems with tm_gmtoff in struct tm fixed
+- added wx/math.h (John Labenski)
+- added Catalan translations (Pau Bosch i Crespo)
+- added Ukrainian translations (Eugene Manko)
+- fixed bug with deleting entries at root level in wxFileConfig
+- chkconf.h now includes platform-specific versions (for MSW
+ and Mac) which contain some tests that were in setup.h
+- added event sink argument to wxEvtHandler::Connect()
+- added support for POST method and alt ports to wxHTTP (Roger Chickering)
+- added wxSocket::IPAddress() (Chris Mellon)
+- wxDataStreams can read/write many elements at once (Mickael Gilabert)
+- added wxRecursionGuard class
+- added wxThreadHelper class (Daniel Howard)
+- Added STL support (--enable-stl for configure, wxUSE_STL in setup.h).
+ When enabled, wxString will derive from std::string, wxArray from,
+ std::vector, wxList from std::list. In addition wxHashTable will be
+ implemented in terms of wxHashMap.
+- Added wxList::compatibility_iterator. Can be used like wxNode* (except
+ it can't be delete()d). It permits writing code which will work
+ both with wxUSE_STL==1 and wxUSE_STL==0.
+
+wxBase:
+
+- added Watcom makefiles
+- fixed bug with searching in sorted arrays (Jürgen Palm)
+
+All GUI ports:
+
+- added wxVScrolledWindow, wxVListBox and wxHtmlLbox classes
+- added wxListbook control
+- added alpha channel support to wxImage
+- added wxRenderer class allowing to customize the drawing of generic controls
+- added wxCLOSE_BOX style for dialogs and frames
+- added wxSplitterWindow and wxWizard handlers to XRC
+- wxWizard is now sizer-friendly and may be made resizable (Robert Vazan)
+- added proportion to wxFlexGridSizer::AddGrowableRow/Col (Maxim Babitski)
+- added wxFlexGridSizer::SetFlexibleDirection() (Szczepan Holyszewski)
+- implemented GetEditControl for wxGenericTreeCtrl (Peter Stieber)
+- improved contrib/utils/convertrc parsing (David J. Cooke)
+- fixed handling of URLs and filenames in wxFileSystem
+- implemented alignment for wxGrid bool editor and renderer
+- support wxListCtrl columns alignment for all platforms and not just MSW
+- added wxToolBar Add/InsertTool(tool) (Janusz Piwowarski)
+- added wxTB_HORZ_TEXT style for MSW and GTK (Axel Schlueter)
+- fixed user dash handling for MSW and GTK (Ken Edwards)
+- WXR resources can now be used in Unicode builds
+- it is now possible to use several wxFileHistory objects in the same menu
+ by giving them different base IDs (Dimitri Schoolwerth)
+- Added wxTLW::SetShape with implementations for wxMSW and wxGTK (so far)
+- FL: removed const from EnableTool parameters
+- FL: signal child window when toolbar is closed
+- In various places, changed tests for pathsep on last char of string to call
+ wxEndsWithPathSeparator(s)
+- Added to defs.h a couple of macros (wxPtrToULong & wxULongToPtr)
+- Minor improvements to document/view framework, including
+ delayed deletion of a document (until after the user has chosen
+ a new document), and more intelligent addition of filenames to
+ the file history, including not adding filenames if not using the
+ default extension for the template
+- sped up wxImage::Scale using fixed point arithmetic (Wade Brainerd)
+- Added BLOB support to wxDB (John Skiff)
+- wxWizard now validates when pressing Back or Next
+- Implemented wxNotebook::DoGetBestSize so Fit now works
+- Added FindItemByPosition to wxMenu
+- wxTimer now derives from wxEvtHandler and is its own owner object by default
+- Extended wxTextAttr and added wxTextCtrl::GetStyle stub
+ to allow better rich text support.
+- implemented wxFlexGridSizer::Show() (Wade Brainerd)
+- Added m_ prefix to wxColourData and wxFontData members
+- Added wxHtmlPrintout::AddFilter so HTML printing can be subject to
+ custom filters as well as HTML viewing.
+- Moved wxApp::SendIdleEvents and wxApp::ProcessIdle into common code.
+- wxWindow::OnInternalIdle is now used in all ports, and ensures that
+ user OnIdle events do not interfere with crucial internal processing.
+- wxWindow::UpdateWindowUI is now a documented function that
+ sends wxUpdateUIEvents, and can be overridden. It has a helper function
+ DoUpdateWindowUI for taking appropriate wxUpdateUIEvent action.
+- Added functions to wxUpdateUIEvent: Set/GetMode, Set/GetUpdateInterval,
+ CanUpdate, to assist with optimising update event frequency.
+- Added functions to wxIdleEvent: Set/GetMode, CanSend, to
+ determine whether a window should receive idle events.
+- Added wxWS_EX_PROCESS_IDLE, wxWS_EX_PROCESS_UI_UPDATES window
+ styles for use with conservative idle and update event modes.
+- send menu update events only when a menu is about to be used (MSW/GTK)
+- improved event processing performance (Hans Van Leemputten)
+- added wxMirrorDC class
+- printing improvements: GetPageInfo() gets called after the DC has
+ been set and after OnPreparePrinting() has been called so it can
+ report the number of pages accurately; doesn't try to set
+ number of pages in print dialog, in common with other Windows apps;
+ wxHTML easy printing's preview shows number of pages
+ correctly; preview scrollbars are set correctly; keyboard navigation
+ improved
+
+Unix:
+
+- fixed compilation on systems with zlib installed but < 1.1.3 version
+- fixed compilation on Solaris 7 with large files support enabled
+- added wxTaskBarIcon implementation for X11
+- added support for GNU/Hurd in configure
+- wxLocale::Init now tries to set .utf8 locale in Unicode mode (Andreas Pflug)
+
+Generic controls:
+
+- implemented wxListCtrl::Refresh() (Norbert Berzen)
+- support adding/removing columns dynamically (Donald C. Taylor)
+- wxToolBarSimple, property list classes, wxTreeLayout moved
+ to contrib/src/deprecated
+
+wxGTK:
+
+- added support for label mnemonics to GTK+2 build (Michael Moss)
+- added native wxMessageDialog implementation for GTK+2 build
+- fixed wxMenu::Remove (John Skiff and Benjamin Williams)
+- made wxTextCtrl::EmulateKeyPress() work for Delete and Backspace
+- fixed wxTopLevelWindow::ShowFullScreen to work with kwin, IceWM and
+ window managers that support _NET_WM_STATE_FULLSCREEN
+- added wxEVT_MENU_OPEN event generation
+- fixed bug in generic file selector causing incomplete file extensions to
+ be appended to filenames with no extension
+- added wxTextCtrl::SetSelection implementation for GTK+ 2
+- fixed wxTextCtrl::IsEditable() for GTK+ 2
+- fixed wxStaticText alignment for GTK+ 2 (Kevin Hock)
+- don't consume 100% CPU when showing a popup menu
+
+wxMac:
+
+- generate wxEVT_SCROLL_THUMBRELEASE and wxEVT_SCROLLWIN_THUMBRELEASE events
+- generate wxEVT_MENU_OPEN and wxEVT_MENU_CLOSE events
+
+wxMSW:
+
+- possibility to use DIBs for wxBitmap implementation (Derry Bryson)
+- added wxCrashReport
+- wxStaticBitmap doesn't stretch its bitmap any longer (like other ports)
+- support for accelerator keys in the owner drawn menus (Derry Bryson)
+- wxCaret::SetSize() doesn't hide the caret any longer as it used to
+- wxCheckListBox::Check() doesn't send CHECKLISTBOX_TOGGLE event any more
+- fixed bugs in wxThread::Wait() and IsAlive()
+- fixed bug with wxTR_EDIT_LABELS not working with wxTR_MULTIPLE
+- fixes for compilation with OpenWatcom and DigitalMars compilers
+- fixed wxStaticText best size calculation (was wrong by '&' width)
+- fixed calling wxFrame::Maximize(FALSE) before the window is shown
+- added wxNotebook::HitTest() (Otto Wyss)
+- libraries built with makefile.g95 have a _min or _cyg suffix (MinGW/Cygwin)
+- when using DLL, wxLocalFSHandler was not being exported
+- fixed problem with wxEvtHandler object not removed from wxPendingEvents
+- Windows XP manifest is now included in wx.rc; it is no longer necessary
+ to ship .exe.manifest file with applications to support XP themes
+- wxLocale::Init no longer reports error if trying to set Unicode-only locale
+ or if user's default locale is Unicode-only
+- improved border handling under Windows XP
+- partial fix for wxNotebook pages looking bad under XP: wxUSE_UXTHEME
+ enables XP theme engine code, and wxUSE_UXTHEME_AUTO tells
+ wxWidgets to use the theme tab colour for control backgrounds.
+- disable wxNB_RIGHT, wxNB_LEFT, wxNB_BOTTOM notebook styles under Windows XP
+- fixed release mode build with VC 7.x (Martin Ecker)
+- added support for wxALWAYS_SHOW_SB style
+- you don't need to add opengl32.lib when using VC++ now (David Falkinder)
+
+wxMotif:
+
+- made wxFileDialog behaviour with complex wildcards more sensible (it still
+ does not support all the features other ports do); refer to wxFileDialog
+ documentation for a detailed explanation
+- implemented wxWakeUpIdle
+- for Motif 2.0, used the native combobox widget instead of the GPL'd
+ xmcombo; xmcombo is still used for Motif 1.x and Lesstif when compiled
+ with Motif 1.x compatibility
+- implemented wxToggleButton
+- wxRadioBox and wxStaticBox now use the default shadow (border) style
+ instead of a sunken border
+- implemented wxBitmapDataObject
+- finished wxClipboard implementation
+
+wxUniv:
+
+- controls in toolbars now supported
+
+wxHTML:
+
+- added text selection to wxHtmlWindow
+- added SetFonts to HTML printing classes (Adrian Philip Look)
+- it is now possible to force page break when printing by inserting
+ into the markup (Greg Chicares)
+- wxHtmlWindow now uses double buffering to prevent flicker
+
+
+OLD CHANGES
+===========
+
+INCOMPATIBLE CHANGES SINCE 2.2.x
+================================
+
+ Please take a few minutes to read the following list, especially
+ paying attention to the most important changes which are marked
+ with '!' in the first column.
+
+ Also please note that you should ensure that WXWIN_COMPATIBILITY_2_2
+ is defined to 1 if you wish to retain maximal compatibility with 2.2
+ series -- however you are also strongly encouraged to try to compile
+ your code without this define as it won't be default any longer in
+ 2.6 release.
+
+ NB: if you want to build your program with different major versions
+ of wxWidgets you will probably find the wxCHECK_VERSION() macro
+ (see the documentation) useful.
+
+
+wxBase:
+
+! wxArray ::Remove(size_t) has been removed to fix compilation problems
+ under 64 bit architectures, please replace it with RemoveAt() in your
+ code.
+
+! wxArray macros have been changed to fix runtime problems under 64 bit
+ architectures and as a side effect of this WX_DEFINE_ARRAY() can only be
+ used now for the pointer types, WX_DEFINE_ARRAY_INT should be used for the
+ arrays containing non-pointers.
+
+- wxObject::CopyObject() and Clone() methods were removed because they
+ simply don't make sense for all objects
+
+- wxEvent now has a pure virtual Clone() method which must be implemented
+ by all derived classes, if you have user-defined event classes please
+ add "wxEvent *Clone() const { return new MyEvent(*this); }" line to them
+
+- small change to wxStopWatch::Pause() semantics, please see the documentation
+
+- unlikely but possible incompatibility: the definition of TRUE has changed
+ from "1" to "(bool)1" (and the same thing for FALSE), so the code which
+ could be erroneously compiled previously such as doing "return FALSE" from
+ a function returning a pointer would stop compiling now (but this change
+ is not supposed to have any effects on valid code)
+
+- another minor change: wxApp::OnAssert() has a new "cond" argument, you
+ must modify YourApp::OnAssert() signature if you were using it to override
+ the default assert handling.
+
+All (GUI):
+
+! the event type constants are not constants any more but are dynamically
+ allocated during run-time which means that they can't be used as case labels
+ in the switch()es, you must rewrite them to use if()s instead
+
+ You may also define WXWIN_COMPATIBILITY_EVENT_TYPES to get the old behaviour
+ but this is strongly discouraged, please consider changing your code
+ instead!
+
+! wxDialog does not derive from wxPanel any longer - if you were using it in
+ your code, please update it. The quick fix for the most cases is to replace
+ the occurrences of wxPanel with wxWindow.
+
+! if you handle (and don't skip) EVT_KEY_DOWN, the EVT_CHAR event is not
+ generated at all, so you must call event.Skip() in your OnKeyDown() if
+ you want to get OnChar() as well
+
+- in general, the key events sent for the various non ASCII key combinations
+ have been changed to make them consistent over all supported platforms,
+ please see the wxKeyEvent documentation for details
+
+- wxYES_NO is now wxYES | wxNO and the manifest values of both wxYES and wxNO
+ have changed (to fix some unfortunate clashes), please check your code to
+ ensure that no tests for wxYES or wxNO are broken: for example, the following
+ will *NOT* work any longer:
+
+ if ( flags & wxYES_NO )
+ ... do something ...
+ if ( flags & wxYES )
+ ... do something else ...
+
+- static wxWizard::Create() doesn't exist any more, the wizards are created
+ in the same way as all the other wxWindow objects, i.e. by directly using
+ the ctor
+
+- wxGLCanvas now derives directly from wxWindow, not wxScrolledWindow
+
+- wxGridCellAttrProvider class API changed, you will need to update your code
+ if you derived any classes from it
+
+- wxImage::ComputeHistogram()'s signature changed to
+ unsigned long ComputeHistogram(wxImageHistogram&) const
+
+- wxEvtHandler cannot be copied/assigned any longer - this never worked but
+ now it results in compile-time error instead of run-time crashes
+
+- WXK_NUMLOCK and WXK_SCROLL keys no longer result in EVT_CHAR() events,
+ they only generate EVT_KEY_DOWN/UP() ones
+
+- the dialogs use wxApp::GetTopWindow() as the parent implicitly if the
+ parent specified is NULL, use wxDIALOG_NO_PARENT style to prevent this
+ from happening
+
+- several obsolete synonyms are only retained in WXWIN_COMPATIBILITY_2_2 mode:
+ for example, use wxScrolledWindow::GetViewStart() now instead of ViewStart()
+ and GetCount() instead of Number() in many classes
+
+- wxCmdLineParser does not use wxLog to output messages anymore.
+ to obtain the previous behaviour, add
+ wxMessageOutput::Set(new wxMessageOutputLog); to your program
+ (you will need to #include )
+
+wxMSW:
+
+! build system changed: setup.h is not a static file in include/wx any more
+ but is created as part of the build process under lib//wx
+ where is of the form (msw|univ)[dll][u][d]. You'll need to update
+ the include path in your make/project files appropriately. Furthermore,
+ xpm.lib is no longer used by wxMSW, it was superseded by the wxXPMDecoder
+ class. You'll need to remove all references to xpm.lib from your
+ make/project files. Finally, the library names have changed as well and now
+ use the following consistent naming convention: wxmsw[ver][u][d].(lib|dll)
+ where 'u' appears for Unicode version, 'd' -- for the debug one and version
+ is only present for the DLLs builds.
+
+- child frames appear in the taskbar by default now, use wxFRAME_NO_TASKBAR
+ style to avoid it
+
+- all overloads of wxDC::SetClippingRegion() combine the given region with the
+ previously selected one instead of replacing it
+
+- wxGetHomeDir() uses HOME environment variable and if it is set will not
+ return the programs directory any longer but its value (this function has
+ never been meant to return the programs directory anyhow)
+
+- wxHTML apps don't need to include wx/html/msw/wxhtml.rc in resources file
+ anymore. The file was removed from wxMSW
+
+
+Unix ports:
+
+! You should use `wx-config --cxxflags` in your makefiles instead of
+ `wx-config --cflags` for compiling C++ files. CXXFLAGS contains CFLAGS
+ and the compiler flags for C++ files only, CFLAGS should still be used
+ to compile pure C files.
+
+
+wxThread and related classes:
+
+- The thread-related classes have been heavily changed since 2.2.x versions
+ as the old code had many serious problems. This could have resulted in
+ semantical changes other than those mentioned here, please review use of
+ wxThread, wxMutex and wxCondition classes in your code.
+
+! wxCondition now *must* be used with a mutex, please read the (updated) class
+ documentation for details and revise your code accordingly: this change was
+ unfortunately needed as it was impossible to ensure the correct behaviour
+ (i.e. absence of race conditions) using the old API.
+
+- wxMutex is not recursive any more in POSIX implementation (it hasn't been
+ recursive in 2.2.x but was in 2.3.1 and 2.3.2), please refer to the class
+ documentation for the discussion of the recursive mutexes.
+
+- wxMutex::IsLocked() doesn't exist any more and should have never existed:
+ this is was unique example of a thread-unsafe-by-design method.
+
+
+OTHER CHANGES
+=============
+
+2.4.0
+-----
+
+wxMSW:
+
+- fixed loss of client data in wxChoice::SetString()
+
+2.3.4
+-----
+
+All:
+
+- added (partial) Indonesian translations (Bambang Purnomosidi D. P.)
+- added wxSizer::Show()/Hide() (Carl Godkin)
+- fixed bugs in wxDateTime::SetToWeekDay()/GetWeek()
+
+Unix (Base/GUI):
+
+- minor OpenBSD compilation/linking fixes, now builds OOB under OpenBSD 3.1
+- don't include -I/usr/include nor -I/usr/local/include in wx-config output
+- shared library symbols are now versioned on platforms that support it (Linux)
+
+wxGTK:
+- Further work for GTK 2.0 and Unicode support.
+- Addition of native frame site grip.
+
+wxX11:
+- Unicode support through Pango library.
+
+wxMSW:
+
+- fixed crashes in wxListCtrl under XP
+- added context menu for rich edit wxTextCtrl
+
+wxHTML:
+
+- fixed wxHTML to work in Unicode build
+
+2.3.3
+-----
+
+wxBase:
+
+- building wxBase with Borland C++ is now supported (Michael Fieldings)
+- wxSemaphore class added, many fixed to wxCondition and wxThread (K.S. Sreeram)
+- fixes to the command line parsing error and usage messages
+- modified wxFileName::CreateTempFileName() to open the file atomically
+ (if possible) and, especially, not to leak the file descriptors under Unix
+- memory leak in wxHTTP fixed (Dimitri Schoolwerth)
+- fixes to AM_PATH_WXCONFIG autoconf macro
+- added wxHashMap class that replaces type-unsafe wxHashTable and is modelled
+ after (non standard) STL hash_map
+- wxLocale now works in Unicode mode
+- wxLocale can now load message catalogs in arbitrary encoding
+- added wxShutdown() function (Marco Cavallini)
+- added wxEXPLICIT macro
+- IPC classes improved and memory leaks fixed (Michael Fielding).
+ Global buffer removed, duplication in docs removed
+- debug new/free implementations made thread-safe
+
+Unix (Base/GUI):
+
+- wxWidgets may be built using BSD and Solaris (and possibly other) make
+ programs and not only GNU make
+- wxTCP-based IPC classes now support communicating over Unix domain sockets
+- wxWidgets may be built as a dynamic shared library under Darwin / Mac OS X
+ lazy linking issues have been solved by linking a single module (.o) into
+ the shared library (two step link using distrib/mac/shared-ld-sh)
+- fixed thread priority setting under Linux
+
+All (GUI):
+
+- it is now possible to set the icons of different sizes for frames (e.g. a
+ small and big ones) using the new wxIconBundle class
+- implemented radio menu items and radio toolbar buttons
+- added possibility to show text in the toolbar buttons
+- added wxArtProvider class that can be used to customize the look of standard
+ wxWidgets dialogs
+- significantly improved native font support
+- wxImage::ComputeHistogram() now uses wxImageHistogram instead of type-unsafe
+ wxHashTable
+- added IFF image handler
+- fixed using custom renderers in wxGrid which was broken in 2.3.2
+- support for multiple images in one file added to wxImage
+ (TIFF, GIF and ICO formats)
+- support for CUR and ANI files in wxImage added (Chris Elliott)
+- wxTextCtrl::GetRange() added
+- added wxGetFontFromUser() convenience function
+- added EVT_MENU_OPEN and EVT_MENU_CLOSE events
+- added Hungarian translations (Janos Vegh)
+- added wxImage::SaveFile(filename) method (Chris Elliott)
+- added wxImage::FloodFill and implemented wxWindowDC::DoFloodFill method
+ for GTK+, Mac, MGL, X11, Motif ports (Chris Elliott)
+- added (platform-dependent) scan code to wxKeyEvent (Bryce Denney)
+- added wxTextCtrl::EmulateKeyPress()
+- Added wxMouseCaptureChangedEvent
+- Added custom character filtering to wxTextValidator
+- wxTreeCtrl now supports incremental keyboard search
+- wxMessageOutput class added
+- wxHelpProvider::RemoveHelp added and called from ~wxWindowBase
+ so that erroneous help strings are no longer found as the hash
+ table fills up
+- updated libpng from 1.0.3 to 1.2.4
+- Added wxView::OnClosingDocument so the application can do cleanup.
+- generic wxListCtrl renamed to wxGenericListCtrl, wxImageList
+ renamed to wxGenericImageList, so they can be used on wxMSW
+ (Rene Rivera).
+- Added wxTreeEvent::IsEditCancelled so the application can tell
+ whether a label edit was cancelled.
+- added static wxFontMapper::Get() accessor
+
+wxMSW:
+
+- small appearance fixes for native look under Windows XP
+- fixed the bug related to the redrawing on resize introduced in 2.3.2
+- fixed multiple bugs in wxExecute() with IO redirection
+- refresh the buttons properly when the window is resized (Hans Van Leemputten)
+- huge (40*) speed up in wxMask::Create()
+- changing wxWidgets styles also changes the underlying Windows window style
+- wxTreeCtrl supports wxTR_HIDE_ROOT style (George Policello)
+- fixed flicker in wxTreeCtrl::SetItemXXX()
+- fixed redraw problems in dynamically resized wxStaticText
+- improvements to wxWidgets applications behaviour when the system colours
+ are changed
+- choose implicit parent for the dialog boxes better
+- fixed wxProgressDialog for ranges > 65535
+- wxSpinButton and wxSpinCtrl now support full 32 bit range (if the version
+ of comctl32.dll installed on the system supports it)
+- wxFontEnumerator now returns all fonts, not only TrueType ones
+- bugs in handling wxFrame styles (border/caption related) fixed
+- showing a dialog from EVT_RADIOBUTTON handler doesn't lead to an infinite
+ recursion any more
+- wxTextCtrl with wxTE_RICH flag scrolls to the end when text is appended to it
+- the separators are not seen behind the controls added to the toolbar any more
+- wxLB_SORT style can be used with wxCheckListBox
+- wxWindowDC and wxClientDC::GetSize() works correctly now
+- Added wxTB_NODIVIDER and wxTB_NOALIGN so native toolbar can be used in FL
+- Multiline labels in buttons are now supported (simply use "\n" in the label)
+- Implemented wxMouseCaptureChangedEvent and made wxGenericDragImage check it
+ has the capture before release it.
+- fixed bugs in multiple selection wxCheckListBox
+- default button handling is now closer to expected
+- setting tooltips for wxSlider now works
+- disabling a parent window also disables all of its children (as in wxGTK)
+- multiple events avoided in wxComboBox
+- tooltip asserts avoided for read-only wxComboBox
+- fixed a race condition during a thread exit and a join
+- fixed a condition where a thread can hang during message/event processing
+- increased space between wxRadioBox label and first radio button
+- don't fail to register remaining window classes if one fails to register
+- wxFontDialog effects only turned on if a valid colour was
+ provided in wxFontData
+- Added wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT flags for text control alignment.
+- Bitmap printing uses 24 bits now, not 8.
+
+wxGTK:
+
+- wxDirDialog now presents the file system in standard Unix way
+- wxButton now honours wxBU_EXACTFIT
+- wxStaticBox now honours wxALIGN_XXX styles
+- added support for non alphanumeric simple character accelerators ('-', '=')
+- new behaviour for wxWindow::Refresh() as it now produces a delayed refresh.
+ Call the new wxWindow::Update() to force an immediate update
+- support for more SGI hardware (12-bit mode among others)
+- fixed wxDC::Blit() to honour source DC's logical coordinates
+- implemented wxIdleEvent::RequestMore() for simple background tasks
+- implemented wxChoice::Delete()
+- fixed bad memory leak in wxFileDialog (Chris Elliott)
+- made internal GC pool dynamically growable
+- added GTK+ 2 and Unicode support
+
+wxMotif:
+
+- improved colour settings return values (Ian Brown)
+- improved border style handling for wxStaticText (Ian Brown)
+- improved toolbar control alignment
+- implemented wxSpinButton
+- implemented wxCheckListBox
+- fixed wxSpinCtrl and wxStaticLine when used with sizers
+- wxStaticBitmap now shows transparent icons correctly
+
+wxX11:
+
+- added generic MDI implementation (Hans Van Leemputten)
+- first cut at wxSocket support (not yet working)
+
+wxMac:
+
+- Many improvements
+
+wxOS2:
+
+- First alpha-quality release
+
+wxHTML:
+
+- fixed wxHtmlHelpController's cache files handling on big endian machines
+- added blocking and redirecting capabilities to wxHtmlWindow via
+ wxHtmlWindow::OnOpeningURL()
+- fixed alignment handling in tables
+- fixed handling to be case insensitive
+
+2.3.2
+-----
+
+New port: wxUniv for Win32/GTK+ is now included in the distribution.
+
+wxBase:
+
+- wxRegEx class added
+- wxGetDiskSpace() function added (Jonothan Farr, Markus Fieber)
+- wxTextBuffer and wxTextFile(wxStream) added (Morten Hanssen)
+- more fixes to wxMBConv classes. Conversion to and from wchar_t now works with
+ glibc 2.2 as well as with glibc 2.1. Unix version now checks for iconv()'s
+ capabilities at runtime instead of in the configure script.
+
+All (GUI):
+
+- support for virtual list control added
+- column images in report mode of the list control
+- wxFindReplaceDialog added (based on work of Markus Greither)
+- wxTextCtrl::SetMaxLength() added (wxMSW/wxGTK)
+- polygon support in wxRegion (Klaas Holwerda)
+- wxStreamToTextRedirector to allow easily redirect cout to wxTextCtrl added
+- fixed bug with using wxExecute() to capture huge amounts of output
+- new wxCalendarCtrl styles added (Søren Erland Vestø)
+- wxWizard changes: loading from WXR support, help button (Robert Cavanaugh)
+- wxDirSelector() added (Paul A. Thiessen)
+- wxGrid cell editing veto support (Roger Gammans)
+- wxListCtrl ITEM_FOCUSED event added
+- support for ICO files in wxImage added (Chris Elliott)
+- improvements to wxDragImage (Chuck Messenger)
+
+wxMSW:
+
+- support for the DBCS fonts (CP 932, 936, 949, 950) (Nathan Cook)
+- new library naming convention under VC++ -- please change your application
+ project files
+
+wxGTK:
+
+- fixed popup menu positioning bug
+- fixed the edit function for wxListCtrl (Chuck Messenger)
+- fixed the key-hitting events for wxListCtrl and wxTreeCtrl, so they
+ correctly return the key which was pressed (Chuck Messenger)
+
+wxMac:
+
+- support for configuration and build under Mac OS X using the Apple Developer
+ Tools
+
+wxHTML:
+
+- new HTML parser with correct parsing of character entities and fixes
+ to tags parsing
+- added support for animated GIFs
+
+2.3.1
+-----
+
+wxBase:
+
+- Fixes for gcc 3.0
+- Fixed new charset detection code
+- ODBC Informix fixes (submitted by Roger Gammans)
+- Added ODBC date support to wxVariant
+- Added wxDir::Traverse
+- Added wxSingleInstanceChecker class
+- Removed redundant wxDebugContext functions using C++ streams,
+ so now standard stream usage should be unnecessary
+
+All (GUI):
+
+- Added wxDbGrid class for displaying ODBC tables
+- Added EVT_GRID_EDITOR_CREATED and wxGridEditorCreatedEvent so the
+ user code can get access to the edit control when it is created, (to
+ push on a custom event handler for example)
+- Added wxTextAttr class and SetStyle, SetDefaultStyle and
+ GetDefaultStyle methods to wxTextCtrl
+- Added wxSingleInstanceChecker
+- Improvements to Tex2RTF
+- Added Paul and Roger Gammans' grid controls
+- Bug in wxDocument::Save logic corrected, whereby Save didn't save when not
+ first-time saved
+- Fixed memory leak in textcmn.cpp
+- Various wxXML enhancements
+- Removed wxCLIP_CHILDREN style from wxSplitterWindow
+- Fixed memory leak in DoPrint, htmprint.cpp
+- Fixed calendar sample bug with using wxCommandEvent::GetInt()
+ instead of GetId()
+- Added wxDbGrid combining wxODBC classes with wxGrid
+- Added more makefiles and project files for contrib hierarchy
+
+wxMSW:
+
+- Fixed wxApp::ProcessMessage so controls don't lose their
+ accelerators when the accelerators are redefined elsewhere
+- Accelerators consisting of simple keystrokes (without control,
+ alt or shift) now work
+- Compile fixes for Watcom C++ added
+- Compile fixes for Cygwin 1.0 added
+- Use SetForegroundWindow() in wxWindow::Raise() instead of BringWindowToTop()
+- Replaced wxYield() call in PopupMenu() by a much safer
+ wxYieldForCommandsOnly() - fixes tree ctrl popup menu bug and other ones
+- Enter processing in wxSpinCtrl fixed
+- Fixed bug in determining the best listbox size
+- Fix for wxFrame's last focus bug
+- We now send iconize events
+- Fixed wxFrame::SetClientSize() with toolbar bug
+- Added mousewheel processing
+- Added wxSystemSettings::Get/SetOption so we can configure
+ wxWidgets at run time; used this to implement no-maskblt option
+ in wxDC
+- Fixed bug when using MDIS_ALLCHILDSTYLES style: so now MDI
+ child frame styles are honoured
+
+wxGTK:
+
+- Fixed slider rounding bug
+- Added code to set wxFont's default encoding to wxLocale::GetSystemEncoding()
+- We now send iconize events
+- Fix for discrepancies between wxNotebookEvent and wxNotebook
+ GetSelection() results
+
+2.3.0
+-----
+
+wxBase:
+
+- fixed problem with wxURL when using static version of the library
+- wxZipFSHandler::FindFirst() and FindNext() now correctly list directories
+- wxMimeTypesManager now can create file associations too (Chris Elliott)
+- wxCopyFile() respects the file permissions (Roland Scholz)
+- wxFTP::GetFileSize() added (Søren Erland Vestø)
+- wxDateTime::IsSameDate() bug fixed
+- wxTimeSpan::Format() now behaves more as expected, see docs
+- wxLocale now provides much more convenient API for setting language and
+ detecting current system language. New API is more abstracted and truly
+ cross-platform, independent of underlying C runtime library.
+
+All (GUI):
+
+- new wxToggleButton class (John Norris, Axel Schlueter)
+- wxCalendarCtrl not highlighting the date with time part bug fixed
+- wxADJUST_MINSIZE sizer flag added
+- FindOrCreateBrush/Pen() bug fix for invalid colour values
+- new wxXPMHandler for reading and writing XPM images
+- added new (now recommended) API for conversion between wxImage and wxBitmap
+ (wxBitmap::ConvertToImage() and wxBitmap::wxBitmap(wxImage&) instead of
+ wxImage methods and ctor)
+- ODBC classes now support DB2, Interbase, and Pervasive SQL
+- ODBC documentation complete!!
+- ODBC classes have much Unicode support added, but not complete
+- ODBC experimental BLOB support added, but not completely tested
+- ODBC NULL column support completed (Roger/Paul Gammans)
+- ODBC All "char *" and char arrays removed and replaced with wxString use
+
+wxMSW:
+
+- threads: bug in wxCondition::Broadcast fixed (Pieter van der Meulen)
+- fixed bug in MDI children flags (mis)handling
+- it is possible to compile wxCHMHelpController with compilers
+ other than Visual C++ now and hhctrl.ocx is loaded at runtime
+
+wxGTK:
+
+- added support for wchar_t (wxUSE_WCHAR_T) under Unix
+
+wxHTML:
+
+- mew feature, wxHtmlProcessor for on-the-fly modification of HTML markup
+- visual enhancements to contents panel of wxHtmlHelpController
+
+2.2.0
+-----
+
+wxBase:
+
+- Fixed bug with directories with trailing (back)slashes in wxPathExists
+- wxString: added wxArrayString::operator==() and !=()
+- Fixes for wxCmdLineParser
+- Added wxGetLocalTimeMillis
+- Completed Czech translations
+- Some stream corrections
+- added missing consts to wxPoint operators
+- wxDateTime ParseFormat fixes
+- wxFile::Open(write_append) will create file if it doesn't exist
+- small fixes to MIME mailcap test command handling, more MIME tests in the sample
+
+All (GUI):
+
+- wxGenericDragImage now allows virtual image drawing, and
+ flicker-free dragging is now possible
+- Added wxPrinter::GetLastError
+- Fixed wxLogGui reentrancy problem
+- Paper names now translated
+- wxGrid fixes
+- Generic validator now caters for more cases (integers in
+ wxTextCtrl, strings in wxChoice, wxComboBox)
+- Fixed crash when docview On... functions return FALSE. Show
+ error message when an non-existent filename is typed into the Open
+ File dialog.
+- Corrected Baltic font encoding handling
+- wxImage: enhanced TIFF code, added new platform-independent BMP
+ writing code
+- wxKeyEvent::GetKeyCode() and HasModifiers() added and documented
+- Fixed wxPropertyForm crashes in sample
+- wxWizard now calls TransferDataFromWindow() before calling
+ wxWizardPage::GetNext() fixing an obvious bug
+
+wxMSW:
+
+- wxWindow::GetCharWidth/Height now calculated accurately.
+ This will affect all .wxr dialog resources, so for
+ backward compatibility, please set
+ wxDIALOG_UNIT_COMPATIBILITY to 1 in setup.h
+- wxListCtrl: set item text in LIST_ITEM_ACTIVATED events
+- wxTextCtrl: implemented setting colours for rich edit controls
+- wxColour now accepts both grey and gray
+- BC++ DLL compilation fixed
+- Watcom C++ makefiles improved for JPEG and TIFF compilation
+- Fixed submenu accelerator bug
+- Fixed dialog focus bug (crash if the previous window to have
+ the focus was destroyed before the dialog closed)
+- Too-small default wxTextCtrl height fixed
+- fixed "missing" initial resize of wxMDIChildFrame
+- wxFrame restores focus better
+- Now ignore wxTHICK_FRAME in wxWindow constructor: only relevant to
+ frames and dialogs, interferes with other window styles otherwise
+ (sometimes you'd get a thick frame in a subwindow)
+- wxTextCtrl insertion point set to the beginning of the control by SetValue
+- Fix so wxMDIParentFrame is actually shown when Show(TRUE) is called.
+- wxFileDialog: adjusts struct size if there's an error (struct
+ sizes can be different on different versions of Windows)
+- wxImageList::GetSize() documented and added to wxMSW
+- fixed default dialog style to make them non resizable again
+- fixed wxFrame::IsShown() which always returned TRUE before
+
+wxGTK:
+
+- Please see docs/gtk/changes.txt.
+
+wxMotif:
+
+- Small compilation fixes
+
+Documentation:
+
+- wxCaret documented
+
+2.1.16
+------
+
+wxBase:
+
+All (GUI):
+
+wxMSW:
+
+- Various bug fixes
+- Added wxCHMHelpController, for invoking MS HTML Help
+ files. This works under VC++ only
+- Modal dialog handling improved
+- Printer dialog now modal
+
+wxGTK:
+
+- Various bug fixes
+
+wxMotif:
+
+- Various bug fixes
+
+2.1.15
+------
+
+Documentation:
+
+- Added docs/tech for technical notes
+
+File hierarchy:
+
+- Started new contrib hierarchy that mirrors
+ the main lib structure; moved OGL and MMedia into it
+
+wxBase:
+
+- wxSocket support
+- wxDateTime replaces and extends old wxDate and wxTime classes (still
+ available but strongly deprecated) with many new features
+- wxLongLong class provides support for (signed) 64 bit integers
+- wxCmdLineParser class for parsing the command line (supporting short and
+ long options, switches and parameters of different types)
+- it is now possible to build wxBase under Win32 (using VC++ only so far)
+ and BeOS (without thread support yet)
+- wxThread class modified to support both detached and joinable threads, also
+ added new GetCPUCount() and SetConcurrency() functions (useful under Solaris
+ only so far)
+- wxDir class for enumerating files in a directory
+- wxLog functions are now (more) MT-safe
+- wxStopWatch class, timer functions have more chances to return correct
+ results for your platform (use ANSI functions where available)
+- wxString::ToLong, ToULong, ToDouble methods and Format() static one added
+- buffer overflows in wxString and wxLog classes fixed (if snprintf() function
+ is available)
+- wxArray::RemoveAt() replaces deprecated wxArray::Remove(index)
+
+all (GUI):
+
+- Added wxImage::Rotate.
+- new wxCalendarCtrl class for picking a date interactively
+- wxMenu(Bar)::Insert() and Remove() functions for dynamic menu management
+- wxToolBar supports arbitrary controls (not only buttons) and can be
+ dynamically changed (Delete/Insert functions)
+- vertical toolbars supported by MSW and GTK native wxToolBar classes
+- wxTreeCtrl and wxListCtrl allow setting colour/fonts for individual items
+- "file open" dialog allows selecting multiple files at once (contributed by
+ John Norris)
+- wxMimeTypesManager uses GNOME/KDE MIME database to get the icons for the
+ MIME types if available (Unix only)
+- wxDC::DrawRotatedText() (based on contribution by Hans-Joachim Baader)
+- TIFF support added (libtiff required and included in the distribution)
+- PCX files can now be written (256 and 24 bits)
+- validators may work recursively if wxWS_EX_VALIDATE_RECURSIVELY is set
+- wxScrolledWindow now has keyboard interface
+- wxTextEntryDialog may be used for entering passwords (supports wxTE_PASSWORD)
+- added wxEncodingConverter and improved wxFontMapper
+ for dealing with conversions between different encodings,
+ charsets support in wxLocale and wxHTML
+- wxDragImage class added
+- samples/help improved to show standard and advanced HTML help
+ controllers, as well as native help
+- moved wxTreeLayout class to main lib
+
+wxMSW:
+
+- wxFrame::MakeFullScreen added.
+- support for enhanced metafiles added, support for copying/pasting metafiles
+ (WMF and enhanced ones) fixed/added.
+- implemented setting colours for push buttons
+- wxStatusBar95 may be now used in dialogs, panels (not only frames) and can be
+ positioned along the top of the screen and not only at the bottom
+- wxTreeCtrl::IsVisible() bug fixed (thanks to Gary Chessun)
+- loading/saving big (> 32K) files in wxTextCtrl works
+- tooltips work with wxRadioBox
+- wxBitmap/wxIcon may be constructed from XPM included into a program, as in
+ Unix ports
+- returning FALSE from OnPrintPage() aborts printing
+- VC++ makefiles and project files made (mostly) consistent
+- wxSetCursorEvent added
+
+wxGTK:
+
+- wxFontMapper endless recursion bug (on some systems) fixed
+- wxGTK synthesizes wxActivateEvents
+- UpdateUI handlers may be used with wxTextCtrl
+
+wxMotif:
+
+- wxMenu::Enable works
+- wxToolBar bugs fixed
+- OGL samples made to work again
+
+wxHTML:
+
+- almost complete rewrite of wxHtmlHelpController,
+ including faster search, bookmarks, printing, setup dialog
+ and cross-platform binary compatible .cached files for faster
+ loading of large helpbooks, case insensitive search
+ split into 3 parts: wxHtmlHelpData, Frame and Controller
+- added support for charsets and tag
+- added support for font faces and justified paragraphs,
+ taken some steps to prepare wxHTML for frames
+- added dynamic pushing/popping of wxHtmlParser tag handlers
+- improved HTML printing
+- added extensive table of HTML characters substitutions ( etc.)
+- fixed wxHtmlWindow flickering, several minor bugfixes
+- added some tags: , , , , , ,
+ fixed handling of relative and absolute font sizes in
+
+
+NOTE: for changes after wxWidgets 2.1.0 b4, please see the CVS
+change log.
+
+2.1.0, b4, May 9th 1999
+-----------------------
+
+wxGTK:
+
+- JPEG support added.
+- Many fixes and changes not thought worth mentioning in this file :-)
+
+wxMSW:
+
+- wxNotebook changes: can add image only; wxNB_FIXEDWIDTH added;
+ SetTabSize added.
+- JPEG support added.
+- Fixes for Cygwin compilation.
+- Added wxGA_SMOOTH and wxFRAME_FLOAT_ON_PARENT styles.
+- Many fixes people didn't tell this file about.
+
+wxMotif:
+
+
+General:
+
+- Some changes for Unicode support, including wxchar.h/cpp.
+
+
+2.0.1 (release), March 1st 1999
+-------------------------------
+
+wxGTK:
+
+- wxGLCanvas fixes.
+- Slider/spinbutton fixes.
+
+wxMSW:
+
+- Fixed problems with in dialogs/panels.
+- Fixed window cursor setting.
+- Fixed toolbar sizing and edge-clipping problems.
+- Some makefile fixes.
+
+wxMotif:
+
+- None.
+
+General:
+
+- Added wxUSE_SOCKETS.
+- More topic overviews.
+- Put wxPrintPaperType, wxPrintPaperDatabase into
+ prntbase.h/cpp for use in non-PostScript situations
+ (e.g. Win16 wxPageSetupDialog).
+
+
+Beta 5, February 18th 1999
+--------------------------
+
+wxGTK:
+
+- wxExecute improved.
+
+wxMSW:
+
+- Fixed wxWindow::IsShown (::IsWindowVisible doesn't behave as
+ expected).
+- Changed VC++ makefiles (.vc) so that it's possible to have
+ debug/release/DLL versions of the library available simultaneously,
+ with names wx.lib, wx_d.lib, wx200.lib(dll), wx200_d.lib(dll).
+- Added BC++ 5 IDE files and instructions.
+- Fixed wxChoice, wxComboBox constructor bugs (m_noStrings initialisation).
+- Fixed focus-related crash.
+
+wxMotif:
+
+- Cured asynchronous wxExecute crash.
+- Added repaint event handlers to wxFrame, wxMDIChildFrame.
+
+General:
+
+- wxLocale documented.
+- Added include filenames to class reference.
+- wxHelpController API changed: SetBrowser becomes SetViewer,
+ DisplaySection works for WinHelp, help sample compiles under Windows
+ (though doesn't display help yet).
+
+Beta 4, February 12th 1999
+--------------------------
+
+wxGTK:
+
+- Miscellaneous fixes.
+
+wxMSW:
+
+- Makefiles for more compilers and samples; Cygwin makefiles
+ rationalised.
+- Added VC++ project file for compiling wxWidgets as DLL.
+
+wxMotif:
+
+- Added OnEraseBackground invocation.
+- Added wxRETAINED implementation for wxScrolledWindow.
+- Cured scrolling display problem by adding XmUpdateDisplay.
+- Tried to make lex-ing in the makefile more generic (command line
+ syntax should apply to both lex and flex).
+- Changed file selector colours for consistency (except for buttons:
+ crashes for some reason).
+- Fixed wxMotif version of wxImage::ConvertToBitmap (used new instead
+ of malloc, which causes memory problems).
+
+General:
+
+- Further doc improvements.
+- wxGenericValidator added.
+- Added wxImageModule to image.cpp, so adds/cleans up standard handlers
+ automatically.
+
+Beta 3, January 31st 1999
+-------------------------
+
+wxGTK:
+
+- wxClipboard/DnD API changes (still in progress).
+- wxToolTip class added.
+- Miscellaneous fixes.
+
+wxMSW:
+
+- wxRegConfig DeleteAll bug fixed.
+- Makefiles for more compilers.
+- TWIN32 support added.
+- Renamed VC++ makefiles from .nt to .vc, and
+ factored out program/library settings.
+- Fixed wxIniConfig bug.
+
+wxMotif:
+
+- A few more colour fixes.
+- wxGLCanvas and OpenGL samples working.
+- Some compiler warnings fixed.
+- wxChoice crash fix.
+- Dialog Editor starting to work on Motif.
+
+General:
+
+- wxBusyCursor class added.
+- Added samples/dde.
+- More doc improvements, incl. expanding docs/html/index.htm.
+
+Beta 2, January 1999
+--------------------
+
+wxGTK:
+
+wxMSW:
+
+- 16-bit BC++ compilation/linking works albeit without the resource system.
+
+wxMotif:
+
+- Cured wxScreenDC origin problem so e.g. sash window sash is drawn at
+ the right place.
+- Cured some widget table clashes.
+- Added thread support (Robert).
+- wxPoem sample now works.
+
+General:
+
+- Rearranged documentation a bit.
+- Sash window uses area of first frame/dialog to paint over when drawing
+ the dragged sash, not just the sash window itself (it clipped to the right
+ or below).
+- Made resource sample use the correct Cancel button id.
+- Moved wxProp to main library (generic directory), created proplist
+ sample.
+- Added bombs and fractal samples.
+
+Beta 1, December 24th 1998
+--------------------------
+
+wxGTK:
+
+- Various
+
+wxMSW, wxMotif: not in sync with this release.
+
+
+Alpha 18, December 29th 1998
+----------------------------
+
+wxMSW:
+
+- Win16 support working again (VC++ 1.5)
+- Win16 now uses generic wxNotebook, wxListCtrl,
+ wxTreeCtrl -- more or less working now, although
+ a little work on wxNotebook is still needed.
+ Under 16-bit Windows, get assertion when you click
+ on a tab.
+- Wrote 16-bit BC++ makefiles: samples don't yet link.
+- Added CodeWarrior support to distribution courtesy
+ of Stefan Csomor.
+
+wxMotif:
+
+- Cured scrolling problem: scrollbars now show/hide themselves
+ without (permanently) resizing the window.
+- Removed some commented-out lines in wxScrolledWindow::AdjustScrollbars
+ that disabled scrollbar paging.
+- Set background colour of drawing area in wxWindow, so e.g. wxListCtrl
+ colours correctly.
+- Removed major bug whereby dialogs were unmanaged automatically
+ when any button was pressed.
+- Fixed colours of wxWindow scrollbars, made list and text controls
+ have a white background.
+- Fixed dialog colour setting.
+- Added settable fonts and colours for wxMenu/wxMenuBar. Now
+ they have sensible colours by default.
+- Fixed a bug in wxStaticBox.
+- Cured wxTreeCtrl bug: now works pretty well!
+- Debugged DrawEllipticArc (a ! in the wrong place).
+- Added SetClippingRegion( const wxRegion& region ).
+- Added wxPoint, wxSize, wxRect versions of SetSize etc.
+
+Alpha 17, November 22nd 1998
+----------------------------
+
+wxMSW:
+
+- More documentation updates, especially for
+ wxLayoutWindow classes and debugging facilities.
+- Changed wxDebugContext to use wxDebugLog instead
+ of wxTrace.
+- Now supports VC++ 6.0, and hopefully BC++ 5.0.
+ However, DLL support may be broken for BC++ since
+ VC++ 6 required changing of WXDLLEXPORT keyword
+ position.
+- Numerous miscellaneous changes.
+
+wxMotif:
+
+- Reimplemented MDI using wxNotebook instead of the MDI widgets, which
+ were too buggy (probably not design for dynamic addition/removal of
+ child frames).
+- Some improvements to the wxNotebook implementation.
+- wxToolBar now uses a bulletin board instead of a form, in an attempt
+ to make it possible to add ordinary wxControls to a toolbar.
+- Cured problem with not being able to use global memory operators,
+ by defining two more global operators, so that the delete will match
+ the debugging implementation.
+- Added wxUSE_DEBUG_NEW_ALWAYS so we can distinguish between using
+ global memory operators (usually OK) and #defining new to be
+ WXDEBUG_NEW (sometimes it might not be OK).
+- Added time.cpp to makefile; set wxUSE_DATETIME to 1.
+- Added a parent-existence check to popup menu code to make it not crash.
+- Added some optimization in wxWindow::SetSize to produce less flicker.
+ It remains to be seen whether this produces any resize bugs.
+
+It's a long time since I updated this file. Previously done:
+
+- wxFrame, wxDialog done.
+- wxScrolledWindow done (but backing pixmap not used at present).
+- wxBitmap done though could be tidied it up at some point.
+- Most basic controls are there, if not rigorously tested.
+- Some MDI support (menus appear on child frames at present).
+- wxNotebook almost done.
+- wxToolBar done (horizontal only, which would be easy to extend
+ to vertical toolbars).
+
+More recently:
+
+- Colour and font changing done (question mark over what happens
+ to scrollbars).
+- Accelerators done (for menu items and buttons). Also event loop
+ tidied up in wxApp so that events are filtered through ProcessXEvent.
+- wxWindow::GetUpdateRegion should now work.
+
+Alpha 16, September 8th 1998
+----------------------------
+
+wxMSW:
+
+- Added wxSashWindow, wxSashLayoutWindow classes, and sashtest
+ sample.
+- Guilhem's socket classes added, plus wxsocket sample.
+- A few more makefiles added.
+- GnuWin32/BC++ compatibility mods.
+- Further doc updates.
+- wxProp updates for correct working with wxGTK.
+
+wxMotif:
+
+- First start at Motif port.
+- Made makefiles for wxMotif source directory and minimal sample.
+- First go at wxApp, wxWindow, wxDialog, wxPen, wxBrush, wxFont,
+ wxColour, wxButton, wxCheckBox, wxTextCtrl, wxStaticText,
+ wxMenu, wxMenuItem, wxMenuBar
+
+Alpha 15, August 31st 1998
+--------------------------
+
+wxMSW:
+
+- wxBitmap debugged.
+- wxDC::GetDepth added.
+- Contribution added whereby wxBitmap will be
+ converted to DC depth if they don't match.
+- wxConfig API improved, documentation updated.
+- Printing classes name conventions cleaned up.
+- wxUpdateUIEvent now derives from wxCommandEvent
+ so event can travel up the window hierarchy.
+
+Alpha 14, July 31st 1998
+------------------------
+
+wxMSW:
+
+- Toolbar API has been simplified, and now
+ wxFrame::GetClientArea returns the available client
+ area when toolbar, status bar etc. have been accounted for.
+ wxFrame::CreateToolBar added in line with CreateStatusBar.
+- Documentation updates, incl. for wxToolBar.
+- New wxAcceleratorTable class plus wxFrame::SetAcceleratorTable.
+- Various additions from other folk, e.g. streams, wxConfig
+ changes, wxNotebook.
+- Added wxDocMDIParentFrame, wxDocMDIChildFrame for doc/view.
+
+Alpha 13, July 8th 1998
+-----------------------
+
+wxMSW:
+
+- Implemented wxPoint as identical to POINT on Windows, and
+ altered wxDC wxPoint functions to use wxPoint directly in
+ Windows functions, for efficiency.
+- Cured wxASSERT bug in wxStatusBar95.
+- #ifdefed out some bits in oleutils.cpp for compilers that
+ don't support it.
+- Added some operators to wxPoint, wxSize.
+- Added inline wxDC functions using wxPoint, wxSize, wxRect.
+
+Alpha 12, July 7th 1998
+-----------------------
+
+wxMSW:
+
+- Added wxApp::GetComCtl32Version, and wxTB_FLAT style, so can
+ have flat toolbars on Win98 or Win95 with IE >= 3 installed.
+
+Alpha 11, July 3rd 1998
+-----------------------
+
+wxMSW:
+
+- Added thread.h, thread.cpp.
+- Changed Enabled, Checked to IsEnabled, IsChecked in wxMenu,
+ wxMenuBar.
+- Changed wxMenuItem::SetBackColor to SetBackgroundColour,
+ SetTextColor to SetTextColour, and added or made public several
+ wxMenuItem accessors.
+- Added two overloads to wxRegion::Contains. Added
+ wxRegion::IsEmpty for a more consistent naming convention.
+- Added Vadim's wxDataObject and wxDropSource.
+- ENTER/LEAVE events now work.
+- Cured wxMemoryDC bug where the DC wasn't being deleted.
+- Cured wxGauge SetSize major bugginess.
+- Cured problem where if a GDI object was created on the stack,
+ then went out of scope, then another object was selected into
+ the DC, GDI objects would leak. This is because the assignment
+ to e.g. wxDC::m_pen would delete the GDI object without it first
+ being selected out of the DC. Cured by selecting the old DC object
+ first, then doing the assignment.
+- Split up wxGaugeMSW, wxGauge95, wxSliderMSW, wxSlider95
+- Various other bug fixes and additions.
+
+Generic:
+
+- Major work on Dialog Editor (still plenty to go).
+- Expanded documentation a bit more.
+
+Alpha 10, May 7th 1998
+----------------------
+
+wxMSW:
+
+- Added desiredWidth, desiredHeight parameters to wxBitmapHandler
+ and wxIcon functions so that you can specify what size of
+ icon should be loaded. Probably will remain a Windows-specific thing.
+- wxStatusBar95 now works for MDI frames.
+- Toolbars in MDI frames now behave normally. They still
+ require application-supplied positioning code though.
+- Changed installation instructions, makefiles and batch files
+ for compiling with Gnu-Win32/Mingw32/EGCS. Also timercmn.cpp
+ change to support Mingw32/EGCS. Bison now used by default.
+
+Alpha 9, April 27th 1998
+------------------------
+
+wxMSW:
+
+- Cured bug in wxStatusBar95 that caused a crash if multiple
+ fields were used.
+- Added Gnu-Win32 b19/Mingw32 support by changing resource
+ compilation and pragmas.
+- Cured wxMenu bug introduced in alpha 8 - didn't respond to
+ commands because VZ changed the id setting in wxMenu::MSWCommand.
+
+Generic:
+
+- Corrected some bugs, such as the wxModule compilation problem.
+- Added Gnu-Win32 b19/Mingw32 support by changing resource
+ compilation and pragmas.
+- Changed SIZEOF to WXSIZEOF.
+
+Alpha 8, April 17th 1998
+------------------------
+
+wxMSW:
+
+- Added IsNull to wxGDIObject to check if the ref data is present or not.
+- Added PNG handler and sample - doesn't work for 16-bit PNGs for
+ some reason :-(
+- Added wxJoystick class and event handling, and simple demo.
+- Added simple wxWave class. Needs Stop() function.
+- Added wxModule (module.h/module.cpp) to allow definition
+ of modules to be initialized and cleaned up on wxWidgets
+ startup/exit.
+- Start of Mingw32 compatibility (see minimal and dialogs samples
+ makefile.m95 files, and install.txt).
+- Note: Windows printing has stopped working... will investigate.
+VADIM'S CHANGES:
+- Updated wxString: bug fixes, added wxArrayString, some
+ compatibility functions.
+- Updated log.h/cpp, added wxApp::CreateLogTarget.
+- file.h: new wxTempFile class.
+- defs.h: added wxSB_SIZE_GRIP for wxStatusBar95
+- statbr95: wxStatusBar95 control.
+- registry.h/cpp: wxRegKey class for Win95 registry.
+- listbox.cpp: corrected some bugs with owner-drawn listboxes.
+- wxConfig and wxFileConfig classes.
+
+Generic:
+
+- Added src/other/png, src/other/zlib directories.
+- Added samples/png.
+- IMPORTANT: Changed 'no id' number from 0 to -1, in wxEVT_ macros.
+ Porters, please check particularly your wxTreeCtrl and wxListCtrl
+ header files.
+- Added modules.h/cpp, config.cpp, fileconf.cpp, textfile.cpp/h.
+
+Alpha 7, March 30th 1998
+------------------------
+
+wxMSW:
+
+- Added tab classes, tab sample.
+- Now can return FALSE from OnInit and windows will be
+ cleaned up properly before exit.
+- Improved border handling so panels don't get borders
+ automatically.
+- Debugged MDI activation from Window menu.
+- Changes to memory debug handling, including checking for
+ memory leaks on application exit - but see issues.txt for
+ unresolved issues.
+- Added wxTaskBarIcon (taskbar.cpp/h, plus samples/taskbar)
+ to allow maintenance of an icon in the Windows 95 taskbar
+ tray area.
+- Got MFC sample working (MFC and wxWidgets in the same
+ application), partly by tweaking ntwxwin.mak settings.
+- Got DLL compilation working again (VC++).
+- Changed wxProp/Dialog Editor filenames.
+
+Generic:
+
+- Added tab classes, tab sample.
+- Revised memory.cpp, memory.h slightly; memory.h now #defines
+ new to WXDEBUG_NEW in DEBUG mode. Windows implementation app.cpp
+ now checks for leaks on exit. Added memcheck sample.
+ See src/msw/issues.txt for more details.
+- resource.h, resource.cpp changed to make wxDefaultResourceTable
+ a pointer. Now initialize resource system with
+ wxInitializeResourceSystem and wxCleanUpResourceSystem, to
+ allow better control of memory.
+- wxString now derives from wxObject, to enable memory leak
+ checking.
+- Added some #include fixes in various files, plus changed
+ float to long in wxToolBar files.
+
+Alpha 6, March 10th 1998
+------------------------
+
+wxMSW:
+
+- Found stack error bug - stopped unwanted OnIdle recursion.
+- Removed bug in wxTreeCtrl::InsertItem I added in alpha 5.
+- Changed exit behaviour in wxApp/wxFrame/wxDialog. Now will
+ check if the number of top-level windows is zero before
+ exiting. Also, wxApp::GetTopWindow will return either
+ m_topWindow or the first member of wxTopLevelWindows, so you
+ don't have to call wxApp::SetTopWindow.
+- Added dynarray.h/dynarray.cpp (from Vadim).
+- Added first cut at OLE drag and drop (from Vadim). dnd sample
+ added. Drop target only at this stage. See src/msw/ole/*.cpp,
+ wx/include/msw/ole/*.h. WIN32 only because of UUID usage.
+ Doesn't work with GnuWin32 - no appropriate headers e.g. for
+ IUnknown.
+ Doesn't work with BC++ either - crashes on program startup.
+- Added Vadim's owner-draw modifications - will probably remain
+ Windows-only. This enhances wxMenu, wxListBox. See ownerdrw sample.
+- Added wxLB_OWNERDRAW for owner-draw listboxes.
+- Vadim's wxCheckListBox derives from wxListBox. See checklst sample.
+ Doesn't entirely work for WIN16.
+- Vadim has added wxMenuItem as a separate file menuitem.cpp. It
+ can also be used as an argument to wxMenu::Append, not just for
+ internal implementation.
+- Some #ifdefs done for MINGW32 compilation (just alter OPTIONS
+ in makeg95.env, together with mingw32.bat). However, resource
+ binding is not working yet so most apps with dialogs crash.
+
+Generic:
+
+- Added Vadim's dynarray.h, dynarray.cpp.
+- Added Vadim's menuitem.cpp.
+- Added Windows-specific wxCheckListBox,
+ owner-draw wxListBox, and drag-and-drop
+ (see docs/msw/changes.txt).
+
+Alpha 5, 14th February 1998
+--------------------------
+
+wxMSW:
+
+- GENERIC AND MSW-SPECIFIC CODE NOW TREATED AS TWO SEPARATE
+ DISTRIBUTIONS. This change log will therefore now refer to
+ the Windows-specific code only. See docs/changes.txt for generic
+ changes.
+- Removed Windows-specific reference counting system (GDI
+ resources were cleaned up in idle time) - minimal
+ advantages now we have a wxWin reference counting system.
+- Added missing WXDLLEXPORT keywords so DLL compilation works
+ again.
+- Removed most warnings for GnuWin32 compilation.
+- Added wxRegion/wxRegionIterator, but haven't yet used it in
+ e.g. wxDC.
+
+Generic:
+
+- GENERIC AND MSW-SPECIFIC CODE NOW TREATED AS TWO SEPARATE
+ DISTRIBUTIONS. This change log will therefore now refer to
+ the generic code only. See docs/msw/changes.txt for Windows-specific
+ changes.
+- Readmes, change logs and installation files now go in
+ platform-specific directories under docs, e.g. docs/msw,
+ docs/gtk.
+- Added DECLARE_APP and IMPLEMENT_APP macros so wxApp object gets
+ created dynamically, not as a global object.
+- Put wxColour into wx/msw/colour.h, src/msw/colour.cpp.
+- Changed names of some include/wx/generic headers to be
+ consistent and to conform to gcc pragma conventions. Also
+ changed choicesg.cpp to choicdgg.cpp.
+- Added gcc pragmas.
+- Added gtk inclusion in include/wx headers.
+- Added consistent file headings to source and headers.
+- Removed lang.cpp, lang.h and references to wxSTR_... variables;
+ added a few references to wxTransString.
+- Added operator to wxTransString that converts automatically
+ to wxString, so we can say e.g. wxMessageBox(wxTransString("Hello"), ...).
+- samples/internat now works (minimally).
+- Added wxMouseEvent::GetPosition and
+ wxMouseEvent::GetLogicalPosition, both returning wxPoints.
+- Made wxSize and wxRect contain longs not ints.
+- Cured some memory leaks (thanks Vadim).
+- Tidied up OnIdle and introduced RequestMore/MoreRequested so
+ will only keep processing OnIdle if it returns TRUE from
+ MoreRequested.
+
+Alpha 4, 31st January 1998
+--------------------------
+
+All:
+
+- Changed wxDC functions to take longs instead of floats. GetSize now takes
+ integer pointers, plus a version that returns a wxSize.
+- const keyword added to various wxDC functions.
+- Under Windows, wxDC no longer has any knowledge of whether
+ an associated window is scrolled or not. Instead, the device
+ origin is set by wxScrolledWindow in wxScrolledWindow::PrepareDC.
+- wxScrolledWindow applications can optionally override the virtual OnDraw
+ function instead of using the OnPaint event handler. The wxDC passed to
+ OnDraw will be translated by PrepareDC to reflect scrolling.
+ When drawing outside of OnDraw, must call PrepareDC explicitly.
+- wxToolBarBase/wxToolBarSimple similarly changed to allow for
+ scrolling toolbars.
+- Integrated wxPostScriptDC patches for 1.xx by Chris Breeze,
+ to help printing with multiple pages.
+- IPC classes given base classes (wxConnectionBase etc.) which
+ define the API used by different implementations. DDE
+ implementation updated to use these base classes.
+- wxHelpInstance now separated into wxHelpControllerBase (base
+ for all implementations), wxWinHelpController (uses standard
+ WinHelp), wxXLPHelpController (talks to wxHelp by DDE or
+ TCP/IP). There will be others eventually, such as
+ wxHTMLHelpController for Microsoft (and Netscape?) HTML Help.
+- Added Vadim Zeitlin's wxString class plus
+ internationalization code (gettext simulation, wxLocale, etc.).
+ New files from Vadim:
+ include\wx\string.h
+ include\wx\debug.h
+ include\wx\file.h
+ include\wx\log.h
+ include\wx\intl.h
+ src\common\string.cpp
+ src\common\log.cpp
+ src\common\intl.cpp
+ src\common\file.cpp
+ No longer use GNU wxString files.
+- Split off file-related functions into include\wx\filefn.h and
+ src\common\filefn.cpp.
+- Borland C++ support (WIN32) for main library and
+ samples, using makefile.b32 files.
+- Preparation done for allowing BC++ to compile wxWin as a DLL,
+ including changes to defs.h.
+- wxIntPoint removed, wxPoint is now int, and wxRealPoint
+ introduced.
+- Added wxShowEvent (generated when window is being shown or
+ hidden).
+- Got minimal, docview, mdi samples working for 16-bit VC++ and
+ cured 16-bit problem with wxTextCtrl (removed global memory
+ trick).
+- Updated GnuWin32 makefiles, checked minimal, mdi, docview samples.
+
+Alpha 3, September 1997
+-----------------------
+
+All:
+
+- wxListCtrl, wxTreeCtrl, wxImageList classes done.
+- Instigated new file hierarchy, split files and classes up more logically.
+- PrologIO and some other utils now put into core library.
+- Revamped print/preview classes, added wxPageSetupDialog.
+- Started documentation.
+
+Alpha 2, 30th April 1997
+------------------------
+
+All:
+
+- EVT_... macros now have at least one argument, for conformance
+ with MetroWerks compiler.
+- Added ids to .wxr file format.
+- Got Dialog Editor compiled and running again but need
+ to extend functionality to be in line with new controls.
+ Added dialoged\test app to allow dynamic loading of .wxr files
+ for testing purposes.
+- Rewrote wxBitmap to allow installable file type
+ handlers.
+- Rewrote wxBitmapButton, wxStaticBitmap to not use Fafa.
+- Wrote most of wxTreeCtrl and sample (need wxImageList to implement it
+ fully).
+- Added back wxRadioBox.
+- Tidied up wx_main.cpp, wxApp class, putting PenWin code in
+ a separate file.
+
+Alpha 1, 5th April 1997
+-----------------------
+
+Generic:
+
+At this point, the following has been achieved:
+
+- A lot, but not all, of the code has been revamped for better
+ naming conventions, protection of data members, and use of
+ wxString instead of char *.
+- Obsolete functionality deleted (e.g. default wxPanel layout,
+ old system event system) and code size reduced.
+- Class hierarchy changed (see design doc) - base classes such
+ as wxbWindow now removed.
+- No longer includes windows.h in wxWin headers, by using stand-in
+ Windows types where needed e.g. WXHWND.
+- PrologIO revised.
+- wxScrolledWindow, wxStatusBar and new MDI classes added.
+ MDI is now achieved using separate classes, not window styles.
+- wxSystemSettings added, and made use of to reflect standard
+ Windows settings.
+- SetButtonFont/SetLabelFont replaced by SetFont; font and colour
+ settings mucho rationalised.
+- All windows are now subclassed with the same window proc to make
+ event handling far more consistent. Old internal wxWnd and derived
+ classes removed.
+- API for controls revised, in particular addition of
+ wxValidator parameters and removal of labels for some controls.
+- 1 validator written: see examples/validate.
+- Event table system introduced (see most samples and
+ wx_event.cpp/ProcessEvent, wx_event.h). wxEvtHandler
+ made more flexible, with Push/PopEventHandler allowing a chain
+ of event handlers.
+- wxRadioBox removed - will be added back soon.
+- Toolbar class hierarchy revised:
+ wxToolBarBase
+ wxToolBarSimple (= old wxToolBar)
+ wxToolBar95 (= old wxButtonBar under Win95)
+ wxToolBarMSW (= old wxButtonBar under WIN16/WIN32)
+- Constraint system debugged somewhat (sizers now work properly).
+- wxFileDialog, wxDirDialog added; other common dialogs now
+ have class equivalents. Generic colour and font dialogs
+ rewritten to not need obsolete panel layout.
+- .wxr resource system partially reinstated, though needs
+ an integer ID for controls. Hopefully the resource system
+ will be replaced by something better and more efficient
+ in the future.
+- Device contexts no longer stored with window and accessed
+ with GetDC - use wxClientDC, wxPaintDC, wxWindowDC stack
+ variables instead.
+- wxSlider uses trackbar class under Win95, and wxSL_LABELS flag
+ determines whether labels are shown. Other Win95-specific flags
+ introduced, e.g. for showing ticks.
+- Styles introduced for dealing with 3D effects per window, for
+ any window: all Win95 3D effects supported, plus transparent windows.
+- Major change to allow 3D effect support without CTL3D, under
+ Win95.
+- Bitmap versions of button and checkbox separated out into new
+ classes, but unimplemented as yet because I intend to remove
+ the need for Fafa - it apparently causes GPFs in Win95 OSR 2.
+- utils/wxprop classes working (except maybe wxPropertyFormView)
+ in preparation for use in Dialog Editor.
+- GNU-WIN32 compilation verified (a month or so ago).
diff --git a/win/wxWidgets_additions/wxWidgets-3.0.2/include/wx/msw/init.h b/win/wxWidgets_additions/wxWidgets-3.0.2/include/wx/msw/init.h
new file mode 100644
index 000000000..8636890ae
--- /dev/null
+++ b/win/wxWidgets_additions/wxWidgets-3.0.2/include/wx/msw/init.h
@@ -0,0 +1,94 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: wx/msw/init.h
+// Purpose: Windows-specific wxEntry() overload
+// Author: Julian Smart
+// Modified by:
+// Created: 01/02/97
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_MSW_INIT_H_
+#define _WX_MSW_INIT_H_
+
+// ----------------------------------------------------------------------------
+// Windows-specific wxEntry() overload and wxIMPLEMENT_WXWIN_MAIN definition
+// ----------------------------------------------------------------------------
+
+// we need HINSTANCE declaration to define WinMain()
+#include "wx/msw/wrapwin.h"
+
+#ifndef SW_SHOWNORMAL
+ #define SW_SHOWNORMAL 1
+#endif
+
+// WinMain() is always ANSI, even in Unicode build, under normal Windows
+// but is always Unicode under CE
+#ifdef __WXWINCE__
+ typedef wchar_t *wxCmdLineArgType;
+#else
+ typedef char *wxCmdLineArgType;
+#endif
+
+// Call this function to prevent wxMSW from calling SetProcessDPIAware().
+// Must be called before wxEntry().
+extern WXDLLIMPEXP_CORE void wxMSWDisableSettingHighDPIAware();
+
+// Windows-only overloads of wxEntry() and wxEntryStart() which take the
+// parameters passed to WinMain() instead of those passed to main()
+extern WXDLLIMPEXP_CORE bool
+ wxEntryStart(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance = NULL,
+ wxCmdLineArgType pCmdLine = NULL,
+ int nCmdShow = SW_SHOWNORMAL);
+
+extern WXDLLIMPEXP_CORE int
+ wxEntry(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance = NULL,
+ wxCmdLineArgType pCmdLine = NULL,
+ int nCmdShow = SW_SHOWNORMAL);
+
+#if defined(__BORLANDC__) && wxUSE_UNICODE
+ // Borland C++ has the following nonstandard behaviour: when the -WU
+ // command line flag is used, the linker expects to find wWinMain instead
+ // of WinMain. This flag causes the compiler to define _UNICODE and
+ // UNICODE symbols and there's no way to detect its use, so we have to
+ // define both WinMain and wWinMain so that wxIMPLEMENT_WXWIN_MAIN works
+ // for both code compiled with and without -WU.
+ // See http://sourceforge.net/tracker/?func=detail&atid=309863&aid=1935997&group_id=9863
+ // for more details.
+ #define wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD \
+ extern "C" int WINAPI wWinMain(HINSTANCE hInstance, \
+ HINSTANCE hPrevInstance, \
+ wchar_t * WXUNUSED(lpCmdLine), \
+ int nCmdShow) \
+ { \
+ wxDISABLE_DEBUG_SUPPORT(); \
+ \
+ /* NB: wxEntry expects lpCmdLine argument to be char*, not */ \
+ /* wchar_t*, but fortunately it's not used anywhere */ \
+ /* and we can simply pass NULL in: */ \
+ return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \
+ }
+#else
+ #define wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD
+#endif // defined(__BORLANDC__) && wxUSE_UNICODE
+
+#define wxIMPLEMENT_WXWIN_MAIN \
+ extern "C" int WINAPI WinMain(HINSTANCE hInstance, \
+ HINSTANCE hPrevInstance, \
+ wxCmdLineArgType WXUNUSED(lpCmdLine), \
+ int nCmdShow) \
+ { \
+ wxDISABLE_DEBUG_SUPPORT(); \
+ \
+ /* NB: We pass NULL in place of lpCmdLine to behave the same as */ \
+ /* Borland-specific wWinMain() above. If it becomes needed */ \
+ /* to pass lpCmdLine to wxEntry() here, you'll have to fix */ \
+ /* wWinMain() above too. */ \
+ return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \
+ } \
+ wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD
+
+
+#endif // _WX_MSW_INIT_H_
diff --git a/win/wxWidgets_additions/wxWidgets-3.0.2/include/wx/msw/setup.h b/win/wxWidgets_additions/wxWidgets-3.0.2/include/wx/msw/setup.h
new file mode 100644
index 000000000..e6ca4d861
--- /dev/null
+++ b/win/wxWidgets_additions/wxWidgets-3.0.2/include/wx/msw/setup.h
@@ -0,0 +1,1665 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: wx/msw/setup.h
+// Purpose: Configuration for the library
+// Author: Julian Smart
+// Modified by:
+// Created: 01/02/97
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_SETUP_H_
+#define _WX_SETUP_H_
+
+/* --- start common options --- */
+// ----------------------------------------------------------------------------
+// global settings
+// ----------------------------------------------------------------------------
+
+// define this to 0 when building wxBase library - this can also be done from
+// makefile/project file overriding the value here
+#ifndef wxUSE_GUI
+ #define wxUSE_GUI 1
+#endif // wxUSE_GUI
+
+// ----------------------------------------------------------------------------
+// compatibility settings
+// ----------------------------------------------------------------------------
+
+// This setting determines the compatibility with 2.6 API: set it to 0 to
+// flag all cases of using deprecated functions.
+//
+// Default is 1 but please try building your code with 0 as the default will
+// change to 0 in the next version and the deprecated functions will disappear
+// in the version after it completely.
+//
+// Recommended setting: 0 (please update your code)
+#define WXWIN_COMPATIBILITY_2_6 0
+
+// This setting determines the compatibility with 2.8 API: set it to 0 to
+// flag all cases of using deprecated functions.
+//
+// Default is 1 but please try building your code with 0 as the default will
+// change to 0 in the next version and the deprecated functions will disappear
+// in the version after it completely.
+//
+// Recommended setting: 0 (please update your code)
+#define WXWIN_COMPATIBILITY_2_8 1
+
+// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when
+// default system font is used for wxWindow::GetCharWidth/Height() instead of
+// the current font.
+//
+// Default is 0
+//
+// Recommended setting: 0
+#define wxDIALOG_UNIT_COMPATIBILITY 0
+
+// ----------------------------------------------------------------------------
+// debugging settings
+// ----------------------------------------------------------------------------
+
+// wxDEBUG_LEVEL will be defined as 1 in wx/debug.h so normally there is no
+// need to define it here. You may do it for two reasons: either completely
+// disable/compile out the asserts in release version (then do it inside #ifdef
+// NDEBUG) or, on the contrary, enable more asserts, including the usually
+// disabled ones, in the debug build (then do it inside #ifndef NDEBUG)
+//
+// #ifdef NDEBUG
+// #define wxDEBUG_LEVEL 0
+// #else
+// #define wxDEBUG_LEVEL 2
+// #endif
+
+// wxHandleFatalExceptions() may be used to catch the program faults at run
+// time and, instead of terminating the program with a usual GPF message box,
+// call the user-defined wxApp::OnFatalException() function. If you set
+// wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work.
+//
+// This setting is for Win32 only and can only be enabled if your compiler
+// supports Win32 structured exception handling (currently only VC++ does)
+//
+// Default is 1
+//
+// Recommended setting: 1 if your compiler supports it.
+#define wxUSE_ON_FATAL_EXCEPTION 1
+
+// Set this to 1 to be able to generate a human-readable (unlike
+// machine-readable minidump created by wxCrashReport::Generate()) stack back
+// trace when your program crashes using wxStackWalker
+//
+// Default is 1 if supported by the compiler.
+//
+// Recommended setting: 1, set to 0 if your programs never crash
+#define wxUSE_STACKWALKER 1
+
+// Set this to 1 to compile in wxDebugReport class which allows you to create
+// and optionally upload to your web site a debug report consisting of back
+// trace of the crash (if wxUSE_STACKWALKER == 1) and other information.
+//
+// Default is 1 if supported by the compiler.
+//
+// Recommended setting: 1, it is compiled into a separate library so there
+// is no overhead if you don't use it
+#define wxUSE_DEBUGREPORT 1
+
+// Generic comment about debugging settings: they are very useful if you don't
+// use any other memory leak detection tools such as Purify/BoundsChecker, but
+// are probably redundant otherwise. Also, Visual C++ CRT has the same features
+// as wxWidgets memory debugging subsystem built in since version 5.0 and you
+// may prefer to use it instead of built in memory debugging code because it is
+// faster and more fool proof.
+//
+// Using VC++ CRT memory debugging is enabled by default in debug build (_DEBUG
+// is defined) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0)
+// and if __NO_VC_CRTDBG__ is not defined.
+
+// The rest of the options in this section are obsolete and not supported,
+// enable them at your own risk.
+
+// If 1, enables wxDebugContext, for writing error messages to file, etc. If
+// __WXDEBUG__ is not defined, will still use the normal memory operators.
+//
+// Default is 0
+//
+// Recommended setting: 0
+#define wxUSE_DEBUG_CONTEXT 0
+
+// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF*
+// __WXDEBUG__ is also defined.
+//
+// WARNING: this code may not work with all architectures, especially if
+// alignment is an issue. This switch is currently ignored for mingw / cygwin
+//
+// Default is 0
+//
+// Recommended setting: 1 if you are not using a memory debugging tool, else 0
+#define wxUSE_MEMORY_TRACING 0
+
+// In debug mode, cause new and delete to be redefined globally.
+// If this causes problems (e.g. link errors which is a common problem
+// especially if you use another library which also redefines the global new
+// and delete), set this to 0.
+// This switch is currently ignored for mingw / cygwin
+//
+// Default is 0
+//
+// Recommended setting: 0
+#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
+
+// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If
+// this causes problems (e.g. link errors), set this to 0. You may need to set
+// this to 0 if using templates (at least for VC++). This switch is currently
+// ignored for MinGW/Cygwin.
+//
+// Default is 0
+//
+// Recommended setting: 0
+#define wxUSE_DEBUG_NEW_ALWAYS 0
+
+
+// ----------------------------------------------------------------------------
+// Unicode support
+// ----------------------------------------------------------------------------
+
+// These settings are obsolete: the library is always built in Unicode mode
+// now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if
+// absolutely necessary -- updating it is strongly recommended as the ANSI mode
+// will disappear completely in future wxWidgets releases.
+#ifndef wxUSE_UNICODE
+ #define wxUSE_UNICODE 1
+#endif
+
+// wxUSE_WCHAR_T is required by wxWidgets now, don't change.
+#define wxUSE_WCHAR_T 1
+
+// ----------------------------------------------------------------------------
+// global features
+// ----------------------------------------------------------------------------
+
+// Compile library in exception-safe mode? If set to 1, the library will try to
+// behave correctly in presence of exceptions (even though it still will not
+// use the exceptions itself) and notify the user code about any unhandled
+// exceptions. If set to 0, propagation of the exceptions through the library
+// code will lead to undefined behaviour -- but the code itself will be
+// slightly smaller and faster.
+//
+// Note that like wxUSE_THREADS this option is automatically set to 0 if
+// wxNO_EXCEPTIONS is defined.
+//
+// Default is 1
+//
+// Recommended setting: depends on whether you intend to use C++ exceptions
+// in your own code (1 if you do, 0 if you don't)
+#define wxUSE_EXCEPTIONS 1
+
+// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI
+//
+// Default is 0
+//
+// Recommended setting: 0 (this is still work in progress...)
+#define wxUSE_EXTENDED_RTTI 0
+
+// Support for message/error logging. This includes wxLogXXX() functions and
+// wxLog and derived classes. Don't set this to 0 unless you really know what
+// you are doing.
+//
+// Default is 1
+//
+// Recommended setting: 1 (always)
+#define wxUSE_LOG 1
+
+// Recommended setting: 1
+#define wxUSE_LOGWINDOW 1
+
+// Recommended setting: 1
+#define wxUSE_LOGGUI 1
+
+// Recommended setting: 1
+#define wxUSE_LOG_DIALOG 1
+
+// Support for command line parsing using wxCmdLineParser class.
+//
+// Default is 1
+//
+// Recommended setting: 1 (can be set to 0 if you don't use the cmd line)
+#define wxUSE_CMDLINE_PARSER 1
+
+// Support for multithreaded applications: if 1, compile in thread classes
+// (thread.h) and make the library a bit more thread safe. Although thread
+// support is quite stable by now, you may still consider recompiling the
+// library without it if you have no use for it - this will result in a
+// somewhat smaller and faster operation.
+//
+// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset
+// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in
+// build/msw/config.* file this value will have no effect.
+//
+// Default is 1
+//
+// Recommended setting: 0 unless you do plan to develop MT applications
+#define wxUSE_THREADS 1
+
+// If enabled, compiles wxWidgets streams classes
+//
+// wx stream classes are used for image IO, process IO redirection, network
+// protocols implementation and much more and so disabling this results in a
+// lot of other functionality being lost.
+//
+// Default is 1
+//
+// Recommended setting: 1 as setting it to 0 disables many other things
+#define wxUSE_STREAMS 1
+
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+// Enable the use of compiler-specific thread local storage keyword, if any.
+// This is used for wxTLS_XXX() macros implementation and normally should use
+// the compiler-provided support as it's simpler and more efficient, but is
+// disabled under Windows in wx/msw/chkconf.h as it can't be used if wxWidgets
+// is used in a dynamically loaded Win32 DLL (i.e. using LoadLibrary()) under
+// XP as this triggers a bug in compiler TLS support that results in crashes
+// when any TLS variables are used.
+//
+// If you're absolutely sure that your build of wxWidgets is never going to be
+// used in such situation, either because it's not going to be linked from any
+// kind of plugin or because you only target Vista or later systems, you can
+// set this to 2 to force the use of compiler TLS even under MSW.
+//
+// Default is 1 meaning that compiler TLS is used only if it's 100% safe.
+//
+// Recommended setting: 2 if you want to have maximal performance and don't
+// care about the scenario described above.
+#define wxUSE_COMPILER_TLS 1
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
+// This is not a real option but is used as the default value for
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
+//
+// Currently the Digital Mars and Watcom compilers come without standard C++
+// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
+// them (e.g. from STLPort).
+//
+// VC++ 5.0 does include standard C++ library headers, however they produce
+// many warnings that can't be turned off when compiled at warning level 4.
+#if defined(__DMC__) || defined(__WATCOMC__) \
+ || (defined(_MSC_VER) && _MSC_VER < 1200)
+ #define wxUSE_STD_DEFAULT 0
+#else
+ #define wxUSE_STD_DEFAULT 1
+#endif
+
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Notice that the compilers mentioned in wxUSE_STD_DEFAULT comment above don't
+// support using standard containers and that VC6 needs non-default options for
+// such build to avoid getting "fatal error C1076: compiler limit : internal
+// heap limit reached; use /Zm to specify a higher limit" in its own standard
+// headers, so you need to ensure you do increase the heap size before enabling
+// this option for this compiler.
+//
+// Default is 0 for compatibility reasons.
+//
+// Recommended setting: 1 unless compatibility with the official wxWidgets
+// build and/or the existing code is a concern.
+#define wxUSE_STD_CONTAINERS 0
+
+// Use standard C++ streams if 1 instead of wx streams in some places. If
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
+//
+// Notice that enabling this does not replace wx streams with std streams
+// everywhere, in a lot of places wx streams are used no matter what.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 if you use the standard streams anyhow and so
+// dependency on the standard streams library is not a
+// problem
+#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
+
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
+//
+// Default is 1 for most compilers.
+//
+// Recommended setting: 1 unless you want to ensure your program doesn't use
+// the standard C++ library at all.
+#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
+
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
+//
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
+//
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
+//
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
+// VC++ 4.2 and above allows and but you can't mix
+// them. Set this option to 1 to use , 0 to use .
+//
+// Note that newer compilers (including VC++ 7.1 and later) don't support
+// wxUSE_IOSTREAMH == 1 and so will be used anyhow.
+//
+// Default is 0.
+//
+// Recommended setting: 0, only set to 1 if you use a really old compiler
+#define wxUSE_IOSTREAMH 0
+
+
+// ----------------------------------------------------------------------------
+// non GUI features selection
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
+// integer which is implemented in terms of native 64 bit integers if any or
+// uses emulation otherwise.
+//
+// This class is required by wxDateTime and so you should enable it if you want
+// to use wxDateTime. For most modern platforms, it will use the native 64 bit
+// integers in which case (almost) all of its functions are inline and it
+// almost does not take any space, so there should be no reason to switch it
+// off.
+//
+// Recommended setting: 1
+#define wxUSE_LONGLONG 1
+
+// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
+// storing binary data in wxConfig on most platforms.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_BASE64 1
+
+// Set this to 1 to be able to use wxEventLoop even in console applications
+// (i.e. using base library only, without GUI). This is mostly useful for
+// processing socket events but is also necessary to use timers in console
+// applications
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_CONSOLE_EVENTLOOP 1
+
+// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
+// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
+//
+// Default is 1
+//
+// Recommended setting: 1 (wxFile is highly recommended as it is required by
+// i18n code, wxFileConfig and others)
+#define wxUSE_FILE 1
+#define wxUSE_FFILE 1
+
+// Use wxFSVolume class providing access to the configured/active mount points
+//
+// Default is 1
+//
+// Recommended setting: 1 (but may be safely disabled if you don't use it)
+#define wxUSE_FSVOLUME 1
+
+// Use wxStandardPaths class which allows to retrieve some standard locations
+// in the file system
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be disabled to save space, but not much)
+#define wxUSE_STDPATHS 1
+
+// use wxTextBuffer class: required by wxTextFile
+#define wxUSE_TEXTBUFFER 1
+
+// use wxTextFile class: requires wxFile and wxTextBuffer, required by
+// wxFileConfig
+#define wxUSE_TEXTFILE 1
+
+// i18n support: _() macro, wxLocale class. Requires wxTextFile.
+#define wxUSE_INTL 1
+
+// Provide wxFoo_l() functions similar to standard foo() functions but taking
+// an extra locale parameter.
+//
+// Notice that this is fully implemented only for the systems providing POSIX
+// xlocale support or Microsoft Visual C++ >= 8 (which provides proprietary
+// almost-equivalent of xlocale functions), otherwise wxFoo_l() functions will
+// only work for the current user locale and "C" locale. You can use
+// wxHAS_XLOCALE_SUPPORT to test whether the full support is available.
+//
+// Default is 1
+//
+// Recommended setting: 1 but may be disabled if you are writing programs
+// running only in C locale anyhow
+#define wxUSE_XLOCALE 1
+
+// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
+// allow to manipulate dates, times and time intervals. wxDateTime replaces the
+// old wxTime and wxDate classes which are still provided for backwards
+// compatibility (and implemented in terms of wxDateTime).
+//
+// Note that this class is relatively new and is still officially in alpha
+// stage because some features are not yet (fully) implemented. It is already
+// quite useful though and should only be disabled if you are aiming at
+// absolutely minimal version of the library.
+//
+// Requires: wxUSE_LONGLONG
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_DATETIME 1
+
+// Set wxUSE_TIMER to 1 to compile wxTimer class
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_TIMER 1
+
+// Use wxStopWatch clas.
+//
+// Default is 1
+//
+// Recommended setting: 1 (needed by wxSocket)
+#define wxUSE_STOPWATCH 1
+
+// Set wxUSE_FSWATCHER to 1 if you want to enable wxFileSystemWatcher
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_FSWATCHER 1
+
+// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes
+// which allow the application to store its settings in the persistent
+// storage. Setting this to 1 will also enable on-demand creation of the
+// global config object in wxApp.
+//
+// See also wxUSE_CONFIG_NATIVE below.
+//
+// Recommended setting: 1
+#define wxUSE_CONFIG 1
+
+// If wxUSE_CONFIG is 1, you may choose to use either the native config
+// classes under Windows (using .INI files under Win16 and the registry under
+// Win32) or the portable text file format used by the config classes under
+// Unix.
+//
+// Default is 1 to use native classes. Note that you may still use
+// wxFileConfig even if you set this to 1 - just the config object created by
+// default for the applications needs will be a wxRegConfig or wxIniConfig and
+// not wxFileConfig.
+//
+// Recommended setting: 1
+#define wxUSE_CONFIG_NATIVE 1
+
+// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows
+// to connect/disconnect from the network and be notified whenever the dial-up
+// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_DIALUP_MANAGER 1
+
+// Compile in classes for run-time DLL loading and function calling.
+// Required by wxUSE_DIALUP_MANAGER.
+//
+// This setting is for Win32 only
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_DYNLIB_CLASS 1
+
+// experimental, don't use for now
+#define wxUSE_DYNAMIC_LOADER 1
+
+// Set to 1 to use socket classes
+#define wxUSE_SOCKETS 1
+
+// Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS)
+//
+// Notice that currently setting this option under Windows will result in
+// programs which can only run on recent OS versions (with ws2_32.dll
+// installed) which is why it is disabled by default.
+//
+// Default is 1.
+//
+// Recommended setting: 1 if you need IPv6 support
+#define wxUSE_IPV6 0
+
+// Set to 1 to enable virtual file systems (required by wxHTML)
+#define wxUSE_FILESYSTEM 1
+
+// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM)
+#define wxUSE_FS_ZIP 1
+
+// Set to 1 to enable virtual archive filesystem (requires wxUSE_FILESYSTEM)
+#define wxUSE_FS_ARCHIVE 1
+
+// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM)
+#define wxUSE_FS_INET 1
+
+// wxArchive classes for accessing archives such as zip and tar
+#define wxUSE_ARCHIVE_STREAMS 1
+
+// Set to 1 to compile wxZipInput/OutputStream classes.
+#define wxUSE_ZIPSTREAM 1
+
+// Set to 1 to compile wxTarInput/OutputStream classes.
+#define wxUSE_TARSTREAM 1
+
+// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by
+// wxUSE_LIBPNG
+#define wxUSE_ZLIB 1
+
+// If enabled, the code written by Apple will be used to write, in a portable
+// way, float on the disk. See extended.c for the license which is different
+// from wxWidgets one.
+//
+// Default is 1.
+//
+// Recommended setting: 1 unless you don't like the license terms (unlikely)
+#define wxUSE_APPLE_IEEE 1
+
+// Joystick support class
+#define wxUSE_JOYSTICK 1
+
+// wxFontEnumerator class
+#define wxUSE_FONTENUM 1
+
+// wxFontMapper class
+#define wxUSE_FONTMAP 1
+
+// wxMimeTypesManager class
+#define wxUSE_MIMETYPE 1
+
+// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP
+// or wxURL you need to set this to 1.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_PROTOCOL 1
+
+// The settings for the individual URL schemes
+#define wxUSE_PROTOCOL_FILE 1
+#define wxUSE_PROTOCOL_FTP 1
+#define wxUSE_PROTOCOL_HTTP 1
+
+// Define this to use wxURL class.
+#define wxUSE_URL 1
+
+// Define this to use native platform url and protocol support.
+// Currently valid only for MS-Windows.
+// Note: if you set this to 1, you can open ftp/http/gopher sites
+// and obtain a valid input stream for these sites
+// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0.
+// Doing so reduces the code size.
+//
+// This code is experimental and subject to change.
+#define wxUSE_URL_NATIVE 0
+
+// Support for wxVariant class used in several places throughout the library,
+// notably in wxDataViewCtrl API.
+//
+// Default is 1.
+//
+// Recommended setting: 1 unless you want to reduce the library size as much as
+// possible in which case setting this to 0 can gain up to 100KB.
+#define wxUSE_VARIANT 1
+
+// Support for wxAny class, the successor for wxVariant.
+//
+// Default is 1.
+//
+// Recommended setting: 1 unless you want to reduce the library size by a small amount,
+// or your compiler cannot for some reason cope with complexity of templates used.
+#define wxUSE_ANY 1
+
+// Support for regular expression matching via wxRegEx class: enable this to
+// use POSIX regular expressions in your code. You need to compile regex
+// library from src/regex to use it under Windows.
+//
+// Default is 0
+//
+// Recommended setting: 1 if your compiler supports it, if it doesn't please
+// contribute us a makefile for src/regex for it
+#define wxUSE_REGEX 1
+
+// wxSystemOptions class
+#define wxUSE_SYSTEM_OPTIONS 1
+
+// wxSound class
+#define wxUSE_SOUND 1
+
+// Use wxMediaCtrl
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_MEDIACTRL 1
+
+// Use wxWidget's XRC XML-based resource system. Recommended.
+//
+// Default is 1
+//
+// Recommended setting: 1 (requires wxUSE_XML)
+#define wxUSE_XRC 1
+
+// XML parsing classes. Note that their API will change in the future, so
+// using wxXmlDocument and wxXmlNode in your app is not recommended.
+//
+// Default is the same as wxUSE_XRC, i.e. 1 by default.
+//
+// Recommended setting: 1 (required by XRC)
+#define wxUSE_XML wxUSE_XRC
+
+// Use wxWidget's AUI docking system
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_AUI 1
+
+// Use wxWidget's Ribbon classes for interfaces
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_RIBBON 1
+
+// Use wxPropertyGrid.
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_PROPGRID 1
+
+// Use wxStyledTextCtrl, a wxWidgets implementation of Scintilla.
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_STC 1
+
+// Use wxWidget's web viewing classes
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_WEBVIEW 1
+
+// Use the IE wxWebView backend
+//
+// Default is 1 on MSW
+//
+// Recommended setting: 1
+#ifdef __WXMSW__
+#define wxUSE_WEBVIEW_IE 1
+#else
+#define wxUSE_WEBVIEW_IE 0
+#endif
+
+// Use the WebKit wxWebView backend
+//
+// Default is 1 on GTK and OSX
+//
+// Recommended setting: 1
+#if defined(__WXGTK__) || defined(__WXOSX__)
+#define wxUSE_WEBVIEW_WEBKIT 1
+#else
+#define wxUSE_WEBVIEW_WEBKIT 0
+#endif
+
+// Enable the new wxGraphicsPath and wxGraphicsContext classes for an advanced
+// 2D drawing API. (Still somewhat experimental)
+//
+// Please note that on Windows gdiplus.dll is loaded dynamically which means
+// that nothing special needs to be done as long as you don't use
+// wxGraphicsContext at all or only use it on XP and later systems but you
+// still do need to distribute it yourself for an application using
+// wxGraphicsContext to be runnable on pre-XP systems.
+//
+// Default is 1 except if you're using a non-Microsoft compiler under Windows
+// as only MSVC7+ is known to ship with gdiplus.h. For other compilers (e.g.
+// mingw32) you may need to install the headers (and just the headers)
+// yourself. If you do, change the setting below manually.
+//
+// Recommended setting: 1 if supported by the compilation environment
+
+// notice that we can't use wxCHECK_VISUALC_VERSION() here as this file is
+// included from wx/platform.h before wxCHECK_VISUALC_VERSION() is defined
+#ifdef _MSC_VER
+# if _MSC_VER >= 1310
+ // MSVC7.1+ comes with new enough Platform SDK, enable
+ // wxGraphicsContext support for it
+# define wxUSE_GRAPHICS_CONTEXT 1
+# else
+ // MSVC 6 didn't include GDI+ headers so disable by default, enable it
+ // here if you use MSVC 6 with a newer SDK
+# define wxUSE_GRAPHICS_CONTEXT 0
+# endif
+#else
+ // Disable support for other Windows compilers, enable it if your compiler
+ // comes with new enough SDK or you installed the headers manually.
+ //
+ // Notice that this will be set by configure under non-Windows platforms
+ // anyhow so the value there is not important.
+# define wxUSE_GRAPHICS_CONTEXT 0
+#endif
+
+// Enable wxGraphicsContext implementation using Cairo library.
+//
+// This is not needed under Windows and detected automatically by configure
+// under other systems, however you may set this to 1 manually if you installed
+// Cairo under Windows yourself and prefer to use it instead the native GDI+
+// implementation.
+//
+// Default is 0
+//
+// Recommended setting: 0
+#define wxUSE_CAIRO 0
+
+
+// ----------------------------------------------------------------------------
+// Individual GUI controls
+// ----------------------------------------------------------------------------
+
+// You must set wxUSE_CONTROLS to 1 if you are using any controls at all
+// (without it, wxControl class is not compiled)
+//
+// Default is 1
+//
+// Recommended setting: 1 (don't change except for very special programs)
+#define wxUSE_CONTROLS 1
+
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP 1
+
+// wxPopupWindow class is a top level transient window. It is currently used
+// to implement wxTipWindow
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW)
+#define wxUSE_POPUPWIN 1
+
+// wxTipWindow allows to implement the custom tooltips, it is used by the
+// context help classes. Requires wxUSE_POPUPWIN.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0)
+#define wxUSE_TIPWINDOW 1
+
+// Each of the settings below corresponds to one wxWidgets control. They are
+// all switched on by default but may be disabled if you are sure that your
+// program (including any standard dialogs it can show!) doesn't need them and
+// if you desperately want to save some space. If you use any of these you must
+// set wxUSE_CONTROLS as well.
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
+#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
+#define wxUSE_BUTTON 1 // wxButton
+#define wxUSE_BMPBUTTON 1 // wxBitmapButton
+#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
+#define wxUSE_CHECKBOX 1 // wxCheckBox
+#define wxUSE_CHECKLISTBOX 1 // wxCheckListBox (requires wxUSE_OWNER_DRAWN)
+#define wxUSE_CHOICE 1 // wxChoice
+#define wxUSE_COLLPANE 1 // wxCollapsiblePane
+#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl
+#define wxUSE_COMBOBOX 1 // wxComboBox
+#define wxUSE_COMMANDLINKBUTTON 1 // wxCommandLinkButton
+#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl
+#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl
+#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl
+#define wxUSE_EDITABLELISTBOX 1 // wxEditableListBox
+#define wxUSE_FILECTRL 1 // wxFileCtrl
+#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl
+#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl
+#define wxUSE_GAUGE 1 // wxGauge
+#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl
+#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl
+#define wxUSE_LISTBOX 1 // wxListBox
+#define wxUSE_LISTCTRL 1 // wxListCtrl
+#define wxUSE_RADIOBOX 1 // wxRadioBox
+#define wxUSE_RADIOBTN 1 // wxRadioButton
+#define wxUSE_RICHMSGDLG 1 // wxRichMessageDialog
+#define wxUSE_SCROLLBAR 1 // wxScrollBar
+#define wxUSE_SEARCHCTRL 1 // wxSearchCtrl
+#define wxUSE_SLIDER 1 // wxSlider
+#define wxUSE_SPINBTN 1 // wxSpinButton
+#define wxUSE_SPINCTRL 1 // wxSpinCtrl
+#define wxUSE_STATBOX 1 // wxStaticBox
+#define wxUSE_STATLINE 1 // wxStaticLine
+#define wxUSE_STATTEXT 1 // wxStaticText
+#define wxUSE_STATBMP 1 // wxStaticBitmap
+#define wxUSE_TEXTCTRL 1 // wxTextCtrl
+#define wxUSE_TIMEPICKCTRL 1 // wxTimePickerCtrl
+#define wxUSE_TOGGLEBTN 1 // requires wxButton
+#define wxUSE_TREECTRL 1 // wxTreeCtrl
+#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
+
+// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
+// below either wxStatusBar95 or a generic wxStatusBar will be used.
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_STATUSBAR 1
+
+// Two status bar implementations are available under Win32: the generic one
+// or the wrapper around native control. For native look and feel the native
+// version should be used.
+//
+// Default is 1 for the platforms where native status bar is supported.
+//
+// Recommended setting: 1 (there is no advantage in using the generic one)
+#define wxUSE_NATIVE_STATUSBAR 1
+
+// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar
+// classes at all. Otherwise, use the native toolbar class unless
+// wxUSE_TOOLBAR_NATIVE is 0.
+//
+// Default is 1 for all settings.
+//
+// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE.
+#define wxUSE_TOOLBAR 1
+#define wxUSE_TOOLBAR_NATIVE 1
+
+// wxNotebook is a control with several "tabs" located on one of its sides. It
+// may be used to logically organise the data presented to the user instead of
+// putting everything in one huge dialog. It replaces wxTabControl and related
+// classes of wxWin 1.6x.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_NOTEBOOK 1
+
+// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of
+// the tabs
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_LISTBOOK 1
+
+// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of
+// the tabs
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_CHOICEBOOK 1
+
+// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of
+// the tabs
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_TREEBOOK 1
+
+// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of
+// tabs
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_TOOLBOOK 1
+
+// wxTaskBarIcon is a small notification icon shown in the system toolbar or
+// dock.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be set to 0 if you don't need it)
+#define wxUSE_TASKBARICON 1
+
+// wxGrid class
+//
+// Default is 1, set to 0 to cut down compilation time and binaries size if you
+// don't use it.
+//
+// Recommended setting: 1
+//
+#define wxUSE_GRID 1
+
+// wxMiniFrame class: a frame with narrow title bar
+//
+// Default is 1.
+//
+// Recommended setting: 1 (it doesn't cost almost anything)
+#define wxUSE_MINIFRAME 1
+
+// wxComboCtrl and related classes: combobox with custom popup window and
+// not necessarily a listbox.
+//
+// Default is 1.
+//
+// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it
+// it used by wxComboBox
+#define wxUSE_COMBOCTRL 1
+
+// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox
+// items.
+//
+// Default is 1.
+//
+// Recommended setting: 1 but can be safely set to 0, except where it is
+// needed as a base class for generic wxBitmapComboBox.
+#define wxUSE_ODCOMBOBOX 1
+
+// wxBitmapComboBox is a combobox that can have images in front of text items.
+//
+// Default is 1.
+//
+// Recommended setting: 1 but can be safely set to 0
+#define wxUSE_BITMAPCOMBOBOX 1
+
+// wxRearrangeCtrl is a wxCheckListBox with two buttons allowing to move items
+// up and down in it. It is also used as part of wxRearrangeDialog.
+//
+// Default is 1.
+//
+// Recommended setting: 1 but can be safely set to 0 (currently used only by
+// wxHeaderCtrl)
+#define wxUSE_REARRANGECTRL 1
+
+// ----------------------------------------------------------------------------
+// Miscellaneous GUI stuff
+// ----------------------------------------------------------------------------
+
+// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
+#define wxUSE_ACCEL 1
+
+// Use the standard art provider. The icons returned by this provider are
+// embedded into the library as XPMs so disabling it reduces the library size
+// somewhat but this should only be done if you use your own custom art
+// provider returning the icons or never use any icons not provided by the
+// native art provider (which might not be implemented at all for some
+// platforms) or by the Tango icons provider (if it's not itself disabled
+// below).
+//
+// Default is 1.
+//
+// Recommended setting: 1 unless you use your own custom art provider.
+#define wxUSE_ARTPROVIDER_STD 1
+
+// Use art provider providing Tango icons: this art provider has higher quality
+// icons than the default ones using smaller size XPM icons without
+// transparency but the embedded PNG icons add to the library size.
+//
+// Default is 1 under non-GTK ports. Under wxGTK the native art provider using
+// the GTK+ stock icons replaces it so it is normally not necessary.
+//
+// Recommended setting: 1 but can be turned off to reduce the library size.
+#define wxUSE_ARTPROVIDER_TANGO 1
+
+// Hotkey support (currently Windows only)
+#define wxUSE_HOTKEY 1
+
+// Use wxCaret: a class implementing a "cursor" in a text control (called caret
+// under Windows).
+//
+// Default is 1.
+//
+// Recommended setting: 1 (can be safely set to 0, not used by the library)
+#define wxUSE_CARET 1
+
+// Use wxDisplay class: it allows enumerating all displays on a system and
+// their geometries as well as finding the display on which the given point or
+// window lies.
+//
+// Default is 1.
+//
+// Recommended setting: 1 if you need it, can be safely set to 0 otherwise
+#define wxUSE_DISPLAY 1
+
+// Miscellaneous geometry code: needed for Canvas library
+#define wxUSE_GEOMETRY 1
+
+// Use wxImageList. This class is needed by wxNotebook, wxTreeCtrl and
+// wxListCtrl.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (set it to 0 if you don't use any of the controls
+// enumerated above, then this class is mostly useless too)
+#define wxUSE_IMAGLIST 1
+
+// Use wxInfoBar class.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be disabled without problems as nothing
+// depends on it)
+#define wxUSE_INFOBAR 1
+
+// Use wxMenu, wxMenuBar, wxMenuItem.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (can't be disabled under MSW)
+#define wxUSE_MENUS 1
+
+// Use wxNotificationMessage.
+//
+// wxNotificationMessage allows to show non-intrusive messages to the user
+// using balloons, banners, popups or whatever is the appropriate method for
+// the current platform.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_NOTIFICATION_MESSAGE 1
+
+// wxPreferencesEditor provides a common API for different ways of presenting
+// the standard "Preferences" or "Properties" dialog under different platforms
+// (e.g. some use modal dialogs, some use modeless ones; some apply the changes
+// immediately while others require an explicit "Apply" button).
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_PREFERENCES_EDITOR 1
+
+// wxRichToolTip is a customizable tooltip class which has more functionality
+// than the stock (but native, unlike this class) wxToolTip.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely set to 0 if you don't need it)
+#define wxUSE_RICHTOOLTIP 1
+
+// Use wxSashWindow class.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_SASH 1
+
+// Use wxSplitterWindow class.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_SPLITTER 1
+
+// Use wxToolTip and wxWindow::Set/GetToolTip() methods.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_TOOLTIPS 1
+
+// wxValidator class and related methods
+#define wxUSE_VALIDATORS 1
+
+// Use reference counted ID management: this means that wxWidgets will track
+// the automatically allocated ids (those used when you use wxID_ANY when
+// creating a window, menu or toolbar item &c) instead of just supposing that
+// the program never runs out of them. This is mostly useful only under wxMSW
+// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
+// long-running programs can run into problems with ids reuse without this. On
+// the other platforms, where the ids have the full int range, this shouldn't
+// be necessary.
+#ifdef __WXMSW__
+#define wxUSE_AUTOID_MANAGEMENT 1
+#else
+#define wxUSE_AUTOID_MANAGEMENT 0
+#endif
+
+// ----------------------------------------------------------------------------
+// common dialogs
+// ----------------------------------------------------------------------------
+
+// On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g.
+// file selector, printer dialog). Switching this off also switches off the
+// printing architecture and interactive wxPrinterDC.
+//
+// Default is 1
+//
+// Recommended setting: 1 (unless it really doesn't work)
+#define wxUSE_COMMON_DIALOGS 1
+
+// wxBusyInfo displays window with message when app is busy. Works in same way
+// as wxBusyCursor
+#define wxUSE_BUSYINFO 1
+
+// Use single/multiple choice dialogs.
+//
+// Default is 1
+//
+// Recommended setting: 1 (used in the library itself)
+#define wxUSE_CHOICEDLG 1
+
+// Use colour picker dialog
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_COLOURDLG 1
+
+// wxDirDlg class for getting a directory name from user
+#define wxUSE_DIRDLG 1
+
+// TODO: setting to choose the generic or native one
+
+// Use file open/save dialogs.
+//
+// Default is 1
+//
+// Recommended setting: 1 (used in many places in the library itself)
+#define wxUSE_FILEDLG 1
+
+// Use find/replace dialogs.
+//
+// Default is 1
+//
+// Recommended setting: 1 (but may be safely set to 0)
+#define wxUSE_FINDREPLDLG 1
+
+// Use font picker dialog
+//
+// Default is 1
+//
+// Recommended setting: 1 (used in the library itself)
+#define wxUSE_FONTDLG 1
+
+// Use wxMessageDialog and wxMessageBox.
+//
+// Default is 1
+//
+// Recommended setting: 1 (used in the library itself)
+#define wxUSE_MSGDLG 1
+
+// progress dialog class for lengthy operations
+#define wxUSE_PROGRESSDLG 1
+
+// support for startup tips (wxShowTip &c)
+#define wxUSE_STARTUP_TIPS 1
+
+// text entry dialog and wxGetTextFromUser function
+#define wxUSE_TEXTDLG 1
+
+// number entry dialog
+#define wxUSE_NUMBERDLG 1
+
+// splash screen class
+#define wxUSE_SPLASH 1
+
+// wizards
+#define wxUSE_WIZARDDLG 1
+
+// Compile in wxAboutBox() function showing the standard "About" dialog.
+//
+// Default is 1
+//
+// Recommended setting: 1 but can be set to 0 to save some space if you don't
+// use this function
+#define wxUSE_ABOUTDLG 1
+
+// wxFileHistory class
+//
+// Default is 1
+//
+// Recommended setting: 1
+#define wxUSE_FILE_HISTORY 1
+
+// ----------------------------------------------------------------------------
+// Metafiles support
+// ----------------------------------------------------------------------------
+
+// Windows supports the graphics format known as metafile which is, though not
+// portable, is widely used under Windows and so is supported by wxWin (under
+// Windows only, of course). Win16 (Win3.1) used the so-called "Window
+// MetaFiles" or WMFs which were replaced with "Enhanced MetaFiles" or EMFs in
+// Win32 (Win9x, NT, 2000). Both of these are supported in wxWin and, by
+// default, WMFs will be used under Win16 and EMFs under Win32. This may be
+// changed by setting wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting
+// wxUSE_ENH_METAFILE to 0. You may also set wxUSE_METAFILE to 0 to not compile
+// in any metafile related classes at all.
+//
+// Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS.
+//
+// Recommended setting: default or 0 for everything for portable programs.
+#define wxUSE_METAFILE 1
+#define wxUSE_ENH_METAFILE 1
+#define wxUSE_WIN_METAFILES_ALWAYS 0
+
+// ----------------------------------------------------------------------------
+// Big GUI components
+// ----------------------------------------------------------------------------
+
+// Set to 0 to disable MDI support.
+//
+// Requires wxUSE_NOTEBOOK under platforms other than MSW.
+//
+// Default is 1.
+//
+// Recommended setting: 1, can be safely set to 0.
+#define wxUSE_MDI 1
+
+// Set to 0 to disable document/view architecture
+#define wxUSE_DOC_VIEW_ARCHITECTURE 1
+
+// Set to 0 to disable MDI document/view architecture
+//
+// Requires wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE
+#define wxUSE_MDI_ARCHITECTURE 1
+
+// Set to 0 to disable print/preview architecture code
+#define wxUSE_PRINTING_ARCHITECTURE 1
+
+// wxHTML sublibrary allows to display HTML in wxWindow programs and much,
+// much more.
+//
+// Default is 1.
+//
+// Recommended setting: 1 (wxHTML is great!), set to 0 if you want compile a
+// smaller library.
+#define wxUSE_HTML 1
+
+// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL
+// headers and libraries to be able to compile the library with wxUSE_GLCANVAS
+// set to 1 and, under Windows, also to add opengl32.lib and glu32.lib to the
+// list of libraries used to link your application (although this is done
+// implicitly for Microsoft Visual C++ users).
+//
+// Default is 1 unless the compiler is known to ship without the necessary
+// headers (Digital Mars) or the platform doesn't support OpenGL (Windows CE).
+//
+// Recommended setting: 1 if you intend to use OpenGL, can be safely set to 0
+// otherwise.
+#define wxUSE_GLCANVAS 1
+
+// wxRichTextCtrl allows editing of styled text.
+//
+// Default is 1.
+//
+// Recommended setting: 1, set to 0 if you want compile a
+// smaller library.
+#define wxUSE_RICHTEXT 1
+
+// ----------------------------------------------------------------------------
+// Data transfer
+// ----------------------------------------------------------------------------
+
+// Use wxClipboard class for clipboard copy/paste.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_CLIPBOARD 1
+
+// Use wxDataObject and related classes. Needed for clipboard and OLE drag and
+// drop
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_DATAOBJ 1
+
+// Use wxDropTarget and wxDropSource classes for drag and drop (this is
+// different from "built in" drag and drop in wxTreeCtrl which is always
+// available). Requires wxUSE_DATAOBJ.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_DRAG_AND_DROP 1
+
+// Use wxAccessible for enhanced and customisable accessibility.
+// Depends on wxUSE_OLE.
+//
+// Default is 0.
+//
+// Recommended setting (at present): 0
+#define wxUSE_ACCESSIBILITY 1
+
+// ----------------------------------------------------------------------------
+// miscellaneous settings
+// ----------------------------------------------------------------------------
+
+// wxSingleInstanceChecker class allows to verify at startup if another program
+// instance is running.
+//
+// Default is 1
+//
+// Recommended setting: 1 (the class is tiny, disabling it won't save much
+// space)
+#define wxUSE_SNGLINST_CHECKER 1
+
+#define wxUSE_DRAGIMAGE 1
+
+#define wxUSE_IPC 1
+ // 0 for no interprocess comms
+#define wxUSE_HELP 1
+ // 0 for no help facility
+
+// Should we use MS HTML help for wxHelpController? If disabled, neither
+// wxCHMHelpController nor wxBestHelpController are available.
+//
+// Default is 1 under MSW, 0 is always used for the other platforms.
+//
+// Recommended setting: 1, only set to 0 if you have trouble compiling
+// wxCHMHelpController (could be a problem with really ancient compilers)
+#define wxUSE_MS_HTML_HELP 1
+
+
+// Use wxHTML-based help controller?
+#define wxUSE_WXHTML_HELP 1
+
+#define wxUSE_CONSTRAINTS 1
+ // 0 for no window layout constraint system
+
+#define wxUSE_SPLINES 1
+ // 0 for no splines
+
+#define wxUSE_MOUSEWHEEL 1
+ // Include mouse wheel support
+
+// Compile wxUIActionSimulator class?
+#define wxUSE_UIACTIONSIMULATOR 1
+
+// ----------------------------------------------------------------------------
+// wxDC classes for various output formats
+// ----------------------------------------------------------------------------
+
+// Set to 1 for PostScript device context.
+#define wxUSE_POSTSCRIPT 0
+
+// Set to 1 to use font metric files in GetTextExtent
+#define wxUSE_AFM_FOR_POSTSCRIPT 1
+
+// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows
+// to create files in SVG (Scalable Vector Graphics) format.
+#define wxUSE_SVG 1
+
+// Should wxDC provide SetTransformMatrix() and related methods?
+//
+// Default is 1 but can be set to 0 if this functionality is not used. Notice
+// that currently only wxMSW supports this so setting this to 0 doesn't change
+// much for non-MSW platforms (although it will still save a few bytes
+// probably).
+//
+// Recommended setting: 1.
+#define wxUSE_DC_TRANSFORM_MATRIX 1
+
+// ----------------------------------------------------------------------------
+// image format support
+// ----------------------------------------------------------------------------
+
+// wxImage supports many different image formats which can be configured at
+// compile-time. BMP is always supported, others are optional and can be safely
+// disabled if you don't plan to use images in such format sometimes saving
+// substantial amount of code in the final library.
+//
+// Some formats require an extra library which is included in wxWin sources
+// which is mentioned if it is the case.
+
+// Set to 1 for wxImage support (recommended).
+#define wxUSE_IMAGE 1
+
+// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB.
+#define wxUSE_LIBPNG 1
+
+// Set to 1 for JPEG format support (requires libjpeg)
+#define wxUSE_LIBJPEG 1
+
+// Set to 1 for TIFF format support (requires libtiff)
+#define wxUSE_LIBTIFF 1
+
+// Set to 1 for TGA format support (loading only)
+#define wxUSE_TGA 1
+
+// Set to 1 for GIF format support
+#define wxUSE_GIF 1
+
+// Set to 1 for PNM format support
+#define wxUSE_PNM 1
+
+// Set to 1 for PCX format support
+#define wxUSE_PCX 1
+
+// Set to 1 for IFF format support (Amiga format)
+#define wxUSE_IFF 0
+
+// Set to 1 for XPM format support
+#define wxUSE_XPM 1
+
+// Set to 1 for MS Icons and Cursors format support
+#define wxUSE_ICO_CUR 1
+
+// Set to 1 to compile in wxPalette class
+#define wxUSE_PALETTE 1
+
+// ----------------------------------------------------------------------------
+// wxUniversal-only options
+// ----------------------------------------------------------------------------
+
+// Set to 1 to enable compilation of all themes, this is the default
+#define wxUSE_ALL_THEMES 1
+
+// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES
+// is unset, if it is set these options are not used; notice that metal theme
+// uses Win32 one
+#define wxUSE_THEME_GTK 0
+#define wxUSE_THEME_METAL 0
+#define wxUSE_THEME_MONO 0
+#define wxUSE_THEME_WIN32 0
+
+
+/* --- end common options --- */
+
+/* --- start MSW options --- */
+// ----------------------------------------------------------------------------
+// Windows-only settings
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_UNICODE_MSLU to 1 if you're compiling wxWidgets in Unicode mode
+// and want to run your programs under Windows 9x and not only NT/2000/XP.
+// This setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see
+// http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx). Note
+// that you will have to modify the makefiles to include unicows.lib import
+// library as the first library (see installation instructions in install.txt
+// to learn how to do it when building the library or samples).
+//
+// If your compiler doesn't have unicows.lib, you can get a version of it at
+// http://libunicows.sourceforge.net
+//
+// Default is 0
+//
+// Recommended setting: 0 (1 if you want to deploy Unicode apps on 9x systems)
+#ifndef wxUSE_UNICODE_MSLU
+ #define wxUSE_UNICODE_MSLU 0
+#endif
+
+// Set this to 1 if you want to use wxWidgets and MFC in the same program. This
+// will override some other settings (see below)
+//
+// Default is 0.
+//
+// Recommended setting: 0 unless you really have to use MFC
+#define wxUSE_MFC 0
+
+// Set this to 1 for generic OLE support: this is required for drag-and-drop,
+// clipboard, OLE Automation. Only set it to 0 if your compiler is very old and
+// can't compile/doesn't have the OLE headers.
+//
+// Default is 1.
+//
+// Recommended setting: 1
+#define wxUSE_OLE 1
+
+// Set this to 1 to enable wxAutomationObject class.
+//
+// Default is 1.
+//
+// Recommended setting: 1 if you need to control other applications via OLE
+// Automation, can be safely set to 0 otherwise
+#define wxUSE_OLE_AUTOMATION 1
+
+// Set this to 1 to enable wxActiveXContainer class allowing to embed OLE
+// controls in wx.
+//
+// Default is 1.
+//
+// Recommended setting: 1, required by wxMediaCtrl
+#define wxUSE_ACTIVEX 1
+
+// wxDC caching implementation
+#define wxUSE_DC_CACHEING 1
+
+// Set this to 1 to enable wxDIB class used internally for manipulating
+// wxBitmap data.
+//
+// Default is 1, set it to 0 only if you don't use wxImage neither
+//
+// Recommended setting: 1 (without it conversion to/from wxImage won't work)
+#define wxUSE_WXDIB 1
+
+// Set to 0 to disable PostScript print/preview architecture code under Windows
+// (just use Windows printing).
+#define wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
+
+// Set this to 1 to compile in wxRegKey class.
+//
+// Default is 1
+//
+// Recommended setting: 1, this is used internally by wx in a few places
+#define wxUSE_REGKEY 1
+
+// Set this to 1 to use RICHEDIT controls for wxTextCtrl with style wxTE_RICH
+// which allows to put more than ~32Kb of text in it even under Win9x (NT
+// doesn't have such limitation).
+//
+// Default is 1 for compilers which support it
+//
+// Recommended setting: 1, only set it to 0 if your compiler doesn't have
+// or can't compile
+#define wxUSE_RICHEDIT 1
+
+// Set this to 1 to use extra features of richedit v2 and later controls
+//
+// Default is 1 for compilers which support it
+//
+// Recommended setting: 1
+#define wxUSE_RICHEDIT2 1
+
+// Set this to 1 to enable support for the owner-drawn menu and listboxes. This
+// is required by wxUSE_CHECKLISTBOX.
+//
+// Default is 1.
+//
+// Recommended setting: 1, set to 0 for a small library size reduction
+#define wxUSE_OWNER_DRAWN 1
+
+// Set this to 1 to enable MSW-specific wxTaskBarIcon::ShowBalloon() method. It
+// is required by native wxNotificationMessage implementation.
+//
+// Default is 1 but disabled in wx/msw/chkconf.h if SDK is too old to contain
+// the necessary declarations.
+//
+// Recommended setting: 1, set to 0 for a tiny library size reduction
+#define wxUSE_TASKBARICON_BALLOONS 1
+
+// Set to 1 to compile MS Windows XP theme engine support
+#define wxUSE_UXTHEME 1
+
+// Set to 1 to use InkEdit control (Tablet PC), if available
+#define wxUSE_INKEDIT 0
+
+// Set to 1 to enable .INI files based wxConfig implementation (wxIniConfig)
+//
+// Default is 0.
+//
+// Recommended setting: 0, nobody uses .INI files any more
+#define wxUSE_INICONF 0
+
+// ----------------------------------------------------------------------------
+// Generic versions of native controls
+// ----------------------------------------------------------------------------
+
+// Set this to 1 to be able to use wxDatePickerCtrlGeneric in addition to the
+// native wxDatePickerCtrl
+//
+// Default is 0.
+//
+// Recommended setting: 0, this is mainly used for testing
+#define wxUSE_DATEPICKCTRL_GENERIC 0
+
+// Set this to 1 to be able to use wxTimePickerCtrlGeneric in addition to the
+// native wxTimePickerCtrl for the platforms that have the latter (MSW).
+//
+// Default is 0.
+//
+// Recommended setting: 0, this is mainly used for testing
+#define wxUSE_TIMEPICKCTRL_GENERIC 0
+
+// ----------------------------------------------------------------------------
+// Crash debugging helpers
+// ----------------------------------------------------------------------------
+
+// Set this to 1 to be able to use wxCrashReport::Generate() to create mini
+// dumps of your program when it crashes (or at any other moment)
+//
+// Default is 1 if supported by the compiler (VC++ and recent BC++ only).
+//
+// Recommended setting: 1, set to 0 if your programs never crash
+#define wxUSE_CRASHREPORT 1
+/* --- end MSW options --- */
+
+#endif // _WX_SETUP_H_
+
diff --git a/win/wxWidgets_additions/wxWidgets-3.0.2/interface/wx/app.h b/win/wxWidgets_additions/wxWidgets-3.0.2/interface/wx/app.h
new file mode 100644
index 000000000..b05db9515
--- /dev/null
+++ b/win/wxWidgets_additions/wxWidgets-3.0.2/interface/wx/app.h
@@ -0,0 +1,1156 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: app.h
+// Purpose: interface of wxApp
+// Author: wxWidgets team
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+
+/**
+ @class wxAppConsole
+
+ This class is essential for writing console-only or hybrid apps without
+ having to define @c wxUSE_GUI=0.
+
+ It is used to:
+ @li set and get application-wide properties (see wxAppConsole::CreateTraits
+ and wxAppConsole::SetXXX functions)
+ @li implement the windowing system message or event loop: events in fact are
+ supported even in console-mode applications (see wxAppConsole::HandleEvent
+ and wxAppConsole::ProcessPendingEvents);
+ @li initiate application processing via wxApp::OnInit;
+ @li allow default processing of events not handled by other
+ objects in the application (see wxAppConsole::FilterEvent)
+ @li implement Apple-specific event handlers (see wxAppConsole::MacXXX functions)
+
+ You should use the macro wxIMPLEMENT_APP(appClass) in your application
+ implementation file to tell wxWidgets how to create an instance of your
+ application class.
+
+ Use wxDECLARE_APP(appClass) in a header file if you want the ::wxGetApp() function
+ (which returns a reference to your application object) to be visible to other
+ files.
+
+ @library{wxbase}
+ @category{appmanagement}
+
+ @see @ref overview_app, wxApp, wxAppTraits, wxEventLoopBase
+*/
+class wxAppConsole : public wxEvtHandler,
+ public wxEventFilter
+{
+protected:
+ /**
+ Creates the wxAppTraits object when GetTraits() needs it for the first time.
+
+ @see wxAppTraits
+ */
+ virtual wxAppTraits* CreateTraits();
+
+public:
+
+ /**
+ Destructor.
+ */
+ virtual ~wxAppConsole();
+
+
+ /**
+ @name Event-handling
+
+ Note that you should look at wxEvtLoopBase for more event-processing
+ documentation.
+ */
+ //@{
+
+ /**
+ Called by wxWidgets on creation of the application. Override this if you wish
+ to provide your own (environment-dependent) main loop.
+
+ @return 0 under X, and the wParam of the WM_QUIT message under Windows.
+ */
+ virtual int MainLoop();
+
+ /**
+ Call this to explicitly exit the main message (event) loop.
+ You should normally exit the main loop (and the application) by deleting
+ the top window.
+
+ This function simply calls wxEvtLoopBase::Exit() on the active loop.
+ */
+ virtual void ExitMainLoop();
+
+ /**
+ Overridden wxEventFilter method.
+
+ This function is called before processing any event and allows the application
+ to preempt the processing of some events, see wxEventFilter
+ documentation for more information.
+
+ wxApp implementation of this method always return -1 indicating that
+ the event should be processed normally.
+ */
+ virtual int FilterEvent(wxEvent& event);
+
+ /**
+ Returns the main event loop instance, i.e.\ the event loop which is started
+ by OnRun() and which dispatches all events sent from the native toolkit
+ to the application (except when new event loops are temporarily set-up).
+ The returned value maybe @NULL. Put initialization code which needs a
+ non-@NULL main event loop into OnEventLoopEnter().
+ */
+ wxEventLoopBase* GetMainLoop() const;
+
+ /**
+ This function simply invokes the given method @a func of the specified
+ event handler @a handler with the @a event as parameter. It exists solely
+ to allow to catch the C++ exceptions which could be thrown by all event
+ handlers in the application in one place: if you want to do this, override
+ this function in your wxApp-derived class and add try/catch clause(s) to it.
+ */
+ virtual void HandleEvent(wxEvtHandler* handler,
+ wxEventFunction func,
+ wxEvent& event) const;
+
+ /**
+ Returns @true if the application is using an event loop.
+
+ This function always returns @true for the GUI applications which
+ must use an event loop but by default only returns @true for the
+ console programs if an event loop is already running as it can't know
+ whether one will be created in the future.
+
+ Thus, it only makes sense to override it in console applications which
+ do use an event loop, to return @true instead of checking if there is a
+ currently active event loop.
+ */
+ virtual bool UsesEventLoop() const;
+
+ //@}
+
+
+ /**
+ @name Pending events
+
+ Pending events are handled by wxAppConsole rather than wxEventLoopBase
+ to allow queuing of events even when there's no event loop
+ (e.g. in wxAppConsole::OnInit).
+ */
+ //@{
+
+ /**
+ Process all pending events; it is necessary to call this function to
+ process events posted with wxEvtHandler::QueueEvent or wxEvtHandler::AddPendingEvent.
+
+ This happens during each event loop iteration (see wxEventLoopBase) in GUI mode but
+ it may be also called directly.
+
+ Note that this function does not only process the pending events for the wxApp object
+ itself (which derives from wxEvtHandler) but also the pending events for @e any
+ event handler of this application.
+
+ This function will immediately return and do nothing if SuspendProcessingOfPendingEvents()
+ was called.
+ */
+ virtual void ProcessPendingEvents();
+
+ /**
+ Deletes the pending events of all wxEvtHandlers of this application.
+
+ See wxEvtHandler::DeletePendingEvents() for warnings about deleting the pending
+ events.
+ */
+ void DeletePendingEvents();
+
+ /**
+ Returns @true if there are pending events on the internal pending event list.
+
+ Whenever wxEvtHandler::QueueEvent or wxEvtHandler::AddPendingEvent() are
+ called (not only for wxApp itself, but for any event handler of the application!),
+ the internal wxApp's list of handlers with pending events is updated and this
+ function will return true.
+ */
+ bool HasPendingEvents() const;
+
+ /**
+ Temporary suspends processing of the pending events.
+
+ @see ResumeProcessingOfPendingEvents()
+ */
+ void SuspendProcessingOfPendingEvents();
+
+ /**
+ Resume processing of the pending events previously stopped because of a
+ call to SuspendProcessingOfPendingEvents().
+ */
+ void ResumeProcessingOfPendingEvents();
+
+ //@}
+
+ /**
+ Delayed objects destruction.
+
+ In applications using events it may be unsafe for an event handler to
+ delete the object which generated the event because more events may be
+ still pending for the same object. In this case the handler may call
+ ScheduleForDestruction() instead.
+ */
+ //@{
+
+ /**
+ Schedule the object for destruction in the near future.
+
+ Notice that if the application is not using an event loop, i.e. if
+ UsesEventLoop() returns @false, this method will simply delete the
+ object immediately.
+
+ Examples of using this function inside wxWidgets itself include
+ deleting the top level windows when they are closed and sockets when
+ they are disconnected.
+ */
+ void ScheduleForDestruction(wxObject *object);
+
+ /**
+ Check if the object had been scheduled for destruction with
+ ScheduleForDestruction().
+
+ This function may be useful as an optimization to avoid doing something
+ with an object which will be soon destroyed in any case.
+ */
+ bool IsScheduledForDestruction(wxObject *object) const;
+
+ //@}
+
+
+ bool Yield(bool onlyIfNeeded = false);
+
+ /**
+ Allows external code to modify global ::wxTheApp, but you should really
+ know what you're doing if you call it.
+
+ @param app
+ Replacement for the global application object.
+
+ @see GetInstance()
+ */
+ static void SetInstance(wxAppConsole* app);
+
+ /**
+ Returns the one and only global application object.
+ Usually ::wxTheApp is used instead.
+
+ @see SetInstance()
+ */
+ static wxAppConsole* GetInstance();
+
+ /**
+ Returns @true if the main event loop is currently running, i.e.\ if the
+ application is inside OnRun().
+
+ This can be useful to test whether events can be dispatched. For example,
+ if this function returns @false, non-blocking sockets cannot be used because
+ the events from them would never be processed.
+ */
+ static bool IsMainLoopRunning();
+
+ /**
+ @name Callbacks for application-wide "events"
+ */
+ //@{
+
+ /**
+ This function is called when an assert failure occurs, i.e.\ the condition
+ specified in wxASSERT() macro evaluated to @false.
+
+ It is only called in debug mode (when @c __WXDEBUG__ is defined) as
+ asserts are not left in the release code at all.
+ The base class version shows the default assert failure dialog box proposing to
+ the user to stop the program, continue or ignore all subsequent asserts.
+
+ @param file
+ the name of the source file where the assert occurred
+ @param line
+ the line number in this file where the assert occurred
+ @param func
+ the name of the function where the assert occurred, may be
+ empty if the compiler doesn't support C99 __FUNCTION__
+ @param cond
+ the condition of the failed assert in text form
+ @param msg
+ the message specified as argument to wxASSERT_MSG or wxFAIL_MSG, will
+ be @NULL if just wxASSERT or wxFAIL was used
+ */
+ virtual void OnAssertFailure(const wxChar *file,
+ int line,
+ const wxChar *func,
+ const wxChar *cond,
+ const wxChar *msg);
+
+ /**
+ Called when command line parsing fails (i.e.\ an incorrect command line option
+ was specified by the user). The default behaviour is to show the program usage
+ text and abort the program.
+
+ Return @true to continue normal execution or @false to return
+ @false from OnInit() thus terminating the program.
+
+ @see OnInitCmdLine()
+ */
+ virtual bool OnCmdLineError(wxCmdLineParser& parser);
+
+ /**
+ Called when the help option (@c --help) was specified on the command line.
+ The default behaviour is to show the program usage text and abort the program.
+
+ Return @true to continue normal execution or @false to return
+ @false from OnInit() thus terminating the program.
+
+ @see OnInitCmdLine()
+ */
+ virtual bool OnCmdLineHelp(wxCmdLineParser& parser);
+
+ /**
+ Called after the command line had been successfully parsed. You may override
+ this method to test for the values of the various parameters which could be
+ set from the command line.
+
+ Don't forget to call the base class version unless you want to suppress
+ processing of the standard command line options.
+ Return @true to continue normal execution or @false to return @false from
+ OnInit() thus terminating the program.
+
+ @see OnInitCmdLine()
+ */
+ virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
+
+ /**
+ Called by wxEventLoopBase::SetActive(): you can override this function
+ and put here the code which needs an active event loop.
+
+ Note that this function is called whenever an event loop is activated;
+ you may want to use wxEventLoopBase::IsMain() to perform initialization
+ specific for the app's main event loop.
+
+ @see OnEventLoopExit()
+ */
+ virtual void OnEventLoopEnter(wxEventLoopBase* loop);
+
+ /**
+ Called by wxEventLoopBase::OnExit() for each event loop which
+ is exited.
+
+ @see OnEventLoopEnter()
+ */
+ virtual void OnEventLoopExit(wxEventLoopBase* loop);
+
+ /**
+ This function is called if an unhandled exception occurs inside the main
+ application event loop. It can return @true to ignore the exception and to
+ continue running the loop or @false to exit the loop and terminate the
+ program. In the latter case it can also use C++ @c throw keyword to
+ rethrow the current exception.
+
+ The default behaviour of this function is the latter in all ports except under
+ Windows where a dialog is shown to the user which allows him to choose between
+ the different options. You may override this function in your class to do
+ something more appropriate.
+
+ Finally note that if the exception is rethrown from here, it can be caught in
+ OnUnhandledException().
+ */
+ virtual bool OnExceptionInMainLoop();
+
+ /**
+ Override this member function for any processing which needs to be
+ done as the application is about to exit. OnExit is called after
+ destroying all application windows and controls, but before
+ wxWidgets cleanup. Note that it is not called at all if
+ OnInit() failed.
+
+ The return value of this function is currently ignored, return the same
+ value as returned by the base class method if you override it.
+ */
+ virtual int OnExit();
+
+ /**
+ This function may be called if something fatal happens: an unhandled
+ exception under Win32 or a fatal signal under Unix, for example. However,
+ this will not happen by default: you have to explicitly call
+ wxHandleFatalExceptions() to enable this.
+
+ Generally speaking, this function should only show a message to the user and
+ return. You may attempt to save unsaved data but this is not guaranteed to
+ work and, in fact, probably won't.
+
+ @see wxHandleFatalExceptions()
+ */
+ virtual void OnFatalException();
+
+ /**
+ This must be provided by the application, and will usually create the
+ application's main window, optionally calling SetTopWindow().
+
+ You may use OnExit() to clean up anything initialized here, provided
+ that the function returns @true.
+
+ Notice that if you want to use the command line processing provided by
+ wxWidgets you have to call the base class version in the derived class
+ OnInit().
+
+ Return @true to continue processing, @false to exit the application
+ immediately.
+ */
+ virtual bool OnInit();
+
+ /**
+ Called from OnInit() and may be used to initialize the parser with the
+ command line options for this application. The base class versions adds
+ support for a few standard options only.
+ */
+ virtual void OnInitCmdLine(wxCmdLineParser& parser);
+
+ /**
+ This virtual function is where the execution of a program written in wxWidgets
+ starts. The default implementation just enters the main loop and starts
+ handling the events until it terminates, either because ExitMainLoop() has
+ been explicitly called or because the last frame has been deleted and
+ GetExitOnFrameDelete() flag is @true (this is the default).
+
+ The return value of this function becomes the exit code of the program, so it
+ should return 0 in case of successful termination.
+ */
+ virtual int OnRun();
+
+ /**
+ This function is called when an unhandled C++ exception occurs in user
+ code called by wxWidgets.
+
+ Any unhandled exceptions thrown from (overridden versions of) OnInit()
+ and OnExit() methods as well as any exceptions thrown from inside the
+ main loop and re-thrown by OnUnhandledException() will result in a call
+ to this function.
+
+ By the time this function is called, the program is already about to
+ exit and the exception can't be handled nor ignored any more, override
+ OnUnhandledException() or use explicit @c try/catch blocks around
+ OnInit() body to be able to handle the exception earlier.
+
+ The default implementation dumps information about the exception using
+ wxMessageOutputBest.
+ */
+ virtual void OnUnhandledException();
+
+ //@}
+
+
+ /**
+ @name Application information
+ */
+ //@{
+
+ /**
+ Returns the user-readable application name.
+
+ The difference between this string and the one returned by GetAppName()
+ is that this one is meant to be shown to the user and so should be used
+ for the window titles, page headers and so on while the other one
+ should be only used internally, e.g. for the file names or
+ configuration file keys.
+
+ If the application name for display had been previously set by
+ SetAppDisplayName(), it will be returned by this function. Otherwise,
+ if SetAppName() had been called its value will be returned; also as is.
+ Finally if none was called, this function returns the program name
+ capitalized using wxString::Capitalize().
+
+ @since 2.9.0
+ */
+ wxString GetAppDisplayName() const;
+
+ /**
+ Returns the application name.
+
+ If SetAppName() had been called, returns the string passed to it.
+ Otherwise returns the program name, i.e. the value of @c argv[0] passed
+ to the @c main() function.
+
+ @see GetAppDisplayName()
+ */
+ wxString GetAppName() const;
+
+ /**
+ Gets the class name of the application. The class name may be used in a
+ platform specific manner to refer to the application.
+
+ @see SetClassName()
+ */
+ wxString GetClassName() const;
+
+ /**
+ Returns a pointer to the wxAppTraits object for the application.
+ If you want to customize the wxAppTraits object, you must override the
+ CreateTraits() function.
+ */
+ wxAppTraits* GetTraits();
+
+ /**
+ Returns the user-readable vendor name. The difference between this string
+ and the one returned by GetVendorName() is that this one is meant to be shown
+ to the user and so should be used for the window titles, page headers and so on
+ while the other one should be only used internally, e.g. for the file names or
+ configuration file keys.
+
+ By default, returns the same string as GetVendorName().
+
+ @since 2.9.0
+ */
+ const wxString& GetVendorDisplayName() const;
+
+ /**
+ Returns the application's vendor name.
+ */
+ const wxString& GetVendorName() const;
+
+ /**
+ Set the application name to be used in the user-visible places such as
+ window titles.
+
+ See GetAppDisplayName() for more about the differences between the
+ display name and name.
+
+ Notice that if this function is called, the name is used as is, without
+ any capitalization as done by default by GetAppDisplayName().
+ */
+ void SetAppDisplayName(const wxString& name);
+
+ /**
+ Sets the name of the application. This name should be used for file names,
+ configuration file entries and other internal strings. For the user-visible
+ strings, such as the window titles, the application display name set by
+ SetAppDisplayName() is used instead.
+
+ By default the application name is set to the name of its executable file.
+
+ @see GetAppName()
+ */
+ void SetAppName(const wxString& name);
+
+ /**
+ Sets the class name of the application. This may be used in a platform specific
+ manner to refer to the application.
+
+ @see GetClassName()
+ */
+ void SetClassName(const wxString& name);
+
+ /**
+ Set the vendor name to be used in the user-visible places.
+ See GetVendorDisplayName() for more about the differences between the
+ display name and name.
+ */
+ void SetVendorDisplayName(const wxString& name);
+
+ /**
+ Sets the name of application's vendor. The name will be used
+ in registry access. A default name is set by wxWidgets.
+
+ @see GetVendorName()
+ */
+ void SetVendorName(const wxString& name);
+
+ //@}
+
+ /**
+ Sets the C locale to the default locale for the current environment.
+
+ It is advised to call this to ensure that the underlying toolkit uses
+ the locale in which the numbers and monetary amounts are shown in the
+ format expected by user and so on.
+
+ Calling this function is roughly equivalent to calling
+ @code
+ setlocale(LC_ALL, "");
+ @endcode
+ but performs additional toolkit-specific tasks under some platforms and
+ so should be used instead of @c setlocale() itself. Alternatively, you
+ can use wxLocale to change the locale with more control.
+
+ Notice that this does @em not change the global C++ locale, you need to
+ do it explicitly if you want, e.g.
+ @code
+ std::locale::global(std::locale(""));
+ @endcode
+ but be warned that locale support in C++ standard library can be poor
+ or worse under some platforms, e.g. the above line results in an
+ immediate crash under OS X up to the version 10.8.2.
+
+ @since 2.9.5
+ */
+ void SetCLocale();
+
+ /**
+ Number of command line arguments (after environment-specific processing).
+ */
+ int argc;
+
+ /**
+ Command line arguments (after environment-specific processing).
+
+ Under Windows and Linux/Unix, you should parse the command line
+ arguments and check for files to be opened when starting your
+ application. Under OS X, you need to override MacOpenFiles()
+ since command line arguments are used differently there.
+
+ You may use the wxCmdLineParser to parse command line arguments.
+ */
+ wxChar** argv;
+};
+
+
+
+
+/**
+ @class wxApp
+
+ The wxApp class represents the application itself when @c wxUSE_GUI=1.
+
+ In addition to the features provided by wxAppConsole it keeps track of
+ the top window (see SetTopWindow()) and adds support for
+ video modes (see SetVideoMode()).
+
+ In general, application-wide settings for GUI-only apps are accessible
+ from wxApp (or from wxSystemSettings or wxSystemOptions classes).
+
+ @beginEventEmissionTable
+ @event{EVT_QUERY_END_SESSION(func)}
+ Process a query end session event, supplying the member function.
+ See wxCloseEvent.
+ @event{EVT_END_SESSION(func)}
+ Process an end session event, supplying the member function.
+ See wxCloseEvent.
+ @event{EVT_ACTIVATE_APP(func)}
+ Process a @c wxEVT_ACTIVATE_APP event. See wxActivateEvent.
+ @event{EVT_HIBERNATE(func)}
+ Process a hibernate event. See wxActivateEvent.
+ @event{EVT_DIALUP_CONNECTED(func)}
+ A connection with the network was established. See wxDialUpEvent.
+ @event{EVT_DIALUP_DISCONNECTED(func)}
+ The connection with the network was lost. See wxDialUpEvent.
+ @event{EVT_IDLE(func)}
+ Process a @c wxEVT_IDLE event. See wxIdleEvent.
+ @endEventTable
+
+ @library{wxbase}
+ @category{appmanagement}
+
+ @see @ref overview_app, wxAppTraits, wxEventLoopBase, wxSystemSettings
+*/
+class wxApp : public wxAppConsole
+{
+public:
+ /**
+ Constructor. Called implicitly with a definition of a wxApp object.
+ */
+ wxApp();
+
+ /**
+ Destructor. Will be called implicitly on program exit if the wxApp
+ object is created on the stack.
+ */
+ virtual ~wxApp();
+
+ /**
+ Get display mode that is used use. This is only used in framebuffer
+ wxWidgets ports such as wxDFB.
+ */
+ virtual wxVideoMode GetDisplayMode() const;
+
+ /**
+ Returns @true if the application will exit when the top-level frame is deleted.
+
+ @see SetExitOnFrameDelete()
+ */
+ bool GetExitOnFrameDelete() const;
+
+ /**
+ Return the layout direction for the current locale or @c wxLayout_Default
+ if it's unknown.
+ */
+ virtual wxLayoutDirection GetLayoutDirection() const;
+
+ /**
+ Returns @true if the application will use the best visual on systems that support
+ different visuals, @false otherwise.
+
+ @see SetUseBestVisual()
+ */
+ bool GetUseBestVisual() const;
+
+ /**
+ Returns a pointer to the top window.
+
+ @remarks
+ If the top window hasn't been set using SetTopWindow(), this function
+ will find the first top-level window (frame or dialog or instance of
+ wxTopLevelWindow) from the internal top level window list and return that.
+
+ @see SetTopWindow()
+ */
+ virtual wxWindow* GetTopWindow() const;
+
+ /**
+ Returns @true if the application is active, i.e.\ if one of its windows is
+ currently in the foreground.
+
+ If this function returns @false and you need to attract users attention to
+ the application, you may use wxTopLevelWindow::RequestUserAttention to do it.
+ */
+ virtual bool IsActive() const;
+
+ /**
+ This function is similar to wxYield(), except that it disables the user
+ input to all program windows before calling wxAppConsole::Yield and re-enables it
+ again afterwards. If @a win is not @NULL, this window will remain enabled,
+ allowing the implementation of some limited user interaction.
+ Returns the result of the call to wxAppConsole::Yield.
+
+ @see wxSafeYield
+ */
+ virtual bool SafeYield(wxWindow *win, bool onlyIfNeeded);
+
+ /**
+ Works like SafeYield() with @e onlyIfNeeded == @true except that
+ it allows the caller to specify a mask of events to be processed.
+
+ See wxAppConsole::YieldFor for more info.
+ */
+ virtual bool SafeYieldFor(wxWindow *win, long eventsToProcess);
+
+ /**
+ Windows-only function for processing a message. This function is called
+ from the main message loop, checking for windows that may wish to process it.
+
+ The function returns @true if the message was processed, @false otherwise.
+ If you use wxWidgets with another class library with its own message loop,
+ you should make sure that this function is called to allow wxWidgets to
+ receive messages. For example, to allow co-existence with the Microsoft
+ Foundation Classes, override the PreTranslateMessage function:
+
+ @code
+ // Provide wxWidgets message loop compatibility
+ BOOL CTheApp::PreTranslateMessage(MSG *msg)
+ {
+ if (wxTheApp && wxTheApp->ProcessMessage((WXMSW *)msg))
+ return true;
+ else
+ return CWinApp::PreTranslateMessage(msg);
+ }
+ @endcode
+
+ @onlyfor{wxmsw}
+ */
+ bool ProcessMessage(WXMSG* msg);
+
+ /**
+ Set display mode to use. This is only used in framebuffer wxWidgets
+ ports such as wxDFB.
+ */
+ virtual bool SetDisplayMode(const wxVideoMode& info);
+
+ /**
+ Allows the programmer to specify whether the application will exit when the
+ top-level frame is deleted.
+
+ @param flag
+ If @true (the default), the application will exit when the top-level frame
+ is deleted. If @false, the application will continue to run.
+
+ @see GetExitOnFrameDelete(), @ref overview_app_shutdown
+ */
+ void SetExitOnFrameDelete(bool flag);
+
+ /**
+ Allows runtime switching of the UI environment theme.
+
+ Currently implemented for wxGTK2-only.
+ Return @true if theme was successfully changed.
+
+ @param theme
+ The name of the new theme or an absolute path to a gtkrc-theme-file
+ */
+ virtual bool SetNativeTheme(const wxString& theme);
+
+ /**
+ Sets the 'top' window. You can call this from within OnInit() to let wxWidgets
+ know which is the main window. You don't have to set the top window;
+ it is only a convenience so that (for example) certain dialogs without parents
+ can use a specific window as the top window.
+
+ If no top window is specified by the application, wxWidgets just uses the
+ first frame or dialog (or better, any wxTopLevelWindow) in its top-level
+ window list, when it needs to use the top window.
+ If you previously called SetTopWindow() and now you need to restore this
+ automatic behaviour you can call @code wxApp::SetTopWindow(NULL) @endcode.
+
+ @param window
+ The new top window.
+
+ @see GetTopWindow(), OnInit()
+ */
+ void SetTopWindow(wxWindow* window);
+
+ /**
+ Allows the programmer to specify whether the application will use the best
+ visual on systems that support several visual on the same display. This is typically
+ the case under Solaris and IRIX, where the default visual is only 8-bit whereas
+ certain applications are supposed to run in TrueColour mode.
+
+ Note that this function has to be called in the constructor of the wxApp
+ instance and won't have any effect when called later on.
+ This function currently only has effect under GTK.
+
+ @param flag
+ If @true, the app will use the best visual.
+ @param forceTrueColour
+ If @true then the application will try to force using a TrueColour
+ visual and abort the app if none is found.
+ */
+ void SetUseBestVisual(bool flag, bool forceTrueColour = false);
+
+
+ /**
+ @name Mac-specific functions
+ */
+ //@{
+
+ /**
+ Called in response of an "open-application" Apple event.
+ Override this to create a new document in your app.
+
+ @onlyfor{wxosx}
+ */
+ virtual void MacNewFile();
+
+ /**
+ Called in response of an openFiles message with Cocoa, or an
+ "open-document" Apple event with Carbon.
+
+ You need to override this method in order to open one or more document
+ files after the user double clicked on it or if the files and/or
+ folders were dropped on either the application in the dock or the
+ application icon in Finder.
+
+ By default this method calls MacOpenFile for each file/folder.
+
+ @onlyfor{wxosx}
+
+ @since 2.9.3
+ */
+ virtual void MacOpenFiles(const wxArrayString& fileNames);
+
+ /**
+ Called in response of an "open-document" Apple event.
+
+ @deprecated
+ This function is kept mostly for backwards compatibility. Please
+ override wxApp::MacOpenFiles method instead in any new code.
+
+ @onlyfor{wxosx}
+ */
+ virtual void MacOpenFile(const wxString& fileName);
+
+ /**
+ Called in response of a "get-url" Apple event.
+
+ @onlyfor{wxosx}
+ */
+ virtual void MacOpenURL(const wxString& url);
+
+ /**
+ Called in response of a "print-document" Apple event.
+
+ @onlyfor{wxosx}
+ */
+ virtual void MacPrintFile(const wxString& fileName);
+
+ /**
+ Called in response of a "reopen-application" Apple event.
+
+ @onlyfor{wxosx}
+ */
+ virtual void MacReopenApp();
+
+ /**
+ May be overridden to indicate that the application is not a foreground
+ GUI application under OS X.
+
+ This method is called during the application startup and returns @true
+ by default. In this case, wxWidgets ensures that the application is ran
+ as a foreground, GUI application so that the user can interact with it
+ normally, even if it is not bundled. If this is undesired, i.e. if the
+ application doesn't need to be brought to the foreground, this method
+ can be overridden to return @false.
+
+ Notice that overriding it doesn't make any difference for the bundled
+ applications which are always foreground unless @c LSBackgroundOnly key
+ is specified in the @c Info.plist file.
+
+ @onlyfor{wxosx}
+
+ @since 3.0.1
+ */
+ virtual bool OSXIsGUIApplication();
+
+ //@}
+
+};
+
+
+
+// ============================================================================
+// Global functions/macros
+// ============================================================================
+
+
+/** @addtogroup group_funcmacro_rtti */
+//@{
+
+/**
+ This is used in headers to create a forward declaration of the ::wxGetApp()
+ function implemented by wxIMPLEMENT_APP().
+
+ It creates the declaration className& wxGetApp()
+ (requires a final semicolon).
+
+ @header{wx/app.h}
+
+ Example:
+
+ @code
+ wxDECLARE_APP(MyApp);
+ @endcode
+*/
+#define wxDECLARE_APP( className )
+
+/**
+ This is used in the application class implementation file to make the
+ application class known to wxWidgets for dynamic construction.
+ Note that this macro requires a final semicolon.
+
+ @header{wx/app.h}
+
+ Example:
+
+ @code
+ wxIMPLEMENT_APP(MyApp);
+ @endcode
+
+ @see wxDECLARE_APP()
+*/
+#define wxIMPLEMENT_APP( className )
+
+//@}
+
+
+
+/**
+ The global pointer to the singleton wxApp object.
+
+ @see wxApp::GetInstance()
+*/
+wxApp *wxTheApp;
+
+
+
+/** @addtogroup group_funcmacro_appinitterm */
+//@{
+
+/**
+ This function doesn't exist in wxWidgets but it is created by using the
+ wxIMPLEMENT_APP() macro.
+
+ Thus, before using it anywhere but in the same module where this macro is
+ used, you must make it available using wxDECLARE_APP().
+
+ The advantage of using this function compared to directly using the global
+ ::wxTheApp pointer is that the latter is of type wxApp* and so wouldn't
+ allow you to access the functions specific to your application class but
+ not present in wxApp while wxGetApp() returns the object of the right type.
+
+ @header{wx/app.h}
+*/
+wxAppDerivedClass& wxGetApp();
+
+/**
+ If @a doIt is @true, the fatal exceptions (also known as general protection
+ faults under Windows or segmentation violations in the Unix world) will be
+ caught and passed to wxApp::OnFatalException.
+
+ By default, i.e. before this function is called, they will be handled in
+ the normal way which usually just means that the application will be
+ terminated. Calling wxHandleFatalExceptions() with @a doIt equal to @false
+ will restore this default behaviour.
+
+ Notice that this function is only available if @c wxUSE_ON_FATAL_EXCEPTION
+ is 1 and under Windows platform this requires a compiler with support for
+ SEH (structured exception handling) which currently means only Microsoft
+ Visual C++ or a recent Borland C++ version.
+
+ @header{wx/app.h}
+*/
+bool wxHandleFatalExceptions(bool doIt = true);
+
+/**
+ This function is used in wxBase only and only if you don't create
+ wxApp object at all. In this case you must call it from your
+ @c main() function before calling any other wxWidgets functions.
+
+ If the function returns @false the initialization could not be performed,
+ in this case the library cannot be used and wxUninitialize() shouldn't be
+ called neither.
+
+ This function may be called several times but wxUninitialize() must be
+ called for each successful call to this function.
+
+ @header{wx/app.h}
+*/
+bool wxInitialize();
+
+/**
+ This function is for use in console (wxBase) programs only. It must be called
+ once for each previous successful call to wxInitialize().
+
+ @header{wx/app.h}
+*/
+void wxUninitialize();
+
+/**
+ This function wakes up the (internal and platform dependent) idle system,
+ i.e. it will force the system to send an idle event even if the system
+ currently @e is idle and thus would not send any idle event until after
+ some other event would get sent. This is also useful for sending events
+ between two threads and is used by the corresponding functions
+ wxPostEvent() and wxEvtHandler::AddPendingEvent().
+
+ @header{wx/app.h}
+*/
+void wxWakeUpIdle();
+
+/**
+ Calls wxAppConsole::Yield.
+
+ @deprecated
+ This function is kept only for backwards compatibility. Please use
+ the wxAppConsole::Yield method instead in any new code.
+
+ @header{wx/app.h}
+*/
+bool wxYield();
+
+/**
+ Calls wxApp::SafeYield.
+
+ @header{wx/app.h}
+*/
+bool wxSafeYield(wxWindow* win = NULL, bool onlyIfNeeded = false);
+
+/**
+ This function initializes wxWidgets in a platform-dependent way. Use this if you
+ are not using the default wxWidgets entry code (e.g. main or WinMain).
+
+ For example, you can initialize wxWidgets from an Microsoft Foundation Classes
+ (MFC) application using this function.
+
+ @note This overload of wxEntry is available under all platforms.
+
+ @see wxEntryStart()
+
+ @header{wx/app.h}
+*/
+int wxEntry(int& argc, wxChar** argv);
+
+/**
+ See wxEntry(int&,wxChar**) for more info about this function.
+
+ Notice that under Windows CE platform, and only there, the type of @a pCmdLine
+ is @c wchar_t *, otherwise it is @c char *, even in Unicode build.
+
+ @remarks To clean up wxWidgets, call wxApp::OnExit followed by the static
+ function wxApp::CleanUp. For example, if exiting from an MFC application
+ that also uses wxWidgets:
+ @code
+ int CTheApp::ExitInstance()
+ {
+ // OnExit isn't called by CleanUp so must be called explicitly.
+ wxTheApp->OnExit();
+ wxApp::CleanUp();
+
+ return CWinApp::ExitInstance();
+ }
+ @endcode
+
+ @onlyfor{wxmsw}
+
+ @header{wx/app.h}
+
+ @see wxMSWDisableSettingHighDPIAware()
+*/
+int wxEntry(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance = NULL,
+ char* pCmdLine = NULL,
+ int nCmdShow = SW_SHOWNORMAL);
+
+//@}
+
+
+
+/** @addtogroup group_funcmacro_procctrl */
+//@{
+
+/**
+ Exits application after calling wxApp::OnExit.
+
+ Should only be used in an emergency: normally the top-level frame
+ should be deleted (after deleting all other frames) to terminate the
+ application. See wxCloseEvent and wxApp.
+
+ @header{wx/app.h}
+*/
+void wxExit();
+
+//@}
+
+/** @addtogroup group_funcmacro_debug */
+//@{
+
+/**
+ @def wxDISABLE_DEBUG_SUPPORT()
+
+ Use this macro to disable all debugging code in release build when not
+ using wxIMPLEMENT_APP().
+
+ Currently this macro disables assert checking and debug and trace level
+ logging messages in release build (i.e. when @c NDEBUG is defined). It is
+ used by wxIMPLEMENT_APP() macro so you only need to use it explicitly if you
+ don't use this macro but initialize wxWidgets directly (e.g. calls
+ wxEntry() or wxEntryStart() itself).
+
+ If you do not want to disable debugging code even in release build of your
+ application, you can use wxSetDefaultAssertHandler() and
+ wxLog::SetLogLevel() with @c wxLOG_Max parameter to enable assertions and
+ debug logging respectively.
+
+ @see wxDISABLE_ASSERTS_IN_RELEASE_BUILD(),
+ wxDISABLE_DEBUG_LOGGING_IN_RELEASE_BUILD(),
+ @ref overview_debugging
+
+ @since 2.9.1
+
+ @header{wx/app.h}
+ */
+#define wxDISABLE_DEBUG_SUPPORT() \
+ wxDISABLE_ASSERTS_IN_RELEASE_BUILD(); \
+ wxDISABLE_DEBUG_LOGGING_IN_RELEASE_BUILD()
+
+//@}
+
diff --git a/win/wxWidgets_additions/wxWidgets-3.0.2/interface/wx/init.h b/win/wxWidgets_additions/wxWidgets-3.0.2/interface/wx/init.h
new file mode 100644
index 000000000..beff4c4b4
--- /dev/null
+++ b/win/wxWidgets_additions/wxWidgets-3.0.2/interface/wx/init.h
@@ -0,0 +1,128 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: init.h
+// Purpose: interface of global functions
+// Author: wxWidgets team
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+
+/**
+ @class wxInitializer
+
+ Create an object of this class on the stack to initialize/cleanup the library
+ automatically.
+
+ @library{wxbase}
+ @category{appmanagement}
+
+ @see wxGLContext
+*/
+class wxInitializer
+{
+public:
+ /**
+ Initializes the library.
+ Calls wxInitialize().
+ */
+ wxInitializer(int argc = 0, wxChar **argv = NULL);
+
+ /**
+ Has the initialization been successful? (explicit test)
+ */
+ bool IsOk() const;
+
+ /**
+ This dtor only does clean up if we initialized the library properly.
+ Calls wxUninitialize().
+ */
+ ~wxInitializer();
+};
+
+
+
+/** @addtogroup group_funcmacro_appinitterm */
+//@{
+
+/**
+ This function can be used to perform the initialization of wxWidgets if you
+ can't use the default initialization code for any reason.
+
+ If the function returns true, the initialization was successful and the
+ global wxApp object ::wxTheApp has been created. Moreover, wxEntryCleanup()
+ must be called afterwards. If the function returns false, a catastrophic
+ initialization error occurred and (at least the GUI part of) the library
+ can't be used at all.
+
+ Notice that parameters @c argc and @c argv may be modified by this
+ function.
+
+ @header{wx/init.h}
+*/
+bool wxEntryStart(int& argc, wxChar** argv);
+
+/**
+ See wxEntryStart(int&,wxChar**) for more info about this function.
+
+ This is an additional overload of wxEntryStart() provided under MSW only.
+ It is meant to be called with the parameters passed to WinMain().
+
+ @note Under Windows CE platform, and only there, the type of @a pCmdLine is
+ @c wchar_t *, otherwise it is @c char *, even in Unicode build.
+
+ @onlyfor{wxmsw}
+
+ @header{wx/init.h}
+*/
+bool wxEntryStart(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance = NULL,
+ char* pCmdLine = NULL,
+ int nCmdShow = SW_SHOWNORMAL);
+
+/**
+ Free resources allocated by a successful call to wxEntryStart().
+
+ @header{wx/init.h}
+*/
+void wxEntryCleanup();
+
+/**
+ Initialize the library (may be called as many times as needed, but each
+ call to wxInitialize() must be matched by wxUninitialize()).
+
+ With this function you may avoid wxDECLARE_APP() and wxIMPLEMENT_APP() macros
+ and use wxInitialize() and wxUninitialize() dynamically in the
+ program startup and termination.
+
+ @header{wx/init.h}
+*/
+bool wxInitialize(int argc = 0, wxChar **argv = NULL);
+
+/**
+ Clean up; the library can't be used any more after the last call to
+ wxUninitialize().
+
+ See wxInitialize() for more info.
+
+ @header{wx/init.h}
+*/
+void wxUninitialize();
+
+/**
+ Prevents wxWidgets from setting HighDPI awareness mode.
+
+ wxEntry calls SetDPIProcessAware() early during initialization on Windows.
+ To prevent this (e.g. because wx is embedded in native code and disabling
+ DPI awareness in the manifest is not an option), call this function
+ *before* wxEntry() is called.
+
+ @onlyfor{wxmsw}
+
+ @header{wx/init.h}
+
+ @since 3.0.3, but only available in 3.0.x, not 3.1+ which doesn't make
+ the SetDPIProcessAware() call anymore.
+*/
+void wxMSWDisableSettingHighDPIAware();
+
+//@}
+
diff --git a/win/wxWidgets_additions/wxWidgets-3.0.2/src/msw/main.cpp b/win/wxWidgets_additions/wxWidgets-3.0.2/src/msw/main.cpp
new file mode 100644
index 000000000..c6bd7a632
--- /dev/null
+++ b/win/wxWidgets_additions/wxWidgets-3.0.2/src/msw/main.cpp
@@ -0,0 +1,455 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: src/msw/main.cpp
+// Purpose: WinMain/DllMain
+// Author: Julian Smart
+// Modified by:
+// Created: 04/01/98
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/event.h"
+ #include "wx/app.h"
+ #include "wx/utils.h"
+#endif //WX_PRECOMP
+
+#include "wx/cmdline.h"
+#include "wx/dynlib.h"
+#include "wx/scopeguard.h"
+
+#include "wx/msw/private.h"
+#include "wx/msw/seh.h"
+
+#if wxUSE_ON_FATAL_EXCEPTION
+ #include "wx/datetime.h"
+ #include "wx/msw/crashrpt.h"
+#endif // wxUSE_ON_FATAL_EXCEPTION
+
+#ifdef __WXWINCE__
+ // there is no ExitProcess() under CE but exiting the main thread has the
+ // same effect
+ #ifndef ExitProcess
+ #define ExitProcess ExitThread
+ #endif
+#endif // __WXWINCE__
+
+#ifdef __BORLANDC__
+ // BC++ has to be special: its run-time expects the DLL entry point to be
+ // named DllEntryPoint instead of the (more) standard DllMain
+ #define DllMain DllEntryPoint
+#endif // __BORLANDC__
+
+#if defined(__WXMICROWIN__)
+ #define HINSTANCE HANDLE
+#endif
+
+// defined in common/init.cpp
+extern int wxEntryReal(int& argc, wxChar **argv);
+extern int wxEntryCleanupReal(int& argc, wxChar **argv);
+
+// ============================================================================
+// implementation: various entry points
+// ============================================================================
+
+#if wxUSE_BASE
+
+// ----------------------------------------------------------------------------
+// wrapper wxEntry catching all Win32 exceptions occurring in a wx program
+// ----------------------------------------------------------------------------
+
+// wrap real wxEntry in a try-except block to be able to call
+// OnFatalException() if necessary
+#if wxUSE_ON_FATAL_EXCEPTION
+
+// global pointer to exception information, only valid inside OnFatalException,
+// used by wxStackWalker and wxCrashReport
+extern EXCEPTION_POINTERS *wxGlobalSEInformation = NULL;
+
+// flag telling us whether the application wants to handle exceptions at all
+static bool gs_handleExceptions = false;
+
+static void wxFatalExit()
+{
+ // use the same exit code as abort()
+ ::ExitProcess(3);
+}
+
+unsigned long wxGlobalSEHandler(EXCEPTION_POINTERS *pExcPtrs)
+{
+ if ( gs_handleExceptions && wxTheApp )
+ {
+ // store the pointer to exception info
+ wxGlobalSEInformation = pExcPtrs;
+
+ // give the user a chance to do something special about this
+ wxSEH_TRY
+ {
+ wxTheApp->OnFatalException();
+ }
+ wxSEH_IGNORE // ignore any exceptions inside the exception handler
+
+ wxGlobalSEInformation = NULL;
+
+ // this will execute our handler and terminate the process
+ return EXCEPTION_EXECUTE_HANDLER;
+ }
+
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
+#ifdef __VISUALC__
+
+void wxSETranslator(unsigned int WXUNUSED(code), EXCEPTION_POINTERS *ep)
+{
+ switch ( wxGlobalSEHandler(ep) )
+ {
+ default:
+ wxFAIL_MSG( wxT("unexpected wxGlobalSEHandler() return value") );
+ // fall through
+
+ case EXCEPTION_EXECUTE_HANDLER:
+ // if wxApp::OnFatalException() had been called we should exit the
+ // application -- but we shouldn't kill our host when we're a DLL
+#ifndef WXMAKINGDLL
+ wxFatalExit();
+#endif // not a DLL
+ break;
+
+ case EXCEPTION_CONTINUE_SEARCH:
+ // we're called for each "catch ( ... )" and if we (re)throw from
+ // here, the catch handler body is not executed, so the effect is
+ // as if had inhibited translation of SE to C++ ones because the
+ // handler will never see any structured exceptions
+ throw;
+ }
+}
+
+#endif // __VISUALC__
+
+bool wxHandleFatalExceptions(bool doit)
+{
+ // assume this can only be called from the main thread
+ gs_handleExceptions = doit;
+
+#if wxUSE_CRASHREPORT
+ if ( doit )
+ {
+ // try to find a place where we can put out report file later
+ wxChar fullname[MAX_PATH];
+ if ( !::GetTempPath(WXSIZEOF(fullname), fullname) )
+ {
+ wxLogLastError(wxT("GetTempPath"));
+
+ // when all else fails...
+ wxStrcpy(fullname, wxT("c:\\"));
+ }
+
+ // use PID and date to make the report file name more unique
+ wxString name = wxString::Format
+ (
+ wxT("%s_%s_%lu.dmp"),
+ wxTheApp ? (const wxChar*)wxTheApp->GetAppDisplayName().c_str()
+ : wxT("wxwindows"),
+ wxDateTime::Now().Format(wxT("%Y%m%dT%H%M%S")).c_str(),
+ ::GetCurrentProcessId()
+ );
+
+ wxStrncat(fullname, name, WXSIZEOF(fullname) - wxStrlen(fullname) - 1);
+
+ wxCrashReport::SetFileName(fullname);
+ }
+#endif // wxUSE_CRASHREPORT
+
+ return true;
+}
+
+int wxEntry(int& argc, wxChar **argv)
+{
+ DisableAutomaticSETranslator();
+
+ wxSEH_TRY
+ {
+ return wxEntryReal(argc, argv);
+ }
+ wxSEH_HANDLE(-1)
+}
+
+#else // !wxUSE_ON_FATAL_EXCEPTION
+
+int wxEntry(int& argc, wxChar **argv)
+{
+ return wxEntryReal(argc, argv);
+}
+
+#endif // wxUSE_ON_FATAL_EXCEPTION/!wxUSE_ON_FATAL_EXCEPTION
+
+#endif // wxUSE_BASE
+
+#if wxUSE_GUI
+
+namespace
+{
+
+#if wxUSE_UNICODE && !defined(__WXWINCE__)
+ #define NEED_UNICODE_CHECK
+#endif
+
+#ifdef NEED_UNICODE_CHECK
+
+// check whether Unicode is available
+bool wxIsUnicodeAvailable()
+{
+ static const wchar_t *ERROR_STRING = L"wxWidgets Fatal Error";
+
+ if ( wxGetOsVersion() != wxOS_WINDOWS_NT )
+ {
+ // we need to be built with MSLU support
+#if !wxUSE_UNICODE_MSLU
+ // note that we can use MessageBoxW() as it's implemented even under
+ // Win9x - OTOH, we can't use wxGetTranslation() because the file APIs
+ // used by wxLocale are not
+ ::MessageBox
+ (
+ NULL,
+ L"This program uses Unicode and requires Windows NT/2000/XP.\n"
+ L"\n"
+ L"Program aborted.",
+ ERROR_STRING,
+ MB_ICONERROR | MB_OK
+ );
+
+ return false;
+#else // wxUSE_UNICODE_MSLU
+ // and the MSLU DLL must also be available
+ HMODULE hmod = ::LoadLibraryA("unicows.dll");
+ if ( !hmod )
+ {
+ ::MessageBox
+ (
+ NULL,
+ L"This program uses Unicode and requires unicows.dll to work "
+ L"under current operating system.\n"
+ L"\n"
+ L"Please install unicows.dll and relaunch the program.",
+ ERROR_STRING,
+ MB_ICONERROR | MB_OK
+ );
+ return false;
+ }
+
+ // this is not really necessary but be tidy
+ ::FreeLibrary(hmod);
+
+ // finally do the last check: has unicows.lib initialized correctly?
+ hmod = ::LoadLibraryW(L"unicows.dll");
+ if ( !hmod )
+ {
+ ::MessageBox
+ (
+ NULL,
+ L"This program uses Unicode but is not using unicows.dll\n"
+ L"correctly and so cannot work under current operating system.\n"
+ L"Please contact the program author for an updated version.\n"
+ L"\n"
+ L"Program aborted.",
+ ERROR_STRING,
+ MB_ICONERROR | MB_OK
+ );
+
+ return false;
+ }
+
+ ::FreeLibrary(hmod);
+#endif // !wxUSE_UNICODE_MSLU
+ }
+
+ return true;
+}
+
+#endif // NEED_UNICODE_CHECK
+
+void wxSetProcessDPIAware()
+{
+#if wxUSE_DYNLIB_CLASS
+ typedef BOOL (WINAPI *SetProcessDPIAware_t)(void);
+ wxDynamicLibrary dllUser32(wxT("user32.dll"));
+ SetProcessDPIAware_t pfnSetProcessDPIAware =
+ (SetProcessDPIAware_t)dllUser32.RawGetSymbol(wxT("SetProcessDPIAware"));
+
+ if ( pfnSetProcessDPIAware )
+ pfnSetProcessDPIAware();
+#endif // wxUSE_DYNLIB_CLASS
+}
+
+// It is sometimes undesirable to force DPI awareness on appplications, e.g.
+// when they are artwork heavy and don't have appropriately scaled bitmaps, or
+// when they are using non-wx, DPI-unaware code. Allow disabling
+// SetProcessDPIAware() call.
+//
+// Further discussion:
+// http://trac.wxwidgets.org/ticket/16116
+// https://groups.google.com/d/topic/wx-dev/Z0VpgzCY34U/discussion
+bool gs_allowChangingDPIAwareness = true;
+
+} //anonymous namespace
+
+void wxMSWDisableSettingHighDPIAware()
+{
+ gs_allowChangingDPIAwareness = false;
+}
+
+// ----------------------------------------------------------------------------
+// Windows-specific wxEntry
+// ----------------------------------------------------------------------------
+
+struct wxMSWCommandLineArguments
+{
+ wxMSWCommandLineArguments() { argc = 0; argv = NULL; }
+
+ void Init(const wxArrayString& args)
+ {
+ argc = args.size();
+
+ // +1 here for the terminating NULL
+ argv = new wxChar *[argc + 1];
+ for ( int i = 0; i < argc; i++ )
+ {
+ argv[i] = wxStrdup(args[i].t_str());
+ }
+
+ // argv[] must be NULL-terminated
+ argv[argc] = NULL;
+ }
+
+ void Free()
+ {
+ if ( !argc )
+ return;
+
+ for ( int i = 0; i < argc; i++ )
+ {
+ free(argv[i]);
+ }
+
+ wxDELETEA(argv);
+ argc = 0;
+ }
+
+ int argc;
+ wxChar **argv;
+};
+
+static wxMSWCommandLineArguments wxArgs;
+
+// common part of wxMSW-specific wxEntryStart() and wxEntry() overloads
+static bool
+wxMSWEntryCommon(HINSTANCE hInstance, int nCmdShow)
+{
+ // the first thing to do is to check if we're trying to run an Unicode
+ // program under Win9x w/o MSLU emulation layer - if so, abort right now
+ // as it has no chance to work and has all chances to crash
+#ifdef NEED_UNICODE_CHECK
+ if ( !wxIsUnicodeAvailable() )
+ return false;
+#endif // NEED_UNICODE_CHECK
+
+
+ // remember the parameters Windows gave us
+ wxSetInstance(hInstance);
+#ifdef __WXMSW__
+ wxApp::m_nCmdShow = nCmdShow;
+#endif
+
+ // parse the command line: we can't use pCmdLine in Unicode build so it is
+ // simpler to never use it at all (this also results in a more correct
+ // argv[0])
+
+ // break the command line in words
+ wxArrayString args;
+
+ const wxChar *cmdLine = ::GetCommandLine();
+ if ( cmdLine )
+ {
+ args = wxCmdLineParser::ConvertStringToArgs(cmdLine);
+ }
+
+#ifdef __WXWINCE__
+ // WinCE doesn't insert the program itself, so do it ourselves.
+ args.Insert(wxGetFullModuleName(), 0);
+#endif
+
+ wxArgs.Init(args);
+
+ return true;
+}
+
+WXDLLEXPORT bool wxEntryStart(HINSTANCE hInstance,
+ HINSTANCE WXUNUSED(hPrevInstance),
+ wxCmdLineArgType WXUNUSED(pCmdLine),
+ int nCmdShow)
+{
+ if ( !wxMSWEntryCommon(hInstance, nCmdShow) )
+ return false;
+
+ return wxEntryStart(wxArgs.argc, wxArgs.argv);
+}
+
+WXDLLEXPORT int wxEntry(HINSTANCE hInstance,
+ HINSTANCE WXUNUSED(hPrevInstance),
+ wxCmdLineArgType WXUNUSED(pCmdLine),
+ int nCmdShow)
+{
+ // wxWidgets library doesn't have problems with non-default DPI settings,
+ // so we can mark the app as "DPI aware" for Vista/Win7 (see
+ // http://msdn.microsoft.com/en-us/library/dd464659%28VS.85%29.aspx).
+ // Note that we intentionally do it here and not in wxApp, so that it
+ // doesn't happen if wx code is hosted in another app (e.g. a plugin).
+ // It can be disabled by calling wxMSWAllowChangingDPIAwareness().
+ if ( gs_allowChangingDPIAwareness )
+ wxSetProcessDPIAware();
+
+ if ( !wxMSWEntryCommon(hInstance, nCmdShow) )
+ return -1;
+
+ wxON_BLOCK_EXIT_OBJ0(wxArgs, wxMSWCommandLineArguments::Free);
+
+ return wxEntry(wxArgs.argc, wxArgs.argv);
+}
+
+#endif // wxUSE_GUI
+
+// ----------------------------------------------------------------------------
+// global HINSTANCE
+// ----------------------------------------------------------------------------
+
+#if wxUSE_BASE
+
+HINSTANCE wxhInstance = 0;
+
+extern "C" HINSTANCE wxGetInstance()
+{
+ return wxhInstance;
+}
+
+void wxSetInstance(HINSTANCE hInst)
+{
+ wxhInstance = hInst;
+}
+
+#endif // wxUSE_BASE
diff --git a/win/wxWidgets_additions/wxWidgets-3.0.2/src/msw/window.cpp b/win/wxWidgets_additions/wxWidgets-3.0.2/src/msw/window.cpp
new file mode 100644
index 000000000..9c383935e
--- /dev/null
+++ b/win/wxWidgets_additions/wxWidgets-3.0.2/src/msw/window.cpp
@@ -0,0 +1,7504 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: src/msw/window.cpp
+// Purpose: wxWindowMSW
+// Author: Julian Smart
+// Modified by: VZ on 13.05.99: no more Default(), MSWOnXXX() reorganisation
+// Created: 04/01/98
+// Copyright: (c) Julian Smart
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ===========================================================================
+// declarations
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#include "wx/window.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/msw/wrapwin.h"
+ #include "wx/msw/wrapcctl.h" // include "properly"
+ #include "wx/msw/missing.h"
+ #include "wx/accel.h"
+ #include "wx/menu.h"
+ #include "wx/dc.h"
+ #include "wx/dcclient.h"
+ #include "wx/dcmemory.h"
+ #include "wx/dialog.h"
+ #include "wx/utils.h"
+ #include "wx/app.h"
+ #include "wx/layout.h"
+ #include "wx/dialog.h"
+ #include "wx/frame.h"
+ #include "wx/listbox.h"
+ #include "wx/button.h"
+ #include "wx/msgdlg.h"
+ #include "wx/settings.h"
+ #include "wx/statbox.h"
+ #include "wx/sizer.h"
+ #include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/textctrl.h"
+ #include "wx/menuitem.h"
+ #include "wx/module.h"
+#endif
+
+#if wxUSE_OWNER_DRAWN && !defined(__WXUNIVERSAL__)
+ #include "wx/ownerdrw.h"
+#endif
+
+#include "wx/hashmap.h"
+#include "wx/evtloop.h"
+#include "wx/power.h"
+#include "wx/scopeguard.h"
+#include "wx/sysopt.h"
+
+#if wxUSE_DRAG_AND_DROP
+ #include "wx/dnd.h"
+#endif
+
+#if wxUSE_ACCESSIBILITY
+ #include "wx/access.h"
+ #include
+ #include
+ #ifndef WM_GETOBJECT
+ #define WM_GETOBJECT 0x003D
+ #endif
+ #ifndef OBJID_CLIENT
+ #define OBJID_CLIENT 0xFFFFFFFC
+ #endif
+#endif
+
+#include "wx/msw/private.h"
+#include "wx/msw/private/keyboard.h"
+#include "wx/msw/dcclient.h"
+#include "wx/private/textmeasure.h"
+
+#if wxUSE_TOOLTIPS
+ #include "wx/tooltip.h"
+#endif
+
+#if wxUSE_CARET
+ #include "wx/caret.h"
+#endif // wxUSE_CARET
+
+#if wxUSE_RADIOBOX
+ #include "wx/radiobox.h"
+#endif // wxUSE_RADIOBOX
+
+#if wxUSE_SPINCTRL
+ #include "wx/spinctrl.h"
+#endif // wxUSE_SPINCTRL
+
+#include "wx/notebook.h"
+#include "wx/listctrl.h"
+#include "wx/dynlib.h"
+
+#include
+
+#if (!defined(__GNUWIN32_OLD__) && !defined(__WXMICROWIN__) /* && !defined(__WXWINCE__) */ ) || defined(__CYGWIN10__)
+ #include
+ #include
+#endif
+
+#ifdef __WIN32__
+ #include
+#endif
+
+#if defined(__WXWINCE__)
+ #include "wx/msw/wince/missing.h"
+#ifdef __POCKETPC__
+ #include
+ #include
+ #include
+ #include
+#endif
+#endif
+
+#if wxUSE_UXTHEME
+ #include "wx/msw/uxtheme.h"
+ #define EP_EDITTEXT 1
+ #define ETS_NORMAL 1
+ #define ETS_HOT 2
+ #define ETS_SELECTED 3
+ #define ETS_DISABLED 4
+ #define ETS_FOCUSED 5
+ #define ETS_READONLY 6
+ #define ETS_ASSIST 7
+#endif
+
+// define the constants used by AnimateWindow() if our SDK doesn't have them
+#ifndef AW_CENTER
+ #define AW_HOR_POSITIVE 0x00000001
+ #define AW_HOR_NEGATIVE 0x00000002
+ #define AW_VER_POSITIVE 0x00000004
+ #define AW_VER_NEGATIVE 0x00000008
+ #define AW_CENTER 0x00000010
+ #define AW_HIDE 0x00010000
+ #define AW_ACTIVATE 0x00020000
+ #define AW_SLIDE 0x00040000
+ #define AW_BLEND 0x00080000
+#endif
+
+#if defined(TME_LEAVE) && defined(WM_MOUSELEAVE) && wxUSE_DYNLIB_CLASS
+ #define HAVE_TRACKMOUSEEVENT
+#endif // everything needed for TrackMouseEvent()
+
+// set this to 1 to filter out duplicate mouse events, e.g. mouse move events
+// when mouse position didnd't change
+#ifdef __WXWINCE__
+ #define wxUSE_MOUSEEVENT_HACK 0
+#else
+ #define wxUSE_MOUSEEVENT_HACK 1
+#endif
+
+// not all compilers/platforms have X button related declarations (notably
+// Windows CE doesn't, and probably some old SDKs don't neither)
+#ifdef WM_XBUTTONDOWN
+ #define wxHAS_XBUTTON
+#endif
+
+#ifndef MAPVK_VK_TO_CHAR
+ #define MAPVK_VK_TO_CHAR 2
+#endif
+
+// ---------------------------------------------------------------------------
+// global variables
+// ---------------------------------------------------------------------------
+
+#if wxUSE_MENUS_NATIVE
+extern wxMenu *wxCurrentPopupMenu;
+#endif
+
+#if wxUSE_UXTHEME
+// This is a hack used by the owner-drawn wxButton implementation to ensure
+// that the brush used for erasing its background is correctly aligned with the
+// control.
+wxWindowMSW *wxWindowBeingErased = NULL;
+#endif // wxUSE_UXTHEME
+
+namespace
+{
+
+// true if we had already created the std colour map, used by
+// wxGetStdColourMap() and wxWindow::OnSysColourChanged() (FIXME-MT)
+bool gs_hasStdCmap = false;
+
+// last mouse event information we need to filter out the duplicates
+#if wxUSE_MOUSEEVENT_HACK
+struct MouseEventInfoDummy
+{
+ // mouse position (in screen coordinates)
+ wxPoint pos;
+
+ // last mouse event type
+ wxEventType type;
+} gs_lastMouseEvent;
+#endif // wxUSE_MOUSEEVENT_HACK
+
+// hash containing the registered handlers for the custom messages
+WX_DECLARE_HASH_MAP(int, wxWindow::MSWMessageHandler,
+ wxIntegerHash, wxIntegerEqual,
+ MSWMessageHandlers);
+
+MSWMessageHandlers gs_messageHandlers;
+
+// hash containing all our windows, it uses HWND keys and wxWindow* values
+WX_DECLARE_HASH_MAP(HWND, wxWindow *,
+ wxPointerHash, wxPointerEqual,
+ WindowHandles);
+
+WindowHandles gs_windowHandles;
+
+#ifdef wxHAS_MSW_BACKGROUND_ERASE_HOOK
+
+// temporary override for WM_ERASEBKGND processing: we don't store this in
+// wxWindow itself as we don't need it during most of the time so don't
+// increase the size of all window objects unnecessarily
+WX_DECLARE_HASH_MAP(wxWindow *, wxWindow *,
+ wxPointerHash, wxPointerEqual,
+ EraseBgHooks);
+
+EraseBgHooks gs_eraseBgHooks;
+
+#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
+
+// If this variable is strictly positive, EVT_CHAR_HOOK is not generated for
+// Escape key presses as it can't be intercepted because it's needed by some
+// currently shown window, e.g. IME entry.
+//
+// This is currently global as we allow using UI from the main thread only
+// anyhow but could be replaced with a thread-specific value in the future if
+// needed.
+int gs_modalEntryWindowCount = 0;
+
+// Indicates whether we are currently processing WM_CAPTURECHANGED message.
+bool gs_insideCaptureChanged = false;
+
+} // anonymous namespace
+
+// ---------------------------------------------------------------------------
+// private functions
+// ---------------------------------------------------------------------------
+
+// the window proc for all our windows
+LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
+ WPARAM wParam, LPARAM lParam);
+
+
+#if wxDEBUG_LEVEL >= 2
+ const wxChar *wxGetMessageName(int message);
+#endif // wxDEBUG_LEVEL >= 2
+
+void wxRemoveHandleAssociation(wxWindowMSW *win);
+extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
+
+// get the text metrics for the current font
+static TEXTMETRIC wxGetTextMetrics(const wxWindowMSW *win);
+
+#ifdef __WXWINCE__
+// find the window for the mouse event at the specified position
+static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y);
+#endif // __WXWINCE__
+
+// wrapper around BringWindowToTop() API
+static inline void wxBringWindowToTop(HWND hwnd)
+{
+#ifdef __WXMICROWIN__
+ // It seems that MicroWindows brings the _parent_ of the window to the top,
+ // which can be the wrong one.
+
+ // activate (set focus to) specified window
+ ::SetFocus(hwnd);
+#endif
+
+ // raise top level parent to top of z order
+ if (!::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
+ {
+ wxLogLastError(wxT("SetWindowPos"));
+ }
+}
+
+#ifndef __WXWINCE__
+
+// ensure that all our parent windows have WS_EX_CONTROLPARENT style
+static void EnsureParentHasControlParentStyle(wxWindow *parent)
+{
+ /*
+ If we have WS_EX_CONTROLPARENT flag we absolutely *must* set it for our
+ parent as well as otherwise several Win32 functions using
+ GetNextDlgTabItem() to iterate over all controls such as
+ IsDialogMessage() or DefDlgProc() would enter an infinite loop: indeed,
+ all of them iterate over all the controls starting from the currently
+ focused one and stop iterating when they get back to the focus but
+ unless all parents have WS_EX_CONTROLPARENT bit set, they would never
+ get back to the initial (focused) window: as we do have this style,
+ GetNextDlgTabItem() will leave this window and continue in its parent,
+ but if the parent doesn't have it, it wouldn't recurse inside it later
+ on and so wouldn't have a chance of getting back to this window either.
+ */
+ while ( parent && !parent->IsTopLevel() )
+ {
+ LONG exStyle = wxGetWindowExStyle(parent);
+ if ( !(exStyle & WS_EX_CONTROLPARENT) )
+ {
+ // force the parent to have this style
+ wxSetWindowExStyle(parent, exStyle | WS_EX_CONTROLPARENT);
+ }
+
+ parent = parent->GetParent();
+ }
+}
+
+#endif // !__WXWINCE__
+
+// GetCursorPos can return an error, so use this function
+// instead.
+// Error originally observed with WinCE, but later using Remote Desktop
+// to connect to XP.
+void wxGetCursorPosMSW(POINT* pt)
+{
+ if (!GetCursorPos(pt))
+ {
+#ifdef __WXWINCE__
+ wxLogLastError(wxT("GetCursorPos"));
+#endif
+ DWORD pos = GetMessagePos();
+ // the coordinates may be negative in multi-monitor systems
+ pt->x = GET_X_LPARAM(pos);
+ pt->y = GET_Y_LPARAM(pos);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// event tables
+// ---------------------------------------------------------------------------
+
+// in wxUniv/MSW this class is abstract because it doesn't have DoPopupMenu()
+// method
+#ifdef __WXUNIVERSAL__
+ IMPLEMENT_ABSTRACT_CLASS(wxWindowMSW, wxWindowBase)
+#endif // __WXUNIVERSAL__
+
+BEGIN_EVENT_TABLE(wxWindowMSW, wxWindowBase)
+ EVT_SYS_COLOUR_CHANGED(wxWindowMSW::OnSysColourChanged)
+#ifdef __WXWINCE__
+ EVT_INIT_DIALOG(wxWindowMSW::OnInitDialog)
+#endif
+END_EVENT_TABLE()
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// wxWindow utility functions
+// ---------------------------------------------------------------------------
+
+// Find an item given the MS Windows id
+wxWindow *wxWindowMSW::FindItem(long id, WXHWND hWnd) const
+{
+ // First check for the control itself and its Windows-level children which
+ // are mapped to the same wxWindow at wx level.
+ wxWindow *wnd = MSWFindItem(id, hWnd);
+ if ( wnd )
+ return wnd;
+
+ // Then check wx level children.
+ wxWindowList::compatibility_iterator current = GetChildren().GetFirst();
+ while (current)
+ {
+ wxWindow *childWin = current->GetData();
+
+ wnd = childWin->FindItem(id, hWnd);
+ if ( wnd )
+ return wnd;
+
+ current = current->GetNext();
+ }
+
+ return NULL;
+}
+
+// Find an item given the MS Windows handle
+wxWindow *wxWindowMSW::FindItemByHWND(WXHWND hWnd, bool controlOnly) const
+{
+ wxWindowList::compatibility_iterator current = GetChildren().GetFirst();
+ while (current)
+ {
+ wxWindow *parent = current->GetData();
+
+ // Do a recursive search.
+ wxWindow *wnd = parent->FindItemByHWND(hWnd);
+ if ( wnd )
+ return wnd;
+
+ if ( !controlOnly
+#if wxUSE_CONTROLS
+ || wxDynamicCast(parent, wxControl)
+#endif // wxUSE_CONTROLS
+ )
+ {
+ wxWindow *item = current->GetData();
+ if ( item->GetHWND() == hWnd )
+ return item;
+ else
+ {
+ if ( item->ContainsHWND(hWnd) )
+ return item;
+ }
+ }
+
+ current = current->GetNext();
+ }
+ return NULL;
+}
+
+// Default command handler
+bool wxWindowMSW::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
+{
+ return false;
+}
+
+// ----------------------------------------------------------------------------
+// constructors and such
+// ----------------------------------------------------------------------------
+
+void wxWindowMSW::Init()
+{
+ // MSW specific
+ m_oldWndProc = NULL;
+ m_mouseInWindow = false;
+ m_lastKeydownProcessed = false;
+
+ m_hWnd = 0;
+
+ m_xThumbSize = 0;
+ m_yThumbSize = 0;
+
+#if wxUSE_DEFERRED_SIZING
+ m_hDWP = 0;
+ m_pendingPosition = wxDefaultPosition;
+ m_pendingSize = wxDefaultSize;
+#endif // wxUSE_DEFERRED_SIZING
+
+#ifdef __POCKETPC__
+ m_contextMenuEnabled = false;
+#endif
+}
+
+// Destructor
+wxWindowMSW::~wxWindowMSW()
+{
+ SendDestroyEvent();
+
+#ifndef __WXUNIVERSAL__
+ // VS: make sure there's no wxFrame with last focus set to us:
+ for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
+ {
+ wxTopLevelWindow *frame = wxDynamicCast(win, wxTopLevelWindow);
+ if ( frame )
+ {
+ if ( frame->GetLastFocus() == this )
+ {
+ frame->SetLastFocus(NULL);
+ }
+
+ // apparently sometimes we can end up with our grand parent
+ // pointing to us as well: this is surely a bug in focus handling
+ // code but it's not clear where it happens so for now just try to
+ // fix it here by not breaking out of the loop
+ //break;
+ }
+ }
+#endif // __WXUNIVERSAL__
+
+ // VS: destroy children first and _then_ detach *this from its parent.
+ // If we did it the other way around, children wouldn't be able
+ // find their parent frame (see above).
+ DestroyChildren();
+
+ if ( m_hWnd )
+ {
+ // VZ: test temp removed to understand what really happens here
+ //if (::IsWindow(GetHwnd()))
+ {
+ if ( !::DestroyWindow(GetHwnd()) )
+ {
+ wxLogLastError(wxT("DestroyWindow"));
+ }
+ }
+
+ // remove hWnd <-> wxWindow association
+ wxRemoveHandleAssociation(this);
+ }
+
+}
+
+/* static */
+const wxChar *wxWindowMSW::MSWGetRegisteredClassName()
+{
+ return wxApp::GetRegisteredClassName(wxT("wxWindow"), COLOR_BTNFACE);
+}
+
+// real construction (Init() must have been called before!)
+bool wxWindowMSW::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name)
+{
+ wxCHECK_MSG( parent, false, wxT("can't create wxWindow without parent") );
+
+ if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
+ return false;
+
+ parent->AddChild(this);
+
+ WXDWORD exstyle;
+ DWORD msflags = MSWGetCreateWindowFlags(&exstyle);
+
+#ifdef __WXUNIVERSAL__
+ // no borders, we draw them ourselves
+ exstyle &= ~(WS_EX_DLGMODALFRAME |
+ WS_EX_STATICEDGE |
+ WS_EX_CLIENTEDGE |
+ WS_EX_WINDOWEDGE);
+ msflags &= ~WS_BORDER;
+#endif // wxUniversal
+
+ if ( IsShown() )
+ {
+ msflags |= WS_VISIBLE;
+ }
+
+ if ( !MSWCreate(MSWGetRegisteredClassName(),
+ NULL, pos, size, msflags, exstyle) )
+ return false;
+
+ InheritAttributes();
+
+ return true;
+}
+
+// ---------------------------------------------------------------------------
+// basic operations
+// ---------------------------------------------------------------------------
+
+void wxWindowMSW::SetFocus()
+{
+ HWND hWnd = GetHwnd();
+ wxCHECK_RET( hWnd, wxT("can't set focus to invalid window") );
+
+#if !defined(__WXWINCE__)
+ ::SetLastError(0);
+#endif
+
+ if ( !::SetFocus(hWnd) )
+ {
+ // was there really an error?
+ DWORD dwRes = ::GetLastError();
+ if ( dwRes )
+ {
+ HWND hwndFocus = ::GetFocus();
+ if ( hwndFocus != hWnd )
+ {
+ wxLogApiError(wxT("SetFocus"), dwRes);
+ }
+ }
+ }
+}
+
+void wxWindowMSW::SetFocusFromKbd()
+{
+ // when the focus is given to the control with DLGC_HASSETSEL style from
+ // keyboard its contents should be entirely selected: this is what
+ // ::IsDialogMessage() does and so we should do it as well to provide the
+ // same LNF as the native programs
+ if ( ::SendMessage(GetHwnd(), WM_GETDLGCODE, 0, 0) & DLGC_HASSETSEL )
+ {
+ ::SendMessage(GetHwnd(), EM_SETSEL, 0, -1);
+ }
+
+ // do this after (maybe) setting the selection as like this when
+ // wxEVT_SET_FOCUS handler is called, the selection would have been already
+ // set correctly -- this may be important
+ wxWindowBase::SetFocusFromKbd();
+}
+
+// Get the window with the focus
+wxWindow *wxWindowBase::DoFindFocus()
+{
+ HWND hWnd = ::GetFocus();
+ if ( hWnd )
+ {
+ return wxGetWindowFromHWND((WXHWND)hWnd);
+ }
+
+ return NULL;
+}
+
+void wxWindowMSW::DoEnable( bool enable )
+{
+ MSWEnableHWND(GetHwnd(), enable);
+}
+
+bool wxWindowMSW::MSWEnableHWND(WXHWND hWnd, bool enable)
+{
+ if ( !hWnd )
+ return false;
+
+ // If disabling focused control, we move focus to the next one, as if the
+ // user pressed Tab. That's because we can't keep focus on a disabled
+ // control, Tab-navigation would stop working then.
+ if ( !enable && ::GetFocus() == hWnd )
+ Navigate();
+
+ return ::EnableWindow(hWnd, (BOOL)enable) != 0;
+}
+
+bool wxWindowMSW::Show(bool show)
+{
+ if ( !wxWindowBase::Show(show) )
+ return false;
+
+ HWND hWnd = GetHwnd();
+
+ // we could be called before the underlying window is created (this is
+ // actually useful to prevent it from being initially shown), e.g.
+ //
+ // wxFoo *foo = new wxFoo;
+ // foo->Hide();
+ // foo->Create(parent, ...);
+ //
+ // should work without errors
+ if ( hWnd )
+ {
+ ::ShowWindow(hWnd, show ? SW_SHOW : SW_HIDE);
+ }
+
+ if ( IsFrozen() )
+ {
+ // DoFreeze/DoThaw don't do anything if the window is not shown, so
+ // we have to call them from here now
+ if ( show )
+ DoFreeze();
+ else
+ DoThaw();
+ }
+
+ return true;
+}
+
+bool
+wxWindowMSW::MSWShowWithEffect(bool show,
+ wxShowEffect effect,
+ unsigned timeout)
+{
+#if wxUSE_DYNLIB_CLASS
+ if ( effect == wxSHOW_EFFECT_NONE ||
+ (GetParent() && !GetParent()->IsShownOnScreen()) )
+ return Show(show);
+
+ if ( !wxWindowBase::Show(show) )
+ return false;
+
+ typedef BOOL (WINAPI *AnimateWindow_t)(HWND, DWORD, DWORD);
+
+ static AnimateWindow_t s_pfnAnimateWindow = NULL;
+ static bool s_initDone = false;
+ if ( !s_initDone )
+ {
+ wxDynamicLibrary dllUser32(wxT("user32.dll"), wxDL_VERBATIM | wxDL_QUIET);
+ wxDL_INIT_FUNC(s_pfn, AnimateWindow, dllUser32);
+
+ s_initDone = true;
+
+ // notice that it's ok to unload user32.dll here as it won't be really
+ // unloaded, being still in use because we link to it statically too
+ }
+
+ if ( !s_pfnAnimateWindow )
+ return Show(show);
+
+ // Show() has a side effect of sending a WM_SIZE to the window, which helps
+ // ensuring that it's laid out correctly, but AnimateWindow() doesn't do
+ // this so send the event ourselves
+ SendSizeEvent();
+
+ // prepare to use AnimateWindow()
+
+ if ( !timeout )
+ timeout = 200; // this is the default animation timeout, per MSDN
+
+ DWORD dwFlags = show ? 0 : AW_HIDE;
+
+ switch ( effect )
+ {
+ case wxSHOW_EFFECT_ROLL_TO_LEFT:
+ dwFlags |= AW_HOR_NEGATIVE;
+ break;
+
+ case wxSHOW_EFFECT_ROLL_TO_RIGHT:
+ dwFlags |= AW_HOR_POSITIVE;
+ break;
+
+ case wxSHOW_EFFECT_ROLL_TO_TOP:
+ dwFlags |= AW_VER_NEGATIVE;
+ break;
+
+ case wxSHOW_EFFECT_ROLL_TO_BOTTOM:
+ dwFlags |= AW_VER_POSITIVE;
+ break;
+
+ case wxSHOW_EFFECT_SLIDE_TO_LEFT:
+ dwFlags |= AW_SLIDE | AW_HOR_NEGATIVE;
+ break;
+
+ case wxSHOW_EFFECT_SLIDE_TO_RIGHT:
+ dwFlags |= AW_SLIDE | AW_HOR_POSITIVE;
+ break;
+
+ case wxSHOW_EFFECT_SLIDE_TO_TOP:
+ dwFlags |= AW_SLIDE | AW_VER_NEGATIVE;
+ break;
+
+ case wxSHOW_EFFECT_SLIDE_TO_BOTTOM:
+ dwFlags |= AW_SLIDE | AW_VER_POSITIVE;
+ break;
+
+ case wxSHOW_EFFECT_BLEND:
+ dwFlags |= AW_BLEND;
+ break;
+
+ case wxSHOW_EFFECT_EXPAND:
+ dwFlags |= AW_CENTER;
+ break;
+
+
+ case wxSHOW_EFFECT_MAX:
+ wxFAIL_MSG( wxT("invalid window show effect") );
+ return false;
+
+ default:
+ wxFAIL_MSG( wxT("unknown window show effect") );
+ return false;
+ }
+
+ if ( !(*s_pfnAnimateWindow)(GetHwnd(), timeout, dwFlags) )
+ {
+ wxLogLastError(wxT("AnimateWindow"));
+
+ return false;
+ }
+
+ return true;
+#else // wxUSE_DYNLIB_CLASS
+ return Show(show);
+#endif
+}
+
+// Raise the window to the top of the Z order
+void wxWindowMSW::Raise()
+{
+ wxBringWindowToTop(GetHwnd());
+}
+
+// Lower the window to the bottom of the Z order
+void wxWindowMSW::Lower()
+{
+ ::SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+}
+
+void wxWindowMSW::DoCaptureMouse()
+{
+ HWND hWnd = GetHwnd();
+ if ( hWnd )
+ {
+ ::SetCapture(hWnd);
+ }
+}
+
+void wxWindowMSW::DoReleaseMouse()
+{
+ if ( !::ReleaseCapture() )
+ {
+ wxLogLastError(wxT("ReleaseCapture"));
+ }
+}
+
+/* static */ wxWindow *wxWindowBase::GetCapture()
+{
+ // When we receive WM_CAPTURECHANGED message, ::GetCapture() still returns
+ // the HWND that is losing the mouse capture. But as we must not release
+ // the capture for it (it's going to happen anyhow), pretend that there is
+ // no capture any more.
+ if ( gs_insideCaptureChanged )
+ return NULL;
+
+ HWND hwnd = ::GetCapture();
+ return hwnd ? wxFindWinFromHandle(hwnd) : NULL;
+}
+
+bool wxWindowMSW::SetFont(const wxFont& font)
+{
+ if ( !wxWindowBase::SetFont(font) )
+ {
+ // nothing to do
+ return false;
+ }
+
+ HWND hWnd = GetHwnd();
+ if ( hWnd != 0 )
+ {
+ // note the use of GetFont() instead of m_font: our own font could have
+ // just been reset and in this case we need to change the font used by
+ // the native window to the default for this class, i.e. exactly what
+ // GetFont() returns
+ WXHANDLE hFont = GetFont().GetResourceHandle();
+
+ wxASSERT_MSG( hFont, wxT("should have valid font") );
+
+ ::SendMessage(hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
+ }
+
+ return true;
+}
+
+bool wxWindowMSW::SetCursor(const wxCursor& cursor)
+{
+ if ( !wxWindowBase::SetCursor(cursor) )
+ {
+ // no change
+ return false;
+ }
+
+ // don't "overwrite" busy cursor
+ if ( wxIsBusy() )
+ return true;
+
+ if ( m_cursor.IsOk() )
+ {
+ // normally we should change the cursor only if it's over this window
+ // but we should do it always if we capture the mouse currently
+ bool set = HasCapture();
+ if ( !set )
+ {
+ HWND hWnd = GetHwnd();
+
+ POINT point;
+ ::wxGetCursorPosMSW(&point);
+
+ RECT rect = wxGetWindowRect(hWnd);
+
+ set = ::PtInRect(&rect, point) != 0;
+ }
+
+ if ( set )
+ {
+ ::SetCursor(GetHcursorOf(m_cursor));
+ }
+ //else: will be set later when the mouse enters this window
+ }
+ else // Invalid cursor: this means reset to the default one.
+ {
+ // To revert to the correct cursor we need to find the window currently
+ // under the cursor and ask it to set its cursor itself as only it
+ // knows what it is.
+ POINT pt;
+ wxGetCursorPosMSW(&pt);
+
+ const wxWindowMSW* win = wxFindWindowAtPoint(wxPoint(pt.x, pt.y));
+ if ( !win )
+ win = this;
+
+ ::SendMessage(GetHwndOf(win), WM_SETCURSOR,
+ (WPARAM)GetHwndOf(win),
+ MAKELPARAM(HTCLIENT, WM_MOUSEMOVE));
+ }
+
+ return true;
+}
+
+void wxWindowMSW::WarpPointer(int x, int y)
+{
+ ClientToScreen(&x, &y);
+
+ if ( !::SetCursorPos(x, y) )
+ {
+ wxLogLastError(wxT("SetCursorPos"));
+ }
+}
+
+void wxWindowMSW::MSWUpdateUIState(int action, int state)
+{
+ // WM_CHANGEUISTATE only appeared in Windows 2000 so it can do us no good
+ // to use it on older systems -- and could possibly do some harm
+ static int s_needToUpdate = -1;
+ if ( s_needToUpdate == -1 )
+ {
+ int verMaj, verMin;
+ s_needToUpdate = wxGetOsVersion(&verMaj, &verMin) == wxOS_WINDOWS_NT &&
+ verMaj >= 5;
+ }
+
+ if ( s_needToUpdate )
+ {
+ // we send WM_CHANGEUISTATE so if nothing needs changing then the system
+ // won't send WM_UPDATEUISTATE
+ ::SendMessage(GetHwnd(), WM_CHANGEUISTATE, MAKEWPARAM(action, state), 0);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// scrolling stuff
+// ---------------------------------------------------------------------------
+
+namespace
+{
+
+inline int GetScrollPosition(HWND hWnd, int wOrient)
+{
+#ifdef __WXMICROWIN__
+ return ::GetScrollPosWX(hWnd, wOrient);
+#else
+ WinStruct scrollInfo;
+ scrollInfo.cbSize = sizeof(SCROLLINFO);
+ scrollInfo.fMask = SIF_POS;
+ ::GetScrollInfo(hWnd, wOrient, &scrollInfo );
+
+ return scrollInfo.nPos;
+
+#endif
+}
+
+inline UINT WXOrientToSB(int orient)
+{
+ return orient == wxHORIZONTAL ? SB_HORZ : SB_VERT;
+}
+
+} // anonymous namespace
+
+int wxWindowMSW::GetScrollPos(int orient) const
+{
+ HWND hWnd = GetHwnd();
+ wxCHECK_MSG( hWnd, 0, wxT("no HWND in GetScrollPos") );
+
+ return GetScrollPosition(hWnd, WXOrientToSB(orient));
+}
+
+// This now returns the whole range, not just the number
+// of positions that we can scroll.
+int wxWindowMSW::GetScrollRange(int orient) const
+{
+ int maxPos;
+ HWND hWnd = GetHwnd();
+ if ( !hWnd )
+ return 0;
+ WinStruct scrollInfo;
+ scrollInfo.fMask = SIF_RANGE;
+ if ( !::GetScrollInfo(hWnd, WXOrientToSB(orient), &scrollInfo) )
+ {
+ // Most of the time this is not really an error, since the return
+ // value can also be zero when there is no scrollbar yet.
+ // wxLogLastError(wxT("GetScrollInfo"));
+ }
+ maxPos = scrollInfo.nMax;
+
+ // undo "range - 1" done in SetScrollbar()
+ return maxPos + 1;
+}
+
+int wxWindowMSW::GetScrollThumb(int orient) const
+{
+ return orient == wxHORIZONTAL ? m_xThumbSize : m_yThumbSize;
+}
+
+void wxWindowMSW::SetScrollPos(int orient, int pos, bool refresh)
+{
+ HWND hWnd = GetHwnd();
+ wxCHECK_RET( hWnd, wxT("SetScrollPos: no HWND") );
+
+ WinStruct info;
+ info.nPage = 0;
+ info.nMin = 0;
+ info.nPos = pos;
+ info.fMask = SIF_POS;
+ if ( HasFlag(wxALWAYS_SHOW_SB) )
+ {
+ // disable scrollbar instead of removing it then
+ info.fMask |= SIF_DISABLENOSCROLL;
+ }
+
+ ::SetScrollInfo(hWnd, WXOrientToSB(orient), &info, refresh);
+}
+
+// New function that will replace some of the above.
+void wxWindowMSW::SetScrollbar(int orient,
+ int pos,
+ int pageSize,
+ int range,
+ bool refresh)
+{
+ // We have to set the variables here to make them valid in events
+ // triggered by ::SetScrollInfo()
+ *(orient == wxHORIZONTAL ? &m_xThumbSize : &m_yThumbSize) = pageSize;
+
+ HWND hwnd = GetHwnd();
+ if ( !hwnd )
+ return;
+
+ WinStruct info;
+ if ( range != -1 )
+ {
+ info.nPage = pageSize;
+ info.nMin = 0; // range is nMax - nMin + 1
+ info.nMax = range - 1; // as both nMax and nMax are inclusive
+ info.nPos = pos;
+
+ // We normally also reenable scrollbar in case it had been previously
+ // disabled by specifying SIF_DISABLENOSCROLL below but we should only
+ // do this if it has valid range, otherwise it would be enabled but not
+ // do anything.
+ if ( range >= pageSize )
+ {
+ ::EnableScrollBar(hwnd, WXOrientToSB(orient), ESB_ENABLE_BOTH);
+ }
+ }
+ //else: leave all the fields to be 0
+
+ info.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
+ if ( HasFlag(wxALWAYS_SHOW_SB) || range == -1 )
+ {
+ // disable scrollbar instead of removing it then
+ info.fMask |= SIF_DISABLENOSCROLL;
+ }
+
+ ::SetScrollInfo(hwnd, WXOrientToSB(orient), &info, refresh);
+}
+
+void wxWindowMSW::ScrollWindow(int dx, int dy, const wxRect *prect)
+{
+ RECT rect;
+ RECT *pr;
+ if ( prect )
+ {
+ wxCopyRectToRECT(*prect, rect);
+ pr = ▭
+ }
+ else
+ {
+ pr = NULL;
+
+ }
+
+#ifdef __WXWINCE__
+ // FIXME: is this the exact equivalent of the line below?
+ ::ScrollWindowEx(GetHwnd(), dx, dy, pr, pr, 0, 0, SW_SCROLLCHILDREN|SW_ERASE|SW_INVALIDATE);
+#else
+ ::ScrollWindow(GetHwnd(), dx, dy, pr, pr);
+#endif
+}
+
+static bool ScrollVertically(HWND hwnd, int kind, int count)
+{
+ int posStart = GetScrollPosition(hwnd, SB_VERT);
+
+ int pos = posStart;
+ for ( int n = 0; n < count; n++ )
+ {
+ ::SendMessage(hwnd, WM_VSCROLL, kind, 0);
+
+ int posNew = GetScrollPosition(hwnd, SB_VERT);
+ if ( posNew == pos )
+ {
+ // don't bother to continue, we're already at top/bottom
+ break;
+ }
+
+ pos = posNew;
+ }
+
+ return pos != posStart;
+}
+
+bool wxWindowMSW::ScrollLines(int lines)
+{
+ bool down = lines > 0;
+
+ return ScrollVertically(GetHwnd(),
+ down ? SB_LINEDOWN : SB_LINEUP,
+ down ? lines : -lines);
+}
+
+bool wxWindowMSW::ScrollPages(int pages)
+{
+ bool down = pages > 0;
+
+ return ScrollVertically(GetHwnd(),
+ down ? SB_PAGEDOWN : SB_PAGEUP,
+ down ? pages : -pages);
+}
+
+// ----------------------------------------------------------------------------
+// RTL support
+// ----------------------------------------------------------------------------
+
+void wxWindowMSW::SetLayoutDirection(wxLayoutDirection dir)
+{
+#ifdef __WXWINCE__
+ wxUnusedVar(dir);
+#else
+ wxCHECK_RET( GetHwnd(),
+ wxT("layout direction must be set after window creation") );
+
+ LONG styleOld = wxGetWindowExStyle(this);
+
+ LONG styleNew = styleOld;
+ switch ( dir )
+ {
+ case wxLayout_LeftToRight:
+ styleNew &= ~WS_EX_LAYOUTRTL;
+ break;
+
+ case wxLayout_RightToLeft:
+ styleNew |= WS_EX_LAYOUTRTL;
+ break;
+
+ default:
+ wxFAIL_MSG(wxT("unsupported layout direction"));
+ break;
+ }
+
+ if ( styleNew != styleOld )
+ {
+ wxSetWindowExStyle(this, styleNew);
+
+ // Update layout: whether we have children or are drawing something, we
+ // need to redo it with the new layout.
+ SendSizeEvent();
+ Refresh();
+ }
+#endif
+}
+
+wxLayoutDirection wxWindowMSW::GetLayoutDirection() const
+{
+#ifdef __WXWINCE__
+ return wxLayout_Default;
+#else
+ wxCHECK_MSG( GetHwnd(), wxLayout_Default, wxT("invalid window") );
+
+ return wxHasWindowExStyle(this, WS_EX_LAYOUTRTL) ? wxLayout_RightToLeft
+ : wxLayout_LeftToRight;
+#endif
+}
+
+wxCoord
+wxWindowMSW::AdjustForLayoutDirection(wxCoord x,
+ wxCoord WXUNUSED(width),
+ wxCoord WXUNUSED(widthTotal)) const
+{
+ // Win32 mirrors the coordinates of RTL windows automatically, so don't
+ // redo it ourselves
+ return x;
+}
+
+// ---------------------------------------------------------------------------
+// subclassing
+// ---------------------------------------------------------------------------
+
+void wxWindowMSW::SubclassWin(WXHWND hWnd)
+{
+ wxASSERT_MSG( !m_oldWndProc, wxT("subclassing window twice?") );
+
+ HWND hwnd = (HWND)hWnd;
+ wxCHECK_RET( ::IsWindow(hwnd), wxT("invalid HWND in SubclassWin") );
+
+ SetHWND(hWnd);
+
+ wxAssociateWinWithHandle(hwnd, this);
+
+ m_oldWndProc = (WXFARPROC)wxGetWindowProc((HWND)hWnd);
+
+ // we don't need to subclass the window of our own class (in the Windows
+ // sense of the word)
+ if ( !wxCheckWindowWndProc(hWnd, (WXFARPROC)wxWndProc) )
+ {
+ wxSetWindowProc(hwnd, wxWndProc);
+
+ // If the window didn't use our window proc during its creation, the
+ // code in HandleCreate() hasn't been executed, so do it here.
+ if ( wxHasWindowExStyle(this, WS_EX_CONTROLPARENT) )
+ EnsureParentHasControlParentStyle(GetParent());
+ }
+ else
+ {
+ // don't bother restoring it either: this also makes it easy to
+ // implement IsOfStandardClass() method which returns true for the
+ // standard controls and false for the wxWidgets own windows as it can
+ // simply check m_oldWndProc
+ m_oldWndProc = NULL;
+ }
+
+ // we're officially created now, send the event
+ wxWindowCreateEvent event((wxWindow *)this);
+ (void)HandleWindowEvent(event);
+}
+
+void wxWindowMSW::UnsubclassWin()
+{
+ wxRemoveHandleAssociation(this);
+
+ // Restore old Window proc
+ HWND hwnd = GetHwnd();
+ if ( hwnd )
+ {
+ SetHWND(0);
+
+ wxCHECK_RET( ::IsWindow(hwnd), wxT("invalid HWND in UnsubclassWin") );
+
+ if ( m_oldWndProc )
+ {
+ if ( !wxCheckWindowWndProc((WXHWND)hwnd, m_oldWndProc) )
+ {
+ wxSetWindowProc(hwnd, (WNDPROC)m_oldWndProc);
+ }
+
+ m_oldWndProc = NULL;
+ }
+ }
+}
+
+void wxWindowMSW::AssociateHandle(WXWidget handle)
+{
+ if ( m_hWnd )
+ {
+ if ( !::DestroyWindow(GetHwnd()) )
+ {
+ wxLogLastError(wxT("DestroyWindow"));
+ }
+ }
+
+ WXHWND wxhwnd = (WXHWND)handle;
+
+ // this also calls SetHWND(wxhwnd)
+ SubclassWin(wxhwnd);
+}
+
+void wxWindowMSW::DissociateHandle()
+{
+ // this also calls SetHWND(0) for us
+ UnsubclassWin();
+}
+
+
+bool wxCheckWindowWndProc(WXHWND hWnd,
+ WXFARPROC WXUNUSED(wndProc))
+{
+ const wxString str(wxGetWindowClass(hWnd));
+
+ // TODO: get rid of wxTLWHiddenParent special case (currently it's not
+ // registered by wxApp but using ad hoc code in msw/toplevel.cpp);
+ // there is also a hidden window class used by sockets &c
+ return wxApp::IsRegisteredClassName(str) || str == wxT("wxTLWHiddenParent");
+}
+
+// ----------------------------------------------------------------------------
+// Style handling
+// ----------------------------------------------------------------------------
+
+void wxWindowMSW::SetWindowStyleFlag(long flags)
+{
+ long flagsOld = GetWindowStyleFlag();
+ if ( flags == flagsOld )
+ return;
+
+ // update the internal variable
+ wxWindowBase::SetWindowStyleFlag(flags);
+
+ // and the real window flags
+ MSWUpdateStyle(flagsOld, GetExtraStyle());
+}
+
+void wxWindowMSW::SetExtraStyle(long exflags)
+{
+ long exflagsOld = GetExtraStyle();
+ if ( exflags == exflagsOld )
+ return;
+
+ // update the internal variable
+ wxWindowBase::SetExtraStyle(exflags);
+
+ // and the real window flags
+ MSWUpdateStyle(GetWindowStyleFlag(), exflagsOld);
+}
+
+void wxWindowMSW::MSWUpdateStyle(long flagsOld, long exflagsOld)
+{
+ // now update the Windows style as well if needed - and if the window had
+ // been already created
+ if ( !GetHwnd() )
+ return;
+
+ // we may need to call SetWindowPos() when we change some styles
+ bool callSWP = false;
+
+ WXDWORD exstyle;
+ long style = MSWGetStyle(GetWindowStyleFlag(), &exstyle);
+
+ // this is quite a horrible hack but we need it because MSWGetStyle()
+ // doesn't take exflags as parameter but uses GetExtraStyle() internally
+ // and so we have to modify the window exflags temporarily to get the
+ // correct exstyleOld
+ long exflagsNew = GetExtraStyle();
+ wxWindowBase::SetExtraStyle(exflagsOld);
+
+ WXDWORD exstyleOld;
+ long styleOld = MSWGetStyle(flagsOld, &exstyleOld);
+
+ wxWindowBase::SetExtraStyle(exflagsNew);
+
+
+ if ( style != styleOld )
+ {
+ // some flags (e.g. WS_VISIBLE or WS_DISABLED) should not be changed by
+ // this function so instead of simply setting the style to the new
+ // value we clear the bits which were set in styleOld but are set in
+ // the new one and set the ones which were not set before
+ long styleReal = ::GetWindowLong(GetHwnd(), GWL_STYLE);
+ styleReal &= ~styleOld;
+ styleReal |= style;
+
+ ::SetWindowLong(GetHwnd(), GWL_STYLE, styleReal);
+
+ // we need to call SetWindowPos() if any of the styles affecting the
+ // frame appearance have changed
+ callSWP = ((styleOld ^ style ) & (WS_BORDER |
+ WS_THICKFRAME |
+ WS_CAPTION |
+ WS_DLGFRAME |
+ WS_MAXIMIZEBOX |
+ WS_MINIMIZEBOX |
+ WS_SYSMENU) ) != 0;
+ }
+
+ // and the extended style
+ long exstyleReal = wxGetWindowExStyle(this);
+
+ if ( exstyle != exstyleOld )
+ {
+ exstyleReal &= ~exstyleOld;
+ exstyleReal |= exstyle;
+
+ wxSetWindowExStyle(this, exstyleReal);
+
+ // ex style changes don't take effect without calling SetWindowPos
+ callSWP = true;
+ }
+
+ if ( callSWP )
+ {
+ // we must call SetWindowPos() to flush the cached extended style and
+ // also to make the change to wxSTAY_ON_TOP style take effect: just
+ // setting the style simply doesn't work
+ if ( !::SetWindowPos(GetHwnd(),
+ exstyleReal & WS_EX_TOPMOST ? HWND_TOPMOST
+ : HWND_NOTOPMOST,
+ 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE |
+ SWP_FRAMECHANGED) )
+ {
+ wxLogLastError(wxT("SetWindowPos"));
+ }
+ }
+}
+
+wxBorder wxWindowMSW::GetDefaultBorderForControl() const
+{
+ return wxBORDER_THEME;
+}
+
+wxBorder wxWindowMSW::GetDefaultBorder() const
+{
+ return wxWindowBase::GetDefaultBorder();
+}
+
+// Translate wxBORDER_THEME (and other border styles if necessary) to the value
+// that makes most sense for this Windows environment
+wxBorder wxWindowMSW::TranslateBorder(wxBorder border) const
+{
+#if defined(__POCKETPC__) || defined(__SMARTPHONE__)
+ if (border == wxBORDER_THEME || border == wxBORDER_SUNKEN || border == wxBORDER_SIMPLE)
+ return wxBORDER_SIMPLE;
+ else
+ return wxBORDER_NONE;
+#else
+#if wxUSE_UXTHEME
+ if (border == wxBORDER_THEME)
+ {
+ if (CanApplyThemeBorder())
+ {
+ wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
+ if (theme)
+ return wxBORDER_THEME;
+ }
+ return wxBORDER_SUNKEN;
+ }
+#endif
+ return border;
+#endif
+}
+
+
+WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
+{
+ // translate common wxWidgets styles to Windows ones
+
+ // most of windows are child ones, those which are not (such as
+ // wxTopLevelWindow) should remove WS_CHILD in their MSWGetStyle()
+ WXDWORD style = WS_CHILD;
+
+ // using this flag results in very significant reduction in flicker,
+ // especially with controls inside the static boxes (as the interior of the
+ // box is not redrawn twice), but sometimes results in redraw problems, so
+ // optionally allow the old code to continue to use it provided a special
+ // system option is turned on
+ if ( !wxSystemOptions::GetOptionInt(wxT("msw.window.no-clip-children"))
+ || (flags & wxCLIP_CHILDREN) )
+ style |= WS_CLIPCHILDREN;
+
+ // it doesn't seem useful to use WS_CLIPSIBLINGS here as we officially
+ // don't support overlapping windows and it only makes sense for them and,
+ // presumably, gives the system some extra work (to manage more clipping
+ // regions), so avoid it altogether
+
+
+ if ( flags & wxVSCROLL )
+ style |= WS_VSCROLL;
+
+ if ( flags & wxHSCROLL )
+ style |= WS_HSCROLL;
+
+ const wxBorder border = TranslateBorder(GetBorder(flags));
+
+ // After translation, border is now optimized for the specific version of Windows
+ // and theme engine presence.
+
+ // WS_BORDER is only required for wxBORDER_SIMPLE
+ if ( border == wxBORDER_SIMPLE )
+ style |= WS_BORDER;
+
+ // now deal with ext style if the caller wants it
+ if ( exstyle )
+ {
+ *exstyle = 0;
+
+#ifndef __WXWINCE__
+ if ( flags & wxTRANSPARENT_WINDOW )
+ *exstyle |= WS_EX_TRANSPARENT;
+#endif
+
+ switch ( border )
+ {
+ default:
+ case wxBORDER_DEFAULT:
+ wxFAIL_MSG( wxT("unknown border style") );
+ // fall through
+
+ case wxBORDER_NONE:
+ case wxBORDER_SIMPLE:
+ case wxBORDER_THEME:
+ break;
+
+ case wxBORDER_STATIC:
+ *exstyle |= WS_EX_STATICEDGE;
+ break;
+
+ case wxBORDER_RAISED:
+ *exstyle |= WS_EX_DLGMODALFRAME;
+ break;
+
+ case wxBORDER_SUNKEN:
+ *exstyle |= WS_EX_CLIENTEDGE;
+ style &= ~WS_BORDER;
+ break;
+
+// case wxBORDER_DOUBLE:
+// *exstyle |= WS_EX_DLGMODALFRAME;
+// break;
+ }
+
+ // wxUniv doesn't use Windows dialog navigation functions at all
+#if !defined(__WXUNIVERSAL__) && !defined(__WXWINCE__)
+ // to make the dialog navigation work with the nested panels we must
+ // use this style (top level windows such as dialogs don't need it)
+ if ( (flags & wxTAB_TRAVERSAL) && !IsTopLevel() )
+ {
+ *exstyle |= WS_EX_CONTROLPARENT;
+ }
+#endif // __WXUNIVERSAL__
+ }
+
+ return style;
+}
+
+// Setup background and foreground colours correctly
+void wxWindowMSW::SetupColours()
+{
+ if ( GetParent() )
+ SetBackgroundColour(GetParent()->GetBackgroundColour());
+}
+
+bool wxWindowMSW::IsMouseInWindow() const
+{
+ // get the mouse position
+ POINT pt;
+ wxGetCursorPosMSW(&pt);
+
+ // find the window which currently has the cursor and go up the window
+ // chain until we find this window - or exhaust it
+ HWND hwnd = ::WindowFromPoint(pt);
+ while ( hwnd && (hwnd != GetHwnd()) )
+ hwnd = ::GetParent(hwnd);
+
+ return hwnd != NULL;
+}
+
+void wxWindowMSW::OnInternalIdle()
+{
+#ifndef HAVE_TRACKMOUSEEVENT
+ // Check if we need to send a LEAVE event
+ if ( m_mouseInWindow )
+ {
+ // note that we should generate the leave event whether the window has
+ // or doesn't have mouse capture
+ if ( !IsMouseInWindow() )
+ {
+ GenerateMouseLeave();
+ }
+ }
+#endif // !HAVE_TRACKMOUSEEVENT
+
+ wxWindowBase::OnInternalIdle();
+}
+
+// Set this window to be the child of 'parent'.
+bool wxWindowMSW::Reparent(wxWindowBase *parent)
+{
+ if ( !wxWindowBase::Reparent(parent) )
+ return false;
+
+ HWND hWndChild = GetHwnd();
+ HWND hWndParent = GetParent() ? GetWinHwnd(GetParent()) : (HWND)0;
+
+ ::SetParent(hWndChild, hWndParent);
+
+#ifndef __WXWINCE__
+ if ( wxHasWindowExStyle(this, WS_EX_CONTROLPARENT) )
+ {
+ EnsureParentHasControlParentStyle(GetParent());
+ }
+#endif // !__WXWINCE__
+
+ return true;
+}
+
+static inline void SendSetRedraw(HWND hwnd, bool on)
+{
+#ifndef __WXMICROWIN__
+ ::SendMessage(hwnd, WM_SETREDRAW, (WPARAM)on, 0);
+#endif
+}
+
+void wxWindowMSW::DoFreeze()
+{
+ if ( !IsShown() )
+ return; // no point in freezing hidden window
+
+ SendSetRedraw(GetHwnd(), false);
+}
+
+void wxWindowMSW::DoThaw()
+{
+ if ( !IsShown() )
+ return; // hidden windows aren't frozen by DoFreeze
+
+ SendSetRedraw(GetHwnd(), true);
+
+ // we need to refresh everything or otherwise the invalidated area
+ // is not going to be repainted
+ Refresh();
+}
+
+void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)
+{
+ HWND hWnd = GetHwnd();
+ if ( hWnd )
+ {
+ RECT mswRect;
+ const RECT *pRect;
+ if ( rect )
+ {
+ wxCopyRectToRECT(*rect, mswRect);
+ pRect = &mswRect;
+ }
+ else
+ {
+ pRect = NULL;
+ }
+
+ // RedrawWindow not available on SmartPhone or eVC++ 3
+#if !defined(__SMARTPHONE__) && !(defined(_WIN32_WCE) && _WIN32_WCE < 400)
+ UINT flags = RDW_INVALIDATE | RDW_ALLCHILDREN;
+ if ( eraseBack )
+ flags |= RDW_ERASE;
+
+ ::RedrawWindow(hWnd, pRect, NULL, flags);
+#else
+ ::InvalidateRect(hWnd, pRect, eraseBack);
+#endif
+ }
+}
+
+void wxWindowMSW::Update()
+{
+ if ( !::UpdateWindow(GetHwnd()) )
+ {
+ wxLogLastError(wxT("UpdateWindow"));
+ }
+
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+ // just calling UpdateWindow() is not enough, what we did in our WM_PAINT
+ // handler needs to be really drawn right now
+ (void)::GdiFlush();
+#endif // __WIN32__
+}
+
+// ---------------------------------------------------------------------------
+// drag and drop
+// ---------------------------------------------------------------------------
+
+#if wxUSE_DRAG_AND_DROP || !defined(__WXWINCE__)
+
+#if wxUSE_STATBOX
+
+// we need to lower the sibling static boxes so controls contained within can be
+// a drop target
+static void AdjustStaticBoxZOrder(wxWindow *parent)
+{
+ // no sibling static boxes if we have no parent (ie TLW)
+ if ( !parent )
+ return;
+
+ for ( wxWindowList::compatibility_iterator node = parent->GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxStaticBox *statbox = wxDynamicCast(node->GetData(), wxStaticBox);
+ if ( statbox )
+ {
+ ::SetWindowPos(GetHwndOf(statbox), HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ }
+ }
+}
+
+#else // !wxUSE_STATBOX
+
+static inline void AdjustStaticBoxZOrder(wxWindow * WXUNUSED(parent))
+{
+}
+
+#endif // wxUSE_STATBOX/!wxUSE_STATBOX
+
+#endif // drag and drop is used
+
+#if wxUSE_DRAG_AND_DROP
+void wxWindowMSW::SetDropTarget(wxDropTarget *pDropTarget)
+{
+ if ( m_dropTarget != 0 ) {
+ m_dropTarget->Revoke(m_hWnd);
+ delete m_dropTarget;
+ }
+
+ m_dropTarget = pDropTarget;
+ if ( m_dropTarget != 0 )
+ {
+ AdjustStaticBoxZOrder(GetParent());
+ m_dropTarget->Register(m_hWnd);
+ }
+}
+#endif // wxUSE_DRAG_AND_DROP
+
+// old-style file manager drag&drop support: we retain the old-style
+// DragAcceptFiles in parallel with SetDropTarget.
+void wxWindowMSW::DragAcceptFiles(bool WXUNUSED_IN_WINCE(accept))
+{
+#ifndef __WXWINCE__
+ HWND hWnd = GetHwnd();
+ if ( hWnd )
+ {
+ AdjustStaticBoxZOrder(GetParent());
+ ::DragAcceptFiles(hWnd, (BOOL)accept);
+ }
+#endif
+}
+
+// ----------------------------------------------------------------------------
+// tooltips
+// ----------------------------------------------------------------------------
+
+#if wxUSE_TOOLTIPS
+
+void wxWindowMSW::DoSetToolTip(wxToolTip *tooltip)
+{
+ wxWindowBase::DoSetToolTip(tooltip);
+
+ if ( m_tooltip )
+ m_tooltip->SetWindow((wxWindow *)this);
+}
+
+#endif // wxUSE_TOOLTIPS
+
+// ---------------------------------------------------------------------------
+// moving and resizing
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::IsSizeDeferred() const
+{
+#if wxUSE_DEFERRED_SIZING
+ if ( m_pendingPosition != wxDefaultPosition ||
+ m_pendingSize != wxDefaultSize )
+ return true;
+#endif // wxUSE_DEFERRED_SIZING
+
+ return false;
+}
+
+// Get total size
+void wxWindowMSW::DoGetSize(int *x, int *y) const
+{
+#if wxUSE_DEFERRED_SIZING
+ // if SetSize() had been called at wx level but not realized at Windows
+ // level yet (i.e. EndDeferWindowPos() not called), we still should return
+ // the new and not the old position to the other wx code
+ if ( m_pendingSize != wxDefaultSize )
+ {
+ if ( x )
+ *x = m_pendingSize.x;
+ if ( y )
+ *y = m_pendingSize.y;
+ }
+ else // use current size
+#endif // wxUSE_DEFERRED_SIZING
+ {
+ RECT rect = wxGetWindowRect(GetHwnd());
+
+ if ( x )
+ *x = rect.right - rect.left;
+ if ( y )
+ *y = rect.bottom - rect.top;
+ }
+}
+
+// Get size *available for subwindows* i.e. excluding menu bar etc.
+void wxWindowMSW::DoGetClientSize(int *x, int *y) const
+{
+#if wxUSE_DEFERRED_SIZING
+ if ( m_pendingSize != wxDefaultSize )
+ {
+ // we need to calculate the client size corresponding to pending size
+ //
+ // FIXME: Unfortunately this doesn't work correctly for the maximized
+ // top level windows, the returned values are too small (e.g.
+ // under Windows 7 on a 1600*1200 screen with task bar on the
+ // right the pending size for a maximized window is 1538*1200
+ // and WM_NCCALCSIZE returns 1528*1172 even though the correct
+ // client size of such window is 1538*1182). No idea how to fix
+ // it though, setting WS_MAXIMIZE in GWL_STYLE before calling
+ // WM_NCCALCSIZE doesn't help and AdjustWindowRectEx() doesn't
+ // work in this direction neither. So we just have to live with
+ // the slightly wrong results and relayout the window when it
+ // gets finally shown in its maximized state (see #11762).
+ RECT rect;
+ rect.left = m_pendingPosition.x;
+ rect.top = m_pendingPosition.y;
+ rect.right = rect.left + m_pendingSize.x;
+ rect.bottom = rect.top + m_pendingSize.y;
+
+ ::SendMessage(GetHwnd(), WM_NCCALCSIZE, FALSE, (LPARAM)&rect);
+
+ if ( x )
+ *x = rect.right - rect.left;
+ if ( y )
+ *y = rect.bottom - rect.top;
+ }
+ else
+#endif // wxUSE_DEFERRED_SIZING
+ {
+ RECT rect = wxGetClientRect(GetHwnd());
+
+ if ( x )
+ *x = rect.right;
+ if ( y )
+ *y = rect.bottom;
+ }
+
+ // The size of the client window can't be negative but ::GetClientRect()
+ // can return negative size for an extremely small (1x1) window with
+ // borders so ensure that we correct it here as having negative sizes is
+ // completely unexpected.
+ if ( x && *x < 0 )
+ *x = 0;
+ if ( y && *y < 0 )
+ *y = 0;
+}
+
+void wxWindowMSW::DoGetPosition(int *x, int *y) const
+{
+ wxWindow * const parent = GetParent();
+
+ wxPoint pos;
+#if wxUSE_DEFERRED_SIZING
+ if ( m_pendingPosition != wxDefaultPosition )
+ {
+ pos = m_pendingPosition;
+ }
+ else // use current position
+#endif // wxUSE_DEFERRED_SIZING
+ {
+ RECT rect = wxGetWindowRect(GetHwnd());
+
+ // we do the adjustments with respect to the parent only for the "real"
+ // children, not for the dialogs/frames
+ if ( !IsTopLevel() )
+ {
+ // In RTL mode, we want the logical left x-coordinate,
+ // which would be the physical right x-coordinate.
+ ::MapWindowPoints(NULL, parent ? GetHwndOf(parent) : HWND_DESKTOP,
+ (LPPOINT)&rect, 2);
+ }
+
+ pos.x = rect.left;
+ pos.y = rect.top;
+ }
+
+ // we also must adjust by the client area offset: a control which is just
+ // under a toolbar could be at (0, 30) in Windows but at (0, 0) in wx
+ if ( parent && !IsTopLevel() )
+ {
+ const wxPoint pt(parent->GetClientAreaOrigin());
+ pos.x -= pt.x;
+ pos.y -= pt.y;
+ }
+
+ if ( x )
+ *x = pos.x;
+ if ( y )
+ *y = pos.y;
+}
+
+void wxWindowMSW::DoScreenToClient(int *x, int *y) const
+{
+ POINT pt;
+ if ( x )
+ pt.x = *x;
+ if ( y )
+ pt.y = *y;
+
+ ::ScreenToClient(GetHwnd(), &pt);
+
+ if ( x )
+ *x = pt.x;
+ if ( y )
+ *y = pt.y;
+}
+
+void wxWindowMSW::DoClientToScreen(int *x, int *y) const
+{
+ POINT pt;
+ if ( x )
+ pt.x = *x;
+ if ( y )
+ pt.y = *y;
+
+ ::ClientToScreen(GetHwnd(), &pt);
+
+ if ( x )
+ *x = pt.x;
+ if ( y )
+ *y = pt.y;
+}
+
+bool
+wxWindowMSW::DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height)
+{
+#if wxUSE_DEFERRED_SIZING
+ // if our parent had prepared a defer window handle for us, use it (unless
+ // we are a top level window)
+ wxWindowMSW * const parent = IsTopLevel() ? NULL : GetParent();
+
+ HDWP hdwp = parent ? (HDWP)parent->m_hDWP : NULL;
+ if ( hdwp )
+ {
+ hdwp = ::DeferWindowPos(hdwp, (HWND)hwnd, NULL, x, y, width, height,
+ SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE);
+ if ( !hdwp )
+ {
+ wxLogLastError(wxT("DeferWindowPos"));
+ }
+ }
+
+ if ( parent )
+ {
+ // hdwp must be updated as it may have been changed
+ parent->m_hDWP = (WXHANDLE)hdwp;
+ }
+
+ if ( hdwp )
+ {
+ // did deferred move, remember new coordinates of the window as they're
+ // different from what Windows would return for it
+ return true;
+ }
+
+ // otherwise (or if deferring failed) move the window in place immediately
+#endif // wxUSE_DEFERRED_SIZING
+ if ( !::MoveWindow((HWND)hwnd, x, y, width, height, IsShown()) )
+ {
+ wxLogLastError(wxT("MoveWindow"));
+ }
+
+ // if wxUSE_DEFERRED_SIZING, indicates that we didn't use deferred move,
+ // ignored otherwise
+ return false;
+}
+
+void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
+{
+ // TODO: is this consistent with other platforms?
+ // Still, negative width or height shouldn't be allowed
+ if (width < 0)
+ width = 0;
+ if (height < 0)
+ height = 0;
+
+ if ( DoMoveSibling(m_hWnd, x, y, width, height) )
+ {
+#if wxUSE_DEFERRED_SIZING
+ m_pendingPosition = wxPoint(x, y);
+ m_pendingSize = wxSize(width, height);
+ }
+ else // window was moved immediately, without deferring it
+ {
+ m_pendingPosition = wxDefaultPosition;
+ m_pendingSize = wxDefaultSize;
+#endif // wxUSE_DEFERRED_SIZING
+ }
+}
+
+// set the size of the window: if the dimensions are positive, just use them,
+// but if any of them is equal to -1, it means that we must find the value for
+// it ourselves (unless sizeFlags contains wxSIZE_ALLOW_MINUS_ONE flag, in
+// which case -1 is a valid value for x and y)
+//
+// If sizeFlags contains wxSIZE_AUTO_WIDTH/HEIGHT flags (default), we calculate
+// the width/height to best suit our contents, otherwise we reuse the current
+// width/height
+void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
+{
+ // get the current size and position...
+ int currentX, currentY;
+ int currentW, currentH;
+
+ GetPosition(¤tX, ¤tY);
+ GetSize(¤tW, ¤tH);
+
+ // ... and don't do anything (avoiding flicker) if it's already ok unless
+ // we're forced to resize the window
+ if ( x == currentX && y == currentY &&
+ width == currentW && height == currentH &&
+ !(sizeFlags & wxSIZE_FORCE) )
+ {
+ if (sizeFlags & wxSIZE_FORCE_EVENT)
+ {
+ wxSizeEvent event( wxSize(width,height), GetId() );
+ event.SetEventObject( this );
+ HandleWindowEvent( event );
+ }
+ return;
+ }
+
+ if ( x == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
+ x = currentX;
+ if ( y == wxDefaultCoord && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
+ y = currentY;
+
+ AdjustForParentClientOrigin(x, y, sizeFlags);
+
+ wxSize size = wxDefaultSize;
+ if ( width == wxDefaultCoord )
+ {
+ if ( sizeFlags & wxSIZE_AUTO_WIDTH )
+ {
+ size = GetBestSize();
+ width = size.x;
+ }
+ else
+ {
+ // just take the current one
+ width = currentW;
+ }
+ }
+
+ if ( height == wxDefaultCoord )
+ {
+ if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
+ {
+ if ( size.x == wxDefaultCoord )
+ {
+ size = GetBestSize();
+ }
+ //else: already called GetBestSize() above
+
+ height = size.y;
+ }
+ else
+ {
+ // just take the current one
+ height = currentH;
+ }
+ }
+
+ DoMoveWindow(x, y, width, height);
+}
+
+void wxWindowMSW::DoSetClientSize(int width, int height)
+{
+ // setting the client size is less obvious than it could have been
+ // because in the result of changing the total size the window scrollbar
+ // may [dis]appear and/or its menubar may [un]wrap (and AdjustWindowRect()
+ // doesn't take neither into account) and so the client size will not be
+ // correct as the difference between the total and client size changes --
+ // so we keep changing it until we get it right
+ //
+ // normally this loop shouldn't take more than 3 iterations (usually 1 but
+ // if scrollbars [dis]appear as the result of the first call, then 2 and it
+ // may become 3 if the window had 0 size originally and so we didn't
+ // calculate the scrollbar correction correctly during the first iteration)
+ // but just to be on the safe side we check for it instead of making it an
+ // "infinite" loop (i.e. leaving break inside as the only way to get out)
+ for ( int i = 0; i < 4; i++ )
+ {
+ RECT rectClient;
+ ::GetClientRect(GetHwnd(), &rectClient);
+
+ // if the size is already ok, stop here (NB: rectClient.left = top = 0)
+ if ( (rectClient.right == width || width == wxDefaultCoord) &&
+ (rectClient.bottom == height || height == wxDefaultCoord) )
+ {
+ break;
+ }
+
+ // Find the difference between the entire window (title bar and all)
+ // and the client area; add this to the new client size to move the
+ // window
+ RECT rectWin;
+ ::GetWindowRect(GetHwnd(), &rectWin);
+
+ const int widthWin = rectWin.right - rectWin.left,
+ heightWin = rectWin.bottom - rectWin.top;
+
+ // MoveWindow positions the child windows relative to the parent, so
+ // adjust if necessary
+ if ( !IsTopLevel() )
+ {
+ wxWindow *parent = GetParent();
+ if ( parent )
+ {
+ ::ScreenToClient(GetHwndOf(parent), (POINT *)&rectWin);
+ }
+ }
+
+ // don't call DoMoveWindow() because we want to move window immediately
+ // and not defer it here as otherwise the value returned by
+ // GetClient/WindowRect() wouldn't change as the window wouldn't be
+ // really resized
+ if ( !::MoveWindow(GetHwnd(),
+ rectWin.left,
+ rectWin.top,
+ width + widthWin - rectClient.right,
+ height + heightWin - rectClient.bottom,
+ TRUE) )
+ {
+ wxLogLastError(wxT("MoveWindow"));
+ }
+ }
+}
+
+wxSize wxWindowMSW::DoGetBorderSize() const
+{
+ wxCoord border;
+ switch ( GetBorder() )
+ {
+ case wxBORDER_STATIC:
+ case wxBORDER_SIMPLE:
+ border = 1;
+ break;
+
+ case wxBORDER_SUNKEN:
+ case wxBORDER_THEME:
+ border = 2;
+ break;
+
+ case wxBORDER_RAISED:
+ border = 3;
+ break;
+
+ default:
+ wxFAIL_MSG( wxT("unknown border style") );
+ // fall through
+
+ case wxBORDER_NONE:
+ border = 0;
+ }
+
+ return 2*wxSize(border, border);
+}
+
+// ---------------------------------------------------------------------------
+// text metrics
+// ---------------------------------------------------------------------------
+
+int wxWindowMSW::GetCharHeight() const
+{
+ return wxGetTextMetrics(this).tmHeight;
+}
+
+int wxWindowMSW::GetCharWidth() const
+{
+ // +1 is needed because Windows apparently adds it when calculating the
+ // dialog units size in pixels
+#if wxDIALOG_UNIT_COMPATIBILITY
+ return wxGetTextMetrics(this).tmAveCharWidth;
+#else
+ return wxGetTextMetrics(this).tmAveCharWidth + 1;
+#endif
+}
+
+void wxWindowMSW::DoGetTextExtent(const wxString& string,
+ int *x, int *y,
+ int *descent,
+ int *externalLeading,
+ const wxFont *fontToUse) const
+{
+ // ensure we work with a valid font
+ wxFont font;
+ if ( !fontToUse || !fontToUse->IsOk() )
+ font = GetFont();
+ else
+ font = *fontToUse;
+
+ wxCHECK_RET( font.IsOk(), wxT("invalid font in GetTextExtent()") );
+
+ const wxWindow* win = static_cast(this);
+ wxTextMeasure txm(win, &font);
+ txm.GetTextExtent(string, x, y, descent, externalLeading);
+}
+
+// ---------------------------------------------------------------------------
+// popup menu
+// ---------------------------------------------------------------------------
+
+#if wxUSE_MENUS_NATIVE
+
+// yield for WM_COMMAND events only, i.e. process all WM_COMMANDs in the queue
+// immediately, without waiting for the next event loop iteration
+//
+// NB: this function should probably be made public later as it can almost
+// surely replace wxYield() elsewhere as well
+static void wxYieldForCommandsOnly()
+{
+ // peek all WM_COMMANDs (it will always return WM_QUIT too but we don't
+ // want to process it here)
+ MSG msg;
+ while ( ::PeekMessage(&msg, (HWND)0, WM_COMMAND, WM_COMMAND, PM_REMOVE) )
+ {
+ if ( msg.message == WM_QUIT )
+ {
+ // if we retrieved a WM_QUIT, insert back into the message queue.
+ ::PostQuitMessage(0);
+ break;
+ }
+
+ // luckily (as we don't have access to wxEventLoopImpl method from here
+ // anyhow...) we don't need to pre process WM_COMMANDs so dispatch it
+ // immediately
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ }
+}
+
+bool wxWindowMSW::DoPopupMenu(wxMenu *menu, int x, int y)
+{
+ menu->UpdateUI();
+
+ wxPoint pt;
+ if ( x == wxDefaultCoord && y == wxDefaultCoord )
+ {
+ pt = wxGetMousePosition();
+ }
+ else
+ {
+ pt = ClientToScreen(wxPoint(x, y));
+ }
+
+#if defined(__WXWINCE__)
+ static const UINT flags = 0;
+#else // !__WXWINCE__
+ UINT flags = TPM_RIGHTBUTTON;
+ // NT4 doesn't support TPM_RECURSE and simply doesn't show the menu at all
+ // when it's use, I'm not sure about Win95/98 but prefer to err on the safe
+ // side and not to use it there neither -- modify the test if it does work
+ // on these systems
+ if ( wxGetWinVersion() >= wxWinVersion_5 )
+ {
+ // using TPM_RECURSE allows us to show a popup menu while another menu
+ // is opened which can be useful and is supported by the other
+ // platforms, so allow it under Windows too
+ flags |= TPM_RECURSE;
+ }
+#endif // __WXWINCE__/!__WXWINCE__
+
+ ::TrackPopupMenu(GetHmenuOf(menu), flags, pt.x, pt.y, 0, GetHwnd(), NULL);
+
+ // we need to do it right now as otherwise the events are never going to be
+ // sent to wxCurrentPopupMenu from HandleCommand()
+ //
+ // note that even eliminating (ugly) wxCurrentPopupMenu global wouldn't
+ // help and we'd still need wxYieldForCommandsOnly() as the menu may be
+ // destroyed as soon as we return (it can be a local variable in the caller
+ // for example) and so we do need to process the event immediately
+ wxYieldForCommandsOnly();
+
+ return true;
+}
+
+#endif // wxUSE_MENUS_NATIVE
+
+// ===========================================================================
+// pre/post message processing
+// ===========================================================================
+
+WXLRESULT wxWindowMSW::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+ WXLRESULT rc;
+ if ( m_oldWndProc )
+ rc = ::CallWindowProc(CASTWNDPROC m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
+ else
+ rc = ::DefWindowProc(GetHwnd(), nMsg, wParam, lParam);
+
+ // Special hack used by wxTextEntry auto-completion only: this event is
+ // sent after the normal keyboard processing so that its handler could use
+ // the updated contents of the text control, after taking the key that was
+ // pressed into account.
+ if ( nMsg == WM_CHAR )
+ {
+ wxKeyEvent event(CreateCharEvent(wxEVT_AFTER_CHAR, wParam, lParam));
+ HandleWindowEvent(event);
+ }
+
+ return rc;
+}
+
+bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
+{
+ // wxUniversal implements tab traversal itself
+#ifndef __WXUNIVERSAL__
+ // Notice that we check for both wxTAB_TRAVERSAL and WS_EX_CONTROLPARENT
+ // being set here. While normally the latter should always be set if the
+ // former is, doing it like this also works if there is ever a bug that
+ // results in wxTAB_TRAVERSAL being set but not WS_EX_CONTROLPARENT as we
+ // must not call IsDialogMessage() then, it would simply hang (see #15458).
+ if ( m_hWnd &&
+ HasFlag(wxTAB_TRAVERSAL) &&
+ (wxGetWindowExStyle(this) & WS_EX_CONTROLPARENT) )
+ {
+ // intercept dialog navigation keys
+ MSG *msg = (MSG *)pMsg;
+
+ // here we try to do all the job which ::IsDialogMessage() usually does
+ // internally
+ if ( msg->message == WM_KEYDOWN )
+ {
+ bool bCtrlDown = wxIsCtrlDown();
+ bool bShiftDown = wxIsShiftDown();
+
+ // WM_GETDLGCODE: ask the control if it wants the key for itself,
+ // don't process it if it's the case (except for Ctrl-Tab/Enter
+ // combinations which are always processed)
+ LONG lDlgCode = ::SendMessage(msg->hwnd, WM_GETDLGCODE, 0, 0);
+
+ // surprisingly, DLGC_WANTALLKEYS bit mask doesn't contain the
+ // DLGC_WANTTAB nor DLGC_WANTARROWS bits although, logically,
+ // it, of course, implies them
+ if ( lDlgCode & DLGC_WANTALLKEYS )
+ {
+ lDlgCode |= DLGC_WANTTAB | DLGC_WANTARROWS;
+ }
+
+ bool bForward = true,
+ bWindowChange = false,
+ bFromTab = false;
+
+ // should we process this message specially?
+ bool bProcess = true;
+ switch ( msg->wParam )
+ {
+ case VK_TAB:
+ if ( (lDlgCode & DLGC_WANTTAB) && !bCtrlDown )
+ {
+ // let the control have the TAB
+ bProcess = false;
+ }
+ else // use it for navigation
+ {
+ // Ctrl-Tab cycles thru notebook pages
+ bWindowChange = bCtrlDown;
+ bForward = !bShiftDown;
+ bFromTab = true;
+ }
+ break;
+
+ case VK_UP:
+ case VK_LEFT:
+ if ( (lDlgCode & DLGC_WANTARROWS) || bCtrlDown )
+ bProcess = false;
+ else
+ bForward = false;
+ break;
+
+ case VK_DOWN:
+ case VK_RIGHT:
+ if ( (lDlgCode & DLGC_WANTARROWS) || bCtrlDown )
+ bProcess = false;
+ break;
+
+ case VK_PRIOR:
+ bForward = false;
+ // fall through
+
+ case VK_NEXT:
+ // we treat PageUp/Dn as arrows because chances are that
+ // a control which needs arrows also needs them for
+ // navigation (e.g. wxTextCtrl, wxListCtrl, ...)
+ if ( (lDlgCode & DLGC_WANTARROWS) && !bCtrlDown )
+ bProcess = false;
+ else // OTOH Ctrl-PageUp/Dn works as [Shift-]Ctrl-Tab
+ bWindowChange = true;
+ break;
+
+ case VK_RETURN:
+ {
+#if wxUSE_BUTTON
+ // currently active button should get enter press even
+ // if there is a default button elsewhere so check if
+ // this window is a button first
+ wxWindow *btn = NULL;
+ if ( lDlgCode & DLGC_DEFPUSHBUTTON )
+ {
+ // let IsDialogMessage() handle this for all
+ // buttons except the owner-drawn ones which it
+ // just seems to ignore
+ long style = ::GetWindowLong(msg->hwnd, GWL_STYLE);
+ if ( (style & BS_OWNERDRAW) == BS_OWNERDRAW )
+ {
+ // emulate the button click
+ btn = wxFindWinFromHandle(msg->hwnd);
+ }
+ }
+ else // not a button itself, do we have default button?
+ {
+ // check if this window or any of its ancestors
+ // wants the message for itself (we always reserve
+ // Ctrl-Enter for dialog navigation though)
+ wxWindow *win = this;
+ if ( !bCtrlDown )
+ {
+ // this will contain the dialog code of this
+ // window and all of its parent windows in turn
+ LONG lDlgCode2 = lDlgCode;
+
+ while ( win )
+ {
+ if ( lDlgCode2 & DLGC_WANTMESSAGE )
+ {
+ // as it wants to process Enter itself,
+ // don't call IsDialogMessage() which
+ // would consume it
+ return false;
+ }
+
+ // don't propagate keyboard messages beyond
+ // the first top level window parent
+ if ( win->IsTopLevel() )
+ break;
+
+ win = win->GetParent();
+
+ lDlgCode2 = ::SendMessage
+ (
+ GetHwndOf(win),
+ WM_GETDLGCODE,
+ 0,
+ 0
+ );
+ }
+ }
+ else // bCtrlDown
+ {
+ win = wxGetTopLevelParent(win);
+ }
+
+ wxTopLevelWindow * const
+ tlw = wxDynamicCast(win, wxTopLevelWindow);
+ if ( tlw )
+ {
+ btn = wxDynamicCast(tlw->GetDefaultItem(),
+ wxButton);
+ }
+ }
+
+ if ( btn && btn->IsEnabled() && btn->IsShownOnScreen() )
+ {
+ btn->MSWCommand(BN_CLICKED, 0 /* unused */);
+ return true;
+ }
+
+ // This "Return" key press won't be actually used for
+ // navigation so don't generate wxNavigationKeyEvent
+ // for it but still pass it to IsDialogMessage() as it
+ // may handle it in some other way (e.g. by playing the
+ // default error sound).
+ bProcess = false;
+
+#endif // wxUSE_BUTTON
+
+#ifdef __WXWINCE__
+ // map Enter presses into button presses on PDAs
+ wxJoystickEvent event(wxEVT_JOY_BUTTON_DOWN);
+ event.SetEventObject(this);
+ if ( HandleWindowEvent(event) )
+ return true;
+#endif // __WXWINCE__
+ }
+ break;
+
+ default:
+ bProcess = false;
+ }
+
+ if ( bProcess )
+ {
+ wxNavigationKeyEvent event;
+ event.SetDirection(bForward);
+ event.SetWindowChange(bWindowChange);
+ event.SetFromTab(bFromTab);
+ event.SetEventObject(this);
+
+ if ( HandleWindowEvent(event) )
+ {
+ // as we don't call IsDialogMessage(), which would take of
+ // this by default, we need to manually send this message
+ // so that controls can change their UI state if needed
+ MSWUpdateUIState(UIS_CLEAR, UISF_HIDEFOCUS);
+
+ return true;
+ }
+ }
+ }
+
+ if ( MSWSafeIsDialogMessage(msg) )
+ {
+ // IsDialogMessage() did something...
+ return true;
+ }
+ }
+#endif // __WXUNIVERSAL__
+
+#if wxUSE_TOOLTIPS
+ if ( m_tooltip )
+ {
+ // relay mouse move events to the tooltip control
+ MSG *msg = (MSG *)pMsg;
+ if ( msg->message == WM_MOUSEMOVE )
+ wxToolTip::RelayEvent(pMsg);
+ }
+#endif // wxUSE_TOOLTIPS
+
+ return false;
+}
+
+bool wxWindowMSW::MSWTranslateMessage(WXMSG* pMsg)
+{
+#if wxUSE_ACCEL && !defined(__WXUNIVERSAL__)
+ return m_acceleratorTable.Translate(this, pMsg);
+#else
+ (void) pMsg;
+ return false;
+#endif // wxUSE_ACCEL
+}
+
+bool wxWindowMSW::MSWShouldPreProcessMessage(WXMSG* WXUNUSED(msg))
+{
+ // We don't have any reason to not preprocess messages at this level.
+ return true;
+}
+
+#ifndef __WXUNIVERSAL__
+
+bool wxWindowMSW::MSWSafeIsDialogMessage(WXMSG* msg)
+{
+ // don't let IsDialogMessage() get VK_ESCAPE as it _always_ eats the
+ // message even when there is no cancel button and when the message is
+ // needed by the control itself: in particular, it prevents the tree in
+ // place edit control from being closed with Escape in a dialog
+ if ( msg->message == WM_KEYDOWN && msg->wParam == VK_ESCAPE )
+ {
+ return false;
+ }
+
+ // ::IsDialogMessage() is broken and may sometimes hang the application by
+ // going into an infinite loop when it tries to find the control to give
+ // focus to when Alt- is pressed, so we try to detect [some of] the
+ // situations when this may happen and not call it then
+ if ( msg->message == WM_SYSCHAR )
+ {
+ HWND hwndFocus = ::GetFocus();
+
+ // if the currently focused window itself has WS_EX_CONTROLPARENT style,
+ // ::IsDialogMessage() will also enter an infinite loop, because it will
+ // recursively check the child windows but not the window itself and so if
+ // none of the children accepts focus it loops forever (as it only stops
+ // when it gets back to the window it started from)
+ //
+ // while it is very unusual that a window with WS_EX_CONTROLPARENT
+ // style has the focus, it can happen. One such possibility is if
+ // all windows are either toplevel, wxDialog, wxPanel or static
+ // controls and no window can actually accept keyboard input.
+#if !defined(__WXWINCE__)
+ if ( ::GetWindowLong(hwndFocus, GWL_EXSTYLE) & WS_EX_CONTROLPARENT )
+ {
+ // pessimistic by default
+ bool canSafelyCallIsDlgMsg = false;
+ for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxWindow * const win = node->GetData();
+ if ( win->CanAcceptFocus() &&
+ !wxHasWindowExStyle(win, WS_EX_CONTROLPARENT) )
+ {
+ // it shouldn't hang...
+ canSafelyCallIsDlgMsg = true;
+
+ break;
+ }
+ }
+
+ if ( !canSafelyCallIsDlgMsg )
+ return false;
+ }
+#endif // !__WXWINCE__
+
+ // ::IsDialogMessage() can enter in an infinite loop when the
+ // currently focused window is disabled or hidden and its
+ // parent has WS_EX_CONTROLPARENT style, so don't call it in
+ // this case
+ while ( hwndFocus )
+ {
+ if ( !::IsWindowEnabled(hwndFocus) ||
+ !::IsWindowVisible(hwndFocus) )
+ {
+ // it would enter an infinite loop if we do this!
+ return false;
+ }
+
+ if ( !(::GetWindowLong(hwndFocus, GWL_STYLE) & WS_CHILD) )
+ {
+ // it's a top level window, don't go further -- e.g. even
+ // if the parent of a dialog is disabled, this doesn't
+ // break navigation inside the dialog
+ break;
+ }
+
+ hwndFocus = ::GetParent(hwndFocus);
+ }
+ }
+
+ return ::IsDialogMessage(GetHwnd(), msg) != 0;
+}
+
+#endif // __WXUNIVERSAL__
+
+// ---------------------------------------------------------------------------
+// message params unpackers
+// ---------------------------------------------------------------------------
+
+void wxWindowMSW::UnpackCommand(WXWPARAM wParam, WXLPARAM lParam,
+ WORD *id, WXHWND *hwnd, WORD *cmd)
+{
+ *id = LOWORD(wParam);
+ *hwnd = (WXHWND)lParam;
+ *cmd = HIWORD(wParam);
+}
+
+void wxWindowMSW::UnpackActivate(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *state, WXWORD *minimized, WXHWND *hwnd)
+{
+ *state = LOWORD(wParam);
+ *minimized = HIWORD(wParam);
+ *hwnd = (WXHWND)lParam;
+}
+
+void wxWindowMSW::UnpackScroll(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *code, WXWORD *pos, WXHWND *hwnd)
+{
+ *code = LOWORD(wParam);
+ *pos = HIWORD(wParam);
+ *hwnd = (WXHWND)lParam;
+}
+
+void wxWindowMSW::UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
+ WXHDC *hdc, WXHWND *hwnd)
+{
+ *hwnd = (WXHWND)lParam;
+ *hdc = (WXHDC)wParam;
+}
+
+void wxWindowMSW::UnpackMenuSelect(WXWPARAM wParam, WXLPARAM lParam,
+ WXWORD *item, WXWORD *flags, WXHMENU *hmenu)
+{
+ *item = (WXWORD)wParam;
+ *flags = HIWORD(wParam);
+ *hmenu = (WXHMENU)lParam;
+}
+
+// ---------------------------------------------------------------------------
+// Main wxWidgets window proc and the window proc for wxWindow
+// ---------------------------------------------------------------------------
+
+// Hook for new window just as it's being created, when the window isn't yet
+// associated with the handle
+static wxWindowMSW *gs_winBeingCreated = NULL;
+
+// implementation of wxWindowCreationHook class: it just sets gs_winBeingCreated to the
+// window being created and insures that it's always unset back later
+wxWindowCreationHook::wxWindowCreationHook(wxWindowMSW *winBeingCreated)
+{
+ gs_winBeingCreated = winBeingCreated;
+}
+
+wxWindowCreationHook::~wxWindowCreationHook()
+{
+ gs_winBeingCreated = NULL;
+}
+
+// Main window proc
+LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ // trace all messages: useful for the debugging but noticeably slows down
+ // the code so don't do it by default
+#if wxDEBUG_LEVEL >= 2
+ // notice that we cast wParam and lParam to long to avoid mismatch with
+ // format specifiers in 64 bit builds where they are both int64 quantities
+ //
+ // casting like this loses information, of course, but it shouldn't matter
+ // much for this diagnostic code and it keeps the code simple
+ wxLogTrace("winmsg",
+ wxT("Processing %s(hWnd=%p, wParam=%08lx, lParam=%08lx)"),
+ wxGetMessageName(message), hWnd, (long)wParam, (long)lParam);
+#endif // wxDEBUG_LEVEL >= 2
+
+ wxWindowMSW *wnd = wxFindWinFromHandle(hWnd);
+
+ // when we get the first message for the HWND we just created, we associate
+ // it with wxWindow stored in gs_winBeingCreated
+ if ( !wnd && gs_winBeingCreated )
+ {
+ wxAssociateWinWithHandle(hWnd, gs_winBeingCreated);
+ wnd = gs_winBeingCreated;
+ gs_winBeingCreated = NULL;
+ wnd->SetHWND((WXHWND)hWnd);
+ }
+
+ LRESULT rc;
+
+ if ( wnd && wxGUIEventLoop::AllowProcessing(wnd) )
+ rc = wnd->MSWWindowProc(message, wParam, lParam);
+ else
+ rc = ::DefWindowProc(hWnd, message, wParam, lParam);
+
+ return rc;
+}
+
+bool
+wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
+ WXUINT message,
+ WXWPARAM wParam,
+ WXLPARAM lParam)
+{
+ // did we process the message?
+ bool processed = false;
+
+ // the return value
+ union
+ {
+ bool allow;
+ WXLRESULT result;
+ WXHBRUSH hBrush;
+ } rc;
+
+ // for most messages we should return 0 when we do process the message
+ rc.result = 0;
+
+ switch ( message )
+ {
+ case WM_CREATE:
+ {
+ bool mayCreate;
+ processed = HandleCreate((WXLPCREATESTRUCT)lParam, &mayCreate);
+ if ( processed )
+ {
+ // return 0 to allow window creation
+ rc.result = mayCreate ? 0 : -1;
+ }
+ }
+ break;
+
+ case WM_DESTROY:
+ // never set processed to true and *always* pass WM_DESTROY to
+ // DefWindowProc() as Windows may do some internal cleanup when
+ // processing it and failing to pass the message along may cause
+ // memory and resource leaks!
+ (void)HandleDestroy();
+ break;
+
+ case WM_SIZE:
+ processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
+ break;
+
+ case WM_MOVE:
+ processed = HandleMove(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
+ break;
+
+#if !defined(__WXWINCE__)
+ case WM_MOVING:
+ {
+ LPRECT pRect = (LPRECT)lParam;
+ wxRect rc;
+ rc.SetLeft(pRect->left);
+ rc.SetTop(pRect->top);
+ rc.SetRight(pRect->right);
+ rc.SetBottom(pRect->bottom);
+ processed = HandleMoving(rc);
+ if (processed) {
+ pRect->left = rc.GetLeft();
+ pRect->top = rc.GetTop();
+ pRect->right = rc.GetRight();
+ pRect->bottom = rc.GetBottom();
+ }
+ }
+ break;
+
+ case WM_ENTERSIZEMOVE:
+ {
+ processed = HandleEnterSizeMove();
+ }
+ break;
+
+ case WM_EXITSIZEMOVE:
+ {
+ processed = HandleExitSizeMove();
+ }
+ break;
+
+ case WM_SIZING:
+ {
+ LPRECT pRect = (LPRECT)lParam;
+ wxRect rc;
+ rc.SetLeft(pRect->left);
+ rc.SetTop(pRect->top);
+ rc.SetRight(pRect->right);
+ rc.SetBottom(pRect->bottom);
+ processed = HandleSizing(rc);
+ if (processed) {
+ pRect->left = rc.GetLeft();
+ pRect->top = rc.GetTop();
+ pRect->right = rc.GetRight();
+ pRect->bottom = rc.GetBottom();
+ }
+ }
+ break;
+#endif // !__WXWINCE__
+
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+ case WM_ACTIVATEAPP:
+ // This implicitly sends a wxEVT_ACTIVATE_APP event
+ wxTheApp->SetActive(wParam != 0, FindFocus());
+ break;
+#endif
+
+ case WM_ACTIVATE:
+ {
+ WXWORD state, minimized;
+ WXHWND hwnd;
+ UnpackActivate(wParam, lParam, &state, &minimized, &hwnd);
+
+ processed = HandleActivate(state, minimized != 0, (WXHWND)hwnd);
+ }
+ break;
+
+ case WM_SETFOCUS:
+ processed = HandleSetFocus((WXHWND)wParam);
+ break;
+
+ case WM_KILLFOCUS:
+ processed = HandleKillFocus((WXHWND)wParam);
+ break;
+
+ case WM_PRINTCLIENT:
+ processed = HandlePrintClient((WXHDC)wParam);
+ break;
+
+ case WM_PAINT:
+ if ( wParam )
+ {
+ wxPaintDCEx dc((wxWindow *)this, (WXHDC)wParam);
+
+ processed = HandlePaint();
+ }
+ else // no DC given
+ {
+ processed = HandlePaint();
+ }
+ break;
+
+ case WM_CLOSE:
+#ifdef __WXUNIVERSAL__
+ // Universal uses its own wxFrame/wxDialog, so we don't receive
+ // close events unless we have this.
+ Close();
+#endif // __WXUNIVERSAL__
+
+ // don't let the DefWindowProc() destroy our window - we'll do it
+ // ourselves in ~wxWindow
+ processed = true;
+ rc.result = TRUE;
+ break;
+
+ case WM_SHOWWINDOW:
+ processed = HandleShow(wParam != 0, (int)lParam);
+ break;
+
+ case WM_MOUSEMOVE:
+ processed = HandleMouseMove(GET_X_LPARAM(lParam),
+ GET_Y_LPARAM(lParam),
+ wParam);
+ break;
+
+#ifdef HAVE_TRACKMOUSEEVENT
+ case WM_MOUSELEAVE:
+ // filter out excess WM_MOUSELEAVE events sent after PopupMenu()
+ // (on XP at least)
+ if ( m_mouseInWindow )
+ {
+ GenerateMouseLeave();
+ }
+
+ // always pass processed back as false, this allows the window
+ // manager to process the message too. This is needed to
+ // ensure windows XP themes work properly as the mouse moves
+ // over widgets like buttons. So don't set processed to true here.
+ break;
+#endif // HAVE_TRACKMOUSEEVENT
+
+#if wxUSE_MOUSEWHEEL
+ case WM_MOUSEWHEEL:
+ processed = HandleMouseWheel(wxMOUSE_WHEEL_VERTICAL, wParam, lParam);
+ break;
+
+ case WM_MOUSEHWHEEL:
+ processed = HandleMouseWheel(wxMOUSE_WHEEL_HORIZONTAL, wParam, lParam);
+ break;
+#endif // wxUSE_MOUSEWHEEL
+
+ case WM_LBUTTONDOWN:
+ case WM_LBUTTONUP:
+ case WM_LBUTTONDBLCLK:
+ case WM_RBUTTONDOWN:
+ case WM_RBUTTONUP:
+ case WM_RBUTTONDBLCLK:
+ case WM_MBUTTONDOWN:
+ case WM_MBUTTONUP:
+ case WM_MBUTTONDBLCLK:
+#ifdef wxHAS_XBUTTON
+ case WM_XBUTTONDOWN:
+ case WM_XBUTTONUP:
+ case WM_XBUTTONDBLCLK:
+#endif // wxHAS_XBUTTON
+ {
+#ifdef __WXMICROWIN__
+ // MicroWindows seems to ignore the fact that a window is
+ // disabled. So catch mouse events and throw them away if
+ // necessary.
+ wxWindowMSW* win = this;
+ for ( ;; )
+ {
+ if (!win->IsEnabled())
+ {
+ processed = true;
+ break;
+ }
+
+ win = win->GetParent();
+ if ( !win || win->IsTopLevel() )
+ break;
+ }
+
+ if ( processed )
+ break;
+
+#endif // __WXMICROWIN__
+ int x = GET_X_LPARAM(lParam),
+ y = GET_Y_LPARAM(lParam);
+
+#ifdef __WXWINCE__
+ // redirect the event to a static control if necessary by
+ // finding one under mouse because under CE the static controls
+ // don't generate mouse events (even with SS_NOTIFY)
+ wxWindowMSW *win;
+ if ( GetCapture() == this )
+ {
+ // but don't do it if the mouse is captured by this window
+ // because then it should really get this event itself
+ win = this;
+ }
+ else
+ {
+ win = FindWindowForMouseEvent(this, &x, &y);
+
+ // this should never happen
+ wxCHECK_MSG( win, 0,
+ wxT("FindWindowForMouseEvent() returned NULL") );
+ }
+#ifdef __POCKETPC__
+ if (IsContextMenuEnabled() && message == WM_LBUTTONDOWN)
+ {
+ SHRGINFO shrgi = {0};
+
+ shrgi.cbSize = sizeof(SHRGINFO);
+ shrgi.hwndClient = (HWND) GetHWND();
+ shrgi.ptDown.x = x;
+ shrgi.ptDown.y = y;
+
+ shrgi.dwFlags = SHRG_RETURNCMD;
+ // shrgi.dwFlags = SHRG_NOTIFYPARENT;
+
+ if (GN_CONTEXTMENU == ::SHRecognizeGesture(&shrgi))
+ {
+ wxPoint pt(x, y);
+ pt = ClientToScreen(pt);
+
+ wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, GetId(), pt);
+
+ evtCtx.SetEventObject(this);
+ if (HandleWindowEvent(evtCtx))
+ {
+ processed = true;
+ return true;
+ }
+ }
+ }
+#endif
+
+#else // !__WXWINCE__
+ wxWindowMSW *win = this;
+#endif // __WXWINCE__/!__WXWINCE__
+
+ processed = win->HandleMouseEvent(message, x, y, wParam);
+
+ // if the app didn't eat the event, handle it in the default
+ // way, that is by giving this window the focus
+ if ( !processed )
+ {
+ // for the standard classes their WndProc sets the focus to
+ // them anyhow and doing it from here results in some weird
+ // problems, so don't do it for them (unnecessary anyhow)
+ if ( !win->IsOfStandardClass() )
+ {
+ if ( message == WM_LBUTTONDOWN && win->IsFocusable() )
+ win->SetFocus();
+ }
+ }
+ }
+ break;
+
+#ifdef MM_JOY1MOVE
+ case MM_JOY1MOVE:
+ case MM_JOY2MOVE:
+ case MM_JOY1ZMOVE:
+ case MM_JOY2ZMOVE:
+ case MM_JOY1BUTTONDOWN:
+ case MM_JOY2BUTTONDOWN:
+ case MM_JOY1BUTTONUP:
+ case MM_JOY2BUTTONUP:
+ processed = HandleJoystickEvent(message,
+ LOWORD(lParam),
+ HIWORD(lParam),
+ wParam);
+ break;
+#endif // __WXMICROWIN__
+
+ case WM_COMMAND:
+ {
+ WORD id, cmd;
+ WXHWND hwnd;
+ UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
+
+ processed = HandleCommand(id, cmd, hwnd);
+ }
+ break;
+
+ case WM_NOTIFY:
+ processed = HandleNotify((int)wParam, lParam, &rc.result);
+ break;
+
+ // we only need to reply to WM_NOTIFYFORMAT manually when using MSLU,
+ // otherwise DefWindowProc() does it perfectly fine for us, but MSLU
+ // apparently doesn't always behave properly and needs some help
+#if wxUSE_UNICODE_MSLU && defined(NF_QUERY)
+ case WM_NOTIFYFORMAT:
+ if ( lParam == NF_QUERY )
+ {
+ processed = true;
+ rc.result = NFR_UNICODE;
+ }
+ break;
+#endif // wxUSE_UNICODE_MSLU
+
+ // for these messages we must return true if process the message
+#ifdef WM_DRAWITEM
+ case WM_DRAWITEM:
+ processed = MSWOnDrawItem(wParam, (WXDRAWITEMSTRUCT *)lParam);
+ if ( processed )
+ rc.result = TRUE;
+ break;
+
+ case WM_MEASUREITEM:
+ processed = MSWOnMeasureItem(wParam, (WXMEASUREITEMSTRUCT *)lParam);
+ if ( processed )
+ rc.result = TRUE;
+ break;
+#endif // defined(WM_DRAWITEM)
+
+ case WM_GETDLGCODE:
+ if ( !IsOfStandardClass() || HasFlag(wxWANTS_CHARS) )
+ {
+ // we always want to get the char events
+ rc.result = DLGC_WANTCHARS;
+
+ if ( HasFlag(wxWANTS_CHARS) )
+ {
+ // in fact, we want everything
+ rc.result |= DLGC_WANTARROWS |
+ DLGC_WANTTAB |
+ DLGC_WANTALLKEYS;
+ }
+
+ processed = true;
+ }
+ //else: get the dlg code from the DefWindowProc()
+ break;
+
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ // Generate the key down event in any case.
+ m_lastKeydownProcessed = HandleKeyDown((WORD) wParam, lParam);
+ if ( m_lastKeydownProcessed )
+ {
+ // If it was processed by an event handler, we stop here,
+ // notably we intentionally don't generate char event then.
+ processed = true;
+ }
+ else // key down event not handled
+ {
+ // Examine the event to decide whether we need to generate a
+ // char event for it ourselves or let Windows do it. Window
+ // mostly only does it for the keys which produce printable
+ // characters (although there are exceptions, e.g. VK_ESCAPE or
+ // VK_BACK (but not VK_DELETE)) while we do it for all keys
+ // except the modifier ones (the wisdom of this is debatable
+ // but by now this decision is enshrined forever due to
+ // backwards compatibility).
+ switch ( wParam )
+ {
+ // No wxEVT_CHAR events are generated for these keys at all.
+ case VK_SHIFT:
+ case VK_CONTROL:
+ case VK_MENU:
+ case VK_CAPITAL:
+ case VK_NUMLOCK:
+ case VK_SCROLL:
+
+ // Windows will send us WM_CHAR for these ones so we'll
+ // generate wxEVT_CHAR for them later when we get it.
+ case VK_ESCAPE:
+ case VK_SPACE:
+ case VK_RETURN:
+ case VK_BACK:
+ case VK_TAB:
+ case VK_ADD:
+ case VK_SUBTRACT:
+ case VK_MULTIPLY:
+ case VK_DIVIDE:
+ case VK_DECIMAL:
+ case VK_NUMPAD0:
+ case VK_NUMPAD1:
+ case VK_NUMPAD2:
+ case VK_NUMPAD3:
+ case VK_NUMPAD4:
+ case VK_NUMPAD5:
+ case VK_NUMPAD6:
+ case VK_NUMPAD7:
+ case VK_NUMPAD8:
+ case VK_NUMPAD9:
+ case VK_OEM_1:
+ case VK_OEM_2:
+ case VK_OEM_3:
+ case VK_OEM_4:
+ case VK_OEM_5:
+ case VK_OEM_6:
+ case VK_OEM_7:
+ case VK_OEM_102:
+ case VK_OEM_PLUS:
+ case VK_OEM_COMMA:
+ case VK_OEM_MINUS:
+ case VK_OEM_PERIOD:
+ break;
+
+#ifdef VK_APPS
+ // special case of VK_APPS: treat it the same as right mouse
+ // click because both usually pop up a context menu
+ case VK_APPS:
+ processed = HandleMouseEvent(WM_RBUTTONDOWN, -1, -1, 0);
+ break;
+#endif // VK_APPS
+
+ default:
+ if ( (wParam >= '0' && wParam <= '9') ||
+ (wParam >= 'A' && wParam <= 'Z') )
+ {
+ // We'll get WM_CHAR for those later too.
+ break;
+ }
+
+ // But for the rest we won't get WM_CHAR later so we do
+ // need to generate the event right now.
+ wxKeyEvent event(wxEVT_CHAR);
+ InitAnyKeyEvent(event, wParam, lParam);
+
+ // Set the "extended" bit in lParam because we want to
+ // generate CHAR events with WXK_HOME and not
+ // WXK_NUMPAD_HOME even if the "Home" key on numpad was
+ // pressed.
+ event.m_keyCode = wxMSWKeyboard::VKToWX
+ (
+ wParam,
+ lParam | (KF_EXTENDED << 16)
+ );
+
+ // Don't produce events without any valid character
+ // code (even if this shouldn't normally happen...).
+ if ( event.m_keyCode != WXK_NONE )
+ processed = HandleWindowEvent(event);
+ }
+ }
+ if (message == WM_SYSKEYDOWN) // Let Windows still handle the SYSKEYs
+ processed = false;
+ break;
+
+ case WM_SYSKEYUP:
+ case WM_KEYUP:
+#ifdef VK_APPS
+ // special case of VK_APPS: treat it the same as right mouse button
+ if ( wParam == VK_APPS )
+ {
+ processed = HandleMouseEvent(WM_RBUTTONUP, -1, -1, 0);
+ }
+ else
+#endif // VK_APPS
+ {
+ processed = HandleKeyUp((WORD) wParam, lParam);
+ }
+ break;
+
+ case WM_SYSCHAR:
+ case WM_CHAR: // Always an ASCII character
+ if ( m_lastKeydownProcessed )
+ {
+ // The key was handled in the EVT_KEY_DOWN and handling
+ // a key in an EVT_KEY_DOWN handler is meant, by
+ // design, to prevent EVT_CHARs from happening
+ m_lastKeydownProcessed = false;
+ processed = true;
+ }
+ else
+ {
+ processed = HandleChar((WORD)wParam, lParam);
+ }
+ break;
+
+ case WM_IME_STARTCOMPOSITION:
+ // IME popup needs Escape as it should undo the changes in its
+ // entry window instead of e.g. closing the dialog for which the
+ // IME is used (and losing all the changes in the IME window).
+ gs_modalEntryWindowCount++;
+ break;
+
+ case WM_IME_ENDCOMPOSITION:
+ gs_modalEntryWindowCount--;
+ break;
+
+#if wxUSE_HOTKEY
+ case WM_HOTKEY:
+ processed = HandleHotKey((WORD)wParam, lParam);
+ break;
+#endif // wxUSE_HOTKEY
+
+ case WM_CUT:
+ case WM_COPY:
+ case WM_PASTE:
+ processed = HandleClipboardEvent(message);
+ break;
+
+ case WM_HSCROLL:
+ case WM_VSCROLL:
+ {
+ WXWORD code, pos;
+ WXHWND hwnd;
+ UnpackScroll(wParam, lParam, &code, &pos, &hwnd);
+
+ processed = MSWOnScroll(message == WM_HSCROLL ? wxHORIZONTAL
+ : wxVERTICAL,
+ code, pos, hwnd);
+ }
+ break;
+
+ // CTLCOLOR messages are sent by children to query the parent for their
+ // colors
+#ifndef __WXMICROWIN__
+ case WM_CTLCOLORMSGBOX:
+ case WM_CTLCOLOREDIT:
+ case WM_CTLCOLORLISTBOX:
+ case WM_CTLCOLORBTN:
+ case WM_CTLCOLORDLG:
+ case WM_CTLCOLORSCROLLBAR:
+ case WM_CTLCOLORSTATIC:
+ {
+ WXHDC hdc;
+ WXHWND hwnd;
+ UnpackCtlColor(wParam, lParam, &hdc, &hwnd);
+
+ processed = HandleCtlColor(&rc.hBrush, (WXHDC)hdc, (WXHWND)hwnd);
+ }
+ break;
+#endif // !__WXMICROWIN__
+
+ case WM_SYSCOLORCHANGE:
+ // the return value for this message is ignored
+ processed = HandleSysColorChange();
+ break;
+
+#if !defined(__WXWINCE__)
+ case WM_DISPLAYCHANGE:
+ processed = HandleDisplayChange();
+ break;
+#endif
+
+ case WM_PALETTECHANGED:
+ processed = HandlePaletteChanged((WXHWND)wParam);
+ break;
+
+ case WM_CAPTURECHANGED:
+ processed = HandleCaptureChanged((WXHWND)lParam);
+ break;
+
+ case WM_SETTINGCHANGE:
+ processed = HandleSettingChange(wParam, lParam);
+ break;
+
+ case WM_QUERYNEWPALETTE:
+ processed = HandleQueryNewPalette();
+ break;
+
+ case WM_ERASEBKGND:
+ {
+#ifdef wxHAS_MSW_BACKGROUND_ERASE_HOOK
+ // check if an override was configured for this window
+ EraseBgHooks::const_iterator it = gs_eraseBgHooks.find(this);
+ if ( it != gs_eraseBgHooks.end() )
+ processed = it->second->MSWEraseBgHook((WXHDC)wParam);
+ else
+#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
+ processed = HandleEraseBkgnd((WXHDC)wParam);
+ }
+
+ if ( processed )
+ {
+ // we processed the message, i.e. erased the background
+ rc.result = TRUE;
+ }
+ break;
+
+#if !defined(__WXWINCE__)
+ case WM_DROPFILES:
+ processed = HandleDropFiles(wParam);
+ break;
+#endif
+
+ case WM_INITDIALOG:
+ processed = HandleInitDialog((WXHWND)wParam);
+
+ if ( processed )
+ {
+ // we never set focus from here
+ rc.result = FALSE;
+ }
+ break;
+
+#if !defined(__WXWINCE__)
+ case WM_QUERYENDSESSION:
+ processed = HandleQueryEndSession(lParam, &rc.allow);
+ break;
+
+ case WM_ENDSESSION:
+ processed = HandleEndSession(wParam != 0, lParam);
+ break;
+
+ case WM_GETMINMAXINFO:
+ processed = HandleGetMinMaxInfo((MINMAXINFO*)lParam);
+ break;
+#endif
+
+ case WM_SETCURSOR:
+ processed = HandleSetCursor((WXHWND)wParam,
+ LOWORD(lParam), // hit test
+ HIWORD(lParam)); // mouse msg
+
+ if ( processed )
+ {
+ // returning TRUE stops the DefWindowProc() from further
+ // processing this message - exactly what we need because we've
+ // just set the cursor.
+ rc.result = TRUE;
+ }
+ break;
+
+#if wxUSE_ACCESSIBILITY
+ case WM_GETOBJECT:
+ {
+ //WPARAM dwFlags = (WPARAM) (DWORD) wParam;
+ LPARAM dwObjId = (LPARAM) (DWORD) lParam;
+
+ if (dwObjId == (LPARAM)OBJID_CLIENT && GetOrCreateAccessible())
+ {
+ processed = true;
+ rc.result = LresultFromObject(IID_IAccessible, wParam, (IUnknown*) GetAccessible()->GetIAccessible());
+ }
+ break;
+ }
+#endif
+
+#if defined(WM_HELP)
+ case WM_HELP:
+ {
+ // by default, WM_HELP is propagated by DefWindowProc() upwards
+ // to the window parent but as we do it ourselves already
+ // (wxHelpEvent is derived from wxCommandEvent), we don't want
+ // to get the other events if we process this message at all
+ processed = true;
+
+ // WM_HELP doesn't use lParam under CE
+#ifndef __WXWINCE__
+ HELPINFO* info = (HELPINFO*) lParam;
+ if ( info->iContextType == HELPINFO_WINDOW )
+ {
+#endif // !__WXWINCE__
+ wxHelpEvent helpEvent
+ (
+ wxEVT_HELP,
+ GetId(),
+#ifdef __WXWINCE__
+ wxGetMousePosition() // what else?
+#else
+ wxPoint(info->MousePos.x, info->MousePos.y)
+#endif
+ );
+
+ helpEvent.SetEventObject(this);
+ HandleWindowEvent(helpEvent);
+#ifndef __WXWINCE__
+ }
+ else if ( info->iContextType == HELPINFO_MENUITEM )
+ {
+ wxHelpEvent helpEvent(wxEVT_HELP, info->iCtrlId);
+ helpEvent.SetEventObject(this);
+ HandleWindowEvent(helpEvent);
+
+ }
+ else // unknown help event?
+ {
+ processed = false;
+ }
+#endif // !__WXWINCE__
+ }
+ break;
+#endif // WM_HELP
+
+#if !defined(__WXWINCE__)
+ case WM_CONTEXTMENU:
+ {
+ // Ignore the events that are propagated from a child window by
+ // DefWindowProc(): as wxContextMenuEvent is already propagated
+ // upwards the window hierarchy by us, not doing this would
+ // result in duplicate events being sent.
+ WXHWND hWnd = (WXHWND)wParam;
+ if ( hWnd != m_hWnd )
+ {
+ wxWindowMSW *win = FindItemByHWND(hWnd);
+ if ( win && IsDescendant(win) )
+ {
+ // We had already generated wxContextMenuEvent when we
+ // got WM_CONTEXTMENU for that window.
+ processed = true;
+ break;
+ }
+ }
+
+ // we don't convert from screen to client coordinates as
+ // the event may be handled by a parent window
+ wxPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
+
+ wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, GetId(), pt);
+ evtCtx.SetEventObject(this);
+
+ processed = HandleWindowEvent(evtCtx);
+ }
+ break;
+#endif
+
+#if wxUSE_MENUS
+ case WM_MENUCHAR:
+ // we're only interested in our own menus, not MF_SYSMENU
+ if ( HIWORD(wParam) == MF_POPUP )
+ {
+ // handle menu chars for ownerdrawn menu items
+ int i = HandleMenuChar(toupper(LOWORD(wParam)), lParam);
+ if ( i != wxNOT_FOUND )
+ {
+ rc.result = MAKELRESULT(i, MNC_EXECUTE);
+ processed = true;
+ }
+ }
+ break;
+
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+ case WM_INITMENUPOPUP:
+ case WM_MENUSELECT:
+ case WM_EXITMENULOOP:
+ case WM_UNINITMENUPOPUP:
+ {
+ // Contrary to MSDN implications, at least some of these messages are
+ // not actually sent to the TLW for popup menus, but to the owning
+ // window or even its parent window.
+ //
+ // wx-3.1+ handles these messages in wxWindow instead, but binary
+ // compatibility requirements on wx-3.0 make it simpler to just forward
+ // the messages to the wxTLW.
+ wxWindow *tlw = wxGetTopLevelParent(this);
+ if (tlw && tlw != this)
+ {
+ rc.result = tlw->MSWWindowProc(message, wParam, lParam);
+ processed = rc.result == 0;
+ }
+ }
+ break;
+#endif // !__WXMICROWIN__
+#endif // wxUSE_MENUS
+
+#ifndef __WXWINCE__
+ case WM_POWERBROADCAST:
+ {
+ bool vetoed;
+ processed = HandlePower(wParam, lParam, &vetoed);
+ rc.result = processed && vetoed ? BROADCAST_QUERY_DENY : TRUE;
+ }
+ break;
+#endif // __WXWINCE__
+
+#if wxUSE_UXTHEME
+ // If we want the default themed border then we need to draw it ourselves
+ case WM_NCCALCSIZE:
+ {
+ wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
+ const wxBorder border = TranslateBorder(GetBorder());
+ if (theme && border == wxBORDER_THEME)
+ {
+ // first ask the widget to calculate the border size
+ rc.result = MSWDefWindowProc(message, wParam, lParam);
+ processed = true;
+
+ // now alter the client size making room for drawing a
+ // themed border
+ RECT *rect;
+ NCCALCSIZE_PARAMS *csparam = NULL;
+ if ( wParam )
+ {
+ csparam = (NCCALCSIZE_PARAMS *)lParam;
+ rect = &csparam->rgrc[0];
+ }
+ else
+ {
+ rect = (RECT *)lParam;
+ }
+
+ wxUxThemeHandle hTheme((const wxWindow *)this, L"EDIT");
+ RECT rcClient = { 0, 0, 0, 0 };
+ wxClientDC dc((wxWindow *)this);
+ wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl();
+
+ if ( theme->GetThemeBackgroundContentRect
+ (
+ hTheme,
+ GetHdcOf(*impl),
+ EP_EDITTEXT,
+ ETS_NORMAL,
+ rect,
+ &rcClient) == S_OK )
+ {
+ InflateRect(&rcClient, -1, -1);
+ if (wParam)
+ csparam->rgrc[0] = rcClient;
+ else
+ *((RECT*)lParam) = rcClient;
+
+ // WVR_REDRAW triggers a bug whereby child windows are moved up and left,
+ // so don't use.
+ // rc.result = WVR_REDRAW;
+ }
+ }
+ }
+ break;
+
+ case WM_NCPAINT:
+ {
+ wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
+ const wxBorder border = TranslateBorder(GetBorder());
+ if (theme && border == wxBORDER_THEME)
+ {
+ // first ask the widget to paint its non-client area, such as scrollbars, etc.
+ rc.result = MSWDefWindowProc(message, wParam, lParam);
+ processed = true;
+
+ wxUxThemeHandle hTheme((const wxWindow *)this, L"EDIT");
+ wxWindowDC dc((wxWindow *)this);
+ wxMSWDCImpl *impl = (wxMSWDCImpl*) dc.GetImpl();
+
+ // Clip the DC so that you only draw on the non-client area
+ RECT rcBorder;
+ wxCopyRectToRECT(GetSize(), rcBorder);
+
+ RECT rcClient;
+ theme->GetThemeBackgroundContentRect(
+ hTheme, GetHdcOf(*impl), EP_EDITTEXT, ETS_NORMAL, &rcBorder, &rcClient);
+ InflateRect(&rcClient, -1, -1);
+
+ ::ExcludeClipRect(GetHdcOf(*impl), rcClient.left, rcClient.top,
+ rcClient.right, rcClient.bottom);
+
+ // Make sure the background is in a proper state
+ if (theme->IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
+ {
+ theme->DrawThemeParentBackground(GetHwnd(), GetHdcOf(*impl), &rcBorder);
+ }
+
+ // Draw the border
+ int nState;
+ if ( !IsEnabled() )
+ nState = ETS_DISABLED;
+ // should we check this?
+ //else if ( ::GetWindowLong(GetHwnd(), GWL_STYLE) & ES_READONLY)
+ // nState = ETS_READONLY;
+ else
+ nState = ETS_NORMAL;
+ theme->DrawThemeBackground(hTheme, GetHdcOf(*impl), EP_EDITTEXT, nState, &rcBorder, NULL);
+ }
+ }
+ break;
+
+#endif // wxUSE_UXTHEME
+
+ default:
+ // try a custom message handler
+ const MSWMessageHandlers::const_iterator
+ i = gs_messageHandlers.find(message);
+ if ( i != gs_messageHandlers.end() )
+ {
+ processed = (*i->second)(this, message, wParam, lParam);
+ }
+ }
+
+ if ( !processed )
+ return false;
+
+ *result = rc.result;
+
+ return true;
+}
+
+WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
+{
+ WXLRESULT result;
+ if ( !MSWHandleMessage(&result, message, wParam, lParam) )
+ {
+#if wxDEBUG_LEVEL >= 2
+ wxLogTrace("winmsg", wxT("Forwarding %s to DefWindowProc."),
+ wxGetMessageName(message));
+#endif // wxDEBUG_LEVEL >= 2
+ result = MSWDefWindowProc(message, wParam, lParam);
+ }
+
+ return result;
+}
+
+// ----------------------------------------------------------------------------
+// wxWindow <-> HWND map
+// ----------------------------------------------------------------------------
+
+wxWindow *wxFindWinFromHandle(HWND hwnd)
+{
+ WindowHandles::const_iterator i = gs_windowHandles.find(hwnd);
+ return i == gs_windowHandles.end() ? NULL : i->second;
+}
+
+void wxAssociateWinWithHandle(HWND hwnd, wxWindowMSW *win)
+{
+ // adding NULL hwnd is (first) surely a result of an error and
+ // (secondly) breaks menu command processing
+ wxCHECK_RET( hwnd != (HWND)NULL,
+ wxT("attempt to add a NULL hwnd to window list ignored") );
+
+#if wxDEBUG_LEVEL
+ WindowHandles::const_iterator i = gs_windowHandles.find(hwnd);
+ if ( i != gs_windowHandles.end() )
+ {
+ if ( i->second != win )
+ {
+ wxFAIL_MSG(
+ wxString::Format(
+ wxT("HWND %p already associated with another window (%s)"),
+ hwnd, win->GetClassInfo()->GetClassName()
+ )
+ );
+ }
+ //else: this actually happens currently because we associate the window
+ // with its HWND during creation (if we create it) and also when
+ // SubclassWin() is called later, this is ok
+ }
+#endif // wxDEBUG_LEVEL
+
+ gs_windowHandles[hwnd] = (wxWindow *)win;
+}
+
+void wxRemoveHandleAssociation(wxWindowMSW *win)
+{
+ gs_windowHandles.erase(GetHwndOf(win));
+}
+
+// ----------------------------------------------------------------------------
+// various MSW speciic class dependent functions
+// ----------------------------------------------------------------------------
+
+// Default destroyer - override if you destroy it in some other way
+// (e.g. with MDI child windows)
+void wxWindowMSW::MSWDestroyWindow()
+{
+}
+
+void wxWindowMSW::MSWGetCreateWindowCoords(const wxPoint& pos,
+ const wxSize& size,
+ int& x, int& y,
+ int& w, int& h) const
+{
+ // CW_USEDEFAULT can't be used for child windows so just position them at
+ // the origin by default
+ x = pos.x == wxDefaultCoord ? 0 : pos.x;
+ y = pos.y == wxDefaultCoord ? 0 : pos.y;
+
+ AdjustForParentClientOrigin(x, y);
+
+ // We don't have any clearly good choice for the size by default neither
+ // but we must use something non-zero.
+ w = WidthDefault(size.x);
+ h = HeightDefault(size.y);
+
+ /*
+ NB: there used to be some code here which set the initial size of the
+ window to the client size of the parent if no explicit size was
+ specified. This was wrong because wxWidgets programs often assume
+ that they get a WM_SIZE (EVT_SIZE) upon creation, however this broke
+ it. To see why, you should understand that Windows sends WM_SIZE from
+ inside ::CreateWindow() anyhow. However, ::CreateWindow() is called
+ from some base class ctor and so this WM_SIZE is not processed in the
+ real class' OnSize() (because it's not fully constructed yet and the
+ event goes to some base class OnSize() instead). So the WM_SIZE we
+ rely on is the one sent when the parent frame resizes its children
+ but here is the problem: if the child already has just the right
+ size, nothing will happen as both wxWidgets and Windows check for
+ this and ignore any attempts to change the window size to the size it
+ already has - so no WM_SIZE would be sent.
+ */
+}
+
+WXHWND wxWindowMSW::MSWGetParent() const
+{
+ return m_parent ? m_parent->GetHWND() : WXHWND(NULL);
+}
+
+bool wxWindowMSW::MSWCreate(const wxChar *wclass,
+ const wxChar *title,
+ const wxPoint& pos,
+ const wxSize& size,
+ WXDWORD style,
+ WXDWORD extendedStyle)
+{
+ // check a common bug in the user code: if the window is created with a
+ // non-default ctor and Create() is called too, we'd create 2 HWND for a
+ // single wxWindow object and this results in all sorts of trouble,
+ // especially for wxTLWs
+ wxCHECK_MSG( !m_hWnd, true, "window can't be recreated" );
+
+ // this can happen if this function is called using the return value of
+ // wxApp::GetRegisteredClassName() which failed
+ wxCHECK_MSG( wclass, false, "failed to register window class?" );
+
+
+ // choose the position/size for the new window
+ int x, y, w, h;
+ (void)MSWGetCreateWindowCoords(pos, size, x, y, w, h);
+
+ // controlId is menu handle for the top level windows, so set it to 0
+ // unless we're creating a child window
+ int controlId = style & WS_CHILD ? GetId() : 0;
+
+ // for each class "Foo" we have we also have "FooNR" ("no repaint") class
+ // which is the same but without CS_[HV]REDRAW class styles so using it
+ // ensures that the window is not fully repainted on each resize
+ wxString className(wclass);
+ if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
+ {
+ className += wxApp::GetNoRedrawClassSuffix();
+ }
+
+ // do create the window
+ wxWindowCreationHook hook(this);
+
+ m_hWnd = (WXHWND)::CreateWindowEx
+ (
+ extendedStyle,
+ className.t_str(),
+ title ? title : m_windowName.t_str(),
+ style,
+ x, y, w, h,
+ (HWND)MSWGetParent(),
+ (HMENU)wxUIntToPtr(controlId),
+ wxGetInstance(),
+ NULL // no extra data
+ );
+
+ if ( !m_hWnd )
+ {
+ wxLogSysError(_("Can't create window of class %s"), className.c_str());
+
+ return false;
+ }
+
+ SubclassWin(m_hWnd);
+
+ return true;
+}
+
+// ===========================================================================
+// MSW message handlers
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// WM_NOTIFY
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
+{
+#ifndef __WXMICROWIN__
+ LPNMHDR hdr = (LPNMHDR)lParam;
+ HWND hWnd = hdr->hwndFrom;
+ wxWindow *win = wxFindWinFromHandle(hWnd);
+
+ // if the control is one of our windows, let it handle the message itself
+ if ( win )
+ {
+ return win->MSWOnNotify(idCtrl, lParam, result);
+ }
+
+ // VZ: why did we do it? normally this is unnecessary and, besides, it
+ // breaks the message processing for the toolbars because the tooltip
+ // notifications were being forwarded to the toolbar child controls
+ // (if it had any) before being passed to the toolbar itself, so in my
+ // example the tooltip for the combobox was always shown instead of the
+ // correct button tooltips
+#if 0
+ // try all our children
+ wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ while ( node )
+ {
+ wxWindow *child = node->GetData();
+ if ( child->MSWOnNotify(idCtrl, lParam, result) )
+ {
+ return true;
+ }
+
+ node = node->GetNext();
+ }
+#endif // 0
+
+ // by default, handle it ourselves
+ return MSWOnNotify(idCtrl, lParam, result);
+#else // __WXMICROWIN__
+ return false;
+#endif
+}
+
+#if wxUSE_TOOLTIPS
+
+bool wxWindowMSW::HandleTooltipNotify(WXUINT code,
+ WXLPARAM lParam,
+ const wxString& ttip)
+{
+ // I don't know why it happens, but the versions of comctl32.dll starting
+ // from 4.70 sometimes send TTN_NEEDTEXTW even to ANSI programs (normally,
+ // this message is supposed to be sent to Unicode programs only) -- hence
+ // we need to handle it as well, otherwise no tooltips will be shown in
+ // this case
+#ifndef __WXWINCE__
+ if ( !(code == (WXUINT) TTN_NEEDTEXTA || code == (WXUINT) TTN_NEEDTEXTW)
+ || ttip.empty() )
+ {
+ // not a tooltip message or no tooltip to show anyhow
+ return false;
+ }
+#endif
+
+ LPTOOLTIPTEXT ttText = (LPTOOLTIPTEXT)lParam;
+
+ // We don't want to use the szText buffer because it has a limit of 80
+ // bytes and this is not enough, especially for Unicode build where it
+ // limits the tooltip string length to only 40 characters
+ //
+ // The best would be, of course, to not impose any length limitations at
+ // all but then the buffer would have to be dynamic and someone would have
+ // to free it and we don't have the tooltip owner object here any more, so
+ // for now use our own static buffer with a higher fixed max length.
+ //
+ // Note that using a static buffer should not be a problem as only a single
+ // tooltip can be shown at the same time anyhow.
+#if !wxUSE_UNICODE
+ if ( code == (WXUINT) TTN_NEEDTEXTW )
+ {
+ // We need to convert tooltip from multi byte to Unicode on the fly.
+ static wchar_t buf[513];
+
+ // Truncate tooltip length if needed as otherwise we might not have
+ // enough space for it in the buffer and MultiByteToWideChar() would
+ // return an error
+ size_t tipLength = wxMin(ttip.length(), WXSIZEOF(buf) - 1);
+
+ // Convert to WideChar without adding the NULL character. The NULL
+ // character is added afterwards (this is more efficient).
+ int len = ::MultiByteToWideChar
+ (
+ CP_ACP,
+ 0, // no flags
+ ttip.t_str(),
+ tipLength,
+ buf,
+ WXSIZEOF(buf) - 1
+ );
+
+ if ( !len )
+ {
+ wxLogLastError(wxT("MultiByteToWideChar()"));
+ }
+
+ buf[len] = L'\0';
+ ttText->lpszText = (LPSTR) buf;
+ }
+ else // TTN_NEEDTEXTA
+#endif // !wxUSE_UNICODE
+ {
+ // we get here if we got TTN_NEEDTEXTA (only happens in ANSI build) or
+ // if we got TTN_NEEDTEXTW in Unicode build: in this case we just have
+ // to copy the string we have into the buffer
+ static wxChar buf[513];
+ wxStrlcpy(buf, ttip.c_str(), WXSIZEOF(buf));
+ ttText->lpszText = buf;
+ }
+
+ return true;
+}
+
+#endif // wxUSE_TOOLTIPS
+
+bool wxWindowMSW::MSWOnNotify(int WXUNUSED(idCtrl),
+ WXLPARAM lParam,
+ WXLPARAM* WXUNUSED(result))
+{
+#if wxUSE_TOOLTIPS
+ if ( m_tooltip )
+ {
+ NMHDR* hdr = (NMHDR *)lParam;
+ if ( HandleTooltipNotify(hdr->code, lParam, m_tooltip->GetTip()))
+ {
+ // processed
+ return true;
+ }
+ }
+#else
+ wxUnusedVar(lParam);
+#endif // wxUSE_TOOLTIPS
+
+ return false;
+}
+
+// ---------------------------------------------------------------------------
+// end session messages
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleQueryEndSession(long logOff, bool *mayEnd)
+{
+#ifdef ENDSESSION_LOGOFF
+ wxCloseEvent event(wxEVT_QUERY_END_SESSION, wxID_ANY);
+ event.SetEventObject(wxTheApp);
+ event.SetCanVeto(true);
+ event.SetLoggingOff(logOff == (long)ENDSESSION_LOGOFF);
+
+ bool rc = wxTheApp->ProcessEvent(event);
+
+ if ( rc )
+ {
+ // we may end only if the app didn't veto session closing (double
+ // negation...)
+ *mayEnd = !event.GetVeto();
+ }
+
+ return rc;
+#else
+ wxUnusedVar(logOff);
+ wxUnusedVar(mayEnd);
+ return false;
+#endif
+}
+
+bool wxWindowMSW::HandleEndSession(bool endSession, long logOff)
+{
+#ifdef ENDSESSION_LOGOFF
+ // do nothing if the session isn't ending
+ if ( !endSession )
+ return false;
+
+ // only send once
+ if ( (this != wxTheApp->GetTopWindow()) )
+ return false;
+
+ wxCloseEvent event(wxEVT_END_SESSION, wxID_ANY);
+ event.SetEventObject(wxTheApp);
+ event.SetCanVeto(false);
+ event.SetLoggingOff((logOff & ENDSESSION_LOGOFF) != 0);
+
+ return wxTheApp->ProcessEvent(event);
+#else
+ wxUnusedVar(endSession);
+ wxUnusedVar(logOff);
+ return false;
+#endif
+}
+
+// ---------------------------------------------------------------------------
+// window creation/destruction
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleCreate(WXLPCREATESTRUCT WXUNUSED_IN_WINCE(cs),
+ bool *mayCreate)
+{
+ // VZ: why is this commented out for WinCE? If it doesn't support
+ // WS_EX_CONTROLPARENT at all it should be somehow handled globally,
+ // not with multiple #ifdef's!
+#ifndef __WXWINCE__
+ if ( ((CREATESTRUCT *)cs)->dwExStyle & WS_EX_CONTROLPARENT )
+ EnsureParentHasControlParentStyle(GetParent());
+#endif // !__WXWINCE__
+
+ *mayCreate = true;
+
+ return true;
+}
+
+bool wxWindowMSW::HandleDestroy()
+{
+ // delete our drop target if we've got one
+#if wxUSE_DRAG_AND_DROP
+ if ( m_dropTarget != NULL )
+ {
+ m_dropTarget->Revoke(m_hWnd);
+
+ wxDELETE(m_dropTarget);
+ }
+#endif // wxUSE_DRAG_AND_DROP
+
+ // WM_DESTROY handled
+ return true;
+}
+
+// ---------------------------------------------------------------------------
+// activation/focus
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleActivate(int state,
+ bool WXUNUSED(minimized),
+ WXHWND WXUNUSED(activate))
+{
+ wxActivateEvent event(wxEVT_ACTIVATE,
+ (state == WA_ACTIVE) || (state == WA_CLICKACTIVE),
+ m_windowId,
+ state == WA_CLICKACTIVE
+ ? wxActivateEvent::Reason_Mouse
+ : wxActivateEvent::Reason_Unknown);
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleSetFocus(WXHWND hwnd)
+{
+ // Strangly enough, some controls get set focus events when they are being
+ // deleted, even if they already had focus before.
+ if ( m_isBeingDeleted )
+ {
+ return false;
+ }
+
+ // notify the parent keeping track of focus for the kbd navigation
+ // purposes that we got it
+ wxChildFocusEvent eventFocus((wxWindow *)this);
+ (void)HandleWindowEvent(eventFocus);
+
+#if wxUSE_CARET
+ // Deal with caret
+ if ( m_caret )
+ {
+ m_caret->OnSetFocus();
+ }
+#endif // wxUSE_CARET
+
+ wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId);
+ event.SetEventObject(this);
+
+ // wxFindWinFromHandle() may return NULL, it is ok
+ event.SetWindow(wxFindWinFromHandle(hwnd));
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleKillFocus(WXHWND hwnd)
+{
+#if wxUSE_CARET
+ // Deal with caret
+ if ( m_caret )
+ {
+ m_caret->OnKillFocus();
+ }
+#endif // wxUSE_CARET
+
+ // Don't send the event when in the process of being deleted. This can
+ // only cause problems if the event handler tries to access the object.
+ if ( m_isBeingDeleted )
+ {
+ return false;
+ }
+
+ wxFocusEvent event(wxEVT_KILL_FOCUS, m_windowId);
+ event.SetEventObject(this);
+
+ // wxFindWinFromHandle() may return NULL, it is ok
+ event.SetWindow(wxFindWinFromHandle(hwnd));
+
+ return HandleWindowEvent(event);
+}
+
+// ---------------------------------------------------------------------------
+// labels
+// ---------------------------------------------------------------------------
+
+void wxWindowMSW::SetLabel( const wxString& label)
+{
+ SetWindowText(GetHwnd(), label.c_str());
+}
+
+wxString wxWindowMSW::GetLabel() const
+{
+ return wxGetWindowText(GetHWND());
+}
+
+// ---------------------------------------------------------------------------
+// miscellaneous
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleShow(bool show, int WXUNUSED(status))
+{
+ wxShowEvent event(GetId(), show);
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleInitDialog(WXHWND WXUNUSED(hWndFocus))
+{
+ wxInitDialogEvent event(GetId());
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam)
+{
+#if defined (__WXMICROWIN__) || defined(__WXWINCE__)
+ wxUnusedVar(wParam);
+ return false;
+#else // __WXMICROWIN__
+ HDROP hFilesInfo = (HDROP) wParam;
+
+ // Get the total number of files dropped
+ UINT gwFilesDropped = ::DragQueryFile
+ (
+ (HDROP)hFilesInfo,
+ (UINT)-1,
+ (LPTSTR)0,
+ (UINT)0
+ );
+
+ wxString *files = new wxString[gwFilesDropped];
+ for ( UINT wIndex = 0; wIndex < gwFilesDropped; wIndex++ )
+ {
+ // first get the needed buffer length (+1 for terminating NUL)
+ size_t len = ::DragQueryFile(hFilesInfo, wIndex, NULL, 0) + 1;
+
+ // and now get the file name
+ ::DragQueryFile(hFilesInfo, wIndex,
+ wxStringBuffer(files[wIndex], len), len);
+ }
+
+ wxDropFilesEvent event(wxEVT_DROP_FILES, gwFilesDropped, files);
+ event.SetEventObject(this);
+
+ POINT dropPoint;
+ DragQueryPoint(hFilesInfo, (LPPOINT) &dropPoint);
+ event.m_pos.x = dropPoint.x;
+ event.m_pos.y = dropPoint.y;
+
+ DragFinish(hFilesInfo);
+
+ return HandleWindowEvent(event);
+#endif
+}
+
+
+bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
+ short nHitTest,
+ int WXUNUSED(mouseMsg))
+{
+#ifndef __WXMICROWIN__
+ // the logic is as follows:
+ // 0. if we're busy, set the busy cursor (even for non client elements)
+ // 1. don't set custom cursor for non client area of enabled windows
+ // 2. ask user EVT_SET_CURSOR handler for the cursor
+ // 3. if still no cursor but we're in a TLW, set the global cursor
+
+ HCURSOR hcursor = 0;
+
+ // Check for "business" is complicated by the fact that modal dialogs shown
+ // while busy cursor is in effect shouldn't show it as they are active and
+ // accept input from the user, unlike all the other windows.
+ bool isBusy = false;
+ if ( wxIsBusy() )
+ {
+ wxDialog* const
+ dlg = wxDynamicCast(wxGetTopLevelParent(this), wxDialog);
+ if ( !dlg || !dlg->IsModal() )
+ isBusy = true;
+ }
+
+ if ( isBusy )
+ {
+ hcursor = wxGetCurrentBusyCursor();
+ }
+ else // not busy
+ {
+ if ( nHitTest != HTCLIENT )
+ return false;
+
+ // first ask the user code - it may wish to set the cursor in some very
+ // specific way (for example, depending on the current position)
+ POINT pt;
+ wxGetCursorPosMSW(&pt);
+
+ int x = pt.x,
+ y = pt.y;
+ ScreenToClient(&x, &y);
+ wxSetCursorEvent event(x, y);
+ event.SetId(GetId());
+ event.SetEventObject(this);
+
+ bool processedEvtSetCursor = HandleWindowEvent(event);
+ if ( processedEvtSetCursor && event.HasCursor() )
+ {
+ hcursor = GetHcursorOf(event.GetCursor());
+ }
+
+ if ( !hcursor )
+ {
+ // the test for processedEvtSetCursor is here to prevent using
+ // m_cursor if the user code caught EVT_SET_CURSOR() and returned
+ // nothing from it - this is a way to say that our cursor shouldn't
+ // be used for this point
+ if ( !processedEvtSetCursor && m_cursor.IsOk() )
+ {
+ hcursor = GetHcursorOf(m_cursor);
+ }
+
+ if ( !hcursor && !GetParent() )
+ {
+ const wxCursor *cursor = wxGetGlobalCursor();
+ if ( cursor && cursor->IsOk() )
+ {
+ hcursor = GetHcursorOf(*cursor);
+ }
+ }
+ }
+ }
+
+
+ if ( hcursor )
+ {
+ ::SetCursor(hcursor);
+
+ // cursor set, stop here
+ return true;
+ }
+#endif // __WXMICROWIN__
+
+ // pass up the window chain
+ return false;
+}
+
+bool wxWindowMSW::HandlePower(WXWPARAM WXUNUSED_IN_WINCE(wParam),
+ WXLPARAM WXUNUSED(lParam),
+ bool *WXUNUSED_IN_WINCE(vetoed))
+{
+#ifdef __WXWINCE__
+ // FIXME
+ return false;
+#else
+ wxEventType evtType;
+ switch ( wParam )
+ {
+ case PBT_APMQUERYSUSPEND:
+ evtType = wxEVT_POWER_SUSPENDING;
+ break;
+
+ case PBT_APMQUERYSUSPENDFAILED:
+ evtType = wxEVT_POWER_SUSPEND_CANCEL;
+ break;
+
+ case PBT_APMSUSPEND:
+ evtType = wxEVT_POWER_SUSPENDED;
+ break;
+
+ case PBT_APMRESUMESUSPEND:
+ evtType = wxEVT_POWER_RESUME;
+ break;
+
+ default:
+ wxLogDebug(wxT("Unknown WM_POWERBROADCAST(%d) event"), wParam);
+ // fall through
+
+ // these messages are currently not mapped to wx events
+ case PBT_APMQUERYSTANDBY:
+ case PBT_APMQUERYSTANDBYFAILED:
+ case PBT_APMSTANDBY:
+ case PBT_APMRESUMESTANDBY:
+ case PBT_APMBATTERYLOW:
+ case PBT_APMPOWERSTATUSCHANGE:
+ case PBT_APMOEMEVENT:
+ case PBT_APMRESUMECRITICAL:
+#ifdef PBT_APMRESUMEAUTOMATIC
+ case PBT_APMRESUMEAUTOMATIC:
+#endif
+ evtType = wxEVT_NULL;
+ break;
+ }
+
+ // don't handle unknown messages
+ if ( evtType == wxEVT_NULL )
+ return false;
+
+ // TODO: notify about PBTF_APMRESUMEFROMFAILURE in case of resume events?
+
+ wxPowerEvent event(evtType);
+ if ( !HandleWindowEvent(event) )
+ return false;
+
+ *vetoed = event.IsVetoed();
+
+ return true;
+#endif
+}
+
+bool wxWindowMSW::IsDoubleBuffered() const
+{
+ for ( const wxWindowMSW *win = this; win; win = win->GetParent() )
+ {
+ if ( wxHasWindowExStyle(win, WS_EX_COMPOSITED) )
+ return true;
+
+ if ( win->IsTopLevel() )
+ break;
+ }
+
+ return false;
+}
+
+void wxWindowMSW::SetDoubleBuffered(bool on)
+{
+ // Get the current extended style bits
+ long exstyle = wxGetWindowExStyle(this);
+
+ // Twiddle the bit as needed
+ if ( on )
+ exstyle |= WS_EX_COMPOSITED;
+ else
+ exstyle &= ~WS_EX_COMPOSITED;
+
+ // put it back
+ wxSetWindowExStyle(this, exstyle);
+}
+
+// ---------------------------------------------------------------------------
+// owner drawn stuff
+// ---------------------------------------------------------------------------
+
+#if (wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE) || \
+ (wxUSE_CONTROLS && !defined(__WXUNIVERSAL__))
+ #define WXUNUSED_UNLESS_ODRAWN(param) param
+#else
+ #define WXUNUSED_UNLESS_ODRAWN(param)
+#endif
+
+bool
+wxWindowMSW::MSWOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id),
+ WXDRAWITEMSTRUCT * WXUNUSED_UNLESS_ODRAWN(itemStruct))
+{
+#if wxUSE_OWNER_DRAWN
+
+#if wxUSE_MENUS_NATIVE
+ // is it a menu item?
+ DRAWITEMSTRUCT *pDrawStruct = (DRAWITEMSTRUCT *)itemStruct;
+ if ( id == 0 && pDrawStruct->CtlType == ODT_MENU )
+ {
+ wxMenuItem *pMenuItem = (wxMenuItem *)(pDrawStruct->itemData);
+
+ // see comment before the same test in MSWOnMeasureItem() below
+ if ( !pMenuItem )
+ return false;
+
+ wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem),
+ false, wxT("MSWOnDrawItem: bad wxMenuItem pointer") );
+
+ // prepare to call OnDrawItem(): notice using of wxDCTemp to prevent
+ // the DC from being released
+ wxDCTemp dc((WXHDC)pDrawStruct->hDC);
+ wxRect rect(pDrawStruct->rcItem.left, pDrawStruct->rcItem.top,
+ pDrawStruct->rcItem.right - pDrawStruct->rcItem.left,
+ pDrawStruct->rcItem.bottom - pDrawStruct->rcItem.top);
+
+ return pMenuItem->OnDrawItem
+ (
+ dc,
+ rect,
+ (wxOwnerDrawn::wxODAction)pDrawStruct->itemAction,
+ (wxOwnerDrawn::wxODStatus)pDrawStruct->itemState
+ );
+ }
+#endif // wxUSE_MENUS_NATIVE
+
+#endif // USE_OWNER_DRAWN
+
+#if wxUSE_CONTROLS && !defined(__WXUNIVERSAL__)
+
+#if wxUSE_OWNER_DRAWN
+ wxControl *item = wxDynamicCast(FindItem(id), wxControl);
+#else // !wxUSE_OWNER_DRAWN
+ // we may still have owner-drawn buttons internally because we have to make
+ // them owner-drawn to support colour change
+ wxControl *item =
+# if wxUSE_BUTTON
+ wxDynamicCast(FindItem(id), wxButton)
+# else
+ NULL
+# endif
+ ;
+#endif // USE_OWNER_DRAWN
+
+ if ( item )
+ {
+ return item->MSWOnDraw(itemStruct);
+ }
+
+#endif // wxUSE_CONTROLS
+
+ return false;
+}
+
+bool
+wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct)
+{
+#if wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE
+ // is it a menu item?
+ MEASUREITEMSTRUCT *pMeasureStruct = (MEASUREITEMSTRUCT *)itemStruct;
+ if ( id == 0 && pMeasureStruct->CtlType == ODT_MENU )
+ {
+ wxMenuItem *pMenuItem = (wxMenuItem *)(pMeasureStruct->itemData);
+
+ // according to Carsten Fuchs the pointer may be NULL under XP if an
+ // MDI child frame is initially maximized, see this for more info:
+ // http://article.gmane.org/gmane.comp.lib.wxwidgets.general/27745
+ //
+ // so silently ignore it instead of asserting
+ if ( !pMenuItem )
+ return false;
+
+ wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem),
+ false, wxT("MSWOnMeasureItem: bad wxMenuItem pointer") );
+
+ size_t w, h;
+ bool rc = pMenuItem->OnMeasureItem(&w, &h);
+
+ pMeasureStruct->itemWidth = w;
+ pMeasureStruct->itemHeight = h;
+
+ return rc;
+ }
+
+ wxControl *item = wxDynamicCast(FindItem(id), wxControl);
+ if ( item )
+ {
+ return item->MSWOnMeasure(itemStruct);
+ }
+#else
+ wxUnusedVar(id);
+ wxUnusedVar(itemStruct);
+#endif // wxUSE_OWNER_DRAWN && wxUSE_MENUS_NATIVE
+
+ return false;
+}
+
+// ---------------------------------------------------------------------------
+// colours and palettes
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleSysColorChange()
+{
+ wxSysColourChangedEvent event;
+ event.SetEventObject(this);
+
+ (void)HandleWindowEvent(event);
+
+ // always let the system carry on the default processing to allow the
+ // native controls to react to the colours update
+ return false;
+}
+
+bool wxWindowMSW::HandleDisplayChange()
+{
+ wxDisplayChangedEvent event;
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+#ifndef __WXMICROWIN__
+
+bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC hDC, WXHWND hWnd)
+{
+#if !wxUSE_CONTROLS || defined(__WXUNIVERSAL__)
+ wxUnusedVar(hDC);
+ wxUnusedVar(hWnd);
+#else
+ wxControl *item = wxDynamicCast(FindItemByHWND(hWnd, true), wxControl);
+
+ if ( item )
+ *brush = item->MSWControlColor(hDC, hWnd);
+ else
+#endif // wxUSE_CONTROLS
+ *brush = NULL;
+
+ return *brush != NULL;
+}
+
+#endif // __WXMICROWIN__
+
+bool wxWindowMSW::HandlePaletteChanged(WXHWND hWndPalChange)
+{
+#if wxUSE_PALETTE
+ // same as below except we don't respond to our own messages
+ if ( hWndPalChange != GetHWND() )
+ {
+ // check to see if we our our parents have a custom palette
+ wxWindowMSW *win = this;
+ while ( win && !win->HasCustomPalette() )
+ {
+ win = win->GetParent();
+ }
+
+ if ( win && win->HasCustomPalette() )
+ {
+ // realize the palette to see whether redrawing is needed
+ HDC hdc = ::GetDC((HWND) hWndPalChange);
+ win->m_palette.SetHPALETTE((WXHPALETTE)
+ ::SelectPalette(hdc, GetHpaletteOf(win->m_palette), FALSE));
+
+ int result = ::RealizePalette(hdc);
+
+ // restore the palette (before releasing the DC)
+ win->m_palette.SetHPALETTE((WXHPALETTE)
+ ::SelectPalette(hdc, GetHpaletteOf(win->m_palette), FALSE));
+ ::RealizePalette(hdc);
+ ::ReleaseDC((HWND) hWndPalChange, hdc);
+
+ // now check for the need to redraw
+ if (result > 0)
+ ::InvalidateRect((HWND) hWndPalChange, NULL, TRUE);
+ }
+
+ }
+#endif // wxUSE_PALETTE
+
+ wxPaletteChangedEvent event(GetId());
+ event.SetEventObject(this);
+ event.SetChangedWindow(wxFindWinFromHandle(hWndPalChange));
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleCaptureChanged(WXHWND hWndGainedCapture)
+{
+ // Ensure that wxWindow::GetCapture() returns NULL if called from the event
+ // handlers invoked below. This is necessary to avoid wrongly calling
+ // ReleaseMouse() when we're already losing the mouse capture anyhow.
+ gs_insideCaptureChanged = true;
+ wxON_BLOCK_EXIT_SET(gs_insideCaptureChanged, false);
+
+ // notify windows on the capture stack about lost capture
+ // (see http://sourceforge.net/tracker/index.php?func=detail&aid=1153662&group_id=9863&atid=109863):
+ wxWindowBase::NotifyCaptureLost();
+
+ wxWindow *win = wxFindWinFromHandle(hWndGainedCapture);
+ wxMouseCaptureChangedEvent event(GetId(), win);
+ event.SetEventObject(this);
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleSettingChange(WXWPARAM wParam, WXLPARAM lParam)
+{
+ // despite MSDN saying "(This message cannot be sent directly to a window.)"
+ // we need to send this to child windows (it is only sent to top-level
+ // windows) so {list,tree}ctrls can adjust their font size if necessary
+ // this is exactly how explorer does it to enable the font size changes
+
+ wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ while ( node )
+ {
+ // top-level windows already get this message from the system
+ wxWindow *win = node->GetData();
+ if ( !win->IsTopLevel() )
+ {
+ ::SendMessage(GetHwndOf(win), WM_SETTINGCHANGE, wParam, lParam);
+ }
+
+ node = node->GetNext();
+ }
+
+ // let the system handle it
+ return false;
+}
+
+bool wxWindowMSW::HandleQueryNewPalette()
+{
+
+#if wxUSE_PALETTE
+ // check to see if we our our parents have a custom palette
+ wxWindowMSW *win = this;
+ while (!win->HasCustomPalette() && win->GetParent()) win = win->GetParent();
+ if (win->HasCustomPalette()) {
+ /* realize the palette to see whether redrawing is needed */
+ HDC hdc = ::GetDC((HWND) GetHWND());
+ win->m_palette.SetHPALETTE( (WXHPALETTE)
+ ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), FALSE) );
+
+ int result = ::RealizePalette(hdc);
+ /* restore the palette (before releasing the DC) */
+ win->m_palette.SetHPALETTE( (WXHPALETTE)
+ ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), TRUE) );
+ ::RealizePalette(hdc);
+ ::ReleaseDC((HWND) GetHWND(), hdc);
+ /* now check for the need to redraw */
+ if (result > 0)
+ ::InvalidateRect((HWND) GetHWND(), NULL, TRUE);
+ }
+#endif // wxUSE_PALETTE
+
+ wxQueryNewPaletteEvent event(GetId());
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event) && event.GetPaletteRealized();
+}
+
+// Responds to colour changes: passes event on to children.
+void wxWindowMSW::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
+{
+ // the top level window also reset the standard colour map as it might have
+ // changed (there is no need to do it for the non top level windows as we
+ // only have to do it once)
+ if ( IsTopLevel() )
+ {
+ // FIXME-MT
+ gs_hasStdCmap = false;
+ }
+ wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ while ( node )
+ {
+ // Only propagate to non-top-level windows because Windows already
+ // sends this event to all top-level ones
+ wxWindow *win = node->GetData();
+ if ( !win->IsTopLevel() )
+ {
+ // we need to send the real WM_SYSCOLORCHANGE and not just trigger
+ // EVT_SYS_COLOUR_CHANGED call because the latter wouldn't work for
+ // the standard controls
+ ::SendMessage(GetHwndOf(win), WM_SYSCOLORCHANGE, 0, 0);
+ }
+
+ node = node->GetNext();
+ }
+}
+
+extern wxCOLORMAP *wxGetStdColourMap()
+{
+ static COLORREF s_stdColours[wxSTD_COL_MAX];
+ static wxCOLORMAP s_cmap[wxSTD_COL_MAX];
+
+ if ( !gs_hasStdCmap )
+ {
+ static bool s_coloursInit = false;
+
+ if ( !s_coloursInit )
+ {
+ // When a bitmap is loaded, the RGB values can change (apparently
+ // because Windows adjusts them to care for the old programs always
+ // using 0xc0c0c0 while the transparent colour for the new Windows
+ // versions is different). But we do this adjustment ourselves so
+ // we want to avoid Windows' "help" and for this we need to have a
+ // reference bitmap which can tell us what the RGB values change
+ // to.
+ wxLogNull logNo; // suppress error if we couldn't load the bitmap
+ wxBitmap stdColourBitmap(wxT("wxBITMAP_STD_COLOURS"));
+ if ( stdColourBitmap.IsOk() )
+ {
+ // the pixels in the bitmap must correspond to wxSTD_COL_XXX!
+ wxASSERT_MSG( stdColourBitmap.GetWidth() == wxSTD_COL_MAX,
+ wxT("forgot to update wxBITMAP_STD_COLOURS!") );
+
+ wxMemoryDC memDC;
+ memDC.SelectObject(stdColourBitmap);
+
+ wxColour colour;
+ for ( size_t i = 0; i < WXSIZEOF(s_stdColours); i++ )
+ {
+ memDC.GetPixel(i, 0, &colour);
+ s_stdColours[i] = wxColourToRGB(colour);
+ }
+ }
+ else // wxBITMAP_STD_COLOURS couldn't be loaded
+ {
+ s_stdColours[0] = RGB(000,000,000); // black
+ s_stdColours[1] = RGB(128,128,128); // dark grey
+ s_stdColours[2] = RGB(192,192,192); // light grey
+ s_stdColours[3] = RGB(255,255,255); // white
+ //s_stdColours[4] = RGB(000,000,255); // blue
+ //s_stdColours[5] = RGB(255,000,255); // magenta
+ }
+
+ s_coloursInit = true;
+ }
+
+ gs_hasStdCmap = true;
+
+ // create the colour map
+#define INIT_CMAP_ENTRY(col) \
+ s_cmap[wxSTD_COL_##col].from = s_stdColours[wxSTD_COL_##col]; \
+ s_cmap[wxSTD_COL_##col].to = ::GetSysColor(COLOR_##col)
+
+ INIT_CMAP_ENTRY(BTNTEXT);
+ INIT_CMAP_ENTRY(BTNSHADOW);
+ INIT_CMAP_ENTRY(BTNFACE);
+ INIT_CMAP_ENTRY(BTNHIGHLIGHT);
+
+#undef INIT_CMAP_ENTRY
+ }
+
+ return s_cmap;
+}
+
+#if wxUSE_UXTHEME && !defined(TMT_FILLCOLOR)
+ #define TMT_FILLCOLOR 3802
+ #define TMT_TEXTCOLOR 3803
+ #define TMT_BORDERCOLOR 3801
+#endif
+
+wxColour wxWindowMSW::MSWGetThemeColour(const wchar_t *themeName,
+ int themePart,
+ int themeState,
+ MSWThemeColour themeColour,
+ wxSystemColour fallback) const
+{
+#if wxUSE_UXTHEME
+ const wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
+ if ( theme )
+ {
+ int themeProperty = 0;
+
+ // TODO: Convert this into a table? Sure would be faster.
+ switch ( themeColour )
+ {
+ case ThemeColourBackground:
+ themeProperty = TMT_FILLCOLOR;
+ break;
+ case ThemeColourText:
+ themeProperty = TMT_TEXTCOLOR;
+ break;
+ case ThemeColourBorder:
+ themeProperty = TMT_BORDERCOLOR;
+ break;
+ default:
+ wxFAIL_MSG(wxT("unsupported theme colour"));
+ };
+
+ wxUxThemeHandle hTheme((const wxWindow *)this, themeName);
+ COLORREF col;
+ HRESULT hr = theme->GetThemeColor
+ (
+ hTheme,
+ themePart,
+ themeState,
+ themeProperty,
+ &col
+ );
+
+ if ( SUCCEEDED(hr) )
+ return wxRGBToColour(col);
+
+ wxLogApiError(
+ wxString::Format(
+ "GetThemeColor(%s, %i, %i, %i)",
+ themeName, themePart, themeState, themeProperty),
+ hr);
+ }
+#else
+ wxUnusedVar(themeName);
+ wxUnusedVar(themePart);
+ wxUnusedVar(themeState);
+ wxUnusedVar(themeColour);
+#endif
+ return wxSystemSettings::GetColour(fallback);
+}
+
+// ---------------------------------------------------------------------------
+// painting
+// ---------------------------------------------------------------------------
+
+// this variable is used to check that a paint event handler which processed
+// the event did create a wxPaintDC inside its code and called BeginPaint() to
+// validate the invalidated window area as otherwise we'd keep getting an
+// endless stream of WM_PAINT messages for this window resulting in a lot of
+// difficult to debug problems (e.g. impossibility to repaint other windows,
+// lack of timer and idle events and so on)
+extern bool wxDidCreatePaintDC;
+bool wxDidCreatePaintDC = false;
+
+bool wxWindowMSW::HandlePaint()
+{
+ HRGN hRegion = ::CreateRectRgn(0, 0, 0, 0); // Dummy call to get a handle
+ if ( !hRegion )
+ {
+ wxLogLastError(wxT("CreateRectRgn"));
+ }
+ if ( ::GetUpdateRgn(GetHwnd(), hRegion, FALSE) == ERROR )
+ {
+ wxLogLastError(wxT("GetUpdateRgn"));
+ }
+
+ m_updateRegion = wxRegion((WXHRGN) hRegion);
+
+ wxDidCreatePaintDC = false;
+
+ wxPaintEvent event(m_windowId);
+ event.SetEventObject(this);
+
+ bool processed = HandleWindowEvent(event);
+
+ if ( processed && !wxDidCreatePaintDC )
+ {
+ // do call MSWDefWindowProc() to validate the update region to avoid
+ // the problems mentioned above
+ processed = false;
+ }
+
+ // note that we must generate NC event after the normal one as otherwise
+ // BeginPaint() will happily overwrite our decorations with the background
+ // colour
+ wxNcPaintEvent eventNc(m_windowId);
+ eventNc.SetEventObject(this);
+ HandleWindowEvent(eventNc);
+
+ // don't keep an HRGN we don't need any longer (GetUpdateRegion() can only
+ // be called from inside the event handlers called above)
+ m_updateRegion.Clear();
+
+ wxPaintDCImpl::EndPaint((wxWindow *)this);
+
+ return processed;
+}
+
+// Can be called from an application's OnPaint handler
+void wxWindowMSW::OnPaint(wxPaintEvent& event)
+{
+#ifdef __WXUNIVERSAL__
+ event.Skip();
+#else
+ HDC hDC = (HDC) wxPaintDCImpl::FindDCInCache((wxWindow*) event.GetEventObject());
+ if (hDC != 0)
+ {
+ MSWDefWindowProc(WM_PAINT, (WPARAM) hDC, 0);
+ }
+#endif
+}
+
+bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc)
+{
+ if ( IsBeingDeleted() )
+ {
+ // We can get WM_ERASEBKGND after starting the destruction of our top
+ // level parent. Handling it in this case is unnecessary and can be
+ // actually harmful as e.g. wxStaticBox::GetClientSize() doesn't work
+ // without a valid TLW parent (because it uses dialog units internally
+ // which use the dialog font), so just don't do anything then.
+ return false;
+ }
+
+ switch ( GetBackgroundStyle() )
+ {
+ case wxBG_STYLE_ERASE:
+ case wxBG_STYLE_COLOUR:
+ // we need to generate an erase background event
+ {
+ wxDCTemp dc(hdc, GetClientSize());
+ wxDCTempImpl *impl = (wxDCTempImpl*) dc.GetImpl();
+
+ impl->SetHDC(hdc);
+ impl->SetWindow((wxWindow *)this);
+
+ wxEraseEvent event(m_windowId, &dc);
+ event.SetEventObject(this);
+ bool rc = HandleWindowEvent(event);
+
+ // must be called manually as ~wxDC doesn't do anything for
+ // wxDCTemp
+ impl->SelectOldObjects(hdc);
+
+ if ( rc )
+ {
+ // background erased by the user-defined handler
+ return true;
+ }
+ }
+ // fall through
+
+ case wxBG_STYLE_SYSTEM:
+ if ( !DoEraseBackground(hdc) )
+ {
+ // let the default processing to take place if we didn't erase
+ // the background ourselves
+ return false;
+ }
+ break;
+
+ case wxBG_STYLE_PAINT:
+ case wxBG_STYLE_TRANSPARENT:
+ // no need to do anything here at all, background will be entirely
+ // redrawn in WM_PAINT handler
+ break;
+
+ default:
+ wxFAIL_MSG( "unknown background style" );
+ }
+
+ return true;
+}
+
+#ifdef wxHAS_MSW_BACKGROUND_ERASE_HOOK
+
+bool wxWindowMSW::MSWHasEraseBgHook() const
+{
+ return gs_eraseBgHooks.find(const_cast(this))
+ != gs_eraseBgHooks.end();
+}
+
+void wxWindowMSW::MSWSetEraseBgHook(wxWindow *child)
+{
+ if ( child )
+ {
+ if ( !gs_eraseBgHooks.insert(
+ EraseBgHooks::value_type(this, child)).second )
+ {
+ wxFAIL_MSG( wxT("Setting erase background hook twice?") );
+ }
+ }
+ else // reset the hook
+ {
+ if ( gs_eraseBgHooks.erase(this) != 1 )
+ {
+ wxFAIL_MSG( wxT("Resetting erase background which was not set?") );
+ }
+ }
+}
+
+#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
+
+bool wxWindowMSW::DoEraseBackground(WXHDC hDC)
+{
+ HBRUSH hbr = (HBRUSH)MSWGetBgBrush(hDC);
+ if ( !hbr )
+ return false;
+
+ // erase just the client area of the window, this is important for the
+ // frames to avoid drawing over the toolbar part of the window (you might
+ // think using WS_CLIPCHILDREN would prevent this from happening, but it
+ // clearly doesn't)
+ RECT rc;
+ wxCopyRectToRECT(GetClientRect(), rc);
+ ::FillRect((HDC)hDC, &rc, hbr);
+
+ return true;
+}
+
+WXHBRUSH
+wxWindowMSW::MSWGetBgBrushForChild(WXHDC hDC, wxWindowMSW *child)
+{
+ // Test for the custom background brush first.
+ WXHBRUSH hbrush = MSWGetCustomBgBrush();
+ if ( hbrush )
+ {
+ // We assume that this is either a stipple or hatched brush and not a
+ // solid one as otherwise it would have been enough to set the
+ // background colour and such brushes need to be positioned correctly
+ // in order to align when different windows are painted, so do it here.
+ RECT rc;
+ ::GetWindowRect(GetHwndOf(child), &rc);
+
+ ::MapWindowPoints(NULL, GetHwnd(), (POINT *)&rc, 1);
+
+ int x = rc.left,
+ y = rc.top;
+ MSWAdjustBrushOrg(&x, &y);
+
+ if ( !::SetBrushOrgEx((HDC)hDC, -x, -y, NULL) )
+ {
+ wxLogLastError(wxT("SetBrushOrgEx(bg brush)"));
+ }
+
+ return hbrush;
+ }
+
+ // Otherwise see if we have a custom background colour.
+ if ( m_hasBgCol )
+ {
+ wxBrush *
+ brush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour());
+
+ return (WXHBRUSH)GetHbrushOf(*brush);
+ }
+
+ return 0;
+}
+
+WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC)
+{
+ // Use the special wxWindowBeingErased variable if it is set as the child
+ // being erased.
+ wxWindowMSW * const child =
+#if wxUSE_UXTHEME
+ wxWindowBeingErased ? wxWindowBeingErased :
+#endif
+ this;
+
+ for ( wxWindowMSW *win = this; win; win = win->GetParent() )
+ {
+ WXHBRUSH hBrush = win->MSWGetBgBrushForChild(hDC, child);
+ if ( hBrush )
+ return hBrush;
+
+ // don't use the parent background if we're not transparent
+ if ( !win->HasTransparentBackground() )
+ break;
+
+ // background is not inherited beyond top level windows
+ if ( win->IsTopLevel() )
+ break;
+ }
+
+ return 0;
+}
+
+bool wxWindowMSW::HandlePrintClient(WXHDC hDC)
+{
+ // we receive this message when DrawThemeParentBackground() is
+ // called from def window proc of several controls under XP and we
+ // must draw properly themed background here
+ //
+ // note that naively I'd expect filling the client rect with the
+ // brush returned by MSWGetBgBrush() work -- but for some reason it
+ // doesn't and we have to call parents MSWPrintChild() which is
+ // supposed to call DrawThemeBackground() with appropriate params
+ //
+ // also note that in this case lParam == PRF_CLIENT but we're
+ // clearly expected to paint the background and nothing else!
+
+ if ( IsTopLevel() || InheritsBackgroundColour() )
+ return false;
+
+ // sometimes we don't want the parent to handle it at all, instead
+ // return whatever value this window wants
+ if ( !MSWShouldPropagatePrintChild() )
+ return MSWPrintChild(hDC, (wxWindow *)this);
+
+ for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
+ {
+ if ( win->MSWPrintChild(hDC, (wxWindow *)this) )
+ return true;
+
+ if ( win->IsTopLevel() || win->InheritsBackgroundColour() )
+ break;
+ }
+
+ return false;
+}
+
+// ---------------------------------------------------------------------------
+// moving and resizing
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleMinimize()
+{
+ wxIconizeEvent event(m_windowId);
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleMaximize()
+{
+ wxMaximizeEvent event(m_windowId);
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleMove(int x, int y)
+{
+ wxPoint point(x,y);
+ wxMoveEvent event(point, m_windowId);
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleMoving(wxRect& rect)
+{
+ wxMoveEvent event(rect, m_windowId);
+ event.SetEventObject(this);
+
+ bool rc = HandleWindowEvent(event);
+ if (rc)
+ rect = event.GetRect();
+ return rc;
+}
+
+bool wxWindowMSW::HandleEnterSizeMove()
+{
+ wxMoveEvent event(wxPoint(0,0), m_windowId);
+ event.SetEventType(wxEVT_MOVE_START);
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleExitSizeMove()
+{
+ wxMoveEvent event(wxPoint(0,0), m_windowId);
+ event.SetEventType(wxEVT_MOVE_END);
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::BeginRepositioningChildren()
+{
+#if wxUSE_DEFERRED_SIZING
+ int numChildren = 0;
+ for ( HWND child = ::GetWindow(GetHwndOf(this), GW_CHILD);
+ child;
+ child = ::GetWindow(child, GW_HWNDNEXT) )
+ {
+ numChildren ++;
+ }
+
+ // Nothing is gained by deferring the repositioning of a single child.
+ if ( numChildren < 2 )
+ return false;
+
+ // Protect against valid m_hDWP being overwritten
+ if ( m_hDWP )
+ return false;
+
+ m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
+ if ( !m_hDWP )
+ {
+ wxLogLastError(wxT("BeginDeferWindowPos"));
+ return false;
+ }
+
+ // Return true to indicate that EndDeferWindowPos() should be called.
+ return true;
+#endif // wxUSE_DEFERRED_SIZING
+}
+
+void wxWindowMSW::EndRepositioningChildren()
+{
+#if wxUSE_DEFERRED_SIZING
+ wxASSERT_MSG( m_hDWP, wxS("Shouldn't be called") );
+
+ // reset m_hDWP to NULL so that child windows don't try to use our
+ // m_hDWP after we call EndDeferWindowPos() on it (this shouldn't
+ // happen anyhow normally but who knows what weird flow of control we
+ // may have depending on what the users EVT_SIZE handler does...)
+ HDWP hDWP = (HDWP)m_hDWP;
+ m_hDWP = NULL;
+
+ // do put all child controls in place at once
+ if ( !::EndDeferWindowPos(hDWP) )
+ {
+ wxLogLastError(wxT("EndDeferWindowPos"));
+ }
+
+ // Reset our children's pending pos/size values.
+ for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxWindowMSW * const child = node->GetData();
+ child->MSWEndDeferWindowPos();
+ }
+#endif // wxUSE_DEFERRED_SIZING
+}
+
+bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
+{
+ // when we resize this window, its children are probably going to be
+ // repositioned as well, prepare to use DeferWindowPos() for them
+ ChildrenRepositioningGuard repositionGuard(this);
+
+ // update this window size
+ bool processed = false;
+ switch ( wParam )
+ {
+ default:
+ wxFAIL_MSG( wxT("unexpected WM_SIZE parameter") );
+ // fall through nevertheless
+
+ case SIZE_MAXHIDE:
+ case SIZE_MAXSHOW:
+ // we're not interested in these messages at all
+ break;
+
+ case SIZE_MINIMIZED:
+ processed = HandleMinimize();
+ break;
+
+ case SIZE_MAXIMIZED:
+ /* processed = */ HandleMaximize();
+ // fall through to send a normal size event as well
+
+ case SIZE_RESTORED:
+ // don't use w and h parameters as they specify the client size
+ // while according to the docs EVT_SIZE handler is supposed to
+ // receive the total size
+ wxSizeEvent event(GetSize(), m_windowId);
+ event.SetEventObject(this);
+
+ processed = HandleWindowEvent(event);
+ }
+
+ return processed;
+}
+
+bool wxWindowMSW::HandleSizing(wxRect& rect)
+{
+ wxSizeEvent event(rect, m_windowId);
+ event.SetEventObject(this);
+
+ bool rc = HandleWindowEvent(event);
+ if (rc)
+ rect = event.GetRect();
+ return rc;
+}
+
+bool wxWindowMSW::HandleGetMinMaxInfo(void *WXUNUSED_IN_WINCE(mmInfo))
+{
+#ifdef __WXWINCE__
+ return false;
+#else
+ MINMAXINFO *info = (MINMAXINFO *)mmInfo;
+
+ bool rc = false;
+
+ int minWidth = GetMinWidth(),
+ minHeight = GetMinHeight(),
+ maxWidth = GetMaxWidth(),
+ maxHeight = GetMaxHeight();
+
+ if ( minWidth != wxDefaultCoord )
+ {
+ info->ptMinTrackSize.x = minWidth;
+ rc = true;
+ }
+
+ if ( minHeight != wxDefaultCoord )
+ {
+ info->ptMinTrackSize.y = minHeight;
+ rc = true;
+ }
+
+ if ( maxWidth != wxDefaultCoord )
+ {
+ info->ptMaxTrackSize.x = maxWidth;
+ rc = true;
+ }
+
+ if ( maxHeight != wxDefaultCoord )
+ {
+ info->ptMaxTrackSize.y = maxHeight;
+ rc = true;
+ }
+
+ return rc;
+#endif
+}
+
+// ---------------------------------------------------------------------------
+// command messages
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleCommand(WXWORD id_, WXWORD cmd, WXHWND control)
+{
+ // sign extend to int from short before comparing with the other int ids
+ int id = (signed short)id_;
+
+#if wxUSE_MENUS_NATIVE
+ if ( !cmd && wxCurrentPopupMenu )
+ {
+ wxMenu *popupMenu = wxCurrentPopupMenu;
+ wxCurrentPopupMenu = NULL;
+
+ return popupMenu->MSWCommand(cmd, id);
+ }
+#endif // wxUSE_MENUS_NATIVE
+
+ wxWindow *win = NULL;
+
+ // first try to find it from HWND - this works even with the broken
+ // programs using the same ids for different controls
+ if ( control )
+ {
+ win = wxFindWinFromHandle(control);
+ }
+
+ // try the id
+ if ( !win )
+ {
+ win = FindItem(id, control);
+ }
+
+ if ( win )
+ {
+ return win->MSWCommand(cmd, id);
+ }
+
+ // the messages sent from the in-place edit control used by the treectrl
+ // for label editing have id == 0, but they should _not_ be treated as menu
+ // messages (they are EN_XXX ones, in fact) so don't translate anything
+ // coming from a control to wxEVT_MENU
+ if ( !control )
+ {
+ wxCommandEvent event(wxEVT_MENU, id);
+ event.SetEventObject(this);
+ event.SetInt(id);
+
+ return HandleWindowEvent(event);
+ }
+ else
+ {
+#if wxUSE_SPINCTRL && !defined(__WXUNIVERSAL__)
+ // the text ctrl which is logically part of wxSpinCtrl sends WM_COMMAND
+ // notifications to its parent which we want to reflect back to
+ // wxSpinCtrl
+ wxSpinCtrl *spin = wxSpinCtrl::GetSpinForTextCtrl(control);
+ if ( spin && spin->ProcessTextCommand(cmd, id) )
+ return true;
+#endif // wxUSE_SPINCTRL
+
+#if wxUSE_CHOICE && defined(__SMARTPHONE__)
+ // the listbox ctrl which is logically part of wxChoice sends WM_COMMAND
+ // notifications to its parent which we want to reflect back to
+ // wxChoice
+ wxChoice *choice = wxChoice::GetChoiceForListBox(control);
+ if ( choice && choice->MSWCommand(cmd, id) )
+ return true;
+#endif
+ }
+
+ return false;
+}
+
+// ---------------------------------------------------------------------------
+// mouse events
+// ---------------------------------------------------------------------------
+
+void wxWindowMSW::InitMouseEvent(wxMouseEvent& event,
+ int x, int y,
+ WXUINT flags)
+{
+ // our client coords are not quite the same as Windows ones
+ wxPoint pt = GetClientAreaOrigin();
+ event.m_x = x - pt.x;
+ event.m_y = y - pt.y;
+
+ event.m_shiftDown = (flags & MK_SHIFT) != 0;
+ event.m_controlDown = (flags & MK_CONTROL) != 0;
+ event.m_leftDown = (flags & MK_LBUTTON) != 0;
+ event.m_middleDown = (flags & MK_MBUTTON) != 0;
+ event.m_rightDown = (flags & MK_RBUTTON) != 0;
+#ifdef wxHAS_XBUTTON
+ event.m_aux1Down = (flags & MK_XBUTTON1) != 0;
+ event.m_aux2Down = (flags & MK_XBUTTON2) != 0;
+#endif // wxHAS_XBUTTON
+ event.m_altDown = ::wxIsAltDown();
+
+#ifndef __WXWINCE__
+ event.SetTimestamp(::GetMessageTime());
+#endif
+
+ event.SetEventObject(this);
+ event.SetId(GetId());
+
+#if wxUSE_MOUSEEVENT_HACK
+ gs_lastMouseEvent.pos = ClientToScreen(wxPoint(x, y));
+ gs_lastMouseEvent.type = event.GetEventType();
+#endif // wxUSE_MOUSEEVENT_HACK
+}
+
+#ifdef __WXWINCE__
+// Windows doesn't send the mouse events to the static controls (which are
+// transparent in the sense that their WM_NCHITTEST handler returns
+// HTTRANSPARENT) at all but we want all controls to receive the mouse events
+// and so we manually check if we don't have a child window under mouse and if
+// we do, send the event to it instead of the window Windows had sent WM_XXX
+// to.
+//
+// Notice that this is not done for the mouse move events because this could
+// (would?) be too slow, but only for clicks which means that the static texts
+// still don't get move, enter nor leave events.
+static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y)
+{
+ wxCHECK_MSG( x && y, win, wxT("NULL pointer in FindWindowForMouseEvent") );
+
+ // first try to find a non transparent child: this allows us to send events
+ // to a static text which is inside a static box, for example
+ POINT pt = { *x, *y };
+ HWND hwnd = GetHwndOf(win),
+ hwndUnderMouse;
+
+#ifdef __WXWINCE__
+ hwndUnderMouse = ::ChildWindowFromPoint
+ (
+ hwnd,
+ pt
+ );
+#else
+ hwndUnderMouse = ::ChildWindowFromPointEx
+ (
+ hwnd,
+ pt,
+ CWP_SKIPINVISIBLE |
+ CWP_SKIPDISABLED |
+ CWP_SKIPTRANSPARENT
+ );
+#endif
+
+ if ( !hwndUnderMouse || hwndUnderMouse == hwnd )
+ {
+ // now try any child window at all
+ hwndUnderMouse = ::ChildWindowFromPoint(hwnd, pt);
+ }
+
+ // check that we have a child window which is susceptible to receive mouse
+ // events: for this it must be shown and enabled
+ if ( hwndUnderMouse &&
+ hwndUnderMouse != hwnd &&
+ ::IsWindowVisible(hwndUnderMouse) &&
+ ::IsWindowEnabled(hwndUnderMouse) )
+ {
+ wxWindow *winUnderMouse = wxFindWinFromHandle(hwndUnderMouse);
+ if ( winUnderMouse )
+ {
+ // translate the mouse coords to the other window coords
+ win->ClientToScreen(x, y);
+ winUnderMouse->ScreenToClient(x, y);
+
+ win = winUnderMouse;
+ }
+ }
+
+ return win;
+}
+#endif // __WXWINCE__
+
+bool wxWindowMSW::HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags)
+{
+ // the mouse events take consecutive IDs from WM_MOUSEFIRST to
+ // WM_MOUSELAST, so it's enough to subtract WM_MOUSEMOVE == WM_MOUSEFIRST
+ // from the message id and take the value in the table to get wxWin event
+ // id
+ static const wxEventType eventsMouse[] =
+ {
+ wxEVT_MOTION,
+ wxEVT_LEFT_DOWN,
+ wxEVT_LEFT_UP,
+ wxEVT_LEFT_DCLICK,
+ wxEVT_RIGHT_DOWN,
+ wxEVT_RIGHT_UP,
+ wxEVT_RIGHT_DCLICK,
+ wxEVT_MIDDLE_DOWN,
+ wxEVT_MIDDLE_UP,
+ wxEVT_MIDDLE_DCLICK,
+ 0, // this one is for wxEVT_MOTION which is not used here
+ wxEVT_AUX1_DOWN,
+ wxEVT_AUX1_UP,
+ wxEVT_AUX1_DCLICK,
+ wxEVT_AUX2_DOWN,
+ wxEVT_AUX2_UP,
+ wxEVT_AUX2_DCLICK
+ };
+
+#ifdef wxHAS_XBUTTON
+ // the same messages are used for both auxiliary mouse buttons so we need
+ // to adjust the index manually
+ switch ( msg )
+ {
+ case WM_XBUTTONDOWN:
+ case WM_XBUTTONUP:
+ case WM_XBUTTONDBLCLK:
+ if ( flags & MK_XBUTTON2 )
+ msg += wxEVT_AUX2_DOWN - wxEVT_AUX1_DOWN;
+ }
+#endif // wxHAS_XBUTTON
+
+ wxMouseEvent event(eventsMouse[msg - WM_MOUSEMOVE]);
+ InitMouseEvent(event, x, y, flags);
+
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags)
+{
+ if ( !m_mouseInWindow )
+ {
+ // it would be wrong to assume that just because we get a mouse move
+ // event that the mouse is inside the window: although this is usually
+ // true, it is not if we had captured the mouse, so we need to check
+ // the mouse coordinates here
+ if ( !HasCapture() || IsMouseInWindow() )
+ {
+ // Generate an ENTER event
+ m_mouseInWindow = true;
+
+#ifdef HAVE_TRACKMOUSEEVENT
+ typedef BOOL (WINAPI *_TrackMouseEvent_t)(LPTRACKMOUSEEVENT);
+#ifdef __WXWINCE__
+ static const _TrackMouseEvent_t
+ s_pfn_TrackMouseEvent = _TrackMouseEvent;
+#else // !__WXWINCE__
+ static _TrackMouseEvent_t s_pfn_TrackMouseEvent;
+ static bool s_initDone = false;
+ if ( !s_initDone )
+ {
+ // see comment in wxApp::GetComCtl32Version() explaining the
+ // use of wxLoadedDLL
+ wxLoadedDLL dllComCtl32(wxT("comctl32.dll"));
+ if ( dllComCtl32.IsLoaded() )
+ {
+ s_pfn_TrackMouseEvent = (_TrackMouseEvent_t)
+ dllComCtl32.RawGetSymbol(wxT("_TrackMouseEvent"));
+ }
+
+ s_initDone = true;
+ }
+
+ if ( s_pfn_TrackMouseEvent )
+#endif // __WXWINCE__/!__WXWINCE__
+ {
+ WinStruct trackinfo;
+
+ trackinfo.dwFlags = TME_LEAVE;
+ trackinfo.hwndTrack = GetHwnd();
+
+ (*s_pfn_TrackMouseEvent)(&trackinfo);
+ }
+#endif // HAVE_TRACKMOUSEEVENT
+
+ wxMouseEvent event(wxEVT_ENTER_WINDOW);
+ InitMouseEvent(event, x, y, flags);
+
+ (void)HandleWindowEvent(event);
+ }
+ }
+#ifdef HAVE_TRACKMOUSEEVENT
+ else // mouse not in window
+ {
+ // Check if we need to send a LEAVE event
+ // Windows doesn't send WM_MOUSELEAVE if the mouse has been captured so
+ // send it here if we are using native mouse leave tracking
+ if ( HasCapture() && !IsMouseInWindow() )
+ {
+ GenerateMouseLeave();
+ }
+ }
+#endif // HAVE_TRACKMOUSEEVENT
+
+#if wxUSE_MOUSEEVENT_HACK
+ // Windows often generates mouse events even if mouse position hasn't
+ // changed (http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/66576)
+ //
+ // Filter this out as it can result in unexpected behaviour compared to
+ // other platforms
+ if ( gs_lastMouseEvent.type == wxEVT_RIGHT_DOWN ||
+ gs_lastMouseEvent.type == wxEVT_LEFT_DOWN ||
+ gs_lastMouseEvent.type == wxEVT_MIDDLE_DOWN ||
+ gs_lastMouseEvent.type == wxEVT_MOTION )
+ {
+ if ( ClientToScreen(wxPoint(x, y)) == gs_lastMouseEvent.pos )
+ {
+ gs_lastMouseEvent.type = wxEVT_MOTION;
+
+ return false;
+ }
+ }
+#endif // wxUSE_MOUSEEVENT_HACK
+
+ return HandleMouseEvent(WM_MOUSEMOVE, x, y, flags);
+}
+
+
+bool
+wxWindowMSW::HandleMouseWheel(wxMouseWheelAxis axis,
+ WXWPARAM wParam, WXLPARAM lParam)
+{
+#if wxUSE_MOUSEWHEEL
+ // notice that WM_MOUSEWHEEL position is in screen coords (as it's
+ // forwarded up to the parent by DefWindowProc()) and not in the client
+ // ones as all the other messages, translate them to the client coords for
+ // consistency -- but do it using Windows function and not our own one
+ // because InitMouseEvent() expects coordinates in Windows client
+ // coordinates and not wx ones (the difference being the height of the
+ // toolbar, if any).
+ POINT pt;
+ pt.x = GET_X_LPARAM(lParam);
+ pt.y = GET_Y_LPARAM(lParam);
+ ::ScreenToClient(GetHwnd(), &pt);
+
+ wxMouseEvent event(wxEVT_MOUSEWHEEL);
+ InitMouseEvent(event, pt.x, pt.y, LOWORD(wParam));
+ event.m_wheelRotation = (short)HIWORD(wParam);
+ event.m_wheelDelta = WHEEL_DELTA;
+ event.m_wheelAxis = axis;
+
+ static int s_linesPerRotation = -1;
+ if ( s_linesPerRotation == -1 )
+ {
+ if ( !::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
+ &s_linesPerRotation, 0))
+ {
+ // this is not supposed to happen
+ wxLogLastError(wxT("SystemParametersInfo(GETWHEELSCROLLLINES)"));
+
+ // the default is 3, so use it if SystemParametersInfo() failed
+ s_linesPerRotation = 3;
+ }
+ }
+
+ static int s_columnsPerRotation = -1;
+ if ( s_columnsPerRotation == -1 )
+ {
+ if ( !::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0,
+ &s_columnsPerRotation, 0))
+ {
+ // this setting is not supported on Windows 2000/XP, so use the value of 1
+ // http://msdn.microsoft.com/en-us/library/ms997498.aspx
+ s_columnsPerRotation = 1;
+ }
+ }
+
+ event.m_linesPerAction = s_linesPerRotation;
+ event.m_columnsPerAction = s_columnsPerRotation;
+ return HandleWindowEvent(event);
+
+#else // !wxUSE_MOUSEWHEEL
+ wxUnusedVar(wParam);
+ wxUnusedVar(lParam);
+
+ return false;
+#endif // wxUSE_MOUSEWHEEL/!wxUSE_MOUSEWHEEL
+}
+
+void wxWindowMSW::GenerateMouseLeave()
+{
+ m_mouseInWindow = false;
+
+ int state = 0;
+ if ( wxIsShiftDown() )
+ state |= MK_SHIFT;
+ if ( wxIsCtrlDown() )
+ state |= MK_CONTROL;
+
+ // Only the high-order bit should be tested
+ if ( GetKeyState( VK_LBUTTON ) & (1<<15) )
+ state |= MK_LBUTTON;
+ if ( GetKeyState( VK_MBUTTON ) & (1<<15) )
+ state |= MK_MBUTTON;
+ if ( GetKeyState( VK_RBUTTON ) & (1<<15) )
+ state |= MK_RBUTTON;
+
+ POINT pt;
+ wxGetCursorPosMSW(&pt);
+
+ // we need to have client coordinates here for symmetry with
+ // wxEVT_ENTER_WINDOW
+ RECT rect = wxGetWindowRect(GetHwnd());
+ pt.x -= rect.left;
+ pt.y -= rect.top;
+
+ wxMouseEvent event(wxEVT_LEAVE_WINDOW);
+ InitMouseEvent(event, pt.x, pt.y, state);
+
+ (void)HandleWindowEvent(event);
+}
+
+// ---------------------------------------------------------------------------
+// keyboard handling
+// ---------------------------------------------------------------------------
+
+namespace
+{
+
+// Implementation of InitAnyKeyEvent() which can also be used when there is no
+// associated window: this can happen for the wxEVT_CHAR_HOOK events created by
+// the global keyboard hook (e.g. the event might have happened in a non-wx
+// window).
+void
+MSWInitAnyKeyEvent(wxKeyEvent& event,
+ WXWPARAM wParam,
+ WXLPARAM lParam,
+ const wxWindowBase *win /* may be NULL */)
+{
+ if ( win )
+ {
+ event.SetId(win->GetId());
+ event.SetEventObject(const_cast(win));
+ }
+ else // No associated window.
+ {
+ // Use wxID_ANY for compatibility with the old code even if wxID_NONE
+ // would arguably make more sense.
+ event.SetId(wxID_ANY);
+ }
+
+ event.m_shiftDown = wxIsShiftDown();
+ event.m_controlDown = wxIsCtrlDown();
+ event.m_altDown = (HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN;
+
+ event.m_rawCode = (wxUint32) wParam;
+ event.m_rawFlags = (wxUint32) lParam;
+#ifndef __WXWINCE__
+ event.SetTimestamp(::GetMessageTime());
+#endif
+}
+
+} // anonymous namespace
+
+void
+wxWindowMSW::InitAnyKeyEvent(wxKeyEvent& event,
+ WXWPARAM wParam,
+ WXLPARAM lParam) const
+{
+ MSWInitAnyKeyEvent(event, wParam, lParam, this);
+}
+
+wxKeyEvent
+wxWindowMSW::CreateKeyEvent(wxEventType evType,
+ WXWPARAM wParam,
+ WXLPARAM lParam) const
+{
+ // Catch any attempts to use this with WM_CHAR, it wouldn't work because
+ // wParam is supposed to be a virtual key and not a character here.
+ wxASSERT_MSG( evType != wxEVT_CHAR && evType != wxEVT_CHAR_HOOK,
+ "CreateKeyEvent() can't be used for char events" );
+
+ wxKeyEvent event(evType);
+ InitAnyKeyEvent(event, wParam, lParam);
+
+ event.m_keyCode = wxMSWKeyboard::VKToWX
+ (
+ wParam,
+ lParam
+#if wxUSE_UNICODE
+ , &event.m_uniChar
+#endif // wxUSE_UNICODE
+ );
+
+ return event;
+}
+
+wxKeyEvent
+wxWindowMSW::CreateCharEvent(wxEventType evType,
+ WXWPARAM wParam,
+ WXLPARAM lParam) const
+{
+ wxKeyEvent event(evType);
+ InitAnyKeyEvent(event, wParam, lParam);
+
+#if wxUSE_UNICODE
+ // TODO: wParam uses UTF-16 so this is incorrect for characters outside of
+ // the BMP, we should use WM_UNICHAR to handle them.
+ event.m_uniChar = wParam;
+#endif // wxUSE_UNICODE
+
+ // Set non-Unicode key code too for compatibility if possible.
+ if ( wParam < 0x80 )
+ {
+ // It's an ASCII character, no need to translate it.
+ event.m_keyCode = wParam;
+ }
+ else
+ {
+ // Check if this key can be represented (as a single character) in the
+ // current locale.
+ const wchar_t wc = wParam;
+ char ch;
+ if ( wxConvLibc.FromWChar(&ch, 1, &wc, 1) != wxCONV_FAILED )
+ {
+ // For compatibility continue to provide the key code in this field
+ // even though using GetUnicodeKey() is recommended now.
+ event.m_keyCode = static_cast(ch);
+ }
+ //else: Key can't be represented in the current locale, leave m_keyCode
+ // as WXK_NONE and use GetUnicodeKey() to access the character.
+ }
+
+ // the alphanumeric keys produced by pressing AltGr+something on European
+ // keyboards have both Ctrl and Alt modifiers which may confuse the user
+ // code as, normally, keys with Ctrl and/or Alt don't result in anything
+ // alphanumeric, so pretend that there are no modifiers at all (the
+ // KEY_DOWN event would still have the correct modifiers if they're really
+ // needed)
+ if ( event.m_controlDown && event.m_altDown &&
+ (event.m_keyCode >= 32 && event.m_keyCode < 256) )
+ {
+ event.m_controlDown =
+ event.m_altDown = false;
+ }
+
+ return event;
+}
+
+// isASCII is true only when we're called from WM_CHAR handler and not from
+// WM_KEYDOWN one
+bool wxWindowMSW::HandleChar(WXWPARAM wParam, WXLPARAM lParam)
+{
+ wxKeyEvent event(CreateCharEvent(wxEVT_CHAR, wParam, lParam));
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleKeyDown(WXWPARAM wParam, WXLPARAM lParam)
+{
+ wxKeyEvent event(CreateKeyEvent(wxEVT_KEY_DOWN, wParam, lParam));
+ return HandleWindowEvent(event);
+}
+
+bool wxWindowMSW::HandleKeyUp(WXWPARAM wParam, WXLPARAM lParam)
+{
+ wxKeyEvent event(CreateKeyEvent(wxEVT_KEY_UP, wParam, lParam));
+ return HandleWindowEvent(event);
+}
+
+#if wxUSE_MENUS
+int wxWindowMSW::HandleMenuChar(int WXUNUSED_IN_WINCE(chAccel),
+ WXLPARAM WXUNUSED_IN_WINCE(lParam))
+{
+ // FIXME: implement GetMenuItemCount for WinCE, possibly
+ // in terms of GetMenuItemInfo
+#ifndef __WXWINCE__
+ const HMENU hmenu = (HMENU)lParam;
+
+ WinStruct mii;
+
+ // we could use MIIM_FTYPE here as we only need to know if the item is
+ // ownerdrawn or not and not dwTypeData which MIIM_TYPE also returns, but
+ // MIIM_FTYPE is not supported under Win95
+ mii.fMask = MIIM_TYPE | MIIM_DATA;
+
+ // find if we have this letter in any owner drawn item
+ const int count = ::GetMenuItemCount(hmenu);
+ for ( int i = 0; i < count; i++ )
+ {
+ // previous loop iteration could modify it, reset it back before
+ // calling GetMenuItemInfo() to prevent it from overflowing dwTypeData
+ mii.cch = 0;
+
+ if ( ::GetMenuItemInfo(hmenu, i, TRUE, &mii) )
+ {
+ if ( mii.fType == MFT_OWNERDRAW )
+ {
+ // dwItemData member of the MENUITEMINFO is a
+ // pointer to the associated wxMenuItem -- see the
+ // menu creation code
+ wxMenuItem *item = (wxMenuItem*)mii.dwItemData;
+
+ const wxString label(item->GetItemLabel());
+ const wxChar *p = wxStrchr(label.t_str(), wxT('&'));
+ while ( p++ )
+ {
+ if ( *p == wxT('&') )
+ {
+ // this is not the accel char, find the real one
+ p = wxStrchr(p + 1, wxT('&'));
+ }
+ else // got the accel char
+ {
+ // FIXME-UNICODE: this comparison doesn't risk to work
+ // for non ASCII accelerator characters I'm afraid, but
+ // what can we do?
+ if ( (wchar_t)wxToupper(*p) == (wchar_t)chAccel )
+ {
+ return i;
+ }
+ else
+ {
+ // this one doesn't match
+ break;
+ }
+ }
+ }
+ }
+ }
+ else // failed to get the menu text?
+ {
+ // it's not fatal, so don't show error, but still log it
+ wxLogLastError(wxT("GetMenuItemInfo"));
+ }
+ }
+#endif
+ return wxNOT_FOUND;
+}
+
+#endif // wxUSE_MENUS
+
+bool wxWindowMSW::HandleClipboardEvent(WXUINT nMsg)
+{
+ const wxEventType type = nMsg == WM_CUT ? wxEVT_TEXT_CUT
+ : nMsg == WM_COPY ? wxEVT_TEXT_COPY
+ : /* nMsg == WM_PASTE */ wxEVT_TEXT_PASTE;
+ wxClipboardTextEvent evt(type, GetId());
+
+ evt.SetEventObject(this);
+
+ return HandleWindowEvent(evt);
+}
+
+// ---------------------------------------------------------------------------
+// joystick
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags)
+{
+#ifdef JOY_BUTTON1
+ int change = 0;
+ if ( flags & JOY_BUTTON1CHG )
+ change = wxJOY_BUTTON1;
+ if ( flags & JOY_BUTTON2CHG )
+ change = wxJOY_BUTTON2;
+ if ( flags & JOY_BUTTON3CHG )
+ change = wxJOY_BUTTON3;
+ if ( flags & JOY_BUTTON4CHG )
+ change = wxJOY_BUTTON4;
+
+ int buttons = 0;
+ if ( flags & JOY_BUTTON1 )
+ buttons |= wxJOY_BUTTON1;
+ if ( flags & JOY_BUTTON2 )
+ buttons |= wxJOY_BUTTON2;
+ if ( flags & JOY_BUTTON3 )
+ buttons |= wxJOY_BUTTON3;
+ if ( flags & JOY_BUTTON4 )
+ buttons |= wxJOY_BUTTON4;
+
+ // the event ids aren't consecutive so we can't use table based lookup
+ int joystick;
+ wxEventType eventType;
+ switch ( msg )
+ {
+ case MM_JOY1MOVE:
+ joystick = 1;
+ eventType = wxEVT_JOY_MOVE;
+ break;
+
+ case MM_JOY2MOVE:
+ joystick = 2;
+ eventType = wxEVT_JOY_MOVE;
+ break;
+
+ case MM_JOY1ZMOVE:
+ joystick = 1;
+ eventType = wxEVT_JOY_ZMOVE;
+ break;
+
+ case MM_JOY2ZMOVE:
+ joystick = 2;
+ eventType = wxEVT_JOY_ZMOVE;
+ break;
+
+ case MM_JOY1BUTTONDOWN:
+ joystick = 1;
+ eventType = wxEVT_JOY_BUTTON_DOWN;
+ break;
+
+ case MM_JOY2BUTTONDOWN:
+ joystick = 2;
+ eventType = wxEVT_JOY_BUTTON_DOWN;
+ break;
+
+ case MM_JOY1BUTTONUP:
+ joystick = 1;
+ eventType = wxEVT_JOY_BUTTON_UP;
+ break;
+
+ case MM_JOY2BUTTONUP:
+ joystick = 2;
+ eventType = wxEVT_JOY_BUTTON_UP;
+ break;
+
+ default:
+ wxFAIL_MSG(wxT("no such joystick event"));
+
+ return false;
+ }
+
+ wxJoystickEvent event(eventType, buttons, joystick, change);
+ if ( eventType == wxEVT_JOY_ZMOVE )
+ event.SetZPosition(x);
+ else
+ event.SetPosition(wxPoint(x, y));
+ event.SetEventObject(this);
+
+ return HandleWindowEvent(event);
+#else
+ wxUnusedVar(msg);
+ wxUnusedVar(x);
+ wxUnusedVar(y);
+ wxUnusedVar(flags);
+ return false;
+#endif
+}
+
+// ---------------------------------------------------------------------------
+// scrolling
+// ---------------------------------------------------------------------------
+
+bool wxWindowMSW::MSWOnScroll(int orientation, WXWORD wParam,
+ WXWORD pos, WXHWND control)
+{
+ if ( control && control != m_hWnd ) // Prevent infinite recursion
+ {
+ wxWindow *child = wxFindWinFromHandle(control);
+ if ( child )
+ return child->MSWOnScroll(orientation, wParam, pos, control);
+ }
+
+ wxScrollWinEvent event;
+ event.SetPosition(pos);
+ event.SetOrientation(orientation);
+ event.SetEventObject(this);
+
+ switch ( wParam )
+ {
+ case SB_TOP:
+ event.SetEventType(wxEVT_SCROLLWIN_TOP);
+ break;
+
+ case SB_BOTTOM:
+ event.SetEventType(wxEVT_SCROLLWIN_BOTTOM);
+ break;
+
+ case SB_LINEUP:
+ event.SetEventType(wxEVT_SCROLLWIN_LINEUP);
+ break;
+
+ case SB_LINEDOWN:
+ event.SetEventType(wxEVT_SCROLLWIN_LINEDOWN);
+ break;
+
+ case SB_PAGEUP:
+ event.SetEventType(wxEVT_SCROLLWIN_PAGEUP);
+ break;
+
+ case SB_PAGEDOWN:
+ event.SetEventType(wxEVT_SCROLLWIN_PAGEDOWN);
+ break;
+
+ case SB_THUMBPOSITION:
+ case SB_THUMBTRACK:
+ // under Win32, the scrollbar range and position are 32 bit integers,
+ // but WM_[HV]SCROLL only carry the low 16 bits of them, so we must
+ // explicitly query the scrollbar for the correct position (this must
+ // be done only for these two SB_ events as they are the only one
+ // carrying the scrollbar position)
+ {
+ WinStruct scrollInfo;
+ scrollInfo.fMask = SIF_TRACKPOS;
+
+ if ( !::GetScrollInfo(GetHwnd(),
+ WXOrientToSB(orientation),
+ &scrollInfo) )
+ {
+ // Not necessarily an error, if there are no scrollbars yet.
+ // wxLogLastError(wxT("GetScrollInfo"));
+ }
+
+ event.SetPosition(scrollInfo.nTrackPos);
+ }
+
+ event.SetEventType( wParam == SB_THUMBPOSITION
+ ? wxEVT_SCROLLWIN_THUMBRELEASE
+ : wxEVT_SCROLLWIN_THUMBTRACK );
+ break;
+
+ default:
+ return false;
+ }
+
+ return HandleWindowEvent(event);
+}
+
+// ----------------------------------------------------------------------------
+// custom message handlers
+// ----------------------------------------------------------------------------
+
+/* static */ bool
+wxWindowMSW::MSWRegisterMessageHandler(int msg, MSWMessageHandler handler)
+{
+ wxCHECK_MSG( gs_messageHandlers.find(msg) == gs_messageHandlers.end(),
+ false, wxT("registering handler for the same message twice") );
+
+ gs_messageHandlers[msg] = handler;
+ return true;
+}
+
+/* static */ void
+wxWindowMSW::MSWUnregisterMessageHandler(int msg, MSWMessageHandler handler)
+{
+ const MSWMessageHandlers::iterator i = gs_messageHandlers.find(msg);
+ wxCHECK_RET( i != gs_messageHandlers.end() && i->second == handler,
+ wxT("unregistering non-registered handler?") );
+
+ gs_messageHandlers.erase(i);
+}
+
+// ===========================================================================
+// global functions
+// ===========================================================================
+
+void wxGetCharSize(WXHWND wnd, int *x, int *y, const wxFont& the_font)
+{
+ TEXTMETRIC tm;
+ HDC dc = ::GetDC((HWND) wnd);
+ HFONT was = 0;
+
+ // the_font.UseResource();
+ // the_font.RealizeResource();
+ HFONT fnt = (HFONT)the_font.GetResourceHandle(); // const_cast
+ if ( fnt )
+ was = (HFONT) SelectObject(dc,fnt);
+
+ GetTextMetrics(dc, &tm);
+ if ( fnt && was )
+ {
+ SelectObject(dc,was);
+ }
+ ReleaseDC((HWND)wnd, dc);
+
+ if ( x )
+ *x = tm.tmAveCharWidth;
+ if ( y )
+ *y = tm.tmHeight + tm.tmExternalLeading;
+
+ // the_font.ReleaseResource();
+}
+
+// ----------------------------------------------------------------------------
+// keyboard codes
+// ----------------------------------------------------------------------------
+
+namespace wxMSWKeyboard
+{
+
+namespace
+{
+
+// use the "extended" bit of lParam to distinguish extended keys from normal
+// keys as the same virtual key code is sent for both by Windows
+inline
+int ChooseNormalOrExtended(int lParam, int keyNormal, int keyExtended)
+{
+ // except that if lParam is 0, it means we don't have real lParam from
+ // WM_KEYDOWN but are just translating just a VK constant (e.g. done from
+ // msw/treectrl.cpp when processing TVN_KEYDOWN) -- then assume this is a
+ // non-numpad (hence extended) key as this is a more common case
+ return !lParam || (HIWORD(lParam) & KF_EXTENDED) ? keyExtended : keyNormal;
+}
+
+// this array contains the Windows virtual key codes which map one to one to
+// WXK_xxx constants and is used in wxMSWKeyboard::VKToWX/WXToVK() below
+//
+// note that keys having a normal and numpad version (e.g. WXK_HOME and
+// WXK_NUMPAD_HOME) are not included in this table as the mapping is not 1-to-1
+const struct wxKeyMapping
+{
+ int vk;
+ wxKeyCode wxk;
+} gs_specialKeys[] =
+{
+ { VK_CANCEL, WXK_CANCEL },
+ { VK_BACK, WXK_BACK },
+ { VK_TAB, WXK_TAB },
+ { VK_CLEAR, WXK_CLEAR },
+ { VK_SHIFT, WXK_SHIFT },
+ { VK_CONTROL, WXK_CONTROL },
+ { VK_MENU , WXK_ALT },
+ { VK_PAUSE, WXK_PAUSE },
+ { VK_CAPITAL, WXK_CAPITAL },
+ { VK_SPACE, WXK_SPACE },
+ { VK_ESCAPE, WXK_ESCAPE },
+ { VK_SELECT, WXK_SELECT },
+ { VK_PRINT, WXK_PRINT },
+ { VK_EXECUTE, WXK_EXECUTE },
+ { VK_SNAPSHOT, WXK_SNAPSHOT },
+ { VK_HELP, WXK_HELP },
+
+ { VK_NUMPAD0, WXK_NUMPAD0 },
+ { VK_NUMPAD1, WXK_NUMPAD1 },
+ { VK_NUMPAD2, WXK_NUMPAD2 },
+ { VK_NUMPAD3, WXK_NUMPAD3 },
+ { VK_NUMPAD4, WXK_NUMPAD4 },
+ { VK_NUMPAD5, WXK_NUMPAD5 },
+ { VK_NUMPAD6, WXK_NUMPAD6 },
+ { VK_NUMPAD7, WXK_NUMPAD7 },
+ { VK_NUMPAD8, WXK_NUMPAD8 },
+ { VK_NUMPAD9, WXK_NUMPAD9 },
+ { VK_MULTIPLY, WXK_NUMPAD_MULTIPLY },
+ { VK_ADD, WXK_NUMPAD_ADD },
+ { VK_SUBTRACT, WXK_NUMPAD_SUBTRACT },
+ { VK_DECIMAL, WXK_NUMPAD_DECIMAL },
+ { VK_DIVIDE, WXK_NUMPAD_DIVIDE },
+
+ { VK_F1, WXK_F1 },
+ { VK_F2, WXK_F2 },
+ { VK_F3, WXK_F3 },
+ { VK_F4, WXK_F4 },
+ { VK_F5, WXK_F5 },
+ { VK_F6, WXK_F6 },
+ { VK_F7, WXK_F7 },
+ { VK_F8, WXK_F8 },
+ { VK_F9, WXK_F9 },
+ { VK_F10, WXK_F10 },
+ { VK_F11, WXK_F11 },
+ { VK_F12, WXK_F12 },
+ { VK_F13, WXK_F13 },
+ { VK_F14, WXK_F14 },
+ { VK_F15, WXK_F15 },
+ { VK_F16, WXK_F16 },
+ { VK_F17, WXK_F17 },
+ { VK_F18, WXK_F18 },
+ { VK_F19, WXK_F19 },
+ { VK_F20, WXK_F20 },
+ { VK_F21, WXK_F21 },
+ { VK_F22, WXK_F22 },
+ { VK_F23, WXK_F23 },
+ { VK_F24, WXK_F24 },
+
+ { VK_NUMLOCK, WXK_NUMLOCK },
+ { VK_SCROLL, WXK_SCROLL },
+
+#ifdef VK_APPS
+ { VK_LWIN, WXK_WINDOWS_LEFT },
+ { VK_RWIN, WXK_WINDOWS_RIGHT },
+ { VK_APPS, WXK_WINDOWS_MENU },
+#endif // VK_APPS defined
+};
+
+} // anonymous namespace
+
+int VKToWX(WXWORD vk, WXLPARAM lParam, wchar_t *uc)
+{
+ int wxk;
+
+ // check the table first
+ for ( size_t n = 0; n < WXSIZEOF(gs_specialKeys); n++ )
+ {
+ if ( gs_specialKeys[n].vk == vk )
+ {
+ wxk = gs_specialKeys[n].wxk;
+ if ( wxk < WXK_START )
+ {
+ // Unicode code for this key is the same as its ASCII code.
+ if ( uc )
+ *uc = wxk;
+ }
+
+ return wxk;
+ }
+ }
+
+ // keys requiring special handling
+ switch ( vk )
+ {
+ case VK_OEM_1:
+ case VK_OEM_PLUS:
+ case VK_OEM_COMMA:
+ case VK_OEM_MINUS:
+ case VK_OEM_PERIOD:
+ case VK_OEM_2:
+ case VK_OEM_3:
+ case VK_OEM_4:
+ case VK_OEM_5:
+ case VK_OEM_6:
+ case VK_OEM_7:
+ case VK_OEM_102:
+ // MapVirtualKey() returns 0 if it fails to convert the virtual
+ // key which nicely corresponds to our WXK_NONE.
+ wxk = ::MapVirtualKey(vk, MAPVK_VK_TO_CHAR);
+
+ if ( HIWORD(wxk) & 0x8000 )
+ {
+ // It's a dead key and we don't return anything at all for them
+ // as we simply don't have any way to indicate the difference
+ // between e.g. a normal "'" and "'" as a dead key -- and
+ // generating the same events for them just doesn't seem like a
+ // good idea.
+ wxk = WXK_NONE;
+ }
+
+ // In any case return this as a Unicode character value.
+ if ( uc )
+ *uc = wxk;
+
+ // For compatibility with the old non-Unicode code we continue
+ // returning key codes for Latin-1 characters directly
+ // (normally it would really only make sense to do it for the
+ // ASCII characters, not Latin-1 ones).
+ if ( wxk > 255 )
+ {
+ // But for anything beyond this we can only return the key
+ // value as a real Unicode character, not a wxKeyCode
+ // because this enum values clash with Unicode characters
+ // (e.g. WXK_LBUTTON also happens to be U+012C a.k.a.
+ // "LATIN CAPITAL LETTER I WITH BREVE").
+ wxk = WXK_NONE;
+ }
+ break;
+
+ // handle extended keys
+ case VK_PRIOR:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_PAGEUP, WXK_PAGEUP);
+ break;
+
+ case VK_NEXT:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_PAGEDOWN, WXK_PAGEDOWN);
+ break;
+
+ case VK_END:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_END, WXK_END);
+ break;
+
+ case VK_HOME:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_HOME, WXK_HOME);
+ break;
+
+ case VK_LEFT:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_LEFT, WXK_LEFT);
+ break;
+
+ case VK_UP:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_UP, WXK_UP);
+ break;
+
+ case VK_RIGHT:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_RIGHT, WXK_RIGHT);
+ break;
+
+ case VK_DOWN:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_DOWN, WXK_DOWN);
+ break;
+
+ case VK_INSERT:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_INSERT, WXK_INSERT);
+ break;
+
+ case VK_DELETE:
+ wxk = ChooseNormalOrExtended(lParam, WXK_NUMPAD_DELETE, WXK_DELETE);
+
+ if ( uc )
+ *uc = WXK_DELETE;
+ break;
+
+ case VK_RETURN:
+ // don't use ChooseNormalOrExtended() here as the keys are reversed
+ // here: numpad enter is the extended one
+ wxk = HIWORD(lParam) & KF_EXTENDED ? WXK_NUMPAD_ENTER : WXK_RETURN;
+
+ if ( uc )
+ *uc = WXK_RETURN;
+ break;
+
+ default:
+ if ( (vk >= '0' && vk <= '9') || (vk >= 'A' && vk <= 'Z') )
+ {
+ // A simple alphanumeric key and the values of them coincide in
+ // Windows and wx for both ASCII and Unicode codes.
+ wxk = vk;
+ }
+ else // Something we simply don't know about at all.
+ {
+ wxk = WXK_NONE;
+ }
+
+ if ( uc )
+ *uc = vk;
+ }
+
+ return wxk;
+}
+
+WXWORD WXToVK(int wxk, bool *isExtended)
+{
+ // check the table first
+ for ( size_t n = 0; n < WXSIZEOF(gs_specialKeys); n++ )
+ {
+ if ( gs_specialKeys[n].wxk == wxk )
+ {
+ // All extended keys (i.e. non-numpad versions of the keys that
+ // exist both in the numpad and outside of it) are dealt with
+ // below.
+ if ( isExtended )
+ *isExtended = false;
+
+ return gs_specialKeys[n].vk;
+ }
+ }
+
+ // and then check for special keys not included in the table
+ bool extended = false;
+ WXWORD vk;
+ switch ( wxk )
+ {
+ case WXK_PAGEUP:
+ extended = true;
+ case WXK_NUMPAD_PAGEUP:
+ vk = VK_PRIOR;
+ break;
+
+ case WXK_PAGEDOWN:
+ extended = true;
+ case WXK_NUMPAD_PAGEDOWN:
+ vk = VK_NEXT;
+ break;
+
+ case WXK_END:
+ extended = true;
+ case WXK_NUMPAD_END:
+ vk = VK_END;
+ break;
+
+ case WXK_HOME:
+ extended = true;
+ case WXK_NUMPAD_HOME:
+ vk = VK_HOME;
+ break;
+
+ case WXK_LEFT:
+ extended = true;
+ case WXK_NUMPAD_LEFT:
+ vk = VK_LEFT;
+ break;
+
+ case WXK_UP:
+ extended = true;
+ case WXK_NUMPAD_UP:
+ vk = VK_UP;
+ break;
+
+ case WXK_RIGHT:
+ extended = true;
+ case WXK_NUMPAD_RIGHT:
+ vk = VK_RIGHT;
+ break;
+
+ case WXK_DOWN:
+ extended = true;
+ case WXK_NUMPAD_DOWN:
+ vk = VK_DOWN;
+ break;
+
+ case WXK_INSERT:
+ extended = true;
+ case WXK_NUMPAD_INSERT:
+ vk = VK_INSERT;
+ break;
+
+ case WXK_DELETE:
+ extended = true;
+ case WXK_NUMPAD_DELETE:
+ vk = VK_DELETE;
+ break;
+
+ default:
+ // no VkKeyScan() under CE unfortunately, we need to test how does
+ // it handle OEM keys
+#ifndef __WXWINCE__
+ // check to see if its one of the OEM key codes.
+ BYTE vks = LOBYTE(VkKeyScan(wxk));
+ if ( vks != 0xff )
+ {
+ vk = vks;
+ }
+ else
+#endif // !__WXWINCE__
+ {
+ vk = (WXWORD)wxk;
+ }
+ }
+
+ if ( isExtended )
+ *isExtended = extended;
+
+ return vk;
+}
+
+} // namespace wxMSWKeyboard
+
+// small helper for wxGetKeyState() and wxGetMouseState()
+static inline bool wxIsKeyDown(WXWORD vk)
+{
+ // SM_SWAPBUTTON is not available under CE, so don't swap buttons there
+#ifdef SM_SWAPBUTTON
+ if ( vk == VK_LBUTTON || vk == VK_RBUTTON )
+ {
+ if ( ::GetSystemMetrics(SM_SWAPBUTTON) )
+ {
+ if ( vk == VK_LBUTTON )
+ vk = VK_RBUTTON;
+ else // vk == VK_RBUTTON
+ vk = VK_LBUTTON;
+ }
+ }
+#endif // SM_SWAPBUTTON
+
+ // the low order bit indicates whether the key was pressed since the last
+ // call and the high order one indicates whether it is down right now and
+ // we only want that one
+ return (GetAsyncKeyState(vk) & (1<<15)) != 0;
+}
+
+bool wxGetKeyState(wxKeyCode key)
+{
+ // although this does work under Windows, it is not supported under other
+ // platforms so don't allow it, you must use wxGetMouseState() instead
+ wxASSERT_MSG( key != VK_LBUTTON &&
+ key != VK_RBUTTON &&
+ key != VK_MBUTTON,
+ wxT("can't use wxGetKeyState() for mouse buttons") );
+
+ const WXWORD vk = wxMSWKeyboard::WXToVK(key);
+
+ // if the requested key is a LED key, return true if the led is pressed
+ if ( key == WXK_NUMLOCK || key == WXK_CAPITAL || key == WXK_SCROLL )
+ {
+ // low order bit means LED is highlighted and high order one means the
+ // key is down; for compatibility with the other ports return true if
+ // either one is set
+ return GetKeyState(vk) != 0;
+
+ }
+ else // normal key
+ {
+ return wxIsKeyDown(vk);
+ }
+}
+
+
+wxMouseState wxGetMouseState()
+{
+ wxMouseState ms;
+ POINT pt;
+ wxGetCursorPosMSW(&pt);
+
+ ms.SetX(pt.x);
+ ms.SetY(pt.y);
+ ms.SetLeftDown(wxIsKeyDown(VK_LBUTTON));
+ ms.SetMiddleDown(wxIsKeyDown(VK_MBUTTON));
+ ms.SetRightDown(wxIsKeyDown(VK_RBUTTON));
+#ifdef wxHAS_XBUTTON
+ ms.SetAux1Down(wxIsKeyDown(VK_XBUTTON1));
+ ms.SetAux2Down(wxIsKeyDown(VK_XBUTTON2));
+#endif // wxHAS_XBUTTON
+
+ ms.SetControlDown(wxIsCtrlDown ());
+ ms.SetShiftDown (wxIsShiftDown());
+ ms.SetAltDown (wxIsAltDown ());
+// ms.SetMetaDown();
+
+ return ms;
+}
+
+
+wxWindow *wxGetActiveWindow()
+{
+ HWND hWnd = GetActiveWindow();
+ if ( hWnd != 0 )
+ {
+ return wxFindWinFromHandle(hWnd);
+ }
+ return NULL;
+}
+
+extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
+{
+ HWND hwnd = (HWND)hWnd;
+
+ // For a radiobutton, we get the radiobox from GWL_USERDATA (which is set
+ // by code in msw/radiobox.cpp), for all the others we just search up the
+ // window hierarchy
+ wxWindow *win = NULL;
+ if ( hwnd )
+ {
+ win = wxFindWinFromHandle(hwnd);
+ if ( !win )
+ {
+#if wxUSE_RADIOBOX && !defined(__WXUNIVERSAL__)
+ // native radiobuttons return DLGC_RADIOBUTTON here and for any
+ // wxWindow class which overrides WM_GETDLGCODE processing to
+ // do it as well, win would be already non NULL
+ if ( ::SendMessage(hwnd, WM_GETDLGCODE, 0, 0) & DLGC_RADIOBUTTON )
+ {
+ win = wxRadioBox::GetFromRadioButtonHWND(hwnd);
+ }
+ //else: it's a wxRadioButton, not a radiobutton from wxRadioBox
+#endif // wxUSE_RADIOBOX
+
+ // spin control text buddy window should be mapped to spin ctrl
+ // itself so try it too
+#if wxUSE_SPINCTRL && !defined(__WXUNIVERSAL__)
+ if ( !win )
+ {
+ win = wxSpinCtrl::GetSpinForTextCtrl((WXHWND)hwnd);
+ }
+#endif // wxUSE_SPINCTRL
+ }
+ }
+
+ while ( hwnd && !win )
+ {
+ // this is a really ugly hack needed to avoid mistakenly returning the
+ // parent frame wxWindow for the find/replace modeless dialog HWND -
+ // this, in turn, is needed to call IsDialogMessage() from
+ // wxApp::ProcessMessage() as for this we must return NULL from here
+ //
+ // FIXME: this is clearly not the best way to do it but I think we'll
+ // need to change HWND <-> wxWindow code more heavily than I can
+ // do it now to fix it
+#ifndef __WXMICROWIN__
+ if ( ::GetWindow(hwnd, GW_OWNER) )
+ {
+ // it's a dialog box, don't go upwards
+ break;
+ }
+#endif
+
+ hwnd = ::GetParent(hwnd);
+ win = wxFindWinFromHandle(hwnd);
+ }
+
+ return win;
+}
+
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+
+// Windows keyboard hook. Allows interception of e.g. F1, ESCAPE
+// in active frames and dialogs, regardless of where the focus is.
+static HHOOK wxTheKeyboardHook = 0;
+
+int APIENTRY
+wxKeyboardHook(int nCode, WORD wParam, DWORD lParam)
+{
+ DWORD hiWord = HIWORD(lParam);
+ if ( nCode != HC_NOREMOVE && ((hiWord & KF_UP) == 0) )
+ {
+ wchar_t uc = 0;
+ int id = wxMSWKeyboard::VKToWX(wParam, lParam, &uc);
+
+ // Don't intercept keyboard entry (notably Escape) if a modal window
+ // (not managed by wx, e.g. IME one) is currently opened as more often
+ // than not it needs all the keys for itself.
+ //
+ // Also don't catch it if a window currently captures the mouse as
+ // Escape is normally used to release the mouse capture and if you
+ // really need to catch all the keys in the window that has mouse
+ // capture it can be easily done in its own EVT_CHAR handler as it is
+ // certain to have focus while it has the capture.
+ if ( !gs_modalEntryWindowCount && !::GetCapture() )
+ {
+ if ( id != WXK_NONE
+#if wxUSE_UNICODE
+ || static_cast(uc) != WXK_NONE
+#endif // wxUSE_UNICODE
+ )
+ {
+ wxWindow const* win = wxWindow::DoFindFocus();
+ if ( !win )
+ {
+ // Even if the focus got lost somehow, still send the event
+ // to the top level parent to allow a wxDialog to always
+ // close on Escape.
+ win = wxGetActiveWindow();
+ }
+
+ wxKeyEvent event(wxEVT_CHAR_HOOK);
+ MSWInitAnyKeyEvent(event, wParam, lParam, win);
+
+ event.m_keyCode = id;
+#if wxUSE_UNICODE
+ event.m_uniChar = uc;
+#endif // wxUSE_UNICODE
+
+ wxEvtHandler * const handler = win ? win->GetEventHandler()
+ : wxTheApp;
+
+ if ( handler && handler->ProcessEvent(event) )
+ {
+ if ( !event.IsNextEventAllowed() )
+ {
+ // Stop processing of this event.
+ return 1;
+ }
+ }
+ }
+ }
+ }
+
+ return (int)CallNextHookEx(wxTheKeyboardHook, nCode, wParam, lParam);
+}
+
+void wxSetKeyboardHook(bool doIt)
+{
+ if ( doIt )
+ {
+ wxTheKeyboardHook = ::SetWindowsHookEx
+ (
+ WH_KEYBOARD,
+ (HOOKPROC)wxKeyboardHook,
+ NULL, // must be NULL for process hook
+ ::GetCurrentThreadId()
+ );
+ if ( !wxTheKeyboardHook )
+ {
+ wxLogLastError(wxT("SetWindowsHookEx(wxKeyboardHook)"));
+ }
+ }
+ else // uninstall
+ {
+ if ( wxTheKeyboardHook )
+ ::UnhookWindowsHookEx(wxTheKeyboardHook);
+ }
+}
+
+#endif // !__WXMICROWIN__
+
+#if wxDEBUG_LEVEL >= 2
+const wxChar *wxGetMessageName(int message)
+{
+ switch ( message )
+ {
+ case 0x0000: return wxT("WM_NULL");
+ case 0x0001: return wxT("WM_CREATE");
+ case 0x0002: return wxT("WM_DESTROY");
+ case 0x0003: return wxT("WM_MOVE");
+ case 0x0005: return wxT("WM_SIZE");
+ case 0x0006: return wxT("WM_ACTIVATE");
+ case 0x0007: return wxT("WM_SETFOCUS");
+ case 0x0008: return wxT("WM_KILLFOCUS");
+ case 0x000A: return wxT("WM_ENABLE");
+ case 0x000B: return wxT("WM_SETREDRAW");
+ case 0x000C: return wxT("WM_SETTEXT");
+ case 0x000D: return wxT("WM_GETTEXT");
+ case 0x000E: return wxT("WM_GETTEXTLENGTH");
+ case 0x000F: return wxT("WM_PAINT");
+ case 0x0010: return wxT("WM_CLOSE");
+ case 0x0011: return wxT("WM_QUERYENDSESSION");
+ case 0x0012: return wxT("WM_QUIT");
+ case 0x0013: return wxT("WM_QUERYOPEN");
+ case 0x0014: return wxT("WM_ERASEBKGND");
+ case 0x0015: return wxT("WM_SYSCOLORCHANGE");
+ case 0x0016: return wxT("WM_ENDSESSION");
+ case 0x0017: return wxT("WM_SYSTEMERROR");
+ case 0x0018: return wxT("WM_SHOWWINDOW");
+ case 0x0019: return wxT("WM_CTLCOLOR");
+ case 0x001A: return wxT("WM_WININICHANGE");
+ case 0x001B: return wxT("WM_DEVMODECHANGE");
+ case 0x001C: return wxT("WM_ACTIVATEAPP");
+ case 0x001D: return wxT("WM_FONTCHANGE");
+ case 0x001E: return wxT("WM_TIMECHANGE");
+ case 0x001F: return wxT("WM_CANCELMODE");
+ case 0x0020: return wxT("WM_SETCURSOR");
+ case 0x0021: return wxT("WM_MOUSEACTIVATE");
+ case 0x0022: return wxT("WM_CHILDACTIVATE");
+ case 0x0023: return wxT("WM_QUEUESYNC");
+ case 0x0024: return wxT("WM_GETMINMAXINFO");
+ case 0x0026: return wxT("WM_PAINTICON");
+ case 0x0027: return wxT("WM_ICONERASEBKGND");
+ case 0x0028: return wxT("WM_NEXTDLGCTL");
+ case 0x002A: return wxT("WM_SPOOLERSTATUS");
+ case 0x002B: return wxT("WM_DRAWITEM");
+ case 0x002C: return wxT("WM_MEASUREITEM");
+ case 0x002D: return wxT("WM_DELETEITEM");
+ case 0x002E: return wxT("WM_VKEYTOITEM");
+ case 0x002F: return wxT("WM_CHARTOITEM");
+ case 0x0030: return wxT("WM_SETFONT");
+ case 0x0031: return wxT("WM_GETFONT");
+ case 0x0037: return wxT("WM_QUERYDRAGICON");
+ case 0x0039: return wxT("WM_COMPAREITEM");
+ case 0x0041: return wxT("WM_COMPACTING");
+ case 0x0044: return wxT("WM_COMMNOTIFY");
+ case 0x0046: return wxT("WM_WINDOWPOSCHANGING");
+ case 0x0047: return wxT("WM_WINDOWPOSCHANGED");
+ case 0x0048: return wxT("WM_POWER");
+
+ case 0x004A: return wxT("WM_COPYDATA");
+ case 0x004B: return wxT("WM_CANCELJOURNAL");
+ case 0x004E: return wxT("WM_NOTIFY");
+ case 0x0050: return wxT("WM_INPUTLANGCHANGEREQUEST");
+ case 0x0051: return wxT("WM_INPUTLANGCHANGE");
+ case 0x0052: return wxT("WM_TCARD");
+ case 0x0053: return wxT("WM_HELP");
+ case 0x0054: return wxT("WM_USERCHANGED");
+ case 0x0055: return wxT("WM_NOTIFYFORMAT");
+ case 0x007B: return wxT("WM_CONTEXTMENU");
+ case 0x007C: return wxT("WM_STYLECHANGING");
+ case 0x007D: return wxT("WM_STYLECHANGED");
+ case 0x007E: return wxT("WM_DISPLAYCHANGE");
+ case 0x007F: return wxT("WM_GETICON");
+ case 0x0080: return wxT("WM_SETICON");
+
+ case 0x0081: return wxT("WM_NCCREATE");
+ case 0x0082: return wxT("WM_NCDESTROY");
+ case 0x0083: return wxT("WM_NCCALCSIZE");
+ case 0x0084: return wxT("WM_NCHITTEST");
+ case 0x0085: return wxT("WM_NCPAINT");
+ case 0x0086: return wxT("WM_NCACTIVATE");
+ case 0x0087: return wxT("WM_GETDLGCODE");
+ case 0x00A0: return wxT("WM_NCMOUSEMOVE");
+ case 0x00A1: return wxT("WM_NCLBUTTONDOWN");
+ case 0x00A2: return wxT("WM_NCLBUTTONUP");
+ case 0x00A3: return wxT("WM_NCLBUTTONDBLCLK");
+ case 0x00A4: return wxT("WM_NCRBUTTONDOWN");
+ case 0x00A5: return wxT("WM_NCRBUTTONUP");
+ case 0x00A6: return wxT("WM_NCRBUTTONDBLCLK");
+ case 0x00A7: return wxT("WM_NCMBUTTONDOWN");
+ case 0x00A8: return wxT("WM_NCMBUTTONUP");
+ case 0x00A9: return wxT("WM_NCMBUTTONDBLCLK");
+
+ case 0x00B0: return wxT("EM_GETSEL");
+ case 0x00B1: return wxT("EM_SETSEL");
+ case 0x00B2: return wxT("EM_GETRECT");
+ case 0x00B3: return wxT("EM_SETRECT");
+ case 0x00B4: return wxT("EM_SETRECTNP");
+ case 0x00B5: return wxT("EM_SCROLL");
+ case 0x00B6: return wxT("EM_LINESCROLL");
+ case 0x00B7: return wxT("EM_SCROLLCARET");
+ case 0x00B8: return wxT("EM_GETMODIFY");
+ case 0x00B9: return wxT("EM_SETMODIFY");
+ case 0x00BA: return wxT("EM_GETLINECOUNT");
+ case 0x00BB: return wxT("EM_LINEINDEX");
+ case 0x00BC: return wxT("EM_SETHANDLE");
+ case 0x00BD: return wxT("EM_GETHANDLE");
+ case 0x00BE: return wxT("EM_GETTHUMB");
+ case 0x00C1: return wxT("EM_LINELENGTH");
+ case 0x00C2: return wxT("EM_REPLACESEL");
+ case 0x00C4: return wxT("EM_GETLINE");
+ case 0x00C5: return wxT("EM_LIMITTEXT/EM_SETLIMITTEXT"); /* ;win40 Name change */
+ case 0x00C6: return wxT("EM_CANUNDO");
+ case 0x00C7: return wxT("EM_UNDO");
+ case 0x00C8: return wxT("EM_FMTLINES");
+ case 0x00C9: return wxT("EM_LINEFROMCHAR");
+ case 0x00CB: return wxT("EM_SETTABSTOPS");
+ case 0x00CC: return wxT("EM_SETPASSWORDCHAR");
+ case 0x00CD: return wxT("EM_EMPTYUNDOBUFFER");
+ case 0x00CE: return wxT("EM_GETFIRSTVISIBLELINE");
+ case 0x00CF: return wxT("EM_SETREADONLY");
+ case 0x00D0: return wxT("EM_SETWORDBREAKPROC");
+ case 0x00D1: return wxT("EM_GETWORDBREAKPROC");
+ case 0x00D2: return wxT("EM_GETPASSWORDCHAR");
+ case 0x00D3: return wxT("EM_SETMARGINS");
+ case 0x00D4: return wxT("EM_GETMARGINS");
+ case 0x00D5: return wxT("EM_GETLIMITTEXT");
+ case 0x00D6: return wxT("EM_POSFROMCHAR");
+ case 0x00D7: return wxT("EM_CHARFROMPOS");
+ case 0x00D8: return wxT("EM_SETIMESTATUS");
+ case 0x00D9: return wxT("EM_GETIMESTATUS");
+
+ case 0x0100: return wxT("WM_KEYDOWN");
+ case 0x0101: return wxT("WM_KEYUP");
+ case 0x0102: return wxT("WM_CHAR");
+ case 0x0103: return wxT("WM_DEADCHAR");
+ case 0x0104: return wxT("WM_SYSKEYDOWN");
+ case 0x0105: return wxT("WM_SYSKEYUP");
+ case 0x0106: return wxT("WM_SYSCHAR");
+ case 0x0107: return wxT("WM_SYSDEADCHAR");
+ case 0x0108: return wxT("WM_KEYLAST");
+
+ case 0x010D: return wxT("WM_IME_STARTCOMPOSITION");
+ case 0x010E: return wxT("WM_IME_ENDCOMPOSITION");
+ case 0x010F: return wxT("WM_IME_COMPOSITION");
+
+ case 0x0110: return wxT("WM_INITDIALOG");
+ case 0x0111: return wxT("WM_COMMAND");
+ case 0x0112: return wxT("WM_SYSCOMMAND");
+ case 0x0113: return wxT("WM_TIMER");
+ case 0x0114: return wxT("WM_HSCROLL");
+ case 0x0115: return wxT("WM_VSCROLL");
+ case 0x0116: return wxT("WM_INITMENU");
+ case 0x0117: return wxT("WM_INITMENUPOPUP");
+ case 0x011F: return wxT("WM_MENUSELECT");
+ case 0x0120: return wxT("WM_MENUCHAR");
+ case 0x0121: return wxT("WM_ENTERIDLE");
+
+ case 0x0127: return wxT("WM_CHANGEUISTATE");
+ case 0x0128: return wxT("WM_UPDATEUISTATE");
+ case 0x0129: return wxT("WM_QUERYUISTATE");
+
+ case 0x0132: return wxT("WM_CTLCOLORMSGBOX");
+ case 0x0133: return wxT("WM_CTLCOLOREDIT");
+ case 0x0134: return wxT("WM_CTLCOLORLISTBOX");
+ case 0x0135: return wxT("WM_CTLCOLORBTN");
+ case 0x0136: return wxT("WM_CTLCOLORDLG");
+ case 0x0137: return wxT("WM_CTLCOLORSCROLLBAR");
+ case 0x0138: return wxT("WM_CTLCOLORSTATIC");
+ case 0x01E1: return wxT("MN_GETHMENU");
+
+ case 0x0200: return wxT("WM_MOUSEMOVE");
+ case 0x0201: return wxT("WM_LBUTTONDOWN");
+ case 0x0202: return wxT("WM_LBUTTONUP");
+ case 0x0203: return wxT("WM_LBUTTONDBLCLK");
+ case 0x0204: return wxT("WM_RBUTTONDOWN");
+ case 0x0205: return wxT("WM_RBUTTONUP");
+ case 0x0206: return wxT("WM_RBUTTONDBLCLK");
+ case 0x0207: return wxT("WM_MBUTTONDOWN");
+ case 0x0208: return wxT("WM_MBUTTONUP");
+ case 0x0209: return wxT("WM_MBUTTONDBLCLK");
+ case 0x020A: return wxT("WM_MOUSEWHEEL");
+ case 0x020B: return wxT("WM_XBUTTONDOWN");
+ case 0x020C: return wxT("WM_XBUTTONUP");
+ case 0x020D: return wxT("WM_XBUTTONDBLCLK");
+ case 0x0210: return wxT("WM_PARENTNOTIFY");
+ case 0x0211: return wxT("WM_ENTERMENULOOP");
+ case 0x0212: return wxT("WM_EXITMENULOOP");
+
+ case 0x0213: return wxT("WM_NEXTMENU");
+ case 0x0214: return wxT("WM_SIZING");
+ case 0x0215: return wxT("WM_CAPTURECHANGED");
+ case 0x0216: return wxT("WM_MOVING");
+ case 0x0218: return wxT("WM_POWERBROADCAST");
+ case 0x0219: return wxT("WM_DEVICECHANGE");
+
+ case 0x0220: return wxT("WM_MDICREATE");
+ case 0x0221: return wxT("WM_MDIDESTROY");
+ case 0x0222: return wxT("WM_MDIACTIVATE");
+ case 0x0223: return wxT("WM_MDIRESTORE");
+ case 0x0224: return wxT("WM_MDINEXT");
+ case 0x0225: return wxT("WM_MDIMAXIMIZE");
+ case 0x0226: return wxT("WM_MDITILE");
+ case 0x0227: return wxT("WM_MDICASCADE");
+ case 0x0228: return wxT("WM_MDIICONARRANGE");
+ case 0x0229: return wxT("WM_MDIGETACTIVE");
+ case 0x0230: return wxT("WM_MDISETMENU");
+ case 0x0233: return wxT("WM_DROPFILES");
+
+ case 0x0281: return wxT("WM_IME_SETCONTEXT");
+ case 0x0282: return wxT("WM_IME_NOTIFY");
+ case 0x0283: return wxT("WM_IME_CONTROL");
+ case 0x0284: return wxT("WM_IME_COMPOSITIONFULL");
+ case 0x0285: return wxT("WM_IME_SELECT");
+ case 0x0286: return wxT("WM_IME_CHAR");
+ case 0x0290: return wxT("WM_IME_KEYDOWN");
+ case 0x0291: return wxT("WM_IME_KEYUP");
+
+ case 0x02A0: return wxT("WM_NCMOUSEHOVER");
+ case 0x02A1: return wxT("WM_MOUSEHOVER");
+ case 0x02A2: return wxT("WM_NCMOUSELEAVE");
+ case 0x02A3: return wxT("WM_MOUSELEAVE");
+
+ case 0x0300: return wxT("WM_CUT");
+ case 0x0301: return wxT("WM_COPY");
+ case 0x0302: return wxT("WM_PASTE");
+ case 0x0303: return wxT("WM_CLEAR");
+ case 0x0304: return wxT("WM_UNDO");
+ case 0x0305: return wxT("WM_RENDERFORMAT");
+ case 0x0306: return wxT("WM_RENDERALLFORMATS");
+ case 0x0307: return wxT("WM_DESTROYCLIPBOARD");
+ case 0x0308: return wxT("WM_DRAWCLIPBOARD");
+ case 0x0309: return wxT("WM_PAINTCLIPBOARD");
+ case 0x030A: return wxT("WM_VSCROLLCLIPBOARD");
+ case 0x030B: return wxT("WM_SIZECLIPBOARD");
+ case 0x030C: return wxT("WM_ASKCBFORMATNAME");
+ case 0x030D: return wxT("WM_CHANGECBCHAIN");
+ case 0x030E: return wxT("WM_HSCROLLCLIPBOARD");
+ case 0x030F: return wxT("WM_QUERYNEWPALETTE");
+ case 0x0310: return wxT("WM_PALETTEISCHANGING");
+ case 0x0311: return wxT("WM_PALETTECHANGED");
+ case 0x0312: return wxT("WM_HOTKEY");
+
+ case 0x0317: return wxT("WM_PRINT");
+ case 0x0318: return wxT("WM_PRINTCLIENT");
+
+ // common controls messages - although they're not strictly speaking
+ // standard, it's nice to decode them nevertheless
+
+ // listview
+ case 0x1000 + 0: return wxT("LVM_GETBKCOLOR");
+ case 0x1000 + 1: return wxT("LVM_SETBKCOLOR");
+ case 0x1000 + 2: return wxT("LVM_GETIMAGELIST");
+ case 0x1000 + 3: return wxT("LVM_SETIMAGELIST");
+ case 0x1000 + 4: return wxT("LVM_GETITEMCOUNT");
+ case 0x1000 + 5: return wxT("LVM_GETITEMA");
+ case 0x1000 + 75: return wxT("LVM_GETITEMW");
+ case 0x1000 + 6: return wxT("LVM_SETITEMA");
+ case 0x1000 + 76: return wxT("LVM_SETITEMW");
+ case 0x1000 + 7: return wxT("LVM_INSERTITEMA");
+ case 0x1000 + 77: return wxT("LVM_INSERTITEMW");
+ case 0x1000 + 8: return wxT("LVM_DELETEITEM");
+ case 0x1000 + 9: return wxT("LVM_DELETEALLITEMS");
+ case 0x1000 + 10: return wxT("LVM_GETCALLBACKMASK");
+ case 0x1000 + 11: return wxT("LVM_SETCALLBACKMASK");
+ case 0x1000 + 12: return wxT("LVM_GETNEXTITEM");
+ case 0x1000 + 13: return wxT("LVM_FINDITEMA");
+ case 0x1000 + 83: return wxT("LVM_FINDITEMW");
+ case 0x1000 + 14: return wxT("LVM_GETITEMRECT");
+ case 0x1000 + 15: return wxT("LVM_SETITEMPOSITION");
+ case 0x1000 + 16: return wxT("LVM_GETITEMPOSITION");
+ case 0x1000 + 17: return wxT("LVM_GETSTRINGWIDTHA");
+ case 0x1000 + 87: return wxT("LVM_GETSTRINGWIDTHW");
+ case 0x1000 + 18: return wxT("LVM_HITTEST");
+ case 0x1000 + 19: return wxT("LVM_ENSUREVISIBLE");
+ case 0x1000 + 20: return wxT("LVM_SCROLL");
+ case 0x1000 + 21: return wxT("LVM_REDRAWITEMS");
+ case 0x1000 + 22: return wxT("LVM_ARRANGE");
+ case 0x1000 + 23: return wxT("LVM_EDITLABELA");
+ case 0x1000 + 118: return wxT("LVM_EDITLABELW");
+ case 0x1000 + 24: return wxT("LVM_GETEDITCONTROL");
+ case 0x1000 + 25: return wxT("LVM_GETCOLUMNA");
+ case 0x1000 + 95: return wxT("LVM_GETCOLUMNW");
+ case 0x1000 + 26: return wxT("LVM_SETCOLUMNA");
+ case 0x1000 + 96: return wxT("LVM_SETCOLUMNW");
+ case 0x1000 + 27: return wxT("LVM_INSERTCOLUMNA");
+ case 0x1000 + 97: return wxT("LVM_INSERTCOLUMNW");
+ case 0x1000 + 28: return wxT("LVM_DELETECOLUMN");
+ case 0x1000 + 29: return wxT("LVM_GETCOLUMNWIDTH");
+ case 0x1000 + 30: return wxT("LVM_SETCOLUMNWIDTH");
+ case 0x1000 + 31: return wxT("LVM_GETHEADER");
+ case 0x1000 + 33: return wxT("LVM_CREATEDRAGIMAGE");
+ case 0x1000 + 34: return wxT("LVM_GETVIEWRECT");
+ case 0x1000 + 35: return wxT("LVM_GETTEXTCOLOR");
+ case 0x1000 + 36: return wxT("LVM_SETTEXTCOLOR");
+ case 0x1000 + 37: return wxT("LVM_GETTEXTBKCOLOR");
+ case 0x1000 + 38: return wxT("LVM_SETTEXTBKCOLOR");
+ case 0x1000 + 39: return wxT("LVM_GETTOPINDEX");
+ case 0x1000 + 40: return wxT("LVM_GETCOUNTPERPAGE");
+ case 0x1000 + 41: return wxT("LVM_GETORIGIN");
+ case 0x1000 + 42: return wxT("LVM_UPDATE");
+ case 0x1000 + 43: return wxT("LVM_SETITEMSTATE");
+ case 0x1000 + 44: return wxT("LVM_GETITEMSTATE");
+ case 0x1000 + 45: return wxT("LVM_GETITEMTEXTA");
+ case 0x1000 + 115: return wxT("LVM_GETITEMTEXTW");
+ case 0x1000 + 46: return wxT("LVM_SETITEMTEXTA");
+ case 0x1000 + 116: return wxT("LVM_SETITEMTEXTW");
+ case 0x1000 + 47: return wxT("LVM_SETITEMCOUNT");
+ case 0x1000 + 48: return wxT("LVM_SORTITEMS");
+ case 0x1000 + 49: return wxT("LVM_SETITEMPOSITION32");
+ case 0x1000 + 50: return wxT("LVM_GETSELECTEDCOUNT");
+ case 0x1000 + 51: return wxT("LVM_GETITEMSPACING");
+ case 0x1000 + 52: return wxT("LVM_GETISEARCHSTRINGA");
+ case 0x1000 + 117: return wxT("LVM_GETISEARCHSTRINGW");
+ case 0x1000 + 53: return wxT("LVM_SETICONSPACING");
+ case 0x1000 + 54: return wxT("LVM_SETEXTENDEDLISTVIEWSTYLE");
+ case 0x1000 + 55: return wxT("LVM_GETEXTENDEDLISTVIEWSTYLE");
+ case 0x1000 + 56: return wxT("LVM_GETSUBITEMRECT");
+ case 0x1000 + 57: return wxT("LVM_SUBITEMHITTEST");
+ case 0x1000 + 58: return wxT("LVM_SETCOLUMNORDERARRAY");
+ case 0x1000 + 59: return wxT("LVM_GETCOLUMNORDERARRAY");
+ case 0x1000 + 60: return wxT("LVM_SETHOTITEM");
+ case 0x1000 + 61: return wxT("LVM_GETHOTITEM");
+ case 0x1000 + 62: return wxT("LVM_SETHOTCURSOR");
+ case 0x1000 + 63: return wxT("LVM_GETHOTCURSOR");
+ case 0x1000 + 64: return wxT("LVM_APPROXIMATEVIEWRECT");
+ case 0x1000 + 65: return wxT("LVM_SETWORKAREA");
+
+ // tree view
+ case 0x1100 + 0: return wxT("TVM_INSERTITEMA");
+ case 0x1100 + 50: return wxT("TVM_INSERTITEMW");
+ case 0x1100 + 1: return wxT("TVM_DELETEITEM");
+ case 0x1100 + 2: return wxT("TVM_EXPAND");
+ case 0x1100 + 4: return wxT("TVM_GETITEMRECT");
+ case 0x1100 + 5: return wxT("TVM_GETCOUNT");
+ case 0x1100 + 6: return wxT("TVM_GETINDENT");
+ case 0x1100 + 7: return wxT("TVM_SETINDENT");
+ case 0x1100 + 8: return wxT("TVM_GETIMAGELIST");
+ case 0x1100 + 9: return wxT("TVM_SETIMAGELIST");
+ case 0x1100 + 10: return wxT("TVM_GETNEXTITEM");
+ case 0x1100 + 11: return wxT("TVM_SELECTITEM");
+ case 0x1100 + 12: return wxT("TVM_GETITEMA");
+ case 0x1100 + 62: return wxT("TVM_GETITEMW");
+ case 0x1100 + 13: return wxT("TVM_SETITEMA");
+ case 0x1100 + 63: return wxT("TVM_SETITEMW");
+ case 0x1100 + 14: return wxT("TVM_EDITLABELA");
+ case 0x1100 + 65: return wxT("TVM_EDITLABELW");
+ case 0x1100 + 15: return wxT("TVM_GETEDITCONTROL");
+ case 0x1100 + 16: return wxT("TVM_GETVISIBLECOUNT");
+ case 0x1100 + 17: return wxT("TVM_HITTEST");
+ case 0x1100 + 18: return wxT("TVM_CREATEDRAGIMAGE");
+ case 0x1100 + 19: return wxT("TVM_SORTCHILDREN");
+ case 0x1100 + 20: return wxT("TVM_ENSUREVISIBLE");
+ case 0x1100 + 21: return wxT("TVM_SORTCHILDRENCB");
+ case 0x1100 + 22: return wxT("TVM_ENDEDITLABELNOW");
+ case 0x1100 + 23: return wxT("TVM_GETISEARCHSTRINGA");
+ case 0x1100 + 64: return wxT("TVM_GETISEARCHSTRINGW");
+ case 0x1100 + 24: return wxT("TVM_SETTOOLTIPS");
+ case 0x1100 + 25: return wxT("TVM_GETTOOLTIPS");
+
+ // header
+ case 0x1200 + 0: return wxT("HDM_GETITEMCOUNT");
+ case 0x1200 + 1: return wxT("HDM_INSERTITEMA");
+ case 0x1200 + 10: return wxT("HDM_INSERTITEMW");
+ case 0x1200 + 2: return wxT("HDM_DELETEITEM");
+ case 0x1200 + 3: return wxT("HDM_GETITEMA");
+ case 0x1200 + 11: return wxT("HDM_GETITEMW");
+ case 0x1200 + 4: return wxT("HDM_SETITEMA");
+ case 0x1200 + 12: return wxT("HDM_SETITEMW");
+ case 0x1200 + 5: return wxT("HDM_LAYOUT");
+ case 0x1200 + 6: return wxT("HDM_HITTEST");
+ case 0x1200 + 7: return wxT("HDM_GETITEMRECT");
+ case 0x1200 + 8: return wxT("HDM_SETIMAGELIST");
+ case 0x1200 + 9: return wxT("HDM_GETIMAGELIST");
+ case 0x1200 + 15: return wxT("HDM_ORDERTOINDEX");
+ case 0x1200 + 16: return wxT("HDM_CREATEDRAGIMAGE");
+ case 0x1200 + 17: return wxT("HDM_GETORDERARRAY");
+ case 0x1200 + 18: return wxT("HDM_SETORDERARRAY");
+ case 0x1200 + 19: return wxT("HDM_SETHOTDIVIDER");
+
+ // tab control
+ case 0x1300 + 2: return wxT("TCM_GETIMAGELIST");
+ case 0x1300 + 3: return wxT("TCM_SETIMAGELIST");
+ case 0x1300 + 4: return wxT("TCM_GETITEMCOUNT");
+ case 0x1300 + 5: return wxT("TCM_GETITEMA");
+ case 0x1300 + 60: return wxT("TCM_GETITEMW");
+ case 0x1300 + 6: return wxT("TCM_SETITEMA");
+ case 0x1300 + 61: return wxT("TCM_SETITEMW");
+ case 0x1300 + 7: return wxT("TCM_INSERTITEMA");
+ case 0x1300 + 62: return wxT("TCM_INSERTITEMW");
+ case 0x1300 + 8: return wxT("TCM_DELETEITEM");
+ case 0x1300 + 9: return wxT("TCM_DELETEALLITEMS");
+ case 0x1300 + 10: return wxT("TCM_GETITEMRECT");
+ case 0x1300 + 11: return wxT("TCM_GETCURSEL");
+ case 0x1300 + 12: return wxT("TCM_SETCURSEL");
+ case 0x1300 + 13: return wxT("TCM_HITTEST");
+ case 0x1300 + 14: return wxT("TCM_SETITEMEXTRA");
+ case 0x1300 + 40: return wxT("TCM_ADJUSTRECT");
+ case 0x1300 + 41: return wxT("TCM_SETITEMSIZE");
+ case 0x1300 + 42: return wxT("TCM_REMOVEIMAGE");
+ case 0x1300 + 43: return wxT("TCM_SETPADDING");
+ case 0x1300 + 44: return wxT("TCM_GETROWCOUNT");
+ case 0x1300 + 45: return wxT("TCM_GETTOOLTIPS");
+ case 0x1300 + 46: return wxT("TCM_SETTOOLTIPS");
+ case 0x1300 + 47: return wxT("TCM_GETCURFOCUS");
+ case 0x1300 + 48: return wxT("TCM_SETCURFOCUS");
+ case 0x1300 + 49: return wxT("TCM_SETMINTABWIDTH");
+ case 0x1300 + 50: return wxT("TCM_DESELECTALL");
+
+ // toolbar
+ case WM_USER+1: return wxT("TB_ENABLEBUTTON");
+ case WM_USER+2: return wxT("TB_CHECKBUTTON");
+ case WM_USER+3: return wxT("TB_PRESSBUTTON");
+ case WM_USER+4: return wxT("TB_HIDEBUTTON");
+ case WM_USER+5: return wxT("TB_INDETERMINATE");
+ case WM_USER+9: return wxT("TB_ISBUTTONENABLED");
+ case WM_USER+10: return wxT("TB_ISBUTTONCHECKED");
+ case WM_USER+11: return wxT("TB_ISBUTTONPRESSED");
+ case WM_USER+12: return wxT("TB_ISBUTTONHIDDEN");
+ case WM_USER+13: return wxT("TB_ISBUTTONINDETERMINATE");
+ case WM_USER+17: return wxT("TB_SETSTATE");
+ case WM_USER+18: return wxT("TB_GETSTATE");
+ case WM_USER+19: return wxT("TB_ADDBITMAP");
+ case WM_USER+20: return wxT("TB_ADDBUTTONS");
+ case WM_USER+21: return wxT("TB_INSERTBUTTON");
+ case WM_USER+22: return wxT("TB_DELETEBUTTON");
+ case WM_USER+23: return wxT("TB_GETBUTTON");
+ case WM_USER+24: return wxT("TB_BUTTONCOUNT");
+ case WM_USER+25: return wxT("TB_COMMANDTOINDEX");
+ case WM_USER+26: return wxT("TB_SAVERESTOREA");
+ case WM_USER+76: return wxT("TB_SAVERESTOREW");
+ case WM_USER+27: return wxT("TB_CUSTOMIZE");
+ case WM_USER+28: return wxT("TB_ADDSTRINGA");
+ case WM_USER+77: return wxT("TB_ADDSTRINGW");
+ case WM_USER+29: return wxT("TB_GETITEMRECT");
+ case WM_USER+30: return wxT("TB_BUTTONSTRUCTSIZE");
+ case WM_USER+31: return wxT("TB_SETBUTTONSIZE");
+ case WM_USER+32: return wxT("TB_SETBITMAPSIZE");
+ case WM_USER+33: return wxT("TB_AUTOSIZE");
+ case WM_USER+35: return wxT("TB_GETTOOLTIPS");
+ case WM_USER+36: return wxT("TB_SETTOOLTIPS");
+ case WM_USER+37: return wxT("TB_SETPARENT");
+ case WM_USER+39: return wxT("TB_SETROWS");
+ case WM_USER+40: return wxT("TB_GETROWS");
+ case WM_USER+42: return wxT("TB_SETCMDID");
+ case WM_USER+43: return wxT("TB_CHANGEBITMAP");
+ case WM_USER+44: return wxT("TB_GETBITMAP");
+ case WM_USER+45: return wxT("TB_GETBUTTONTEXTA");
+ case WM_USER+75: return wxT("TB_GETBUTTONTEXTW");
+ case WM_USER+46: return wxT("TB_REPLACEBITMAP");
+ case WM_USER+47: return wxT("TB_SETINDENT");
+ case WM_USER+48: return wxT("TB_SETIMAGELIST");
+ case WM_USER+49: return wxT("TB_GETIMAGELIST");
+ case WM_USER+50: return wxT("TB_LOADIMAGES");
+ case WM_USER+51: return wxT("TB_GETRECT");
+ case WM_USER+52: return wxT("TB_SETHOTIMAGELIST");
+ case WM_USER+53: return wxT("TB_GETHOTIMAGELIST");
+ case WM_USER+54: return wxT("TB_SETDISABLEDIMAGELIST");
+ case WM_USER+55: return wxT("TB_GETDISABLEDIMAGELIST");
+ case WM_USER+56: return wxT("TB_SETSTYLE");
+ case WM_USER+57: return wxT("TB_GETSTYLE");
+ case WM_USER+58: return wxT("TB_GETBUTTONSIZE");
+ case WM_USER+59: return wxT("TB_SETBUTTONWIDTH");
+ case WM_USER+60: return wxT("TB_SETMAXTEXTROWS");
+ case WM_USER+61: return wxT("TB_GETTEXTROWS");
+ case WM_USER+41: return wxT("TB_GETBITMAPFLAGS");
+
+ default:
+ static wxString s_szBuf;
+ s_szBuf.Printf(wxT(""), message);
+ return s_szBuf.c_str();
+ }
+}
+#endif // wxDEBUG_LEVEL >= 2
+
+static TEXTMETRIC wxGetTextMetrics(const wxWindowMSW *win)
+{
+ // prepare the DC
+ TEXTMETRIC tm;
+ HWND hwnd = GetHwndOf(win);
+ HDC hdc = ::GetDC(hwnd);
+
+#if !wxDIALOG_UNIT_COMPATIBILITY
+ // and select the current font into it
+ HFONT hfont = GetHfontOf(win->GetFont());
+ if ( hfont )
+ {
+ hfont = (HFONT)::SelectObject(hdc, hfont);
+ }
+#endif
+
+ // finally retrieve the text metrics from it
+ GetTextMetrics(hdc, &tm);
+
+#if !wxDIALOG_UNIT_COMPATIBILITY
+ // and clean up
+ if ( hfont )
+ {
+ (void)::SelectObject(hdc, hfont);
+ }
+#endif
+
+ ::ReleaseDC(hwnd, hdc);
+
+ return tm;
+}
+
+// Find the wxWindow at the current mouse position, returning the mouse
+// position.
+wxWindow* wxFindWindowAtPointer(wxPoint& pt)
+{
+ pt = wxGetMousePosition();
+ return wxFindWindowAtPoint(pt);
+}
+
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+ POINT pt2;
+ pt2.x = pt.x;
+ pt2.y = pt.y;
+
+ HWND hWnd = ::WindowFromPoint(pt2);
+ if ( hWnd )
+ {
+ // WindowFromPoint() ignores the disabled children but we're supposed
+ // to take them into account, so check if we have a child at this
+ // coordinate using ChildWindowFromPointEx().
+ for ( ;; )
+ {
+ pt2.x = pt.x;
+ pt2.y = pt.y;
+ ::ScreenToClient(hWnd, &pt2);
+ HWND child = ::ChildWindowFromPointEx(hWnd, pt2, CWP_SKIPINVISIBLE);
+ if ( child == hWnd || !child )
+ break;
+
+ // ChildWindowFromPointEx() only examines the immediate children
+ // but we want to get the deepest (top in Z-order) one, so continue
+ // iterating for as long as it finds anything.
+ hWnd = child;
+ }
+ }
+
+ return wxGetWindowFromHWND((WXHWND)hWnd);
+}
+
+// Get the current mouse position.
+wxPoint wxGetMousePosition()
+{
+ POINT pt;
+ wxGetCursorPosMSW(&pt);
+
+ return wxPoint(pt.x, pt.y);
+}
+
+#if wxUSE_HOTKEY
+
+#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
+static void WinCEUnregisterHotKey(int modifiers, int id)
+{
+ // Register hotkeys for the hardware buttons
+ HINSTANCE hCoreDll;
+ typedef BOOL (WINAPI *UnregisterFunc1Proc)(UINT, UINT);
+
+ UnregisterFunc1Proc procUnregisterFunc;
+ hCoreDll = LoadLibrary(wxT("coredll.dll"));
+ if (hCoreDll)
+ {
+ procUnregisterFunc = (UnregisterFunc1Proc)GetProcAddress(hCoreDll, wxT("UnregisterFunc1"));
+ if (procUnregisterFunc)
+ procUnregisterFunc(modifiers, id);
+ FreeLibrary(hCoreDll);
+ }
+}
+#endif
+
+bool wxWindowMSW::RegisterHotKey(int hotkeyId, int modifiers, int keycode)
+{
+ UINT win_modifiers=0;
+ if ( modifiers & wxMOD_ALT )
+ win_modifiers |= MOD_ALT;
+ if ( modifiers & wxMOD_SHIFT )
+ win_modifiers |= MOD_SHIFT;
+ if ( modifiers & wxMOD_CONTROL )
+ win_modifiers |= MOD_CONTROL;
+ if ( modifiers & wxMOD_WIN )
+ win_modifiers |= MOD_WIN;
+
+#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
+ // Required for PPC and Smartphone hardware buttons
+ if (keycode >= WXK_SPECIAL1 && keycode <= WXK_SPECIAL20)
+ WinCEUnregisterHotKey(win_modifiers, hotkeyId);
+#endif
+
+ if ( !::RegisterHotKey(GetHwnd(), hotkeyId, win_modifiers, keycode) )
+ {
+ wxLogLastError(wxT("RegisterHotKey"));
+
+ return false;
+ }
+
+ return true;
+}
+
+bool wxWindowMSW::UnregisterHotKey(int hotkeyId)
+{
+#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
+ WinCEUnregisterHotKey(MOD_WIN, hotkeyId);
+#endif
+
+ if ( !::UnregisterHotKey(GetHwnd(), hotkeyId) )
+ {
+ wxLogLastError(wxT("UnregisterHotKey"));
+
+ return false;
+ }
+
+ return true;
+}
+
+bool wxWindowMSW::HandleHotKey(WXWPARAM wParam, WXLPARAM lParam)
+{
+ int win_modifiers = LOWORD(lParam);
+
+ wxKeyEvent event(CreateKeyEvent(wxEVT_HOTKEY, HIWORD(lParam)));
+ event.SetId(wParam);
+ event.m_shiftDown = (win_modifiers & MOD_SHIFT) != 0;
+ event.m_controlDown = (win_modifiers & MOD_CONTROL) != 0;
+ event.m_altDown = (win_modifiers & MOD_ALT) != 0;
+ event.m_metaDown = (win_modifiers & MOD_WIN) != 0;
+
+ return HandleWindowEvent(event);
+}
+
+#endif // wxUSE_HOTKEY
+
+// Not tested under WinCE
+#ifndef __WXWINCE__
+
+// this class installs a message hook which really wakes up our idle processing
+// each time a WM_NULL is received (wxWakeUpIdle does this), even if we're
+// sitting inside a local modal loop (e.g. a menu is opened or scrollbar is
+// being dragged or even inside ::MessageBox()) and so don't control message
+// dispatching otherwise
+class wxIdleWakeUpModule : public wxModule
+{
+public:
+ virtual bool OnInit()
+ {
+ ms_hMsgHookProc = ::SetWindowsHookEx
+ (
+ WH_GETMESSAGE,
+ &wxIdleWakeUpModule::MsgHookProc,
+ NULL,
+ GetCurrentThreadId()
+ );
+
+ if ( !ms_hMsgHookProc )
+ {
+ wxLogLastError(wxT("SetWindowsHookEx(WH_GETMESSAGE)"));
+
+ return false;
+ }
+
+ return true;
+ }
+
+ virtual void OnExit()
+ {
+ ::UnhookWindowsHookEx(wxIdleWakeUpModule::ms_hMsgHookProc);
+ }
+
+ static LRESULT CALLBACK MsgHookProc(int nCode, WPARAM wParam, LPARAM lParam)
+ {
+ MSG *msg = (MSG*)lParam;
+
+ // only process the message if it is actually going to be removed from
+ // the message queue, this prevents that the same event from being
+ // processed multiple times if now someone just called PeekMessage()
+ if ( msg->message == WM_NULL && wParam == PM_REMOVE )
+ {
+ wxTheApp->ProcessPendingEvents();
+ }
+
+ return CallNextHookEx(ms_hMsgHookProc, nCode, wParam, lParam);
+ }
+
+private:
+ static HHOOK ms_hMsgHookProc;
+
+ DECLARE_DYNAMIC_CLASS(wxIdleWakeUpModule)
+};
+
+HHOOK wxIdleWakeUpModule::ms_hMsgHookProc = 0;
+
+IMPLEMENT_DYNAMIC_CLASS(wxIdleWakeUpModule, wxModule)
+
+#endif // __WXWINCE__
+
+#ifdef __WXWINCE__
+
+#if wxUSE_STATBOX
+static void wxAdjustZOrder(wxWindow* parent)
+{
+ if (wxDynamicCast(parent, wxStaticBox))
+ {
+ // Set the z-order correctly
+ SetWindowPos((HWND) parent->GetHWND(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
+ }
+
+ wxWindowList::compatibility_iterator current = parent->GetChildren().GetFirst();
+ while (current)
+ {
+ wxWindow *childWin = current->GetData();
+ wxAdjustZOrder(childWin);
+ current = current->GetNext();
+ }
+}
+#endif
+
+// We need to adjust the z-order of static boxes in WinCE, to
+// make 'contained' controls visible
+void wxWindowMSW::OnInitDialog( wxInitDialogEvent& event )
+{
+#if wxUSE_STATBOX
+ wxAdjustZOrder(this);
+#endif
+
+ event.Skip();
+}
+#endif
|