To post the Print dialog box from a button in your dialog box, you first access the print form mode by using the getPrintForm method of the FileToolsetGui class. This can be done by storing a pointer to the form as shown in the following example: from sessionGui
import FileToolsetGui
class MyMainWindow(AFXMainWindow):
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def __init__(self, app, windowTitle=''):
...
fileToolset = FileToolsetGui()
self.printForm = fileToolset.getPrintForm()
self.registerToolset(fileToolset,
GUI_IN_MENUBAR|GUI_IN_TOOLBAR)
...
Then you can use the print form in your dialog box class, as shown below: printForm = getAFXApp().getAFXMainWindow().printForm
FXButton(parent, 'Print...', None, printForm,
AFXMode.ID_ACTIVATE)
To access the print form, you must construct and register the file toolset. However, you cannot access the print form from within a plug-in. As a result, you can only use the approach described here in a customized application. | |||||||