Julian Smart [Tue, 20 Aug 2002 17:16:05 +0000 (17:16 +0000)]
Applied patch [ 597700 ] Fix proposal for wxJoystick under MSW
Proposed fixes for the wxWindows joystick code under
MSW.
Some of these would be valid for other platforms, too.
Events for buttons are named wrong, docs say different.
Docs say EVT_JOY_BUTTON_DOWN and
EVT_JOY_BUTTON_UP,
but the code says EVT_JOY_DOWN and EVT_JOY_UP. I
suggest
changing the code to match the docs.
wxJoystick::GetNumberJoysticks() should be a static
member
function. Having to create a joystick object to see if there
are joysticks is silly.
Docs for GetNumberJoysticks() must be changed; it returns
the
number of potentially connected joysticks, not the number of
actually connected. Alternatively, GetNumberJoysticks() and
others must be rewritten to conform with documentation,
including
remapping of wxWindows sequential joystick ID's to match
MSW non-sequential joystick ID's.
dwSize is not set when joyGetPosEx() is called. SEVERE
ERROR.
Error return value from functions should not be a legal
return,
for instance, wxJoystick::GetPOVCTSPosition() returns 0
for error,
but this is a legal return value.
GetButtonState() supports only four (out of 32) buttons.
Also, should return as bitmap (LSB = button 1). (Win32
does this,
although not documented as such).
Julian Smart [Tue, 20 Aug 2002 09:09:55 +0000 (09:09 +0000)]
Applied patch [ 597398 ] Generic MDI, wxNotebook based.
By Hans Van Leemputten (hansvl)
- This patch implements a generic notebook based mdi,
due to that wxMDIChildFrame could not derive from
wxFrame some things in the samples and in the docmdi
classes needed to be adjusted... basically this comes
down to not do (wxFrame *) but instead do
(wxMDIChildFrame *), or store a pointer to the frame in a
wxWindow* instead of a wxFrame variable...
- The main reason wxMDIChildFrame cannot derive from
wxFrame is that it would take to much platform specific
functions to be overwritten (= lot of ifdef's). This then
couldn't be called generic anymore, so that's why we
need to derive from wxPanel...
- Tested on/with:
1. wxMSW (I disabled the MSW MDI implementation to
be able to test it), tested it with the MDI sample,
docvwmdi sample and docview sample and also tested it
with wxWorkshop. (test = compile and run)
2. wxX11, tested with the same set wxWin samples as
the wxMSW test. I also compiled wxWorkshop with it,
but could not run wxWorkshop due to some issue not
related to the MDI implementation.
- How to apply:
* Apply the patch
* move mdig.cpp into wxWindows/src/generic/
* move mdig.h into wxWindows/include/wx/generic/
- Some extra things that still need to be done:
* File lists, project files should be updated to include
mdig.cpp (the patch only change this on wxX11)
* The configuration script should be updated.
* Maybe wxUSE_GENERIC_MDI_ARCHITECTURE also
should be added so it is only included when wanted...
Julian Smart [Tue, 20 Aug 2002 08:34:05 +0000 (08:34 +0000)]
Applied patch [ 597320 ] Return wxNotebook::SetSelection value
By Hans Van Leemputten (hansvl)
According to the documentation
wxNotebook::SetSelection() should return the previous
selection... (Like wxMSW does) but the wxUniv version
returns the currently selected selection.
Patch was tested with wxX11.
Applied patch [ 597313 ] Popup menu still used after deletion
By Hans Van Leemputten (hansvl)
- This patch exists out of 2 parts;
Part 1 is a patch to show the problem with the menu
sample (this part is just to show the problem and should
not be put into CVS!).
Part 2 is the fix and should be put in CVS.
(src/univ/menu.cpp)
- Instructions to reproduce the problem with the menu
sample:
1. Apply part 1 of the patch only.
2. Run the sample after recompiling it.
3. Press "Close Test" -> "Close", this will basically
remove the current menu bar and recreate it again and
re-use the menu item "Close test" from the old menu
bar...
4. Again press "Close Test", doing this will already
crash the sample.
- The cause of the problem is that the m_popupMenu in
wxMenu is deleted because it is a child of the old menu
bar (Note: it does not get destroyed by the wxMenu
destructor, but by DestroyChildren()) and m_popupMenu
is not put back to NULL when this happens...
Julian Smart [Fri, 16 Aug 2002 11:24:46 +0000 (11:24 +0000)]
Applied [ 594925 ] Implement wxArtProvider and XRC together
By Robert O'Connor (robertoconnor)
This patch is a draft which successfully allows a wxArtProvider to serve out icons to bitmaps for XRC files.
The syntax to use a wxArtProvider bitmap is:
<bitmap stock_id="wxART_INFORMATION" stock_client="wxART_TOOLBAR">somefallbackicon.png</bitmap>
The bitmap is optional, and will only be used as a fallback image, if the wxArtProvider returned a wxNullBitmap for some reason.
The client attribute, if not specified, currently will be wxART_OTHER. Perhaps there should be a guessing heuristic of it being in a menu node to call wxART_MENU.
Usage of XRC resouces and wxArtProvider together can be seen in an updated /contrib/samples/xrc demo, which is a separate patch.
Search the wx-dev mailing lists for "wxArtProvider" and "XRC" for the full discussions on this feature's API design.
Applied patch [ 594932 ] Extended XRC XML resources sample
By Robert O'Connor (robertoconnor)
This is a more comprehensive introduction to how to get up and running using XRC in your new wxWindows project.
It describes both the basics (for new users) and advanced features. It consists of a demo of dialogs and frames loaded from XRC. Each dialog has a textctrl at the top of the dialog, which walks the new user through that feature.
There are 8 demos:
The 4 basic ones:
-A non-derived dialog, as typically used for an about dialog.
-A derived dialog that loads its resources from an XRC (a frequently-asked question on the mailing lists), and responds to some simple events, including the disable-another-control-via-EVT_UPDATE_UI that is another FAQ, and powerful and simple-to-use feature.
-A XRC reference "Controls" dialog, using a notebook. Each tab has a single control. All XRC handled widgets can be seen at a glance, and how to use them under XRC.
-An uncentered dialog, to demonstrate the easy use of <centered>1</centered> to automatically place a Dialog centered on its parent..
The 4 advanced ones:
-Embedding a custom class into an XRC dialog, by using the "unknown" class.
-Using wxArtProvider to use stock icons from within your your XRC resources.
-Using the platform attribute to selectively show a part of XRC based on the current OS.
-Runtime variable expansion (demo only. Not implemented at this time).
Also:
-The main frame is now demonstrated as being loaded as an XRC.
- The toolbar has longhelp tag demonstrated, and are hooked up to the same events as the menu to show how XRCID() works on the same tool and menuitem XRCID.
-Some custom icons for the demonstration were created, and put into the toolbar and menubar. A custom icon also for the demonstration.
-The example code has been put in 1 class per file (both .cpp and a matching .xrc), to make it much less confusing for a newcomer to figure out what class is what, expecially with all the wx macros for declaration and implementation.
Julian Smart [Fri, 16 Aug 2002 10:51:07 +0000 (10:51 +0000)]
Applied [ 594745 ] Fixes core dump under Forte 6U1 in imagbmp.cpp
By John Skiff
I was getting a core dump under Solaris 2.6 when
storing images. My compiler is Forte 6 Update 1. The
problem was in imagbmp.cpp:
t@1 (l@1) signal BUS (invalid address alignment) in
wxANIHandler::DoCanRead at line 1304 in file "imagbmp.cpp"
1304 if ( FCC1 != *riff32 )
(dbx) p FCC1
FCC1 = 31064321
(dbx) p *riff32
*riff32 = 1380533830
(dbx)
I have tested the fix under Windows 2000, Solaris 2.6,
and Irix 6.5.