Created
October 27, 2015 08:59
-
-
Save lukpazera/835219d2587b38bf3a58 to your computer and use it in GitHub Desktop.
How to open a Yes/No dialog using dialog service (MODO SDK).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This snippet demonstrates a function that will open a Yes/No dialog in MODO using dialog service. | |
* | |
* To create a dialog we need dialog service. We use dialog service to allocate message object | |
* that will determine the type of dialog that we will open and will contain the text of the message | |
* that we want to display. The text needs to be set in the message table in a config file. | |
* Next we set message object to our message passing message table name and message key | |
* and we use SetCode() method to set the type of a dialog that we want to open. | |
* Finally, we open such prepared message via dialog service | |
* and translate the result into boolean value. | |
*/ | |
bool openYesNoDialog() | |
{ | |
CLxUser_StdDialogService dialogSrv; | |
CLxUser_Message msg; | |
dialogSrv.MessageAllocate( msg ); | |
msg.SetMessage ( "messageTableName", "messageKey", 0 ); | |
msg.SetCode( LXeMSGDIALOG_AS_YESNO ); | |
LxResult result = dialogSrv.MessageOpen(msg, "@messageTableName@messageKey@", NULL, NULL); | |
return ( result == LXeMSGDIALOG_YES ) ? true : false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment