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

SourceForge.net noreply at sourceforge.net
Thu Jun 7 01:33:09 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-07 08:33

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

I don't know how else I can explain it to you. How about you start by
answering my questions:

1. The second toolbar and the wxMDIClientWindow share the same parent.
wxWidgets does not support overlapping windows. Where do you resize the
wxMDIClientWindow?

2. Thank you for the screenshots however I understand what the problem is,
it is you that cannot understand the solution. Try my bugreport.diff and
confirm it shows the same problem. You don't need the child frame to see it
as you can move any other window over it and it won't repaint, just as you
have described. See question 1 for the explaination of why this is.

3. Where is your diff file with the EVT_SIZE code added? And this time
read my earlier suggestions about not having code that isn't related to the
problem. Why submit a diff file that contains changes to other files in it?
And use CVS HEAD for the diff.

4. Have you even looked at the toolbar sample yet?

I'm trying my best here to explain this to you but you are making it
difficult. Stop changing the status and priority, I can assure you the bug
is in your code and not wxWidgets.

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

Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-07 07:55

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

File Added: bug_4.PNG

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

Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-07 07:54

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

File Added: bug_3.PNG

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

Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-07 07:53

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

File Added: bug_2.PNG

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

Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-07 07:52

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

Jamie,
please look at the attached screenshots.
The EVT_SIZE handler has absolutely nothing to do with the painting. It
just resizes the window.
When I added the EVT_SIZE to my code, it didn't change anything!

Please look at the attached screenshots to see what is going on...

bug_1 - is after the step 3
bug_2 - is after the step 4
bug_3 and bug_4 describes the bug.

Thank you.

File Added: bug_1.PNG

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

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