Search found 92 matches

by gpu
Thu Aug 28, 2014 9:40 am
Forum: C++ Development
Topic: pan and scale a wxScrollWindow
Replies: 6
Views: 1360

Re: pan and scale a wxScrollWindow

plus, when i wheel the mouse, not only the Scale things i do works, but also the srcollbar(verticle one) is moving...i think it's the defalut event which i have to deal
by gpu
Thu Aug 28, 2014 9:32 am
Forum: C++ Development
Topic: pan and scale a wxScrollWindow
Replies: 6
Views: 1360

Re: pan and scale a wxScrollWindow

thanks :) so ur opinion is that don't use SetDeviceOrigin, i now have problem: (1)i use mouseWheel event to scale the window, and i set the virtual size, it works fine. But when i drag the scrollbar, the background drawed lines are now fresh, i mean ,how can i get the scrollbar event when i draging ...
by gpu
Thu Aug 28, 2014 8:07 am
Forum: C++ Development
Topic: pan and scale a wxScrollWindow
Replies: 6
Views: 1360

Re: pan and scale a wxScrollWindow

and if i want a "infinit" wxScrollWindow, is it possible?
I mean wherever i drag, there is always the window
by gpu
Thu Aug 28, 2014 8:03 am
Forum: C++ Development
Topic: pan and scale a wxScrollWindow
Replies: 6
Views: 1360

pan and scale a wxScrollWindow

i want to pan a very big wxScrollWindow, i realized with dc.SetDeviceOrigin, but i still want to know what is the best way to do this? (2)and then as for the scale problem, what is the difference beteen SetSize and SetVirtualSize ? actually i need a very big window. (3)hwo to show the Scrollbats, i ...
by gpu
Wed Aug 27, 2014 2:05 pm
Forum: C++ Development
Topic: How make wxPanel transparent on Windows and Linux?
Replies: 40
Views: 9524

Re: How make wxPanel transparent on Windows and Linux?

the problem is solved, it's the SetdeviceOrigin problem
and I used wxPaintDC for both the parent and child, cause if use wxBufferedDC for the Child , the Child's background is always black!
thanks!
by gpu
Wed Aug 27, 2014 1:42 pm
Forum: C++ Development
Topic: How make wxPanel transparent on Windows and Linux?
Replies: 40
Views: 9524

Re: How make wxPanel transparent on Windows and Linux?

Parent::Render(wxDC& dc, const wxRect&) { //dc.setPen(); //HERE, just draw some simple line for test now //dc.SetPen(wxNullPen); } The question is what exactly you're drawing here, i.e. do you clear the background before drawing any lines? I don't clear the background...I just use dc.DrawLine draw ...
by gpu
Wed Aug 27, 2014 11:07 am
Forum: C++ Development
Topic: How make wxPanel transparent on Windows and Linux?
Replies: 40
Views: 9524

Re: How make wxPanel transparent on Windows and Linux?

This will definitely be a problem in the final code, because the background of the panel will contain the same drawing as the upper left corner of the parent.
But where should I use it ?
by gpu
Wed Aug 27, 2014 9:59 am
Forum: C++ Development
Topic: How make wxPanel transparent on Windows and Linux?
Replies: 40
Views: 9524

Re: How make wxPanel transparent on Windows and Linux?

Parent::paintEvent(wxPaintEvent&) { wxPaintDC(this); // Render(dc, GetRect()); } Parent::Render(wxDC& dc, const wxRect&) { //dc.setPen(); //HERE, just draw some simple line for test now //dc.SetPen(wxNullPen); } ////////////////////////////////////// Child::paintEvent(wxPaintEvent&) { wxBufferedPai...
by gpu
Wed Aug 27, 2014 9:49 am
Forum: C++ Development
Topic: How make wxPanel transparent on Windows and Linux?
Replies: 40
Views: 9524

Re: How make wxPanel transparent on Windows and Linux?

the parent is just set a background color, and draw some simple geometry,
the child panel have a semi-transparent bitmap...but the background is still black, is there any API should be called else?
by gpu
Wed Aug 27, 2014 9:25 am
Forum: C++ Development
Topic: How make wxPanel transparent on Windows and Linux?
Replies: 40
Views: 9524

Re: How make wxPanel transparent on Windows and Linux?

In principle it should work this way, but i can't tell you where exactly it fails. First try without the child panels and make sure that the parent window redraws correctly. Then add the panel, try commenting out parts of the paining process to see where it fails. the parent is ok...but when I use ...
by gpu
Wed Aug 27, 2014 8:30 am
Forum: C++ Development
Topic: How make wxPanel transparent on Windows and Linux?
Replies: 40
Views: 9524

Re: How make wxPanel transparent on Windows and Linux?

I tried like this: Parent::paintEvent(wxPaintEvent&) { wxPaintDC(this); // Render(dc, GetRect()); } Parent::Render(wxDC& dc, const wxRect&) { dc.setPen(); //draw sth dc.SetPen(wxNullPen); } ////////////////////////////////////// Child::paintEvent(wxPaintEvent&) { wxBufferedPaintDC(this); // Render(d...
by gpu
Wed Aug 27, 2014 7:18 am
Forum: C++ Development
Topic: about DND, and mouseMove
Replies: 3
Views: 1069

Re: about DND, and mouseMove

Thank you, and anyone familiar with this problem? :D
by gpu
Wed Aug 27, 2014 2:23 am
Forum: C++ Development
Topic: How make wxPanel transparent on Windows and Linux?
Replies: 40
Views: 9524

Re: How make wxPanel transparent on Windows and Linux?

I have difficulties understanding what exactly you're asking, so i'll answer more generally: The wxScrolledWindow is the background of everything, so AFAIU it will not be transparent. The panels on top should be semi-transparent so that the background ( the wxScrolledWindow ) shines through. When y...
by gpu
Wed Aug 27, 2014 2:00 am
Forum: C++ Development
Topic: about DND, and mouseMove
Replies: 3
Views: 1069

Re: about DND, and mouseMove

actually I just want to LButtonDown on one panel, and then drag to another panel, then LButtonUp, at last draw a line between them, (1)if i just link them without sending any data, should I still use the DND of wxWidgets.....another way is to just check the boundingbox the panel when LButtonUp, but ...
by gpu
Wed Aug 27, 2014 1:59 am
Forum: C++ Development
Topic: can ScrolledWindow resize with mouseWheel?
Replies: 17
Views: 3052

Re: can ScrolledWindow resize with mouseWheel?

Maybe you could try to remember the panel's outer size when it's at 100%, so that you always have a base value for your scaling calculations. yes, i do remember the myPanel size when it's 100%...my question is that the chilren controsl on it, of course i can remember all there size, but I think it'...