Skip to content

Commit

Permalink
Fixed #27: Added missing popup menu items to bitmap and disassembly v…
Browse files Browse the repository at this point in the history
…iews
  • Loading branch information
robmcmullen committed Apr 11, 2016
1 parent 24ad132 commit 3c73cf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion omnivore/tasks/hex_edit/disassembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,5 +347,5 @@ def get_goto_action(self, r, c):

def get_popup_actions(self, r, c):
goto_action = self.get_goto_action(r, c)
return [goto_action, None, CutAction, CopyAction, PasteAction, None, SelectAllAction, SelectNoneAction, GetSegmentFromSelectionAction, MarkSelectionAsCodeAction, MarkSelectionAsDataAction, AddCommentPopupAction]
return [goto_action, None, CutAction, CopyAction, PasteAction, None, SelectAllAction, SelectNoneAction, GetSegmentFromSelectionAction, MarkSelectionAsCodeAction, MarkSelectionAsDataAction, AddCommentPopupAction, RemoveCommentPopupAction]

7 changes: 5 additions & 2 deletions omnivore/utils/wx/bitviewscroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,15 @@ def on_resize(self, evt):
self.calc_image_size()

def on_popup(self, evt):
byte, bit, inside = self.event_coords_to_byte(evt)
actions = self.get_popup_actions()
style = self.segment.style[byte]
popup_data = {'index': byte, 'in_selection': style&0x80}
if actions:
self.editor.popup_context_menu_from_actions(self, actions)
self.editor.popup_context_menu_from_actions(self, actions, popup_data)

def get_popup_actions(self):
return [CutAction, CopyAction, PasteAction, None, SelectAllAction, SelectNoneAction]
return [CutAction, CopyAction, PasteAction, None, SelectAllAction, SelectNoneAction, GetSegmentFromSelectionAction, MarkSelectionAsCodeAction, MarkSelectionAsDataAction, AddCommentPopupAction, RemoveCommentPopupAction]

def on_focus(self, evt):
log.debug("on_focus!")
Expand Down

0 comments on commit 3c73cf3

Please sign in to comment.