[ wxwindows-Bugs-1720516 ] toolbar does not get a painting events

SourceForge.net noreply at sourceforge.net
Wed Jun 6 03:00:19 PDT 2007


Bugs item #1720516, was opened at 2007-05-17 07:00
Message generated for change (Comment added) made by jrgadd
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1720516&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMSW specific
Group: Fatal
>Status: Closed
>Resolution: Invalid
>Priority: 1
Private: No
Submitted By: ONEEYEMAN (oneeyeman)
Assigned to: Nobody/Anonymous (nobody)
Summary: toolbar does not get a painting events

Initial Comment:
Attached please find the modified files from the docvwmdi sample.

I saw it with the 2.8.1 wxMSW on WinXP SP 2 with MSVC.

Steps to reproduce the problem:
0. Copy new.xpm file from the toolbar sample to the docvwmdi directory.
1. Compile the docvwmdi sample.
2. Run the sample.
3. Click the button on the first toolbar (or select File->New).
4. Select "Drawing" from the list and click OK.
5. Second toolbar will be created along with the drawing view.

Try to click the button on the second toolbar (the one that is being vertical). Nothing happened.
Drag the MDI child window over the second toolbar. The toolbar will be erased on the space you are dragging the mdi child over.

----------------------------------------------------------------------

>Comment By: Jamie Gadd (jrgadd)
Date: 2007-06-06 10:00

Message:
Logged In: YES 
user_id=1193054
Originator: NO

That diff is unusable, have you even read my suggestions?

It makes no difference when you create the 2nd toolbar if you don't handle
the resizing. Where in your code do you resize the wxMDIClientWindow to
adjust for the new toolbar?

Apply bugreport.diff and confirm the behaviour is as you have described
re: the painting.
Now apply fix.diff to a clean sample and see how it works. Remove the
EVT_SIZE event handler and then try it.

Again, this is all demonstrated in the toolbar sample.

----------------------------------------------------------------------

Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-06 05:38

Message:
Logged In: YES 
user_id=1325635
Originator: YES

Jamie,
I created the diff to show the problem.
Please apply, then follow the steps in the description of the bug.

It is a little different than your code.
The difference is that my code creates the program with one toolbar only
(main toolbar).
Second toolbar shows up when the view is created.

The idea is to change the toolbar when the view is changing/creating. But
it is a second toolbar, not the first one.

Only the main toolbar should be visible when the program starts.

Thank you
File Added: bug_sample

----------------------------------------------------------------------

Comment By: Jamie Gadd (jrgadd)
Date: 2007-06-03 06:03

Message:
Logged In: YES 
user_id=1193054
Originator: NO

Have another look.

----------------------------------------------------------------------

Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-03 04:24

Message:
Logged In: YES 
user_id=1325635
Originator: YES

Jamie,
The code you put on will work. I am not arguing this.
If you tried to run my files, you would've see that I'm creating 2
toolbars: one main toolbar (for the application), and one local toolbar
(for the view command).
The second toolbar (local one) does not get updated. In fact it does not
receive any events/messages at all.
When I looked at your code I found only one toolbar created....

Thank you.

----------------------------------------------------------------------

Comment By: Jamie Gadd (jrgadd)
Date: 2007-06-02 00:43

Message:
Logged In: YES 
user_id=1193054
Originator: NO

File Added: fix.diff

----------------------------------------------------------------------

Comment By: Jamie Gadd (jrgadd)
Date: 2007-06-02 00:42

Message:
Logged In: YES 
user_id=1193054
Originator: NO

This is because you don't adjust the size for the wxMDIClientWindow, see
fix. This is demonstrated clearly in the toolbar sample.

Some suggestions:

Why were these lines included?
        wxSize test = GetMainFrame()->GetClientSize();
        test.y -= 2;
No need for the call to CreateStatusBar()
Don't use TABs
Don't include additional headers unnecessarily e.g. "wx/notebook.h"

I have attached a sample of your files with the excess removed as an
example of how you should submit these in the future. Try and have it in
this format next time please.

File Added: bugreport.diff

----------------------------------------------------------------------

Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-05-17 07:04

Message:
Logged In: YES 
user_id=1325635
Originator: YES

File Added: view.cpp

----------------------------------------------------------------------

Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-05-17 07:02

Message:
Logged In: YES 
user_id=1325635
Originator: YES

File Added: docview.h

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1720516&group_id=9863




More information about the wx-dev mailing list