Changing dialog properties Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
Kkamudu
Experienced Solver
Experienced Solver
Posts: 61
Joined: Sun Jul 06, 2008 7:59 am

Changing dialog properties

Post by Kkamudu » Fri May 21, 2010 10:21 am

Hi,
I have created a dialog with a caption and two buttons. This works fine. However I would like to change the way this dialog looks based on a variable. As an example I would like to change the caption and also add or remove one or more buttons. How can I do this? I tried googling around but could not find any answer. Thank you for your time.
Kamesh

Tony0945
Experienced Solver
Experienced Solver
Posts: 96
Joined: Wed Oct 21, 2009 4:02 pm

Post by Tony0945 » Mon May 24, 2010 1:20 am

Does the variable change while the Dialog is active?

If you are just looking at the variable when the dialog is created, just put some conditional code in Create_GUI_controls(). If the variable changes as a result of actions in the dialog, just delete or new the appropriate buttons in the Onwhatever() handler. Changing how it looks can be accomplished by overriding OnPaint() and invalidating the rectangle (MSVC term, I forget the wxWidgets term). If the variable is external and you want changes to it to be detected... Maybe a timer that checks the variable and acts accordingly?

Please specify the use of the variable in a little more detail.

Post Reply