IC Python API:RLPy RIDialog
Contents
- 1 Detailed Description
- 2 Member Functions
- 2.1 GetDialogType
- 2.2 GetTitle
- 2.3 GetWindow
- 2.4 GetWindowTitle
- 2.5 IsModal
- 2.6 RegisterEventCallback
- 2.7 RegisterNativeEventCallback
- 2.8 SetModal
- 2.9 SetParent
- 2.10 SetWindowTitle
- 2.11 UnregisterAllEventCallbacks
- 2.12 UnregisterEventCallback
- 2.13 UnregisterEventCallbacks
- 2.14 UnregisterNativeEventCallback
- 2.15 UnregisterNativeEventCallbacks
- Main article: Modules.
Detailed Description
This class is custom widget dialog. A Dialog is always a top-level widget, but if it has a parent, its
default location is centered on top of the parent's top- level widget.class DialogEventCallback(RLPy.RDialogCallback):
def __init__(self):
RLPy.RDialogCallback.__init__(self)
def OnDialogShow(self):
print("dialog show")
def OnDialogHide(self):
print("dialog hide")
def OnDialogClose(self):
print("dialog close")
return True
rl_dialog = RLPy.RUi.CreateRDialog()
rl_dialog.SetWindowTitle("main_dialog")
print(rl_dialog.GetWindowTitle()) # main_dialog
# register dialog event
dialog_event_callback = DialogEventCallback()
dialog_register_id = rl_dialog.RegisterEventCallBack(dialog_event_callback)
# use id to unregister
rl_dialog.UnregisterEventCallback(dialog_register_id)
rl_dialog.Show()
rl_dialog.IsVisble() # True
rl_dialog.Hide()
rl_dialog.IsVisble() # False
Member Functions
GetDialogType
RLPy.RIDialog.GetDialogType ( self )
Return current dialog type.
Returns
- RLPy.EDialogType_Normal
- RLPy.EDialogType_Exclusive
GetTitle
RLPy.RIDialog.GetTitle ( self )
Get title bar widget's address.
Returns
GetWindow
RLPy.RIDialog.GetWindow ( self )
Get dialog's itself address.
Returns
GetWindowTitle
RLPy.RIDialog.GetWindowTitle ( self )
Get title bar Name.
Returns
IsModal
RLPy.RIDialog.IsModal ( self )
Return if dialog is modal or modeless.
Return Values
True if dialog is modal
False if dialog is modeless
RegisterEventCallback
RLPy.RIDialog.RegisterEventCallback ( self, pfCallback )
Dialog event callback.
Parameters
pfCallback [IN] dialog event callback pointer - RLPy.RDialogCallback
Returns
RegisterNativeEventCallback
RLPy.RIDialog.RegisterNativeEventCallback ( self, pfCallback )
Windows event callback.
Parameters
pfCallback [IN] Window message callback pointer - RLPy.RWinMessageCallback
Returns
SetModal
RLPy.RIDialog.SetModal ( self, bModal )
Set dialog modal or modeless.
Parameters
bModal [IN] True is modal or False is modeless - bool
SetParent
RLPy.RIDialog.SetParent ( self, pWidget )
Set the parent of the dialog.
Parameters
pWidget [IN] Widget pointer - QWidget
SetWindowTitle
RLPy.RIDialog.SetWindowTitle ( self, strTitleName )
Set dialog title name.
Parameters
strTitleName [IN] title name - string
UnregisterAllEventCallbacks
RLPy.RIDialog.UnregisterAllEventCallbacks ( self )
Unregister all dialog event callback.
Return Values
RLPy.RStatus.Success Success
RLPy.RStatus.Failure Fail
UnregisterEventCallback
RLPy.RIDialog.UnregisterEventCallback ( self, uId )
Unregister dialog event callback with Id.
Parameters
uId [IN] callback id - int
Return Values
RLPy.RStatus.Success Success
RLPy.RStatus.Failure Fail
UnregisterEventCallbacks
RLPy.RIDialog.UnregisterEventCallbacks ( self, kIds )
Unregister dialog event callback with Ids.
Parameters
kIds [IN] callback ids - int
Return Values
RLPy.RStatus.Success Success
RLPy.RStatus.Failure Fail
UnregisterNativeEventCallback
RLPy.RIDialog.UnregisterNativeEventCallback ( self, uId )
Unregister windows event callback with Id.
Parameters
uId [IN] callback id - int
Return Values
RLPy.RStatus.Success Success
RLPy.RStatus.Failure Fail
UnregisterNativeEventCallbacks
RLPy.RIDialog.UnregisterNativeEventCallbacks ( self, kIds )
Unregister windows event callback with Ids.
Parameters
kIds [IN] callback ids - int
Return Values
RLPy.RStatus.Success Success
RLPy.RStatus.Failure Fail