[ wxwindows-Bugs-1720516 ] toolbar does not get a painting events
SourceForge.net
noreply at sourceforge.net
Thu Jun 7 16:52:24 PDT 2007
Bugs item #1720516, was opened at 2007-05-17 09:00
Message generated for change (Comment added) made by vadz
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: Trivial
Status: Open
Resolution: None
>Priority: 2
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: Vadim Zeitlin (vadz)
Date: 2007-06-08 01:52
Message:
Logged In: YES
user_id=71618
Originator: NO
I didn't look at this bug but you seem to totally ignore Jamie's
questions. Why don't you answer them and look carefully at what he's
telling you? Chances are you could learn something. It really doesn't look
you've ever read what he wrote at all.
And, at the very least it looks like this bug has a trivial workaround so
why does it have such high priority?
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-08 01:46
Message:
Logged In: YES
user_id=1325635
Originator: YES
Jamie,
Here is the code snippet from your source:
wxSize size = frame->GetClientSize();
frame->m_toolbar = new wxToolBar( frame, wxID_ANY, wxDefaultPosition,
wxDefaultSize, wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT | wxTB_VERTICAL );
frame->m_toolbar->AddTool(wxID_NEW, _T("New"), wxBitmap(new_xpm),
wxNullBitmap, wxITEM_NORMAL, _T("New file"), _T("This is help for new file
tool") );
frame->m_toolbar->Realize();
frame->m_toolbar->SetSize( 0, 0, wxDefaultCoord, size.y );
frame->Centre(wxBOTH);
After creating the second toolbar you're resizing the main frame calling
the EVT_SIZE handler.
In my case, the top window is already re-positioned, which means that
after creating the second toolbar, I don't need to re-position, i.e. call
EVT_SIZE handler. It just un-neccessary.
Thank you.
----------------------------------------------------------------------
Comment By: Jamie Gadd (jrgadd)
Date: 2007-06-07 10: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 09:55
Message:
Logged In: YES
user_id=1325635
Originator: YES
File Added: bug_4.PNG
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-07 09:54
Message:
Logged In: YES
user_id=1325635
Originator: YES
File Added: bug_3.PNG
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-07 09:53
Message:
Logged In: YES
user_id=1325635
Originator: YES
File Added: bug_2.PNG
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-07 09: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 12: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 07: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 08:03
Message:
Logged In: YES
user_id=1193054
Originator: NO
Have another look.
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-06-03 06: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 02:43
Message:
Logged In: YES
user_id=1193054
Originator: NO
File Added: fix.diff
----------------------------------------------------------------------
Comment By: Jamie Gadd (jrgadd)
Date: 2007-06-02 02: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 09:04
Message:
Logged In: YES
user_id=1325635
Originator: YES
File Added: view.cpp
----------------------------------------------------------------------
Comment By: ONEEYEMAN (oneeyeman)
Date: 2007-05-17 09: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