Constructors

There are three prototypes of the AFXDialog constructor.

The difference between the three prototypes is the occluding behavior of the dialog box, as illustrated in the following examples:

  • The following statement creates a dialog box that always occludes the main window when overlapping with the main window:

    AFXDialog(title, actionButtonIds=0,
        opts=DIALOG_NORMAL, x = 0, y = 0, w = 0, h = 0)   
  • The following statement creates a dialog box that always occludes its owner widget (usually a dialog box) when overlapping with the widget:

    AFXDialog(owner, title, actionButtonIds=0,
        opts=DIALOG_NORMAL, x = 0, y = 0, w = 0, h = 0)
  • The following statement creates a dialog box that can be occluded by any other windows in the application:

    AFXDialog(app, title, actionButtonIds=0,
        opts = DIALOG_NORMAL, x = 0, y = 0, w = 0, h = 0)   

When you construct a dialog box, you will start by deriving from the AFXDialog class. The first thing you should do in the constructor body is call the base class constructor to properly initialize the dialog. Then, you would build the contents of your dialog by adding widgets. For example:

class MyDB(AFXDialog):

    # My constructor
    def __init__(self):

        # Call base class constructor
        AFXDialog.__init__(self, 'My Dialog', self.DISMISS)

    # Add widgets next...