uguivisibility.c

来自「Pro.TOOLKIT.Wildfire插件设计.配套光盘-141M.zip」· C语言 代码 · 共 108 行

C
108
字号
/*-----------------------------------------------------------------------------  File:		UgUIVisibility.c  Description:	ProTK doc code sample            PTC             File   Date   Version   Author  Vers  Comment--------- -------  -------- ----- ---------------------------------------------14-Jul-02  J-03-29  JCN     $$1   Submitted.-----------------------------------------------------------------------------*/#include <ProToolkit.h>#include <ProUIDialog.h>#include <ProUIPushbutton.h>#define UGUIVISIBILITY "uguivisibility"/*====================================================================*\FUNCTION: UserCloseActionPURPOSE:  Action function for the Close button in this example\*====================================================================*/static void UserCloseAction (char* dialog, char* button, ProAppData data){	ProUIDialogExit (UGUIVISIBILITY, PRO_TK_NO_ERROR);}/*====================================================================*\FUNCTION: UserVisibilityTogglePURPOSE:  Action function for the "Visible" checkbutton\*====================================================================*/static void UserVisibilityToggle (char* dialog, char* button, ProAppData data){	ProBoolean checked;	ProUICheckbuttonGetState (UGUIVISIBILITY, "VisibleCheck", &checked);	if (checked)		ProUIPushbuttonShow (UGUIVISIBILITY, "TargetBtn");	else		ProUIPushbuttonHide (UGUIVISIBILITY, "TargetBtn");}/*====================================================================*\FUNCTION: UserSensitivityTogglePURPOSE:  Action function for the "Sensitive" checkbutton\*====================================================================*/static void UserSensitivityToggle (char* dialog, char* button, ProAppData data){	ProBoolean checked;	ProUICheckbuttonGetState (UGUIVISIBILITY, "SensitiveCheck", &checked);	if (checked)		ProUIPushbuttonEnable (UGUIVISIBILITY, "TargetBtn");	else		ProUIPushbuttonDisable (UGUIVISIBILITY, "TargetBtn");}/*====================================================================*\FUNCTION: UserRelabelActionPURPOSE:  Action function for the "Label" input panel\*====================================================================*/static void UserRelabelAction (char* dialog, char* button, ProAppData data){	wchar_t* label;	ProUIInputpanelValueGet (UGUIVISIBILITY, "ButtonLabel", &label);	ProUIPushbuttonTextSet (UGUIVISIBILITY, "TargetBtn", label);	ProWstringFree (label);}/*====================================================================*\FUNCTION: UserUIVisibilityExamplePURPOSE:  Shows example of using runtime visibility and sensitivity of 			components\*====================================================================*/int UserUIVisibilityExample () {     ProLine wline;     int status;/*--------------------------------------------------------------------*\     Load the dialog from the resource file \*--------------------------------------------------------------------*/     ProUIDialogCreate(UGUIVISIBILITY, UGUIVISIBILITY);/*--------------------------------------------------------------------*\     Set the OK and Cancel button actions \*--------------------------------------------------------------------*/     ProUIPushbuttonActivateActionSet(UGUIVISIBILITY,"CloseButton",										UserCloseAction, NULL);    ProUICheckbuttonActivateActionSet(UGUIVISIBILITY,"VisibleCheck",UserVisibilityToggle,        NULL);	ProUICheckbuttonActivateActionSet(UGUIVISIBILITY,"SensitiveCheck",UserSensitivityToggle,        NULL);	ProUIInputpanelInputActionSet(UGUIVISIBILITY,"ButtonLabel",UserRelabelAction,        NULL);/*--------------------------------------------------------------------*\     Display and activate the dialog \*--------------------------------------------------------------------*/     ProUIDialogActivate(UGUIVISIBILITY, &status);/*--------------------------------------------------------------------*\     Remove the dialog from memory \*--------------------------------------------------------------------*/     ProUIDialogDestroy(UGUIVISIBILITY);    return(1); }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?