当前位置: 首页>>代码示例>>C++>>正文


C++ ProcessEvent函数代码示例

本文整理汇总了C++中ProcessEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ ProcessEvent函数的具体用法?C++ ProcessEvent怎么用?C++ ProcessEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ProcessEvent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: event

bool wxTabCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
{
    wxTabEvent event(wxEVT_NULL, m_windowId);
    wxEventType eventType wxDUMMY_INITIALIZE(wxEVT_NULL);
    NMHDR* hdr1 = (NMHDR*) lParam;
    switch ( hdr1->code )
    {
        case TCN_SELCHANGE:
            eventType = wxEVT_COMMAND_TAB_SEL_CHANGED;
            break;

        case TCN_SELCHANGING:
            eventType = wxEVT_COMMAND_TAB_SEL_CHANGING;
            break;

#ifndef __WXWINCE__
        case TTN_NEEDTEXT:
        {
            // TODO
//            if (!tool->m_shortHelpString.empty())
//                ttText->lpszText = (char *) (const char *)tool->m_shortHelpString;
        }
#endif
        default :
            return wxControl::MSWOnNotify(idCtrl, lParam, result);
    }

    event.SetEventObject( this );
    event.SetEventType(eventType);
    event.SetInt(idCtrl) ;
    event.SetSelection(idCtrl);

    return ProcessEvent(event);
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:34,代码来源:tabctrl.cpp

示例2: key_to_event

bool
InputEvents::ProcessKey(Mode mode, unsigned key_code)
{
  if (IsAltair() && key_code == 0xF5) {
    UIActions::SignalShutdown(false);
    return true;
  }

  if (!global_running)
    return false;

#ifdef KOBO
#ifdef ENABLE_SDL
  if (key_code == SDLK_POWER)
    /* the Kobo power button opens the main menu */
    key_code = KEY_MENU;
#else
  // TODO: check the console key code
#endif
#endif

  // Which key - can be defined locally or at default (fall back to default)
  unsigned event_id = key_to_event(mode, overlay_mode, key_code);
  if (event_id == 0)
    return false;

  ProcessEvent(event_id);
  return true;
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:29,代码来源:InputEvents.cpp

示例3: ProcessEvent

//
// Event_OnProjectileLaunch()
//
void hhHarvesterSimple::Event_OnProjectileLaunch(hhProjectile *proj) {
	
	// Can't launch again yet
	float min = spawnArgs.GetFloat( "dda_delay_min" );
	float max = spawnArgs.GetFloat( "dda_delay_max" );
	float delay = min + (max - min) * (1.0f - gameLocal.GetDDAValue());

	if(gameLocal.GetTime() - lastAntiProjectileAttack < delay)
		return;	
	
	// The person who launched this projectile wasn't someone to worry about
	if(proj->GetOwner() && !(ReactionTo(proj->GetOwner()) & (ATTACK_ON_SIGHT | ATTACK_ON_DAMAGE)))
		return;
	
	// TODO: more intelligent checks for if we should launch the anti-projectile chaff
	idVec3 fw		= viewAxis[0];
	idVec3 projFw	= proj->GetAxis()[0]; 
	if(proj->GetOwner())
		projFw = proj->GetOwner()->GetAxis()[0];
	float dot = fw * projFw;
	if(dot > -.7f)
		return;

	ProcessEvent(&MA_AntiProjectileAttack, proj);
}
开发者ID:mrwonko,项目名称:preymotionmod,代码行数:28,代码来源:ai_harvester_simple.cpp

示例4: event

void
SbModel::fireSbModelChanged(void)
{
	wxCommandEvent event(anEVT_ROW_SIZECHANGE);
	event.SetInt(entries_.size());
	ProcessEvent(event);
}
开发者ID:genua,项目名称:anoubis,代码行数:7,代码来源:SbModel.cpp

示例5: ProcessEvent

/*
================
idMoveable::Event_SetOwnerFromSpawnArgs
================
*/
void idMoveable::Event_SetOwnerFromSpawnArgs( void ) {
	idStr owner;

	if ( spawnArgs.GetString( "owner", "", owner ) ) {
		ProcessEvent( &EV_SetOwner, gameLocal.FindEntity( owner ) );
	}
}
开发者ID:alepulver,项目名称:dhewm3,代码行数:12,代码来源:Moveable.cpp

示例6: WXUNUSED

void wxRibbonToolBar::OnMouseUp(wxMouseEvent& WXUNUSED(evt))
{
    if(m_active_tool)
    {
        if(m_active_tool->state & wxRIBBON_TOOLBAR_TOOL_ACTIVE_MASK)
        {
            wxEventType evt_type = wxEVT_COMMAND_RIBBONTOOL_CLICKED;
            if(m_active_tool->state & wxRIBBON_TOOLBAR_TOOL_DROPDOWN_ACTIVE)
                evt_type = wxEVT_COMMAND_RIBBONTOOL_DROPDOWN_CLICKED;
            wxRibbonToolBarEvent notification(evt_type, m_active_tool->id);
            if(m_active_tool->kind == wxRIBBON_BUTTON_TOGGLE)
            {
                m_active_tool->state ^=
                    wxRIBBON_BUTTONBAR_BUTTON_TOGGLED;
                notification.SetInt(m_active_tool->state &
                    wxRIBBON_BUTTONBAR_BUTTON_TOGGLED);
            }
            notification.SetEventObject(this);
            notification.SetBar(this);
            ProcessEvent(notification);
        }

        // Notice that m_active_tool could have been reset by the event handler
        // above so we need to test it again.
        if (m_active_tool)
        {
            m_active_tool->state &= ~wxRIBBON_TOOLBAR_TOOL_ACTIVE_MASK;
            m_active_tool = NULL;
            Refresh(false);
        }
    }
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:32,代码来源:toolbar.cpp

示例7: FileTypeOf

// ----------------------------------------------------------------------------
bool ThreadSearchFrame::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& files)
// ----------------------------------------------------------------------------
{
    bool success = true; // Safe case initialisation

    // first check to see if a workspace is passed. If so, only this will be loaded
    wxString foundWorkspace;
    for (unsigned int i = 0; i < files.GetCount(); ++i)
    {
        FileType ft = FileTypeOf(files[i]);
        if (ft == ftCodeBlocksWorkspace || ft == ftMSVC6Workspace || ft == ftMSVC7Workspace)
        {
            foundWorkspace = files[i];
            break;
        }
    }

    if (!foundWorkspace.IsEmpty())
      success &= OpenGeneric(foundWorkspace);
    else
    {
        wxBusyCursor useless;
        wxPaintEvent e;
        ProcessEvent(e);

        Freeze();
        for (unsigned int i = 0; i < files.GetCount(); ++i)
          success &= OpenGeneric(files[i]);
        Thaw();
    }
    return success;
}
开发者ID:469306621,项目名称:Languages,代码行数:33,代码来源:ThreadSearchFrame.cpp

示例8: while

/*
===============
idEventLoop::RunEventLoop
===============
*/
int idEventLoop::RunEventLoop( bool commandExecution )
{
	sysEvent_t	ev;
	
	while( 1 )
	{
	
		if( commandExecution )
		{
			// execute any bound commands before processing another event
			cmdSystem->ExecuteCommandBuffer();
		}
		
		ev = GetEvent();
		
		// if no more events are available
		if( ev.evType == SE_NONE )
		{
			return 0;
		}
		ProcessEvent( ev );
	}
	
	return 0;	// never reached
}
开发者ID:BielBdeLuna,项目名称:StormEngine2,代码行数:30,代码来源:EventLoop.cpp

示例9: mail

void KIWAY::ExpressMail( FRAME_T aDestination,
                MAIL_T aCommand, const std::string& aPayload, wxWindow* aSource )
{
    KIWAY_EXPRESS   mail( aDestination, aCommand, aPayload, aSource );

    ProcessEvent( mail );
}
开发者ID:blairbonnett-mirrors,项目名称:kicad,代码行数:7,代码来源:kiway.cpp

示例10: GetPhysics

/*
================
rvEffect::Event_EarthQuake
================
*/
void rvEffect::Event_EarthQuake ( float requiresLOS ) {
    float quakeChance;

    if ( !spawnArgs.GetFloat("quakeChance", "0", quakeChance) ) {
        return;
    }

    if ( rvRandom::flrand(0, 1.0f) > quakeChance ) {
        // failed its activation roll
        return;
    }

    if ( requiresLOS ) {
        // if the player doesn't have line of sight to this fx, don't do anything
        trace_t		trace;
        idPlayer	*player = gameLocal.GetLocalPlayer();
        idVec3		viewOrigin;
        idMat3		viewAxis;

        player->GetViewPos(viewOrigin, viewAxis);
// RAVEN BEGIN
// ddynerman: multiple collision worlds
        gameLocal.TracePoint( this, trace, viewOrigin, GetPhysics()->GetOrigin(), MASK_OPAQUE, player );
// RAVEN END
        if (trace.fraction < 1.0f)
        {
            // something blocked LOS
            return;
        }
    }

    // activate this effect now
    ProcessEvent ( &EV_Activate, gameLocal.entities[ENTITYNUM_WORLD] );
}
开发者ID:Big-Zam,项目名称:IT266-gameMod,代码行数:39,代码来源:Effect.cpp

示例11: switch

    void ReplicatedStore::StateMachine::PostChangeRoleEvent(
        ::FABRIC_REPLICA_ROLE newRole, 
        StateMachineCallback const & callback,
        ComponentRootSPtr const & root)
    {
        ReplicatedStoreEvent::Enum event;
        switch (newRole)
        {
            case ::FABRIC_REPLICA_ROLE_PRIMARY:
                event = ReplicatedStoreEvent::ChangePrimary;
                break;

            case ::FABRIC_REPLICA_ROLE_IDLE_SECONDARY:
            case ::FABRIC_REPLICA_ROLE_ACTIVE_SECONDARY:
                event = ReplicatedStoreEvent::ChangeSecondary;
                break;

            default:
                Assert::CodingError(
                    "{0} unrecognized ::FABRIC_REPLICA_ROLE = {1}", 
                    this->TraceId, 
                    static_cast<int>(newRole));
        }

        Threadpool::Post([this, root, event, callback]{ ProcessEvent(event, callback); });
    }
开发者ID:vturecek,项目名称:Service-Fabric,代码行数:26,代码来源:ReplicatedStore.StateMachine.cpp

示例12: switch

        void KeyboardShortcutEditor::OnKeyUp(wxKeyEvent& event) {
            if (m_key == WXK_NONE) {
                const int key = event.GetKeyCode();
                switch (key) {
                    case WXK_SHIFT:
                    case WXK_ALT:
                    case WXK_CONTROL:
                        if (m_modifierKey1 == key)
                            m_modifierKey1 = WXK_NONE;
                        else if (m_modifierKey2 == key)
                            m_modifierKey2 = WXK_NONE;
                        else if (m_modifierKey3 == key)
                            m_modifierKey3 = WXK_NONE;
                        break;
#if defined __APPLE__
                    case WXK_RAW_CONTROL:
                        // not supported
                        break;
#endif
                    default:
                        break;
                }
                update();
            } else {
                KeyboardShortcutEvent shortcutEvent(m_modifierKey1, m_modifierKey2, m_modifierKey3, m_key);
                shortcutEvent.SetEventType(EVT_KEYBOARD_SHORTCUT_EVENT);
                shortcutEvent.SetEventObject(this);
                shortcutEvent.SetId(GetId());
                ProcessEvent(shortcutEvent);
            }
        }
开发者ID:ProPuke,项目名称:TrenchBroom,代码行数:31,代码来源:KeyboardShortcutEditor.cpp

示例13: event

void LLDBConnector::DeleteAllBreakpoints()
{
    if ( !IsRunning() ) {
        m_pendingDeletionBreakpoints.clear();
        m_breakpoints.clear();
        
        LLDBEvent event(wxEVT_LLDB_BREAKPOINTS_UPDATED);
        event.SetBreakpoints( GetAllBreakpoints() );
        ProcessEvent( event );
        return;
     }

    // mark all breakpoints for deletion
    CL_DEBUGS(wxString () << "codelite: DeleteAllBreakpoints called");
    m_pendingDeletionBreakpoints.swap( m_breakpoints );
    
    if ( !IsCanInteract() ) {
        Interrupt( kInterruptReasonDeleteAllBreakpoints );
        
    } else {
        LLDBCommand command;
        command.SetCommandType(kCommandDeleteAllBreakpoints);
        SendCommand( command );
        m_pendingDeletionBreakpoints.clear();

    }
}
开发者ID:blitz-research,项目名称:codelite,代码行数:27,代码来源:LLDBConnector.cpp

示例14: xwl_pollevent

i32 xwl_pollevent( xwl_event_t *event )
{
#ifdef _WIN32
	MSG msg;

	while ( PeekMessage( &msg, 0, 0, 0, PM_REMOVE ) )
	{
		TranslateMessage( &msg );
		DispatchMessage( &msg );
	}
#endif

#if LINUX
    XEvent ev;
    i32 i;
    xwl_window_handle_t *wh = 0;
    XEvent lastKeyReleaseEvent;

    for( i = 0; i < XWL_MAX_WINDOW_HANDLES; ++i )
    {
        wh = &xwl_windowHandles[i];
        if ( wh->handle.handle != 0 )
        {
            while (XCheckIfEvent( currentDisplay, &ev, &CheckEvent, wh->handle.handle) )
            {
                if ((ev.type == KeyPress) || (ev.type == KeyRelease) )
                {
                    if ( ev.xkey.keycode < 256 )
                    {
                        // To detect if it is a repeated key event, we check the current state of the key.
                        // - If the state is "down", KeyReleased events must obviously be discarded.
                        // - KeyPress events are a little bit harder to handle: they depend on the EnableKeyRepeat state,
                        //   and we need to properly forward the first one.
                        char keys[32];
                        XQueryKeymap(currentDisplay, keys);
                        if (keys[ev.xkey.keycode >> 3] & (1 << (ev.xkey.keycode % 8)))
                        {
                            // KeyRelease event + key down = repeated event --> discard
                            if (ev.type == KeyRelease)
                            {
                                lastKeyReleaseEvent = ev;
                                continue;
                            }

                            // KeyPress event + key repeat disabled + matching KeyRelease event = repeated event --> discard
                            if ((ev.type == KeyPress) &&
                                (lastKeyReleaseEvent.xkey.keycode == ev.xkey.keycode) &&
                                (lastKeyReleaseEvent.xkey.time == ev.xkey.time))
                            {
                                continue;
                            }
                        }
                    }
                }

                ProcessEvent( ev, wh );
            }
        }
    }
开发者ID:apetrone,项目名称:precache,代码行数:59,代码来源:xwl.c

示例15: ev_pause

void CMusikPlayer::FinalizePause()
{
	m_SndEngine.SetPlayState( MUSIKEngine::Paused );
	m_Paused = true;
    MusikPlayerEvent ev_pause(this,wxEVT_MUSIKPLAYER_PLAY_PAUSE);
    ProcessEvent(ev_pause);

}
开发者ID:BackupTheBerlios,项目名称:musik-svn,代码行数:8,代码来源:MusikPlayer.cpp


注:本文中的ProcessEvent函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。