def OnCommand(self, hwnd, msg, wparam, lparam):
        """Handle button presses: OK, Cancel and the callback buttons
        which are optional for text fields
        """
        id = win32api.LOWORD(wparam)
        if id == win32con.IDOK:
            self.OnOk(hwnd)
        elif id == win32con.IDCANCEL:
            self.OnCancel(hwnd)
        elif self.IDC_CALLBACK_BASE <= id < (self.IDC_CALLBACK_BASE + len(self.fields)):
            self.OnCallback(hwnd, self.IDC_FIELD_BASE + id - self.IDC_CALLBACK_BASE)
dataset/ETHPy150Open tjguk/winsys/winsys/dialogs.py/Dialog.OnCommand/original