One class with Multiple IDDs (is this possible)
-
I've created an MDI application that has test.cpp and test.h in it. I've created an IDD (which is a form) called IDD_TEST and declared it in test.h under the //Dialog Data as: enum { IDD = IDD_TEST }; How does one link multiple IDDs ( i.e. if I create IDD_TEST1 ) to 1 class (test.h and test.cpp) so that the variables and event handlers for the controls of both IDDs are located in test.h and test.cpp and I can use them together. (i.e. if m_nCheckBoxTest is in IDD_TEST and m_nCheckBoxTest1 is in IDD_TEST1 I can do:
if(m_nCheckBoxTest.GetCheck() == 1 && m_nCheckBoxTest1.GetCheck() == 1){}
The dilema is I can't fit everything into just 1 form for my I&T GUI....(even with scroll bars enabled...) Please help...Kitty5
-
I've created an MDI application that has test.cpp and test.h in it. I've created an IDD (which is a form) called IDD_TEST and declared it in test.h under the //Dialog Data as: enum { IDD = IDD_TEST }; How does one link multiple IDDs ( i.e. if I create IDD_TEST1 ) to 1 class (test.h and test.cpp) so that the variables and event handlers for the controls of both IDDs are located in test.h and test.cpp and I can use them together. (i.e. if m_nCheckBoxTest is in IDD_TEST and m_nCheckBoxTest1 is in IDD_TEST1 I can do:
if(m_nCheckBoxTest.GetCheck() == 1 && m_nCheckBoxTest1.GetCheck() == 1){}
The dilema is I can't fit everything into just 1 form for my I&T GUI....(even with scroll bars enabled...) Please help...Kitty5
could you put all of your handlers in to a single class derived from CDialog (I'm assuming MFC here) and then have the dialogs derive from your handler class?
class HandlerClass : public CDialog { } class Dialog1 : public HandlerClass { } class Dialog2 : public HandlerClass { }
cje
-
I've created an MDI application that has test.cpp and test.h in it. I've created an IDD (which is a form) called IDD_TEST and declared it in test.h under the //Dialog Data as: enum { IDD = IDD_TEST }; How does one link multiple IDDs ( i.e. if I create IDD_TEST1 ) to 1 class (test.h and test.cpp) so that the variables and event handlers for the controls of both IDDs are located in test.h and test.cpp and I can use them together. (i.e. if m_nCheckBoxTest is in IDD_TEST and m_nCheckBoxTest1 is in IDD_TEST1 I can do:
if(m_nCheckBoxTest.GetCheck() == 1 && m_nCheckBoxTest1.GetCheck() == 1){}
The dilema is I can't fit everything into just 1 form for my I&T GUI....(even with scroll bars enabled...) Please help...Kitty5
Are you sure you want to do this? Our product currently has this scenario in several places and it is a nightmare to maintain, especialy where help is involved. Just this week I separated one of the .h/.cpp pairs so that each was using its own dialog template. The dialog templates are almost identical so the original author thought it would be neat if only one class serviced both templates. Yuck!
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb