The cerebro.actions module provides access to various menus in the application to manipulate menu items.
classcerebro.actions.Action(function, name, icon='', shortcut='', shortcut_context=0)
Class providing interface to access action elements.
function()
Returns: | element executable function. |
Return type: | string |
is_checkable()
Returns: | option to mark the element on/off. |
Return type: | bool |
See also
is_checked()
Returns: | element on/off. |
Return type: | bool |
See also
is_enabled()
Returns: | element activity. |
Return type: | bool |
See also
is_visible()
Returns: | element visibility. |
Return type: | bool |
See also
name()
Returns: | name of the item. |
Return type: | string |
See also
set_checkable(isCheckable)
Parameters: | isCheckable (bool) – возможность отметить элемент включенным/выключенным. |
See also
set_checked(isChecked)
Parameters: | isChecked (bool) – element on/off. |
См.также
set_enabled(isEnabled)
Parameters: | isEnabled (bool) – item activity. |
See also
set_name(name)
Parameters: | name (string) – element name. |
See also
set_visible(isVisible)
Parameters: | isVisible (bool) – element visibility. |
See also
classcerebro.actions.Actions(type)
The class providing an interface for accessing menu items.
action(function)
Parameters: | function (string) – action function. |
Returns: | added action. |
Return type: | cerebro.actions.Action |
add_menu(name, icon='')
Parameters: | |
Returns: | added menu. |
Return type: | cerebro.actions.Actions |
Adds a menu
See also
add_separator()
Adds a separator to the menu.
See also
has_action(function)
Parameters: | function (string) – function of action. |
Returns: | if the action exists. |
Return type: | bool |
has_menu(name)
Parameters: | name (string) – menu name. |
Returns: | if the menu exists. |
Return type: | bool |
insert_menu(pos, name, icon='')
Parameters: | |
Returns: | inserted menu. |
Return type: | cerebro.actions.Actions |
Inserts the menu in a specific position.
See also
insert_separator(pos)
Parameters: | pos (int) – separator position. |
See also
menu(name)
Parameters: | name (string) – menu name. |
Returns: | menu. |
Return type: | cerebro.actions.Actions |
multimetod_add_action()
add_action(function, name, icon = „“, shortcut = „“, shortcut_context = 0)
Parameters: | |
Returns: | added action. |
Return type: | cerebro.actions.Action |
add_action(action)
Parameters: | action (cerebro.actions.Action) – an action. |
Returns: | added action. |
Return type: | cerebro.actions.Action |
my_action = cerebro.actions.TaskToolBar().add_action('function', 'name')
See also
multimetod_insert_action()
insert_action(pos, function, name, icon = „“, shortcut = „“, shortcut_context = 0)
Parameters: | |
Returns: | inserted action. |
Return type: | cerebro.actions.Action |
insert_action(action)
Parameters: | |
Returns: | added action. |
Return type: | cerebro.actions.Action |
Inserts an action at a specific position.
my_action = cerebro.actions.TaskToolBar().insert_action(0, 'function', 'name')
See also
remove_action(function)
Parameters: | function (string) – an executable function of the item. |
See also
remove_menu(name)
Parameters: | name (string) – menu name. |
See also
size()
Returns: | menu size (number of items). |
Return type: | int |
classcerebro.actions.AttachmentEditorMenu
A class providing an interface for accessing the context menu of attachments in the message add/edit window.
Actions: „app.action.attachment.download_thumbnails“ „app.action.attachment.download“ „app.action.attachment.download_all“ „app.action.attachment.copy_path“ „app.action.attachment.copy_http_url“ „app.action.attachment.add_all_to_mirada“ „app.action.attachment.open“ „app.action.attachment.open_link“ „app.action.attachment.save_as“ „app.action.attachment.delete“ „app.action.attachment.delete_all“
# Adding a button to the context menu of attachments in the message add/edit window
attachmentEditorMenu = cerebro.actions.AttachmentEditorMenu() # got the context menu
attachmentEditorMenu.add_action('action.msgbox', 'Сообщение') # added the Message button
classcerebro.actions.AttachmentForumMenu
A class providing an interface for accessing the context menu of attachments in the forum. Actions and menus added to this class will also be displayed in the message forum.
Actions: „app.action.attachment.download_thumbnails“ „app.action.attachment.download“ „app.action.attachment.download_all“ „app.action.attachment.upload“ „app.action.attachment.upload_all“ „app.action.attachment.copy_path“ „app.action.attachment.copy_http_url“ „app.action.attachment.create_thumbnails“ „app.action.attachment.create_all_thumbnails“ „app.action.attachment.add_all_to_mirada“ „app.action.attachment.open“ „app.action.attachment.open_link“ „app.action.attachment.save_as“ „app.action.attachment.delete“ „app.action.attachment.delete_all“
# Adding a button to the attachment forum context menu:
attachmentForumMenu = cerebro.actions.AttachmentForumMenu() # got the context menu
attachmentForumMenu.add_action('action.msgbox', 'Сообщение') # added the Message button
classcerebro.actions.AttachmentForumToolBar
A class providing an interface for accessing the attachment forum toolbar.
# Adding a button to the attachment forum toolbar:
attachmentForumToolBar = cerebro.actions.AttachmentForumToolBar() # got the attachment forum toolbar
attachmentForumToolBar.add_action('action.msgbox', 'Сообщение') # added the Message button
classcerebro.actions.AttachmentSearchMenu
A class providing an interface for accessing the context menu of an attachment in the Search tab.
Actions: „app.action.attachment.download_thumbnails“ „app.action.attachment.download“ „app.action.attachment.download_all“ „app.action.attachment.upload“ „app.action.attachment.upload_all“ „app.action.attachment.copy_path“ „app.action.attachment.copy_http_url“ „app.action.attachment.create_thumbnails“ „app.action.attachment.create_all_thumbnails“ „app.action.attachment.add_all_to_mirada“ „app.action.attachment.open“ „app.action.attachment.open_link“ „app.action.attachment.save_as“ „app.action.attachment.delete“ „app.action.attachment.delete_all“
# Adding a button to the attachment's context menu in the Search tab:
attachmentSearchMenu = cerebro.actions.AttachmentSearchMenu() # got the context menu
attachmentSearchMenu.add_action('action.msgbox', 'Сообщение') # added the Message button
classcerebro.actions.AttachmentSearchToolBar
A class providing an interface for accessing the attachment toolbar in the Search tab.
Actions: „app.action.attachment.download_thumbnails“ „app.action.attachment.download“ „app.action.attachment.download_all“ „app.action.attachment.upload“ „app.action.attachment.upload_all“ „app.action.attachment.copy_path“ „app.action.attachment.copy_http_url“ „app.action.attachment.create_thumbnails“ „app.action.attachment.create_all_thumbnails“ „app.action.attachment.add_all_to_mirada“ „app.action.attachment.open“ „app.action.attachment.open_link“ „app.action.attachment.save_as“ „app.action.attachment.delete“ „app.action.attachment.delete_all“
# Adding a button to the attachment toolbar on the Search tab:
attachmentSearchToolBar = cerebro.actions.AttachmentSearchToolBar() # got the toolbar
attachmentSearchToolBar.add_action('action.msgbox', 'Сообщение') # added the Message button
classcerebro.actions.MainMenu
A class providing an interface for accessing the main menu items
Menu IDs: „cerebro“ - Cerebro „view“ - View „tools“ - Tools „conference“- Web conference „help“ - Help
# Adding a button to the custom main menu and the Help menu:
mainMenu = cerebro.actions.MainMenu() # got the main menu of the app
myMenu = mainmenu.add_menu('MyMenu') # created a user menu
act = cerebro.actions.Action('action.msgbox', 'Сообщение') # created an action (button)
myMenu.add_action(act) # added a button to user menu
mHelp = mainMenu.menu('help') # got the Help menu
mHelp.insert_action(0, act) # added Help menu button to first position
classcerebro.actions.MessageForumMenu
A class providing an interface for accessing the context menu of a message.
Actions: ‘app.action.message.go_parent’ ‘app.action.message.copy_url’ ‘app.action.message.copy_http_url’ ‘app.action.message.new’ ‘app.action.message.client_visible’ ‘app.action.message.approve’ ‘app.action.message.cut’ ‘app.action.message.copy’ ‘app.action.message.copy_tree’ ‘app.action.message.paste’ ‘app.action.message.edit’ ‘app.action.message.delete’
# Adding a button to the message context menu:
messageForumMenu = cerebro.actions.MessageForumMenu() # получили контекстное меню сообщения
messageForumMenu.add_action('action.msgbox', 'Сообщение') # добавили кнопку Сообщение
classcerebro.actions.MessageForumToolBar
A class providing an interface for accessing the forum message toolbar.
Actions: „app.action.message.new“
# Adding a button to the message forum toolbar:
messageForumToolBar = cerebro.actions.MessageForumToolBar() # получили тулбар форума сообщений
messageForumToolBar.add_action('action.msgbox', 'Сообщение') # добавили кнопку Сообщение
classcerebro.actions.TaskActiveMenu
Class providing an interface to access the task context menu in the active tasks window.
Actions: „app.action.task.edit“ „app.action.task.cut“ „app.action.task.cut_referense“ „app.action.task.copy“ „app.action.task.copy_reference“ „app.action.task.done“ „app.action.task.unread“ „app.action.task.subscribe“ „app.action.task.favorite“ „app.action.task.multi_rename“ „app.action.task.select_link“ „app.action.task.make_link“ „app.action.task.link_chain“
# Adding a button to the task context menu on the Search tab:
taskActiveMenu = cerebro.actions.TaskActiveMenu() # got the task context menu
taskActiveMenu.add_action('action.msgbox', 'Сообщение') # added Message button
classcerebro.actions.TaskNavigatorMenu
A class providing an interface to access elements of the task context menu on the navigation tab.
Actions: „app.action.task.new“ „app.action.task.edit“ „app.action.task.delete“ „app.action.task.cut“ „app.action.task.cut_referense“ „app.action.task.copy“ „app.action.task.copy_reference“ „app.action.task.paste“ „app.action.task.special_paste“ „app.action.task.unique“ „app.action.task.done“ „app.action.task.unread“ „app.action.task.subscribe“ „app.action.task.favorite“ „app.action.task.replicate“ „app.action.task.multi_rename“ „app.action.task.select_link“ „app.action.task.make_link“ „app.action.task.link_chain“
# Adding a button to the task context menu on the navigation tab:
taskNavMenu = cerebro.actions.TaskNavigatorMenu() # got task context menu
taskNavMenu.add_action('action.msgbox', 'Сообщение') # added the Message button
classcerebro.actions.TaskSearchMenu
Class providing an interface to access the task context menu on the Search tab.
Actions: „app.action.task.edit“ „app.action.task.cut“ „app.action.task.cut_referense“ „app.action.task.copy“ „app.action.task.copy_reference“ „app.action.task.done“ „app.action.task.unread“ „app.action.task.subscribe“ „app.action.task.favorite“ „app.action.task.multi_rename“ „app.action.task.select_link“ „app.action.task.make_link“ „app.action.task.link_chain“
# Adding a button to the task context menu on the Search tab:
taskSearchMenu = cerebro.actions.TaskSearchMenu() # got task context menu
taskSearchMenu.add_action('action.msgbox', 'Сообщение') # added the Message button
classcerebro.actions.TaskToDoListMenu
A class providing an interface to access the task context menu on the To Do List tab.
Actions: „app.action.task.edit“ „app.action.task.cut“ „app.action.task.cut_referense“ „app.action.task.copy“ „app.action.task.copy_reference“ „app.action.task.done“ „app.action.task.unread“ „app.action.task.subscribe“ „app.action.task.favorite“ „app.action.task.multi_rename“ „app.action.task.select_link“ „app.action.task.make_link“ „app.action.task.link_chain“
# Adding a button to the task context menu on the To Do List tab:
taskToDoListMenu = cerebro.actions.TaskToDoListMenu() # got task context menu
taskToDoListMenu.add_action('action.msgbox', 'Сообщение') # added the Message button
classcerebro.actions.TaskToolBar
Class providing interface to access the task tulbar.
Actions: „app.action.task.new“ „app.action.task.edit“ „app.action.task.delete“ „app.action.task.cut“ „app.action.task.cut_referense“ „app.action.task.copy“ „app.action.task.copy_reference“ „app.action.task.paste“ „app.action.task.special_paste“ „app.action.task.unique“ „app.action.task.done“ „app.action.task.unread“ „app.action.task.subscribe“ „app.action.task.favorite“ „app.action.task.replicate“ „app.action.task.multi_rename“ „app.action.task.select_link“ „app.action.task.make_link“ „app.action.task.link_chain“
# Adding a button to the task toolbar:
icon = cerebro.core.python_api_dir() + '/examples/icon.png' # Path to the icon
taskToolBar = cerebro.actions.TaskToolBar() # got the task toolbar
taskToolBar.add_action('action.msgbox', 'Сообщение', icon) # added the Message button