none
Delegates RRS feed

  • Question

  • In my C++/CLI Visual Studio 2008 project, I constantly encounter the need to use delegates in order to communicate between Forms and other files. Is this a normal state of events - or is this a sign there is something wrong with my implementation strategy?

    In my GUI I use Tab pages in order to bring together all the project's modes, which consists of forms and general ref classes. I.e. I have a main form and have several classes each of which represents an implementation mode. The main form then calls these classes, and I use delegates for these classes to communicate back to the main form to display various results in the main form's GUI.

    The other way would be to display a different form for each mode within a panel - but that seems more complex than the above method.

    Again, is using Tab pages for this situation common practice?

    Tuesday, June 1, 2010 2:44 AM

Answers

  • Hi,

      Below is my understanding:

      - You have multiple classes which represent different implementation modes.

      - The main form is the GUI.

      - The mode classes raise events to notify the main form to updatethe UI accordingly.

      If I understand it right, I think this design is OK.

      I am not sure about your other way. Are you trying to hook each of the mode classes to a panel, and use tabview to switch between the panels? I think this is OK, too. Though the GUI may be more complicated.

      Could you provide some more details about you scenario for others to respond you better.


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Edited by SamAgain Tuesday, June 1, 2010 7:29 AM refine
    • Marked as answer by SamAgain Wednesday, June 9, 2010 7:24 AM
    Tuesday, June 1, 2010 7:28 AM

All replies

  • Hi,

      Below is my understanding:

      - You have multiple classes which represent different implementation modes.

      - The main form is the GUI.

      - The mode classes raise events to notify the main form to updatethe UI accordingly.

      If I understand it right, I think this design is OK.

      I am not sure about your other way. Are you trying to hook each of the mode classes to a panel, and use tabview to switch between the panels? I think this is OK, too. Though the GUI may be more complicated.

      Could you provide some more details about you scenario for others to respond you better.


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Edited by SamAgain Tuesday, June 1, 2010 7:29 AM refine
    • Marked as answer by SamAgain Wednesday, June 9, 2010 7:24 AM
    Tuesday, June 1, 2010 7:28 AM
  • We temporarily mark a reply, please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Please mark the right answer at right time.
    Thanks,
    Sam
    Wednesday, June 9, 2010 7:24 AM