Click here to Skip to main content
15,915,765 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDialog repaint with no flickering ... Pin
Andre Massada15-Oct-04 8:47
Andre Massada15-Oct-04 8:47 
GeneralRe: Dialog repaint with no flickering ... Pin
Blake Miller15-Oct-04 9:26
Blake Miller15-Oct-04 9:26 
Generalprivate instance of a public struct Pin
elephantstar15-Oct-04 8:34
elephantstar15-Oct-04 8:34 
GeneralRe: private instance of a public struct Pin
Maximilien15-Oct-04 8:51
Maximilien15-Oct-04 8:51 
GeneralRe: private instance of a public struct Pin
elephantstar15-Oct-04 10:04
elephantstar15-Oct-04 10:04 
GeneralRe: private instance of a public struct Pin
Maximilien15-Oct-04 10:22
Maximilien15-Oct-04 10:22 
GeneralRe: private instance of a public struct Pin
elephantstar15-Oct-04 10:57
elephantstar15-Oct-04 10:57 
GeneralRe: private instance of a public struct Pin
Maximilien15-Oct-04 14:53
Maximilien15-Oct-04 14:53 
ok, if I understand correctly ...

- Each item in the check list is a structure ( containing the user input ); and is filled in their own child window ( so, a class, with the data )

You could have one big class ( structure ) containing all user inputs for all sub-forms; this class is created by the parent of the sub-forms, and a reference is passed to each sub-form. Each subform can fill (set) the values in that class; and the parent window can get the values, to update the UI; each sub-forms can keep local copies of the data for undo/reset, but those can be discreet values, no need to make a structure out of them.



for example ( very simplified, 2 forms, with one value per form ):
// the data for all forms ... 
class MyData
{
private:
  int m_iForm1Value;
  int m_iForm2Value;
public:
  void SetForm1Value( int i ) { m_iForm1Value = 1;};
  int  GetForm1Value( ) { return m_iForm1Value; };

  void SetForm2Value( int i ) { m_iForm2Value = 1;};
  int  GetForm2Value( ) { return m_iForm2Value; };

  bool IsForm1Complete(){ return m_iForm1Value != 0; }; // for example 

  bool IsForm2Complete(){ return m_iForm2Value != 0; }; // for example 


};


class ParentFormDialog : public CDialog
{
private:
  MyClass& m_Data; // or create on the heap with new ...
  void SetData( MyClass& data );
}


// user click on item 1 
void ParentFormDialog::OnItem1Clicked() 
{
  // I will make the form modal, it's simpler.
  Form1Dialog dlg;
  dlg.SetData( &m_Data )
  dlg.DoModal();
  // ... 
}


void Form1Dialog::OnOk()
{
  // m_Data is a reference passed to the form dialog.
  // also, the data in m_Data need only be changed when the user ok/accept the new data. 
  int iValue = 1; // Get the value from the UI.
  m_Data.SetForm1Value( iValue );
}


is this workable ? I think I understand what you want to achieve.

If you really want to have a structure for each sub-form data, make them class and implement a copy constructor, so you can copy them at will.



Maximilien Lincourt
Your Head A Splode - Strong Bad
GeneralRe: private instance of a public struct Pin
elephantstar19-Oct-04 6:33
elephantstar19-Oct-04 6:33 
GeneralLinking Unicode and non-Unicode DLLs in same .EXE Pin
EurekaJim15-Oct-04 8:31
EurekaJim15-Oct-04 8:31 
GeneralRe: Linking Unicode and non-Unicode DLLs in same .EXE Pin
Blake Miller15-Oct-04 9:30
Blake Miller15-Oct-04 9:30 
GeneralRe: Linking Unicode and non-Unicode DLLs in same .EXE Pin
EurekaJim15-Oct-04 9:50
EurekaJim15-Oct-04 9:50 
GeneralRe: Linking Unicode and non-Unicode DLLs in same .EXE Pin
Blake Miller15-Oct-04 9:59
Blake Miller15-Oct-04 9:59 
GeneralSafer Timer Thread termination Pin
15-Oct-04 8:26
suss15-Oct-04 8:26 
GeneralRe: Safer Timer Thread termination Pin
Doug Mitchell15-Oct-04 9:05
Doug Mitchell15-Oct-04 9:05 
GeneralRe: Safer Timer Thread termination Pin
Blake Miller15-Oct-04 9:38
Blake Miller15-Oct-04 9:38 
Generalconversion operator not being called for both objects Pin
lino_i15-Oct-04 6:53
lino_i15-Oct-04 6:53 
GeneralRe: conversion operator not being called for both objects Pin
David Crow15-Oct-04 8:09
David Crow15-Oct-04 8:09 
GeneralRe: conversion operator not being called for both objects Pin
lino_i15-Oct-04 8:37
lino_i15-Oct-04 8:37 
GeneralRe: conversion operator not being called for both objects Pin
David Crow15-Oct-04 9:03
David Crow15-Oct-04 9:03 
GeneralRe: conversion operator not being called for both objects Pin
lino_i15-Oct-04 9:25
lino_i15-Oct-04 9:25 
GeneralRe: conversion operator not being called for both objects Pin
David Crow15-Oct-04 9:46
David Crow15-Oct-04 9:46 
GeneralRe: conversion operator not being called for both objects Pin
lino_i15-Oct-04 9:50
lino_i15-Oct-04 9:50 
GeneralRe: conversion operator not being called for both objects Pin
David Crow15-Oct-04 9:59
David Crow15-Oct-04 9:59 
GeneralSkinned dialogs Pin
mtzlplyk15-Oct-04 6:14
mtzlplyk15-Oct-04 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.