The following options are supported in the popup menu:
You can also add a custom button to the popup menu by using the table's appendClientPopupItem method, as shown in Figure 1. ![]() The following example shows how you can enable various popup menu options: vf = FXVerticalFrame(parent, FRAME_SUNKEN|FRAME_THICK,
0,0,0,0, 0,0,0,0)
table = AFXTable(vf, 4, 3, 4, 3, None, 0,
AFXTABLE_NORMAL|AFXTABLE_EDITABLE)
table.setLeadingColumns(1)
table.setLeadingRows(1)
table.setLeadingRowLabels('X\tY')
table.showHorizontalGrid(True)
table.showVerticalGrid(True)
table.setColumnWidth(0, 30)
# Center all columns
table.setColumnJustify(-1, table.CENTER)
table.setPopupOptions(
AFXTable.POPUP_CUT|AFXTable.POPUP_COPY
|AFXTable.POPUP_PASTE
|AFXTable.POPUP_INSERT_ROW
|AFXTable.POPUP_DELETE_ROW
|AFXTable.POPUP_CLEAR_CONTENTS
|AFXTable.POPUP_READ_FROM_FILE
)
table.appendClientPopupItem('My Button', None, self,
self.ID_MY_BUTTON)
FXMAPFUNC(self, SEL_COMMAND, self.ID_MY_BUTTON, MyDB.onCmdMyBtn) | |||||||||||||||||||||||||||||||||||||