|
|
Comments and Discussions
|
|
 |

|
client area calculation bug in windows 7 (may be vista too)
In method CResizableLayout::MakeResizable:
before:
pWnd->ModifyStyle(DS_MODALFRAME, WS_THICKFRAME);
CRect rect(CPoint(lpCreateStruct->x, lpCreateStruct->y), CSize(lpCreateStruct->cx, lpCreateStruct->cy));
pWnd->SendMessage(WM_NCCALCSIZE, FALSE, (LPARAM)&rect);
::AdjustWindowRectEx(&rect, pWnd->GetStyle(),
::IsMenu(pWnd->GetMenu()->GetSafeHmenu()), pWnd->GetExStyle());
after:
CRect rect(CPoint(lpCreateStruct->x, lpCreateStruct->y), CSize(lpCreateStruct->cx, lpCreateStruct->cy));
pWnd->SendMessage(WM_NCCALCSIZE, FALSE, (LPARAM)&rect);
pWnd->ModifyStyle(DS_MODALFRAME, WS_THICKFRAME);
::AdjustWindowRectEx(&rect, pWnd->GetStyle(),
::IsMenu(pWnd->GetMenu()->GetSafeHmenu()), pWnd->GetExStyle());
|
|
|
|

|
Same as http://www.codeproject.com/Articles/1175/ResizableLib?msg=2323262#xx2323262xx ?
Andreas.
|
|
|
|

|
I noticed a class CResizableSplitterWnd, which presumably adds support for CSplitterWnd. How can I anchor splitter to window edge, so that for instance on resize only top pane is resized, and bottom pane's size remains fixed?
|
|
|
|

|
I don't want to inherit CTestDlg from CResizableDialog,because CTestDlg inherit from my own CMySkinDialog and I don't want CMySkinDialog to inherit from CResizableDialog because some dialogs don't need to use the resizable function.So what is the solution?Can I use class member to resizable my controls?
Thanks very much!
|
|
|
|

|
You can inherit from CResizableLayout (and others), the same way as CResizableDialog is doing and copy the basic implementation (OnSize, OnInitDialog, and so on...) to your own class.
If you need to reuse the same logic, you can make another base class, very much like CResizableDialog, but that does not inherit from CDialog. You can then inherit your dialogs from CDialog and from this "window-less" class, and connect window messages to its base implementation.
Just make sure that both your "skin" base class and CResizableLayout have a chance to process OnSize events.
It may become tricky when you have to implement OnEraseBkgnd.
Best,
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)
|
|
|
|

|
Thanks.I worked it out as you said.void CDlgSimul::OnSize(UINT nType, int cx, int cy)
{
CBaseDialog::OnSize(nType, cx, cy);
ArrangeLayout();
}
class CDlgSimul : public CBaseDialog,CResizableLayout
AddAnchor(IDC_EDIT_REV,TOP_LEFT, BOTTOM_RIGHT);
AddAnchor(IDC_STATIC_TRA,BOTTOM_LEFT, BOTTOM_RIGHT);
It workes well.Thanks very much!
|
|
|
|

|
May I ask why not add DECLARE_DYNAMIC(CResizableDialog)
and IMPLEMENT_DYNAMIC(CResizableDialog, CDialog)
to CResizableDialog source files?
So I can replace all "CDialog" to "CResizableDialog" in my TestDlg.cpp including the code "IMPLEMENT_DYNAMIC(CTestDlg , CDialog)"
modified 29 Sep '11 - 9:37.
|
|
|
|
|
|

|
I haven't got the time to dedicate to this code for a long time, it's true.
But that doesn't mean that users of this library cannot do some work on it on their own and then share their improvements. That's the primary reason why I shared the code.
So you decide if it's dead or not.
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)
|
|
|
|

|
Has anyone looked into adding dialog (or control) ratio restrictions?
ie: - keep same aspect ratio while stretching...
Help!
Thanks!
|
|
|
|

|
In my application the propertysheets are modeless. The first time the sheet and its pages are brought up, the sizes are correct. However next time that the sheet and its pages are brought up, size of the sheet and placement of the p[ages has changed, does anyone know whether it is possible at all to use this library for modeless property sheets and pages?
|
|
|
|

|
It is possible, I'm using modeless CResizableSheetEx as a child control in CResizableDialog. 1.4 alpha has several issues with such use. I hope the owner will fix it in the future releases.
1. CResizableLayout::MakeResizable is making parent dialog smaller (approximately by size of the border), as a workaround change your main dialog's Border to Resizing.
2. CListCtrl with View property as Report is the most problematic. CWnd::DefWindosProc bombards property sheet with WM_GETDLGCODE messages, use WS_EX_CONTROLPARENT style when creating property sheet or modify it in OnInitDialog. Such report list controls also have problem with double buffering in CResizableLayout::ClipChildren, it's affecting other childs, disable it by defining RSZLIB_NO_XP_DOUBLE_BUFFER preprocessor.
|
|
|
|

|
Hi,
One of a demo of projects is not Linking.
Libraries are compiled.
Used Library source v1.4 (alpha) and Visual Studio 2008.
Has read through all similar themes but decisions in them has not found.
Help to solve the given problem, or prompt the alternative decision please.
1>------ Build started: Project: Demo, Configuration: Debug Unicode Win32 ------
1>Compiling...
1>StdAfx.cpp
1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
1>Compiling...
1>Demo.cpp
1>DemoDlg.cpp
1>MyPropertyPages.cpp
1>MyPropertySheet.cpp
1>Generating Code...
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>MyPropertyPages.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const * __stdcall CResizablePage::GetThisMessageMap(void)" (?GetThisMessageMap@CResizablePage@@KGPBUAFX_MSGMAP@@XZ)
1>MyPropertyPages.obj : error LNK2019: unresolved external symbol "public: static struct CRuntimeClass * __stdcall CResizablePage::GetThisClass(void)" (?GetThisClass@CResizablePage@@SGPAUCRuntimeClass@@XZ) referenced in function "protected: static struct CRuntimeClass * __stdcall CMyPropertyPage1::_GetBaseClass(void)" (?_GetBaseClass@CMyPropertyPage1@@KGPAUCRuntimeClass@@XZ)
1>MyPropertyPages.obj : error LNK2019: unresolved external symbol "public: __thiscall CResizablePage::CResizablePage(unsigned int,unsigned int)" (??0CResizablePage@@QAE@II@Z) referenced in function "public: __thiscall CMyPropertyPage1::CMyPropertyPage1(void)" (??0CMyPropertyPage1@@
..... e.t.c.
|
|
|
|

|
Hi _andrey_,
I had same error, but when i add "resizeableformview.h (and .cpp) and resizeablelayout.h (and .cpp) under dll solution explorer, the problem solved.
hope that helps you as well
Moslem SALEH
|
|
|
|

|
Hello,
I have to draw the width of a property sheet and I need to have the width of this sheet dynamic. So I create the sheet with the pages and then I calculate the width and set this width of the sheet with setWindowPos.
Now the sheet grows bigger but the pages stay the same. Is there any special function I need to use when I change the size of a window so the pages resize too?
when I resize the window with the mouse and the grip everyting works perfect.
Thx and greetz
Ric
|
|
|
|

|
If the resize works when using the mouse, it has to work also with SetWindowPos. Make sure you pass SWP_NOACTIVATE | SWP_NOZORDER as flags and nothing else, or try to force SWP_FRAMECHANGED.
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)
modified on Saturday, March 27, 2010 6:23 AM
|
|
|
|

|
If I put a List Control on a CResizableDialog or CResizablePropertyPage and the resources 'View' property is set to 'Report' the entire Dialog/Page is blank. For example a simple dialog with a report and a few control buttons shows up as grey. As soon as the 'View' property is set to anything but 'Report' (Icon, List, or Small Icon) the problem goes away.
I've not found others talking about this on the forum and considering. Could this be a missing window style on the parent/control?
|
|
|
|

|
Hi,
I try to test your lib.
I have search for a solutions in posts but didn't found nothing
I have do exactly what you said
- put demo and lib in same folder
- add the lib project in the demo
- build
But visual studio 2008 show 98 errors LNK2001 and LNK2019 like this
Error 89 error LNK2001: unresolved external symbol "protected: virtual int __thiscall CResizableSheetEx::CalcSizeExtra(struct HWND__ *,class CSize,class CSize &)" (?CalcSizeExtra@CResizableSheetEx@@MAEHPAUHWND__@@VCSize@@AAV3@@Z) WizSheet.obj Wizard97
How can I resolv those errors and test the lib ?
thanks
How can
|
|
|
|

|
Hello,
I found the bug, that it is possible to size a dialog smaller (2 pixel) than the original size (resource) started with.
I tested this with the first dialog "IDD_DEMO_DIALOG" of the DemoDlg application.
Andreas.
|
|
|
|

|
Great!
Do you also have a fix for that?
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)
|
|
|
|

|
Hello Paolo,
I debuged the library with VS2005 on XP today an I think this bug occurs, because in function CResizableDialog::OnNcCreate SetMinTrackSize(CSize(lpCreateStruct->cx, lpCreateStruct->cy)) is called before MakeResizable(lpCreateStruct) and in function CResizableLayout::MakeResizable the style of the window is modified, so the dimension of the window changes.
If you call SetMinTrackSize after MakeResizable all is fine.
Andreas.
|
|
|
|

|
Paolo,
First of thanks for the excellent library.
First question, is the SF CVS rep the latest and greatest? I’m just curious as its showing 11 months since the last change.
Problems I’ve found and solved:
I found a problem if you try to anchor an OLE control (ChartFX). Basically you get an exception because the hWnd can’t be extracted by AddAnchor. I changed it to the following:
void AddAnchor(UINT nID, ANCHOR anchorTopLeft, ANCHOR anchorBottomRight)
{
HWND hWnd = ::GetDlgItem(GetResizableWnd()->GetSafeHwnd(),nID);
if (!hWnd)
{
CWnd * pControl = GetResizableWnd()->GetDlgItem(nID);
hWnd = pControl ? pControl->GetSafeHwnd() : 0;
}
AddAnchor(hWnd, anchorTopLeft, anchorBottomRight);
}
This is the approach I noticed MS used to handle OLE controls while debugging into a DDX control binding for the same OLE control.
Problems I have:
If I create a 1 x 2 matrix (i.e. embed a 2 row splitter into a 2 column splitter and have essentially 3 panes) I have problems resizing the frame. The left pane is a CEditView, while the other two views are in-house views. I can email it to you if you like. I modified one of your demos and reproduced the same problem. I ported your library to VC2008 but I’m still running a VC2005 version if that helps.
Anyway the problem is the frame basically gets a mind of its own. When you initially open it up things look okay, but if I click the resize widget the frame shrinks a bit and then I can’t resize it beyond a certain amount. It appears to be resizing to some amount bound by the min column/row sizes set during splitter view creation.
Grazie Tanto - I was born in Naples. My parents now live there again and my wife and I love to travel in Italy. BTW my mother is Greek (hence the forum name).
Pavlo
|
|
|
|

|
Hi Pavlo,
Yes, code on SourceForge is the latest available.
The problem with ActiveX ID was known and there is a work-around somewhere in the forums. Basically you just need to associate a member variable with the control and use that with AddAnchor (the variant that takes an HWND, not a control ID).
You may send me a (as smallest as possible) demo project for VC++ 6.0 or VS2008. It could be the occasion to resume a bit of work on this project.
Glad to hear you like my country, but sad because I dislike its governants!
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've not used code project to send email messages before and I realized that perhaps it's "email" is also tied to your yahoo email which I discovered yesterday is probably no longer valid because of the bounce back I got. Just wanted to ping you to see if you got my message yesterday and that I need your email to send you the test project.
Pavlos
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
A set of classes to ease the development of resizable windows with MFC
| Type | Article |
| Licence | CPOL |
| First Posted | 10 Jun 2001 |
| Views | 720,248 |
| Downloads | 22,465 |
| Bookmarked | 240 times |
|
|