Example #1
0
    def AddCommand(self,
                   caption,
                   flags = _idaapi.CHOOSER_POPUP_MENU,
                   menu_index = -1,
                   icon = -1,
				   emb=None):
        """
        Deprecated: Use
          - register_action()
          - attach_action_to_menu()
          - attach_action_to_popup()
        """
        # Use the 'emb' as a sentinel. It will be passed the correct value from the EmbeddedChooserControl
        if self.embedded and ((emb is None) or (emb != 2002)):
            raise RuntimeError("Please add a command through EmbeddedChooserControl.AddCommand()")
        return _idaapi.choose2_add_command(self, caption, flags, menu_index, icon)
Example #2
0
    def AddCommand(self,
                   caption,
                   flags = _idaapi.CHOOSER_POPUP_MENU,
                   menu_index = -1,
                   icon = -1,
				   emb=None):
        """
        Adds a new chooser command
        Save the returned value and later use it in the OnCommand handler

        @return: Returns a negative value on failure or the command index
        """

        # Use the 'emb' as a sentinel. It will be passed the correct value from the EmbeddedChooserControl
        if self.embedded and ((emb is None) or (emb != 2002)):
            raise RuntimeError("Please add a command through EmbeddedChooserControl.AddCommand()")
        return _idaapi.choose2_add_command(self, caption, flags, menu_index, icon)
Example #3
0
 def AddCommand(self,
                caption,
                flags=_idaapi.CHOOSER_POPUP_MENU,
                menu_index=-1,
                icon=-1,
                emb=None):
     """
     Deprecated: Use
       - register_action()
       - attach_action_to_menu()
       - attach_action_to_popup()
     """
     # Use the 'emb' as a sentinel. It will be passed the correct value from the EmbeddedChooserControl
     if self.embedded and ((emb is None) or (emb != 2002)):
         raise RuntimeError(
             "Please add a command through EmbeddedChooserControl.AddCommand()"
         )
     return _idaapi.choose2_add_command(self, caption, flags, menu_index,
                                        icon)
Example #4
0
    def AddCommand(self,
                   caption,
                   flags=_idaapi.CHOOSER_POPUP_MENU,
                   menu_index=-1,
                   icon=-1,
                   emb=None):
        """
        Adds a new chooser command
        Save the returned value and later use it in the OnCommand handler

        @return: Returns a negative value on failure or the command index
        """

        # Use the 'emb' as a sentinel. It will be passed the correct value from the EmbeddedChooserControl
        if self.embedded and ((emb is None) or (emb != 2002)):
            raise RuntimeError(
                "Please add a command through EmbeddedChooserControl.AddCommand()"
            )
        return _idaapi.choose2_add_command(self, caption, flags, menu_index,
                                           icon)