code: def create_dialog(self):
          
          bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
          self.idx_ok = bbox.button(QDialogButtonBox.Ok)
          self.idx_cancel = bbox.button(QDialogButtonBox.Cancel)
  
          filebutton = QPushButton()
          filebutton.setText('Choose')
          self.idx_filename = filebutton
          
          self.xp_format = FormMenu(['CSV', 'Brain Vision'])
          self.all_types = FormBool('All event types')
          
          self.idx_evt_type = QListWidget()
          self.idx_evt_type.setSelectionMode(QAbstractItemView.ExtendedSelection)
          
          filebutton.clicked.connect(self.save_as)
          self.all_types.connect(self.toggle_buttons)
          bbox.clicked.connect(self.button_clicked)
          
          form = QFormLayout()
          form.addRow('Filename', self.idx_filename)
          form.addRow('Format', self.xp_format)
          form.addRow(self.all_types)
          form.addRow('Event type(s)', self.idx_evt_type)
          
          btnlayout = QHBoxLayout()
          btnlayout.addStretch(1)
          btnlayout.addWidget(bbox)
  
          vlayout = QVBoxLayout()
          vlayout.addLayout(form)
          vlayout.addStretch(1)
          vlayout.addLayout(btnlayout)
  
          self.setLayout(vlayout)
docs: Create the dialog.