IC Python API:RLPy RUi
- Main article: Modules.
Detailed Description
This class provides UI related operations.
# add hot key - space
def do_somthing():
print("do something.")
sapce_hot_key = RLPy.RUi.AddHotKey("Space")
space_action = wrapInstance(int(sapce_hot_key), PySide2.QtWidgets.QAction)
space_action.triggered.connect(do_somthing)
# remove hot key
RLPy.RUi.RemoveHotKey(sapce_hot_key)
# add Test menu
plugin_menu = wrapInstance(int(RLPy.RUi.AddMenu("Test", RLPy.EMenu_Plugins)), PySide2.QtWidgets.QMenu)
plugin_action = plugin_menu.addAction("sub menu action")
plugin_action.triggered.connect(do_somthing)
# remove menu
RLPy.RUi.RemoveMenu(plugin_menu)
# open file dialog
file_path = RLPy.RUi.OpenFileDialog("Json Files(*.json)")
print(file_path)
# open multiple files dialog
file_path_list = RLPy.RUi.OpenFilesDialog("Json Files(*.json)")
print(file_path_list)
# save file dialog
file_path = RLPy.RUi.SaveFileDialog("Json Files(*.json)")
print(file_path)
# show message box
RLPy.RUi.ShowMessageBox("Title", "Msg", RLPy.EMsgButton_Ok)
# show message box with checked option
RLPy.RUi.ShowMessageBox("Title", "Msg", RLPy.EMsgButton_Ok, True, "CheckBoxMsg")
Member Functions
AddHotKey
RLPy.RUi.AddHotKey ( strKeySequence )
Add HotKey.
Parameters
strKeySequence [IN] Hot key sequence - string
Returns
AddMenu
RLPy.RUi.AddMenu ( args )
Add menu.
Parameters
strMenuName [IN] Name of the menu - string
eParent [IN] Parent of the menu - RLPy.EMenu
- RLPy.EMenu_Plugins Plugins menu.
Returns
CreateRDialog
RLPy.RUi.CreateRDialog ( args )
Create dialog.
Parameters
eDialogType [IN] dialog is normal or exclusive - RLPy.EDialogType
- RLPy.EDialogType_Normal
- RLPy.EDialogType_Exclusive
Returns
CreateRDockWidget
RLPy.RUi.CreateRDockWidget ( )
Create dockwidget.
Returns
GetCSSType
RLPy.RUi.GetCSSType ( )
Get CSS type.
Returns
- RLPy.ECSSType_Color_0
- RLPy.ECSSType_Color_1
GetMainWindow
RLPy.RUi.GetMainWindow ( )
Get MainWindow's address.
Returns
GetResolutionType
RLPy.RUi.GetResolutionType ( )
Get resolution type.
Returns
- RLPy.EResolutionType_Large
- RLPy.EResolutionType_Original
- RLPy.EResolutionType_Small
OpenFileDialog
RLPy.RUi.OpenFileDialog ( args )
Show the open file dialog and returns the selected file path name.
Parameters
strFilter [IN] File filter - string
Returns
OpenFilesDialog
RLPy.RUi.OpenFilesDialog ( args )
Show the open file dialog and returns multiple selected file path names.
Parameters
strFilter [IN] File filter - string
Returns
RemoveHotKey
RLPy.RUi.RemoveHotKey ( pAction )
Remove HotKey.
Parameters
pAction [IN] HotKey to remove - QAction
Returns
RemoveMenu
RLPy.RUi.RemoveMenu ( pMenu )
Remove Menu.
Parameters
pMenu [IN] menu to remove - QMenu
Returns
SaveFileDialog
RLPy.RUi.SaveFileDialog ( strFilter )
Show the save file dialog and returns the selected file path name.
Parameters
strFilter [IN] File filter - string
Returns
ShowMessageBox
RLPy.RUi.ShowMessageBox ( args )
Show message.
Parameters
strTitle [IN] Title of message box - string
strMsg [IN] Message in message box - string
eBtn [IN] Button configuration - RLPy.EMsgButton
- RLPy.EMsgButton_NoButton
- RLPy.EMsgButton_Ok
- RLPy.EMsgButton_Save
- RLPy.EMsgButton_SaveAll
- RLPy.EMsgButton_Open
- RLPy.EMsgButton_Yes
- RLPy.EMsgButton_YesToAll
- RLPy.EMsgButton_No
- RLPy.EMsgButton_NoToAll
- RLPy.EMsgButton_Abort
- RLPy.EMsgButton_Retry
- RLPy.EMsgButton_Overlook
- RLPy.EMsgButton_Close
- RLPy.EMsgButton_Cancel
- RLPy.EMsgButton_Discard
- RLPy.EMsgButton_Help
- RLPy.EMsgButton_Apply
- RLPy.EMsgButton_Reset
- RLPy.EMsgButton_RestoreDefaults
- RLPy.EMsgButton_OkDontAskAgain
bChecked [IN] show checked message box if True - bool
strCheckBoxMsg [IN] Checked message - string