 |
|
 |
i saw another article resizablelib,it shows "some minor issues"?
and "dead" what else message, this version still have these problems?
|
|
|
|
 |
|
|
 |
|
 |
I used the with a CformView inside an ultimate tools tabbed MDI app with an ultimate Grid and other controls on the page. The grid exoanded to fill the middle of the page. All I needed to add to the grid was some code to a expand a column to fill up the extra white space to the vertical scroll bar(if present);
|
|
|
|
 |
|
 |
I got your article when seeking a method avoiding controls flickering in FormView. I find you did do it well. It seems you realize it by ClipChildren(pDC) in OnEraseBkgnd(), but I am so dull as not to understand it, so I beg your help , I just want to avoid flickering, not to resizable the controls.
chenzd
|
|
|
|
 |
|
 |
Well, basically the rule is "never paint a pixel more than once", unless it's the same color of course.
ClipChildren achieves this by protecting child controls from the parent when it paints the background. That works well with controls that do paint their background by themselves. It does not work for transparent controls, for example a group box.
Anyway, if you're not interested to resizing, then just follow the above rule. If you want more flexibility when painting a control's client area, you might want to use a double buffering scheme, that is you can "infringe" the rule when drawing on the back buffer (a memory DC), then you copy it on the front buffer (the paint DC).
You might want to look for CMemDC on this site or on the web.
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
 |
|
 |
CMemDC did solve my problems , thank you Paolo, and the CMemDC writer.
chenzd
|
|
|
|
 |
|
 |
Great.It is just what I want.
Thanks
Benben
|
|
|
|
 |
|
 |
Hi,
maybe I do not use the class properly, maybe it is not develop properly. I have a CResizableForm class (a basic CFormView derived wich I changed the CFormView to the CResiz...).
on call of the SetWindowPos or MoveWindow, having the GetWindowRect before of course, doesn't resize the form at all.
what is wrong?
thank you
|
|
|
|
 |
|
 |
The problem is that you want to resize the form, which is a child window, instead of resizing its parent.
Call GetParent() or GetParentFrame() and then use the returned window.
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
 |
|
 |
Hi,
I'm haveng problems with using the ActiveX for windows media player on my CResizableFormView derived class, what happnes is that I try to AddAnchor the control in the OnInitialUpdate but CResizableLayout AddAnchor fails in calling ::IsChild(pParent->GetSafeHwnd(), hWnd);.
I know the cause, it's because the activex control dosent have HWND == NULL in my OnInitialUpdate method, but I can't figure out why.
Can you help me?
Thanks
Pedro Miranda.
Pedro Miranda
|
|
|
|
 |
|
 |
Hi,
What happens if you just ignore the assertion? Does resizing work?
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
 |
|
 |
Hi Paolo,
First let me thank you for your reply and for your excellent work and specially for sharing it with us.
Now, lets get this fingers typing J
It does works if I ignore the assertion, but it keeps asserting in ArrangeLayoutCallback because in ArrangeLayout layout.hWnd == NULL and I do not have overridden ArrangeLayoutCallback.
This problem only appends if I in
void CMyFormView::OnInitialUpdate()
{
AddAnchor(m_MyControl.m_hWnd,MIDDLE_CENTER);
CResizableFormView::OnInitialUpdate();
}
if instead I
void CMyFormView::OnInitialUpdate()
{
CResizableFormView::OnInitialUpdate();
AddAnchor(m_MyControl.m_hWnd,MIDDLE_CENTER);
}
It works fine.
I’ve manage to find out why, after steeping into MFC code I discovered that although I have a instance of MyControl it does not have a Window associated with it, it’s in:
CFormView::OnInitialUpdateà CWnd::UpdateDataà CMyFormView::DoDataExchangeà:: DDX_Control that the Window is associated with my control by calling rControl.SubclassWindow(hWndCtrl).
My question is if there is no problem in calling AddAnchor after CResizableFormView::OnInitialUpdate and specially if I need to call CResizableFormView::ArrangeLayout() again after it.
Thank you
To anyone you sees this post.....Visit Italy, Paolo’s Homeland...one of the most beautiful country I had the pleasure of traveling.....with the most beautiful ladies on earth...........lucky Italians J
Pedro Miranda
|
|
|
|
 |
|
 |
Pedro Miranda wrote:
My question is if there is no problem in calling AddAnchor after CResizableFormView::OnInitialUpdate and specially if I need to call CResizableFormView::ArrangeLayout() again after it.
Well, there is a short and a long version of the story. Let's begin with the short one: you need to call AddAnchor after calling the base implementation of OnInitialUpdate(). That's precisely because DDX is initialized during that call.
Now the long version. Unfortunately OnInitialUpdate() is not the best place to do one-shot initialization tasks, because it could be called more than once by the framework. We would need something like OnInitDialog, that unfortunately is not available for FormViews. The good news is that I'm working on a workaround that enables OnInitDialog and will hopefully solve this and some other problems in the next version of the library.
Experimental code is on CVS at SourceForge, along with new versions of the demo applications. I have no time now to release anything, but I would be grateful to anyone interested in some testing.
The easiest way to obtain the code is downloading the CVS Nightly Tarball or using some CVS client, such as WinCvs.
Thanks,
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
 |
|
 |
I'd used the Dialog version in the past - but I'd forgotten there was a FormView version as well.
Just what I needed, thanks and keep up the good work
JohnJ
Time for a but no
http://www.rainbow-innov.co.uk[^]
|
|
|
|
 |
|
 |
I have one ActiveX control (a HexEdit inherited from OleControl) and button.
- Button is moving well during resizing the View.
- ActiveX is blinking during moving.
- but when I click on this ActiveX it takes its original Position and size as in RC file (resource)!
I suppose that this is not connected to your code, but mybe you have any suggestion ? (maybe @DeferWindowPos@ technics do not work well ?)
- Also when I open files from MRU list of my APP (SDI), it take it original position ... :(
|
|
|
|
 |
|
 |
shilon wrote:
ActiveX is blinking during moving.
That should depend on how the control redraws itself. The default for ResizableLib is clipping enabled and no refresh, so it shouldn't flicker unless it's painting itself in many steps.
As for the positioning issues, is there a way I could reproduce them with some standard ActiveX (calendar, grid, ...) or could you provide more details about its implementation, or better a small test project?
Thanks,
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
 |
|
 |
About Resizing:
I make an experiment:
- from a menu I do SetWindowPos(ActiX_HWND, ....).
- i do some Resize of main App.
- and now, after clicking on AciteX it take size which i set in SetWinPos()...
I do not try to reproduce this with standart ActiveX's ...
This ActiveX is HEX Edit ActiveX from this site ...
So make a SDI based on FormView to reproduce this.
|
|
|
|
 |
|
 |
shilon wrote:
This ActiveX is HEX Edit ActiveX from this site ...
Unfortunately the links on that page are dead, so I couldn't have a look at the control's source code.
However DeferWindowPos and SetWindowPos should have the same results, unless they're using different flags.
Also, from the description of the problem it seems quite strange... if you click on it, it will go to the initial position, or the one you set with SetWindowPos. Maybe the control itself, or the base class, is caching the initial position somewhere... ??
Does it happen the same if you give the focus to it using the keyboard?
Also, could you verify with the debugger if the HWND on which you call AddAnchor is the same as the one on which you call SetWindowPos? And if they are different use Spy++ to see what they are?
Paolo
------
Why spend 2 minutes doing it by hand when you can spend all night plus most of the following day writing a system to do it for you? - (Chris Maunder)
|
|
|
|
 |
|
 |
One of the things I really like about the CResizableDialog class is the ability to use the SetMinTrackSize and SetMaxTrackSize functions which are now apparently part of this CResizableMinMax class that part of the library.
Anyway, would this work for the CResizableFormView? I want to be able to set the minimum and maximum track sizes on the mainfrm as well for my SDI application.
Thanks in advance,
Matt Philmon
|
|
|
|
 |
|
 |
A CFormView is a child window, so you don't get any WM_GETMINMAXINFO message.
But you should be able to successfully use that class for your CMainFrame and CChildFrame (in MDI projects). I just tried
Cheers,
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
 |
|
 |
Hi,
I test your function for a CFormView.
I have tho activx, in a dialog and saome bottons...
the activx's are atach'ed in tho statics...
All the thinh are ok until I resize to a little dialog and
I must scroll verticaly.
I don't know why, but my activx's are going in the first position.
???????
Regards,
Bogdan
Bogdan
|
|
|
|
 |
|
 |
Hi Bogdan,
This is very strange. My code has almost nothing to do with scrolling...
Could you please send me some sample code or small demo prject to reproduce the problem?
Paolo
|
|
|
|
 |
|
 |
Hi, Paolo:
I probably have the same problem with scrolling in a MFC project.
In my form view, the top part is a static control for main drawing.
AT left of bottom are some edit and button control, at bottom right is a tab control.
When sizing, the drawing stretch left-right and up-down. The tan control stretches left right.
I derived my form view from the CResizableFormView.
After sizing, the formview is less than its original size. So its H and V scroll bars appear.
Move the bars to right and bottom, grab the right-bottom of window frame for sizing.
You will find weird at up-left of form view when moving scroll bars.
Could you please tell me what happens there.
Note: when I did not derive my form view from the CResizableFormView. Above problem does not happen.
Thanks.
Haibiao
|
|
|
|
 |
|
 |
I have been looking for this forever. Thanks.
-Matt Newman
|
|
|
|
 |