The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 ResizeDialog- derived classes and dimensions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cdrozdowski111

USA
247 Posts

Posted - 08/17/2013 :  4:41:12 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 9.0.0 SR2 64-bit, Win7 64-bit/32-bit, running in VMware Fusion 5.0.3

I created a basic custom dialog class derived from ResizeDialog. I then created some derived classes For example (pseudocode):

class Base_Dlg : public ResizeDialog
...
class Child1_Dlg : public Base_Dlg
...
class Child2_Dlg : public Base_Dlg
...

When I create objects of the various classes, they all share the same postion and dimensions when resized. The resizing code is in the base class. How can I make it such that each class retains its own postion and dimensions?

Edited by - cdrozdowski111 on 08/17/2013 4:41:44 PM

cdrozdowski111

USA
247 Posts

Posted - 08/18/2013 :  9:02:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I figured it out. I think. It does work. I can implement these two events in my base class overriding the noted string variable in my derived classes.


BOOL OnInitSize()
{
	return FALSE;
}


BOOL OnRestoreSize(ODWP dwSizeInfo)
{
	void * p = (void*)dwSizeInfo;
	DLGSIZEINFO *pSz = (DLGSIZEINFO*)p;
	lstrcpyn(pSz->szDialogName, m_strDlgID, MAXLINE); // m_strDlgID is a string property I can change in derived classes
	
	...
	
	return TRUE;
}
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000