• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetEventKind函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TextInputEventHandler

static pascal OSStatus TextInputEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
    OSStatus result = eventNotHandledErr ;

    wxWindow* focus = wxWindow::FindFocus() ;
    char charCode ;
    UInt32 keyCode ;
    UInt32 modifiers ;
    Point point ;

    EventRef rawEvent ;

    GetEventParameter( event , kEventParamTextInputSendKeyboardEvent ,typeEventRef,NULL,sizeof(rawEvent),NULL,&rawEvent ) ;

    GetEventParameter( rawEvent, kEventParamKeyMacCharCodes, typeChar, NULL,sizeof(char), NULL,&charCode );
    GetEventParameter( rawEvent, kEventParamKeyCode, typeUInt32, NULL,  sizeof(UInt32), NULL, &keyCode );
       GetEventParameter( rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);
    GetEventParameter( rawEvent, kEventParamMouseLocation, typeQDPoint, NULL,
        sizeof( Point ), NULL, &point );

    switch ( GetEventKind( event ) )
    {
        case kEventTextInputUnicodeForKeyEvent :
            // this is only called when no default handler has jumped in, eg a wxControl on a floater window does not
            // get its own kEventTextInputUnicodeForKeyEvent, so we route back the
            wxControl* control = wxDynamicCast( focus , wxControl ) ;
            if ( control )
            {
                ControlHandle macControl = (ControlHandle) control->GetMacControl() ;
                if ( macControl )
                {
                    ::HandleControlKey( macControl , keyCode , charCode , modifiers ) ;
                    result = noErr ;
                }
            }
            /*
            // this may lead to double events sent to a window in case all handlers have skipped the key down event
            UInt32 when = EventTimeToTicks( GetEventTime( event ) ) ;
            UInt32 message = (keyCode << 8) + charCode;

            if ( (focus != NULL) && wxTheApp->MacSendKeyDownEvent(
                focus , message , modifiers , when , point.h , point.v ) )
            {
                result = noErr ;
            }
            */
            break ;
    }

    return result ;
}
开发者ID:Duion,项目名称:Torsion,代码行数:51,代码来源:toplevel.cpp


示例2: wxMacAppMenuEventHandler

static pascal OSStatus
wxMacAppMenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{    
    wxMacCarbonEvent cEvent( event ) ;
    MenuRef menuRef = cEvent.GetParameter<MenuRef>(kEventParamDirectObject) ;
    wxMenu* menu = wxFindMenuFromMacMenu( menuRef ) ;
    
    if ( menu )
    {
        wxEventType type=0;        
        MenuCommand cmd=0;
        switch (GetEventKind(event))
        {
            case kEventMenuOpening:
                type = wxEVT_MENU_OPEN;
                break;
            case kEventMenuClosed:
                type = wxEVT_MENU_CLOSE;
                break;
            case kEventMenuTargetItem:
                cmd = cEvent.GetParameter<MenuCommand>(kEventParamMenuCommand,typeMenuCommand) ;
                if (cmd != 0) 
                    type = wxEVT_MENU_HIGHLIGHT;
                break;
            default:
                wxFAIL_MSG(wxT("Unexpected menu event kind"));
                break;
        }

        if ( type )
        {
            wxMenuEvent wxevent(type, cmd, menu);
            wxevent.SetEventObject(menu);

            wxEvtHandler* handler = menu->GetEventHandler();
            if (handler && handler->ProcessEvent(wxevent))
            {
                // handled
            }
            else
            {
                wxWindow *win = menu->GetInvokingWindow();
                if (win) 
                    win->GetEventHandler()->ProcessEvent(wxevent);
                }
            }
    }
    
    return eventNotHandledErr;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:50,代码来源:app.cpp


示例3: CarbonEventHandlerProc

static OSStatus
CarbonEventHandlerProc(
    EventHandlerCallRef callRef,
    EventRef event,
    void *userData)
{
    OSStatus err = eventNotHandledErr;
    TkMacOSXEvent macEvent;
    MacEventStatus eventStatus;

    macEvent.eventRef = event;
    macEvent.eClass = GetEventClass(event);
    macEvent.eKind = GetEventKind(event);
    macEvent.interp = (Tcl_Interp *) userData;
    macEvent.callRef = callRef;
    bzero(&eventStatus, sizeof(eventStatus));

#ifdef TK_MAC_DEBUG_CARBON_EVENTS
    if (!(macEvent.eClass == kEventClassMouse && (
	    macEvent.eKind == kEventMouseMoved ||
	    macEvent.eKind == kEventMouseDragged))) {
	TkMacOSXDbgMsg("Started handling %s",
		TkMacOSXCarbonEventToAscii(event));
	TkMacOSXInitNamedDebugSymbol(HIToolbox, void, _DebugPrintEvent,
		EventRef inEvent);
	if (_DebugPrintEvent) {
	    /*
	     * Carbon-internal event debugging (c.f. Technote 2124)
	     */

	    _DebugPrintEvent(event);
	}
    }
#endif /* TK_MAC_DEBUG_CARBON_EVENTS */

    TkMacOSXProcessEvent(&macEvent,&eventStatus);
    if (eventStatus.stopProcessing) {
	err = noErr;
    }

#ifdef TK_MAC_DEBUG_CARBON_EVENTS
    if (macEvent.eKind != kEventMouseMoved &&
	    macEvent.eKind != kEventMouseDragged) {
	TkMacOSXDbgMsg("Finished handling %s: %s handled",
		TkMacOSXCarbonEventToAscii(event),
		eventStatus.stopProcessing ? "   " : "not");
    }
#endif /* TK_MAC_DEBUG_CARBON_EVENTS */
    return err;
}
开发者ID:aosm,项目名称:tcl,代码行数:50,代码来源:tkMacOSXCarbonEvents.c


示例4: HIOpenGLViewEventControl

OSStatus HIOpenGLViewEventControl (EventHandlerCallRef inCall, EventRef inEvent, HIOpenGLViewData* inData)
{
    fprintf(stderr, "HIOpenGLViewEventControl\n");
    switch (GetEventKind(inEvent))
    {
        case kEventControlInitialize: return HIOpenGLViewEventControlInitialize(inCall, inEvent, inData); break;
        case kEventControlDraw: return HIOpenGLViewEventControlDraw(inCall, inEvent, inData); break;
        case kEventControlHitTest: return HIOpenGLViewEventControlHitTest(inCall, inEvent, inData); break;
        case kEventControlHiliteChanged: return HIOpenGLViewEventControlHiliteChanged(inCall, inEvent, inData); break;
        case kEventControlBoundsChanged: return HIOpenGLViewEventControlBoundsChanged(inCall, inEvent, inData); break;
        case kEventControlOwningWindowChanged: return HIOpenGLViewEventControlOwningWindowChanged(inCall, inEvent, inData); break;
        default: return eventNotHandledErr; break;
    }
}
开发者ID:toddlipcon,项目名称:PScope,代码行数:14,代码来源:HIOpenGLView.cpp


示例5: EventHandler

static pascal OSStatus EventHandler(EventHandlerCallRef handler, EventRef event, void *data)
{
   OSStatus result = eventNotHandledErr;

   VSTEffectDialog *dlg = (VSTEffectDialog *)data;

   if (GetEventClass(event) == kEventClassWindow && GetEventKind(event) == kEventWindowClose) {
      dlg->RemoveHandler();
      dlg->Close();
      result = noErr;
   }

   return result;
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:14,代码来源:VSTEffect.cpp


示例6: qxt_mac_handle_hot_key

OSStatus qxt_mac_handle_hot_key(EventHandlerCallRef nextHandler, EventRef event,
                                void *data) {
  Q_UNUSED(nextHandler);
  Q_UNUSED(data);
  if (GetEventClass(event) == kEventClassKeyboard &&
      GetEventKind(event) == kEventHotKeyPressed) {
    EventHotKeyID keyID;
    GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, NULL,
                      sizeof(keyID), NULL, &keyID);
    Identifier id = keyIDs.key(keyID.id);
    QxtGlobalShortcutPrivate::activateShortcut(id.second, id.first);
  }
  return noErr;
}
开发者ID:CelineThiry,项目名称:MellowPlayer,代码行数:14,代码来源:qxtglobalshortcut_mac.cpp


示例7: keyHandler

OSStatus keyHandler(EventHandlerCallRef hcr, EventRef theEvent, void* inUserData) 
{
    UInt32 eventKind;
    UInt32 eventClass;
    OSErr  err        = noErr;

    eventKind  = GetEventKind     (theEvent);
    eventClass = GetEventClass    (theEvent);
    err        = GetEventParameter(theEvent, kEventParamKeyMacCharCodes, typeChar, NULL, sizeof(lastKey), NULL, &lastKey);
    if (err != noErr)
        lastKey = NO_KEY;
		
    return noErr;
}
开发者ID:DORARA29,项目名称:AtomManipulator,代码行数:14,代码来源:window_carbon.cpp


示例8: handleEvents

static OSStatus handleEvents( EventHandlerCallRef ref, EventRef e, void *data ) {
    switch( GetEventKind(e) ) {
    case eCall: {
        value *r;
        value f;
        GetEventParameter(e,pFunc,typeVoidPtr,0,sizeof(void*),0,&r);
        f = *r;
        free_root(r);
        val_call0(f);
        break;
    }
    }
    return 0;
}
开发者ID:MattTuttle,项目名称:neko,代码行数:14,代码来源:ui.c


示例9: listBoxControlEventHandler

// --------------------------------------------------------------------------------------
static pascal OSStatus listBoxControlEventHandler(EventHandlerCallRef nextHandler, 
													EventRef event, void *prefsDialog)
{
	OSStatus result = eventNotHandledErr;
	UInt32 eventClass, eventKind;
	DialogRef dialog;
	WindowRef dialogWindow;
	
	eventClass = GetEventClass(event);
	eventKind = GetEventKind(event);
	
	switch (eventClass)
	{
		case kEventClassTextInput:
			switch (eventKind)
			{
				case kEventTextInputUnicodeForKeyEvent:
						/* The strategy here is to first let the default handler handle 
						   the event (i.e. change the selected cell in the category list 
						   box control), then react to that change by showing the 
						   correct category panel.  However the key pressed could 
						   potentially cause the default or cancel button to get hit.  
						   In this case, our window handler will be called which will 
						   dispose of the dialog.  If this is the case, we need to not 
						   postprocess the event.  We will test for this by getting the 
						   dialog's window, retaining it, calling the default handler, 
						   then getting the window's retain count.  If the retain count 
						   is back to 1, then we know the dialog is already disposed. */
					dialog = (DialogRef)prefsDialog;
					dialogWindow = GetDialogWindow(dialog);
					RetainWindow(dialogWindow);		// hold onto the dialog's window
					
					result = CallNextEventHandler(nextHandler, event);
					if (result == noErr)	// we don't need to postprocess if nothing happened
					{
						ItemCount retainCount;
						
						retainCount = GetWindowRetainCount(dialogWindow);
						if (retainCount > 1)		// if we're the last one holding the window
							handleDialogItemHit(dialog, iIconList);		// then there's no 
					}			// need to postprocess anything because it's about to go away
					
					ReleaseWindow(dialogWindow);
					break;
			}
			break;
	}
	
	return result;
}
开发者ID:fruitsamples,项目名称:CarbonPorting,代码行数:51,代码来源:PrefsDialog.c


示例10: FilterFieldEventHandler

static OSStatus FilterFieldEventHandler(EventHandlerCallRef handlerCallRef,
					EventRef event, void *userData)
{
	Q_UNUSED(handlerCallRef);
	FilterWidget *filter = (FilterWidget *) userData;
	OSType eventClass = GetEventClass(event);
	UInt32 eventKind = GetEventKind(event);

	if (eventClass == kEventClassSearchField && eventKind == kEventSearchFieldCancelClicked)
		filter->clear();
	else if (eventClass == kEventClassTextField && eventKind == kEventTextDidChange)
		filter->emitTextChanged();
	return (eventNotHandledErr);
}
开发者ID:partition,项目名称:kadu,代码行数:14,代码来源:filter-widget.cpp


示例11: event

// ---------------------------------------------------------------------------
// 
// -----------
bool bToolPrintArea::event(EventRef evt){
UInt32	clss=GetEventClass(evt);
	if(clss==kEventClassWindow){
UInt32	kind=GetEventKind(evt);
		switch(kind){
			case kEventWindowDrawContent:
			case kEventWindowUpdate:
				update(false);
				return(true);
				break;
		}
	}
	return(bStdToolPres::event(evt));
}
开发者ID:CarteBlancheConseil,项目名称:MacMap,代码行数:17,代码来源:bToolPrintArea.cpp


示例12: DefaultEventHandler

pascal OSStatus DefaultEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{
	OSStatus	err, result = eventNotHandledErr;
	WindowRef	tWindowRef = (WindowRef) inUserData;

	switch (GetEventClass(inEvent))
	{
		case kEventClassWindow:
			switch (GetEventKind(inEvent))
			{
				case kEventWindowClose:
					QuitAppModalLoopForWindow(tWindowRef);
					result = noErr;
			}

			break;

		case kEventClassCommand:
			switch (GetEventKind(inEvent))
			{
				case kEventCommandUpdateStatus:
					HICommand	tHICommand;

					err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand);
					if (err == noErr && tHICommand.commandID == 'clos')
					{
						UpdateMenuCommandStatus(true);
						result = noErr;
					}
			}

			break;
	}

	return (result);
}
开发者ID:OV2,项目名称:snes9x-libsnes,代码行数:36,代码来源:mac-dialog.cpp


示例13: GetEventClass

bool	AUPropertyControl::HandleEvent(EventHandlerCallRef inHandlerRef, EventRef event)
{	
	UInt32 eclass = GetEventClass(event);
	UInt32 ekind = GetEventKind(event);
	switch (eclass) {
	case kEventClassControl:
		switch (ekind) {
		case kEventControlValueFieldChanged:
			HandleControlChange();
			return true;	// handled
		}
	}

	return false;
}
开发者ID:kdridi,项目名称:acau,代码行数:15,代码来源:AUCarbonViewControl.cpp


示例14: StatusWindowEventHandler

/* EVENT HANDLER */
static OSStatus StatusWindowEventHandler (
    EventHandlerCallRef nextHandler, EventRef event, void *userData)
{
    OSStatus err = noErr;
    CARBON_GUI *me = (CARBON_GUI *)userData;
	switch (GetEventKind (event))
    {
		case kEventWindowClose:
			me->showStatus(false);
			break;
		default:
            break;
    }
    return err;
}
开发者ID:dyne,项目名称:MuSE,代码行数:16,代码来源:carbon_gui.cpp


示例15: event

// ---------------------------------------------------------------------------
//
// -----------
bool bXMapTopoCheck::event(EventRef evt){
UInt32	clss=GetEventClass(evt);
    
    if(clss==kEventClassMacMap){
        UInt32	kind=GetEventKind(evt);
        switch(kind){
            case kEventMacMapDataBase:
                check_events();
                break;
            default:
                break;
        }
    }
    return(false);
}
开发者ID:CarteBlancheConseil,项目名称:Instances,代码行数:18,代码来源:bXMapTopoCheck.cpp


示例16: wxMacAppMenuEventHandler

static pascal OSStatus
wxMacAppMenuEventHandler( EventHandlerCallRef WXUNUSED(handler),
                          EventRef event,
                          void *WXUNUSED(data) )
{
    wxMacCarbonEvent cEvent( event ) ;
    MenuRef menuRef = cEvent.GetParameter<MenuRef>(kEventParamDirectObject) ;
#ifndef __WXUNIVERSAL__
    wxMenu* menu = wxFindMenuFromMacMenu( menuRef ) ;

    if ( menu )
    {
        switch (GetEventKind(event))
        {
            case kEventMenuOpening:
                menu->HandleMenuOpened();
                break;

            case kEventMenuClosed:
                menu->HandleMenuClosed();
                break;

            case kEventMenuTargetItem:
                {
                    HICommand command ;

                    command.menu.menuRef = menuRef;
                    command.menu.menuItemIndex = cEvent.GetParameter<MenuItemIndex>(kEventParamMenuItemIndex,typeMenuItemIndex) ;
                    command.commandID = cEvent.GetParameter<MenuCommand>(kEventParamMenuCommand,typeMenuCommand) ;
                    if (command.commandID != 0)
                    {
                        wxMenuItem* item = NULL ;
                        wxMenu* itemMenu = wxFindMenuFromMacCommand( command , item ) ;
                        if ( itemMenu && item )
                            itemMenu->HandleMenuItemHighlighted( item );
                    }
                }
                break;

            default:
                wxFAIL_MSG(wxT("Unexpected menu event kind"));
                break;
        }

    }
#endif
    return eventNotHandledErr;
}
开发者ID:zhchbin,项目名称:wxWidgets,代码行数:48,代码来源:app.cpp


示例17: QuartzEventHandler

OSStatus QuartzEventHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData )
{
	OSStatus 	err = eventNotHandledErr;
	UInt32		eventKind = GetEventKind( inEvent ), RWinCode, devsize;
        int		devnum;
        WindowRef 	EventWindow;
        EventRef	REvent;
        NewDevDesc 	*dd;
 	
        if( GetEventClass(inEvent) != kEventClassWindow)
         return(err);
         
        GetEventParameter(inEvent, kEventParamDirectObject, typeWindowRef, NULL, sizeof(EventWindow),
                                NULL, &EventWindow);
                                
        if(GetWindowProperty(EventWindow, kRAppSignature, 'QRTZ', sizeof(int), NULL, &devnum) != noErr)
           return eventNotHandledErr;
                                
        switch(eventKind){
            case kEventWindowClose:
            {
                KillDevice(GetDevice(devnum));
                err= noErr; 
            }
            break;
         
            case kEventWindowBoundsChanged:
                if( (dd = ((GEDevDesc*) GetDevice(devnum))->dev) ){
                    QuartzDesc *xd = (QuartzDesc *) dd-> deviceSpecific;
                    Rect portRect;
                    GetWindowPortBounds ( xd->window, & portRect ) ;
                    if( (xd->windowWidth != portRect.right) || (xd->windowHeight != portRect.bottom) ){
					 xd->resize = true;
                     dd->size(&(dd->left), &(dd->right), &(dd->bottom), &(dd->top), dd);
					 xd->resize = false;
                     GEplayDisplayList((GEDevDesc*) GetDevice(devnum));      
                    }  
                    err = noErr;
                }
            break;

            default:
            break;
        }    
 	   
	return err;
}
开发者ID:Vladimir84,项目名称:rcc,代码行数:47,代码来源:devQuartz.c


示例18: gelatineRendererEventHandler

pascal OSStatus gelatineRendererEventHandler(EventHandlerCallRef handler,
                                             EventRef event,
                                             void* userData)
{
  OSStatus result = eventNotHandledErr;
  GelatinePaneView* view = reinterpret_cast <GelatinePaneView*> (userData);
  UInt32 eventKind = GetEventKind(event);

  switch (eventKind) {

  case kEventControlInitialize:
    view->init();
    break;

  case kEventControlDispose:
    view->dispose();
    break;

  case kEventControlActivate:
    view->swapPortsAndDisplay();
    break;

  case kEventControlDeactivate:
    break;

  case kEventControlDraw:
    view->swapPortsAndDisplay();
    break;

  case kEventControlBoundsChanged:
    Rect* controlRect = view->getModel()._bounds;

    Rect portRect;
    GetWindowPortBounds(view->getModel().getWindowRef(), &portRect);
    InvalWindowRect(view->getModel().getWindowRef(), &portRect);

    view->resize(controlRect->left,
                 controlRect->top,
                 controlRect->right,
                 controlRect->bottom);
    view->swapPortsAndDisplay();
    break;

  }

  return result;
}
开发者ID:williamwaterson,项目名称:protolayer,代码行数:47,代码来源:GelatinePaneView.cpp


示例19: GetEventParameter

OSStatus
TabbedWindow::WindowHandleControlEvent( EventHandlerCallRef handler, EventRef event )
{
    OSStatus status = eventNotHandledErr;
    
    // grab the controlRef out of the event
    ControlRef controlHitRef;
    status = GetEventParameter( event, kEventParamDirectObject, typeControlRef,
            NULL, sizeof( ControlRef ), NULL, (void *) &controlHitRef );
    require_noerr( status, HandleControlEvent_err );
    
    // grab the id out of the event
    ControlID controlHitID;
    status = GetControlID( controlHitRef, &controlHitID );
    require_noerr( status, HandleControlEvent_err );
    
    status = eventNotHandledErr;
    
    switch( GetEventKind( event ) )
    {
        // we only handle the kEventControlHit control event
        case kEventControlHit:
        {
            // check to see if the control hit was our happy tab thingy
            switch( controlHitID.signature )
            {
                case kMasterTabControlSignature:
                    status = this->SwitchTabPane( controlHitRef );
                    //check_noerr( status );
                    break;
                default:
                    std::cout << "Some other unidentified control was hit" << std::endl;
                    status = eventNotHandledErr;
                    break;
            }
        }
            break;
        default:
            status = eventNotHandledErr;
            break;
    }

HandleControlEvent_err:

    return status;
}
开发者ID:fruitsamples,项目名称:InkSample,代码行数:46,代码来源:TabbedWindow.cpp


示例20: VumeterWindowEventHandler

static OSStatus VumeterWindowEventHandler (
    EventHandlerCallRef nextHandler, EventRef event, void *userData)
{
    OSStatus err = noErr;
    CARBON_GUI *me = (CARBON_GUI *)userData;
	switch (GetEventKind (event))
    {
		case kEventWindowClose:
			SetControlValue(mainControls[VOL_BUT],0);
			me->showVumeters(false);
			break;
		default:
            err = eventNotHandledErr;
            break;
    }
    return err;
}
开发者ID:dyne,项目名称:MuSE,代码行数:17,代码来源:carbon_gui.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetEventParameter函数代码示例发布时间:2022-05-30
下一篇:
C++ GetEventHandler函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap