IC Python API:RLPy RIDialog

From Reallusion Wiki!
Revision as of 02:49, 28 March 2019 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Detailed Description== This class is custom widget dialog. A Dialog is always a top-level widget, but if it has a...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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

Dialog type - RLPy.EDialogType
  • RLPy.EDialogType_Normal
  • RLPy.EDialogType_Exclusive

GetTitle

RLPy.RIDialog.GetTitle ( self )

Get title bar widget's address.

Returns

Address of the title bar widget - QWidget

GetWindow

RLPy.RIDialog.GetWindow ( self )

Get dialog's itself address.

Returns

A pointer to the dialog - QWidget

GetWindowTitle

RLPy.RIDialog.GetWindowTitle ( self )

Get title bar Name.

Returns

Title bar name - string

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

Dialog Event callBack id - int

RegisterNativeEventCallback

RLPy.RIDialog.RegisterNativeEventCallback ( self, pfCallback )

Windows event callback.

Parameters

pfCallback [IN] Window message callback pointer - RLPy.RWinMessageCallback

Returns

Windows Event callBack id - int

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