|
I just spent 2 hours trying to move 1 Item in my app when resizing, knowing I have 6 others to do the same to and i still did not get it right.
Then i decided to look here and found your Class. 30 min later i have all 7 items moving just as i wanted.
Just wanted to say GREAT class.
CanopenR
|
|
|
|
|
hi
I have two list controls and some buttons in my dialog. I have added handlers in the OnInitDialog as shown below.
//CList Controls ->m_bFlickerFree is set to 1
AddControl(IDC_LIST1, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 1, 0.0, 0.5,0);
AddControl(IDC_LIST2, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 1, 0.5, 0.5,0);
//CButton Controls ->m_bFlickerFree is set to 1
AddControl(IDC_BTN1, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 1, 0.0, 0.5,0);
AddControl(IDC_BTN2, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 1, 0.5, 0.5,0);
AddControl(IDC_BTN3, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 1, 0.0, 0.5,0);
AddControl(IDC_BTN4, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 1, 0.5, 0.5,0);
//CEdit Controls ->m_bFlickerFree is set to 1
AddControl(IDC_EDIT1, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 1, 0.0, 0.5,0);
AddControl(IDC_EDIT2, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 1, 0.5, 0.5,0);
//Group Box Controls ->m_bFlickerFree is set to 0
AddControl(IDC_STATIC1, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 0, 0.0, 0.5,0);
AddControl(IDC_STATIC2, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 0, 0.5, 0.5,0);
AddControl(IDC_STATIC3, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 0, 0.0, 0.5,0);
AddControl(IDC_STATIC4, CST_DELTA_ZOOM, CST_DELTA_ZOOM, CST_NONE, CST_NONE, 0, 0.5, 0.5,0);
I still get the flickering problem i.e the dialog controls flicker as you resize the dialog. Can any one give me some idea to stop the flickering.
Thanks
|
|
|
|
|
Hi,
I think I have done everything correct when setting up the project.
It compiles and links just fine.
The only problem is that I cannot resize the dialog
When I try to grab the resize icon with my mouse nothing happens...
I am using VC++ 2005
It is easily reproduced, just create a new MFC-Dialog-based app and add this Resize-stuff to get the not-so-very-resizable-dialog...
Ideas?
|
|
|
|
|
The problem is solved!
The thing that had to be done was to set the Dialog's Border Appearance to Resizing instead of the default.
|
|
|
|
|
What do you mean set the Dialog's Border Appearance to Resizing instead of the default? What do you do extra to make it resize? I had try to change AddControl(..) parameters but it still doesn't resize. can you help me?
|
|
|
|
|
I got it. Change at Dialog Properties, Style, Border for that perticular dialog.
|
|
|
|
|
hi..i have done all the above(i.e.: Change the BORDER property to Resize and added all the code for controls) stuff but still not able to Resize the items in the DialogBox.Plz help me i'm stuck from few days on it...Thanks in advance..
|
|
|
|
|
error LNK2001: unresolved external symbol "public: virtual __thiscall CResizeDlg::~CResizeDlg(void)" (??1CResizeDlg@@UAE@XZ)
SlideEffectDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CResizeDlg::~CResizeDlg(void)" (??1CResizeDlg@@UAE@XZ)
SlideEffectDlg.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const CResizeDlg::messageMap" (?messageMap@CResizeDlg@@1UAFX_MSGMAP@@B)
SlideEffectDlg.obj : error LNK2001: unresolved external symbol "protected: virtual int __thiscall CResizeDlg::OnInitDialog(void)" (?OnInitDialog@CResizeDlg@@MAEHXZ)
SlideEffectDlg.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall CResizeDlg::GetRuntimeClass(void)const " (?GetRuntimeClass@CResizeDlg@@UBEPAUCRuntimeClass@@XZ)
SlideEffectDlg.obj : error LNK2001: unresolved external symbol "public: __thiscall CResizeDlg::CResizeDlg(unsigned int,class CWnd *)" (??0CResizeDlg@@QAE@IPAVCWnd@@@Z)
Debug/SlideEffect.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.
|
|
|
|
|
The border is non displayed in refresh tree-view control, any suggestion ?
|
|
|
|
|
The vertical resizing is not working properly when CST_RELATIVE flag is used.
In CItemCtrl::OnSize function, I replaced:
ctrlRect.top = (int)((double)m_yRatio * 1.0 * pnRect->Width() - newCy / 2.0);
with:
ctrlRect.top = (int)((double)m_yRatio * 1.0 * pnRect->Height() - newCy / 2.0);
This helped a bit, but ratios are still calculated wrong.
Anyone solved this problem?
Peter L
|
|
|
|
|
How do you ensure that the dialog Gripper bar appears on resizeable dialogs?
gjr
|
|
|
|
|
I found a little bug in constructor.
CResizeDlg::CResizeDlg(const UINT resID,CWnd *pParent)
: CDialog(resID,pParent)
{
m_xSt = CST_RESIZE;
m_xSt = CST_RESIZE;
m_xMin = 32;
m_yMin = 32;
m_nDelaySide = 0;
}
I guess should be
m_xSt = CST_RESIZE;
m_ySt = CST_RESIZE;
|
|
|
|
|
This bug may cause random block of vertical resize in my project on VS2005.
So I made the same change and then all work OK.
|
|
|
|
|
thanks - saved me some debugging...
|
|
|
|
|
Hi,
Thanks for the wonderful code i was searching for.suited my application very well.Everything works out well except the bitmaps which are not resized while i resize the CBitmapbutton in the dialog.What should i do?.Do i have to load the bitmaps for different sizes depending upon the button size?
|
|
|
|
|
Hi,
After looking at several solutions, I fortunately now discovered your code here.
Thanks a lot, this was just what I needed, and all without being way to complex (for a beginner as I am *g*)!
greetings,
knilch2000
|
|
|
|
|
A minor bug:
CResizeDlg::CResizeDlg(const UINT resID,CWnd *pParent)
: CDialog(resID,pParent)
{
m_xSt = CST_RESIZE;
m_ySt = CST_RESIZE; // changed to m_ySt
m_xMin = 32;
m_yMin = 32;
m_nDelaySide = 0;
}
|
|
|
|
|
Hey does anyone know how to fix this error?
error C2509: 'OnInitDialog' : member function not declared in 'CAboutDlg'
|
|
|
|
|
I wont change dialog size in code. When I do it ex:
void CResizeDlgDlg::OnOK()
{
MoveWindow (0, 0, 500, 500);
}
Controls not moving, they stay in the same place
Should I call other function or extend CResizeDlg class?
|
|
|
|
|
After updating the code with the patches from other messages, there are still two problems. Both are related to using the maximize button on the dialog. In the first case if you maximize immediately after instantiating the dialog, the controls don't move relative to the upper left corner. If you then restore the dialog size by clicking again, adjust using a mouse drag action and then click maximize again all appears correct. However when you restore the dialog size again you loose the controls and drag indicator. The obvious solution is to not allow a maximize button, however it would be nice to have a patch for this, providing a complete solution.
--hsm
|
|
|
|
|
Hi,
Catch the WM_SYSCOMMAND and inside put m_nDelaySide = WMSZ_BOTTOMRIGHT;
Don't have time to be more precise.
void CYourDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
m_nDelaySide = WMSZ_BOTTOMRIGHT;
CDialog::OnSysCommand(nID, lParam);
}
|
|
|
|
|
Hi,
Should have figured that one out for myself! Much thanks!
--hsm
|
|
|
|
|
Hi,
I spoke a little too soon in my reply. After the change I still have essentially the same problems. After an immediate max window message window is of course expanded full screen, however the controls neither move nor resize.
--hsm
p.s. added:
void CGridDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
m_nDelaySide = WMSZ_BOTTOMRIGHT;
CDialog::OnSysCommand(nID,lParam);
}
|
|
|
|
|
I don't have time to check for now.
But if you are a developper why don't you try to solve it by yourself.
In debug mode watch what's going on when you resize a dialog and do the same
when you click on maximize/minimize button.
If you don't find send me a small visual project with your code and I will have a look!
|
|
|
|
|
Argh! You mean actually work ? Oh alright-- sniff, sniff, small whine...
--hsm
|
|
|
|
|