本文整理汇总了C++中idWidgetAction::GetScriptFunction方法的典型用法代码示例。如果您正苦于以下问题:C++ idWidgetAction::GetScriptFunction方法的具体用法?C++ idWidgetAction::GetScriptFunction怎么用?C++ idWidgetAction::GetScriptFunction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idWidgetAction
的用法示例。
在下文中一共展示了idWidgetAction::GetScriptFunction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAction
/*
================================================
idMenuHandler::Update
================================================
*/
bool idMenuHandler::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
widgetAction_t actionType = action.GetType();
const idSWFParmList & parms = action.GetParms();
switch ( actionType ) {
case WIDGET_ACTION_ADJUST_FIELD: {
if ( widget != NULL && widget->GetDataSource() != NULL ) {
widget->GetDataSource()->AdjustField( widget->GetDataSourceFieldIndex(), parms[ 0 ].ToInteger() );
widget->Update();
}
return true;
}
case WIDGET_ACTION_FUNCTION: {
if ( verify( action.GetScriptFunction() != NULL ) ) {
action.GetScriptFunction()->Call( event.thisObject, event.parms );
}
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED: {
idMenuScreen * const screen = menuScreens[ activeScreen ];
if ( screen != NULL ) {
idWidgetEvent pressEvent( WIDGET_EVENT_PRESS, 0, event.thisObject, idSWFParmList() );
screen->ReceiveEvent( pressEvent );
}
return true;
}
case WIDGET_ACTION_START_REPEATER: {
idWidgetAction repeatAction;
widgetAction_t repeatActionType = static_cast< widgetAction_t >( parms[ 0 ].ToInteger() );
assert( parms.Num() >= 2 );
int repeatDelay = DEFAULT_REPEAT_TIME;
if ( parms.Num() >= 3 ) {
repeatDelay = parms[2].ToInteger();
}
repeatAction.Set( repeatActionType, parms[ 1 ], repeatDelay );
StartWidgetActionRepeater( widget, repeatAction, event );
return true;
}
case WIDGET_ACTION_STOP_REPEATER: {
ClearWidgetActionRepeater();
return true;
}
}
if ( !widget->GetHandlerIsParent() ) {
for ( int index = 0; index < children.Num(); ++index ) {
if ( children[index] != NULL ) {
if ( children[index]->HandleAction( action, event, widget, forceHandled ) ) {
return true;
}
}
}
}
return false;
}