您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ HIViewFindByID函数代码示例

51自学网 2021-06-01 21:23:23
  C++
这篇教程C++ HIViewFindByID函数代码示例写得很实用,希望能帮到您。

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

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

示例1: NPServerDialogEventHandler

static pascal OSStatus NPServerDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData){	OSStatus	err, result = eventNotHandledErr;	WindowRef	tWindowRef = (WindowRef) inUserData;	switch (GetEventClass(inEvent))	{		case kEventClassCommand:			switch (GetEventKind(inEvent))			{				HICommand	tHICommand;				case kEventCommandUpdateStatus:					err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand);					if (err == noErr && tHICommand.commandID == 'clos')					{						UpdateMenuCommandStatus(false);						result = noErr;					}					break;				case kEventCommandProcess:					err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand);					if (err == noErr)					{						switch (tHICommand.commandID)						{							case 'OKAY':								HIViewRef	ctl, root;								HIViewID	cid;								root = HIViewGetRoot(tWindowRef);								cid.id = 0;								cid.signature = 'OKAY';								HIViewFindByID(root, cid, &ctl);								DeactivateControl(ctl);								cid.signature = 'CNSL';								HIViewFindByID(root, cid, &ctl);								DeactivateControl(ctl);								npserver.dialogprocess = kNPSDialogProcess;								result = noErr;								break;							case 'CNSL':								npserver.dialogprocess = kNPSDialogCancel;								result = noErr;								break;						}					}					break;			}			break;	}	return (result);}
开发者ID:OV2,项目名称:snes9x-libsnes,代码行数:60,


示例2: DeleteCheatItem

static void DeleteCheatItem (void){	OSStatus	err;	HIViewRef	ctl, root;	HIViewID	cid;	Handle		selectedItems;	ItemCount	selectionCount;	selectedItems = NewHandle(0);	if (!selectedItems)		return;	err = GetDataBrowserItems(dbRef, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, selectedItems);	selectionCount = (GetHandleSize(selectedItems) / sizeof(DataBrowserItemID));	if (selectionCount == 0)	{		DisposeHandle(selectedItems);		return;	}	err = RemoveDataBrowserItems(dbRef, kDataBrowserNoItem, selectionCount, (DataBrowserItemID *) *selectedItems, kDataBrowserItemNoProperty);	for (unsigned int i = 0; i < selectionCount; i++)	{		citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].valid   = false;		citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].enabled = false;		numofcheats--;	}	DisposeHandle(selectedItems);	root = HIViewGetRoot(wRef);	cid.id = 0;	if (numofcheats < MAC_MAX_CHEATS)	{		cid.signature = kNewButton;		HIViewFindByID(root, cid, &ctl);		err = ActivateControl(ctl);	}	if (numofcheats == 0)	{		cid.signature = kAllButton;		HIViewFindByID(root, cid, &ctl);		err = DeactivateControl(ctl);	}}
开发者ID:libretro,项目名称:snes9x,代码行数:49,


示例3: Prompt

//-------------------------------------------------------------------------------------//	Prompt//-------------------------------------------------------------------------------------//	Put up a modal panel and request some text.//CFStringRefPrompt( CFStringRef inPrompt, CFStringRef inDefaultText ){    IBNibRef 			nibRef;	OSStatus			err;	WindowRef			window;	EventTypeSpec		kEvents[] = { { kEventClassCommand, kEventCommandProcess } };	PanelInfo			info;	HIViewRef			view;		info.window = window;	info.string = NULL;    err = CreateNibReference( CFSTR( "main" ), &nibRef );    require_noerr( err, CantGetNibRef );		err = CreateWindowFromNib( nibRef, CFSTR( "Prompt" ), &window );	require_noerr( err, CantCreateWindow );		DisposeNibReference( nibRef );	if ( inPrompt )	{		HIViewFindByID( HIViewGetRoot( window ), kPromptLabelID, &view );		SetControlData( view, 0, kControlStaticTextCFStringTag, sizeof( CFStringRef ), &inPrompt );	}		HIViewFindByID( HIViewGetRoot( window ), kTextFieldID, &view );	if ( inDefaultText )		SetControlData( view, 0, kControlEditTextCFStringTag, sizeof( CFStringRef ), &inDefaultText );		SetKeyboardFocus( window, view, kControlFocusNextPart );	InstallWindowEventHandler( window, InputPanelHandler, GetEventTypeCount( kEvents ),				kEvents, &info, NULL );			ShowWindow( window );		info.window = window;	RunAppModalLoopForWindow( window );	DisposeWindow( window );CantCreateWindow:CantGetNibRef:	return info.string;}
开发者ID:fruitsamples,项目名称:SimpleCarbonWeb,代码行数:54,


示例4: AspectRatioTextEventHandler

static pascal OSStatus AspectRatioTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData){	OSStatus	err, result = eventNotHandledErr;	HIViewRef	ctl, slider;	HIViewID	cid;	float		w, h, v;	int			iw, ih;	err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl);	if (err == noErr)	{		cid.signature = 'grap';		cid.id = iNibGAspectRatio;		HIViewFindByID(HIViewGetSuperview(ctl), cid, &slider);		GetGameDisplay(&iw, &ih);		w = (float) iw;		h = (float) ih;		v = (float) SNES_WIDTH / (float) SNES_HEIGHT * h;		macAspectRatio = (int) (((4.0f / 3.0f) * h - v) / (w - v) * 10000.0f);		SetControl32BitValue(slider, macAspectRatio);		result = noErr;	}	return (result);}
开发者ID:libretro,项目名称:snes9x,代码行数:29,


示例5: timerCallback

            void timerCallback()            {                // Wait for the moment when PT deigns to allow our view to                // take up its actual location (see rant above)                HIViewRef content = 0;                HIViewFindByID (HIViewGetRoot ((WindowRef) hostWindow), kHIViewWindowContentID, &content);                HIPoint p = { 0.0f, 0.0f };                HIViewRef v = HIViewGetFirstSubview (parentView);                HIViewConvertPoint (&p, v, content);                if (p.y > 12)                {                    if (p.x != titleW || p.y != titleH)                    {                        GrafPtr oldport;                        GetPort (&oldport);                        SetPort (owner->GetViewPort());                        SetOrigin (-titleW, -titleH);                        SetPort (oldport);                    }                    HIViewRef v = HIViewGetFirstSubview (parentView);                    SetControlSupervisor (v, 0);                    stopTimer();                    forcedRepaintTimer = new RepaintCheckTimer (*this);                }            }
开发者ID:NonPlayerCharactor,项目名称:juce_pitcher,代码行数:29,


示例6: InputRateTextEventHandler

static pascal OSStatus InputRateTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData){	OSStatus	err, result = eventNotHandledErr;	HIViewRef	ctl, slider;	HIViewID	cid;	SInt32		value;	char		num[10];	err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl);	if (err == noErr)	{		cid.signature = 'snd_';		cid.id = iNibSInputRate;		HIViewFindByID(HIViewGetSuperview(ctl), cid, &slider);		value = GetControl32BitValue(slider);		value /= 50;		value *= 50;		if (value > 33000)			value = 33000;		if (value < 31000)			value = 31000;		SetControl32BitValue(slider, value);		sprintf(num, "%ld", value);		SetEditTextCStr(ctl, num, true);		result = noErr;	}	return (result);}
开发者ID:libretro,项目名称:snes9x,代码行数:32,


示例7: Handle_ControlValueFieldOrHiliteChanged

/******************************************************* Handle_ControlValueFieldOrHiliteChanged(inHandlerCallRef, inEvent, inUserData) ** Purpose:  called to handle the change of the value or hilite of our custom view, we update the static text field** Inputs:   inHandlerCallRef    - reference to the current handler call chain*           inEvent             - the event*           inUserData          - app-specified data you passed in the call to InstallEventHandler** Returns:  OSStatus            - noErr indicates the event was handled*                                 eventNotHandledErr indicates the event was not handled and the Toolbox should take over*/static pascal OSStatus Handle_ControlValueFieldOrHiliteChanged(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)	{	OSStatus status;	HIViewRef customView = (HIViewRef)inUserData;		// Finding our static text control	HIViewRef statText;	status = HIViewFindByID(HIViewGetRoot(GetControlOwner(customView)), kStaticTextID, &statText);	require_noerr(status, ExitValueFieldChanged);	// Grabbing the fields that we are interested in	CFStringRef theCFString = CFStringCreateWithFormat(NULL, NULL, CFSTR("Value: %ld, Min: %ld, Max: %ld, Hilite: %d"), GetControl32BitValue(customView), GetControl32BitMinimum(customView), GetControl32BitMaximum(customView), GetControlHilite(customView));	require(theCFString != NULL, ExitValueFieldChanged);	// Setting the text in the control#ifdef MAC_OS_X_VERSION_10_4	status = HIViewSetText(statText, theCFString);#else	status = SetControlData(statText, kControlEntireControl, kControlStaticTextCFStringTag, sizeof(theCFString), &theCFString);#endif	require_noerr(status, ExitValueFieldChanged);	CFRelease(theCFString);ExitValueFieldChanged:	if (status == noErr) status = eventNotHandledErr;	return status;	}   // Handle_ControlValueFieldOrHiliteChanged
开发者ID:fruitsamples,项目名称:Custom_HIView_Tutorial,代码行数:42,


示例8: NPClientBeginPlayerListSheet

static void NPClientBeginPlayerListSheet (void){	OSStatus	err;	CFStringRef	ref;	HIViewRef	ctl, root;	HIViewID	cid;	root = HIViewGetRoot(sRef);	cid.signature = 'PLNM';	for (int i = 0; i < NP_MAX_PLAYERS; i++)	{		if (npcinfo[i].ready)		{			cid.id = npcinfo[i].player;			HIViewFindByID(root, cid, &ctl);			ref = CFStringCreateWithCString(kCFAllocatorDefault, npcinfo[i].name, kCFStringEncodingUTF8);			if (ref)			{				SetStaticTextCFString(ctl, ref, false);				CFRelease(ref);			}			else				SetStaticTextCFString(ctl, CFSTR("unknown"), false);		}	}	err = ShowSheetWindow(sRef, mRef);}
开发者ID:RedGuyyyy,项目名称:snes9x,代码行数:29,


示例9: InputPanelHandler

//-------------------------------------------------------------------------------------//	InputPanelHandler//-------------------------------------------------------------------------------------//	Deal with events in our prompt panel. We merely respond to the cancel and OK commands// 	that are sent from the push buttons and terminate our modal loop. If OK is pressed,//	we get the string and store it in our PanelInfo structure.//static OSStatusInputPanelHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData ){	HICommand			command;	OSStatus			result = eventNotHandledErr;	PanelInfo*			info = (PanelInfo*)inUserData;		GetEventParameter( inEvent, kEventParamDirectObject, typeHICommand, NULL,			sizeof( HICommand ), NULL, &command );	if ( command.commandID == kHICommandCancel )	{		QuitAppModalLoopForWindow( info->window );		result = noErr;	}	else if ( command.commandID == kHICommandOK )	{		HIViewRef		textField;				HIViewFindByID( HIViewGetRoot( info->window ), kTextFieldID, &textField );		GetControlData( textField, 0, kControlEditTextCFStringTag, sizeof( CFStringRef ), &info->string, NULL );		QuitAppModalLoopForWindow( info->window );	}		return result;}
开发者ID:fruitsamples,项目名称:SimpleCarbonWeb,代码行数:33,


示例10: SelectTabPane

static void SelectTabPane (HIViewRef tabControl, SInt16 index){	HIViewRef	sup, userPane, selectedPane = NULL;	HIViewID	cid;	lastTabIndex = index;	sup = HIViewGetSuperview(tabControl);	cid.signature = 'tabs';	for (int i = 1; i < tabList[0] + 1; i++)	{		cid.id = tabList[i];		HIViewFindByID(sup, cid, &userPane);		if (i == index)			selectedPane = userPane;		else			HIViewSetVisible(userPane, false);	}	if (selectedPane != NULL)		HIViewSetVisible(selectedPane, true);	HIViewSetNeedsDisplay(tabControl, true);}
开发者ID:libretro,项目名称:snes9x,代码行数:26,


示例11: MacOSXDialogCommandProcess

static pascal OSStatus MacOSXDialogCommandProcess(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void* inUserData){	HICommand aCommand;	OSStatus status = eventNotHandledErr;		GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &aCommand);		switch (aCommand.commandID)	{		case kHICommandOK:			// we got a valid click on the OK button so let's quit our local run loop			QuitAppModalLoopForWindow((WindowRef) inUserData);			break;		case 'CBED':		{			// we still enable or disable the custom spot view depending on whether the box is checked or not			HIViewRef checkBox = ((HICommandExtended *)&aCommand)->source.control;			SInt32 enable = GetControl32BitValue(checkBox);			HIViewID hidcsv = {0, 13};			HIViewRef customSpotView;			HIViewFindByID(HIViewGetRoot(GetControlOwner(checkBox)), hidcsv, &customSpotView);			if (enable)				ActivateControl(customSpotView);			else				DeactivateControl(customSpotView);			HIViewSetNeedsDisplay(customSpotView, true);		}			break;	}		return status;}
开发者ID:fruitsamples,项目名称:DialogsToHIViews,代码行数:32,


示例12: Handle_PostLittleArrowsClick

/******************************************************* Handle_PostLittleArrowsClick(inHandlerCallRef, inEvent, inUserData) ** Purpose:  called to update the static text with the current value of the little arrows control** Inputs:   inHandlerCallRef    - reference to the current handler call chain*			inEvent             - the event*           inUserData          - app-specified data you passed in the call to InstallEventHandler** Returns:  OSStatus            - noErr indicates the event was handled*                                 eventNotHandledErr indicates the event was not handled and the Toolbox should take over*/static pascal OSStatus Handle_PostLittleArrowsClick(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData){	OSStatus status = eventNotHandledErr;	ControlRef littleArrows = (ControlRef)inUserData;	SInt32 value = GetControl32BitValue(littleArrows);		HIViewID staticTextID = { 'STTC', 100 };	HIViewRef staticText;	status = HIViewFindByID(HIViewGetRoot(GetControlOwner(littleArrows)), staticTextID, &staticText);	require_noerr(status, HIViewFindByID);	require(littleArrows != NULL, HIViewFindByID);		CFStringRef theValueStr = CFStringCreateWithFormat(NULL, NULL, CFSTR("%ld"), value);	require(theValueStr != NULL, CFStringCreateWithFormat);	HIViewSetText(staticText, theValueStr);	CFRelease(theValueStr);CFStringCreateWithFormat:HIViewFindByID:	if (status == noErr)		status = eventNotHandledErr;	return status;}   // Handle_PostLittleArrowsClick
开发者ID:fruitsamples,项目名称:LittleArrowsShowcase,代码行数:40,


示例13: SetExtraStyle

bool wxDialog::Create( wxWindow *parent,    wxWindowID id,    const wxString& title,    const wxPoint& pos,    const wxSize& size,    long style,    const wxString& name ){    SetExtraStyle( GetExtraStyle() | wxTOPLEVEL_EX_DIALOG );    // All dialogs should really have this style...    style |= wxTAB_TRAVERSAL;    // ...but not these styles    style &= ~(wxYES | wxOK | wxNO); // | wxCANCEL    if ( !wxTopLevelWindow::Create( parent, id, title, pos, size, style, name ) )        return false;#if TARGET_API_MAC_OSX    HIViewRef growBoxRef = 0 ;    OSStatus err = HIViewFindByID( HIViewGetRoot( (WindowRef)m_macWindow ), kHIViewWindowGrowBoxID, &growBoxRef  );    if ( err == noErr && growBoxRef != 0 )        HIGrowBoxViewSetTransparent( growBoxRef, true ) ;#endif    return true;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:28,


示例14: AddCheatItem

static void AddCheatItem (void){	OSStatus			err;	HIViewRef			ctl, root;	HIViewID			cid;	DataBrowserItemID	id[1];	unsigned int		i;	if (numofcheats == MAC_MAX_CHEATS)		return;	for (i = 0; i < MAC_MAX_CHEATS; i++)		if (citem[i].valid == false)			break;	if (i == MAC_MAX_CHEATS)		return;	numofcheats++;	citem[i].valid   = true;	citem[i].enabled = false;	citem[i].address = 0;	citem[i].value   = 0;	sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id);	id[0] = citem[i].id;	err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty);	err = RevealDataBrowserItem(dbRef, id[0], kCmAddress, true);	root = HIViewGetRoot(wRef);	cid.id = 0;	if (numofcheats == MAC_MAX_CHEATS)	{		cid.signature = kNewButton;		HIViewFindByID(root, cid, &ctl);		err = DeactivateControl(ctl);	}	if (numofcheats)	{		cid.signature = kAllButton;		HIViewFindByID(root, cid, &ctl);		err = ActivateControl(ctl);	}}
开发者ID:libretro,项目名称:snes9x,代码行数:46,


示例15: GetTextViewFromWindow

//---------------------------------------------------------------------// Returns the HITextView ref from one of our windows.//HIViewRef GetTextViewFromWindow(WindowRef window){	HIViewRef textView = NULL;	if( window != NULL )		verify_noerr( HIViewFindByID(HIViewGetRoot(window), gTextViewID, &textView) );	return textView;}
开发者ID:fruitsamples,项目名称:HITextViewDemo,代码行数:12,


示例16: InstallWindowEventHandler

/* initialize the status window (used to show console messages in the graphic environment */void CARBON_GUI::setupStatusWindow() {	OSStatus err=CreateWindowFromNib(nibRef,CFSTR("StatusWindow"),&statusWindow);	if(err!=noErr) msg->error("Can't create status window (%d)!!",err);	//SetDrawerParent(statusWindow,window);	//SetDrawerPreferredEdge(statusWindow,kWindowEdgeBottom);	//SetDrawerOffsets(statusWindow,20,20);		/* install an eventHandler to intercept close requests */	err = InstallWindowEventHandler (statusWindow, 		NewEventHandlerUPP (StatusWindowEventHandler), 		GetEventTypeCount(statusEvents), statusEvents, this, NULL);	if(err != noErr) msg->error("Can't install status window eventHandler");		/* and then install a command handler (to handle "clear" requests) */	err=InstallWindowEventHandler(statusWindow,NewEventHandlerUPP(StatusWindowCommandHandler),		GetEventTypeCount(commands),commands,this,NULL);			/* obtain an HIViewRef for the status text box ... we have to use it 	 * to setup various properties and to obain a TXNObject needed to manage its content */	const ControlID txtid={ CARBON_GUI_APP_SIGNATURE, STATUS_TEXT_ID };	err= HIViewFindByID(HIViewGetRoot(statusWindow), txtid, &statusTextView);	if(err!=noErr) return;// msg->warning("Can't get textView for status window (%d)!!",err);	statusText = HITextViewGetTXNObject(statusTextView);	if(!statusText) {		msg->error("Can't get statusText object from status window!!");	}//	TXNControlTag iControlTags[1] = { kTXNAutoScrollBehaviorTag };//	TXNControlData iControlData[1] = { kTXNAutoScrollNever }; //kTXNAutoScrollWhenInsertionVisible };//	err = TXNSetTXNObjectControls(statusText,false,1,iControlTags,iControlData);	//TextViewSetObjectControlData	//TextViewSetObjectControlData(statusText,kTXNAutoScrollBehaviorTag,kUn kTXNAutoScrollWhenInsertionVisible)	/* setup status text font size and color */	// Create type attribute data structure	UInt32   fontSize = 10 << 16; // needs to be in Fixed format	TXNAttributeData fsData,fcData;	fsData.dataValue=fontSize;	fcData.dataPtr=(void *)&black;	TXNTypeAttributes attributes[] = {		//{ kTXNQDFontStyleAttribute, kTXNQDFontStyleAttributeSize, bold },		{ kTXNQDFontColorAttribute, kTXNQDFontColorAttributeSize,fcData}, //&lgrey },		{ kTXNQDFontSizeAttribute, kTXNFontSizeAttributeSize,fsData }	};	err= TXNSetTypeAttributes( statusText, 2, attributes,		kTXNStartOffset,kTXNEndOffset );			/* block user input in the statusText box */	TXNControlTag tags[] = { kTXNNoUserIOTag };	TXNControlData vals[] = { kTXNReadOnly };	err=TXNSetTXNObjectControls(statusText,false,1,tags,vals);	if(err!=noErr) msg->error("Can't set statusText properties (%d)!!",err);	// TXNSetScrollbarState(statusText,kScrollBarsAlwaysActive);			//struct TXNBackground bg = {  kTXNBackgroundTypeRGB, black };	//TXNSetBackground(statusText,&bg);}
开发者ID:dyne,项目名称:MuSE,代码行数:57,


示例17: HIViewGetFrame

IPopupMenu* IGraphicsCarbon::CreateIPopupMenu(IPopupMenu* pMenu, IRECT* pAreaRect){  // Get the plugin gui frame rect within the host's window  HIRect rct;  HIViewGetFrame(this->mView, &rct);  // Get the host's window rect within the screen  Rect wrct;  GetWindowBounds(this->mWindow, kWindowContentRgn, &wrct);  #ifdef RTAS_API  int xpos = wrct.left + this->GetLeftOffset() + pAreaRect->L;  int ypos = wrct.top + this->GetTopOffset() + pAreaRect->B + 5;  #else  HIViewRef contentView;  HIViewFindByID(HIViewGetRoot(this->mWindow), kHIViewWindowContentID, &contentView);  HIViewConvertRect(&rct, HIViewGetSuperview((HIViewRef)this->mView), contentView);  int xpos = wrct.left + rct.origin.x + pAreaRect->L;  int ypos = wrct.top + rct.origin.y + pAreaRect->B + 5;  #endif  MenuRef menuRef = CreateMenu(pMenu);  if (menuRef)  {    int32_t popUpItem = 1;    int32_t PopUpMenuItem = PopUpMenuSelect(menuRef, ypos, xpos, popUpItem);    short result = LoWord(PopUpMenuItem) - 1;    short menuIDResult = HiWord(PopUpMenuItem);    IPopupMenu* resultMenu = 0;    if (menuIDResult != 0)    {      MenuRef usedMenuRef = GetMenuHandle(menuIDResult);      if (usedMenuRef)      {        if (GetMenuItemRefCon(usedMenuRef, 0, (URefCon*)&resultMenu) == noErr)        {          resultMenu->SetChosenItemIdx(result);        }      }    }    CFRelease(menuRef);    return resultMenu;  }  else  {    return 0;  }}
开发者ID:Brado231,项目名称:Faderport_XT,代码行数:55,


示例18: NPServerDialog

bool8 NPServerDialog (void){	OSStatus	err;	IBNibRef	nibRef;	npserver.dialogcancel = true;	err = CreateNibReference(kMacS9XCFString, &nibRef);	if (err == noErr)	{		WindowRef	tWindowRef;		err = CreateWindowFromNib(nibRef, CFSTR("ClientList"), &tWindowRef);		if (err == noErr)		{			EventHandlerRef		eref;			EventLoopTimerRef	tref;			EventHandlerUPP		eventUPP;			EventLoopTimerUPP	timerUPP;			EventTypeSpec		windowEvents[] = { { kEventClassCommand, kEventCommandProcess      },												   { kEventClassCommand, kEventCommandUpdateStatus } };			HIViewRef			ctl;			HIViewID			cid = { 'Chse', 0 };			npserver.dialogprocess = kNPSDialogInit;			eventUPP = NewEventHandlerUPP(NPServerDialogEventHandler);			err = InstallWindowEventHandler(tWindowRef, eventUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) tWindowRef, &eref);			timerUPP = NewEventLoopTimerUPP(NPServerDialogTimerHandler);			err = InstallEventLoopTimer(GetCurrentEventLoop(), 0.0f, 0.1f, timerUPP, (void *) tWindowRef, &tref);			HIViewFindByID(HIViewGetRoot(tWindowRef), cid, &ctl);			HIViewSetVisible(ctl, false);			MoveWindowPosition(tWindowRef, kWindowServer, false);			ShowWindow(tWindowRef);			err = RunAppModalLoopForWindow(tWindowRef);			HideWindow(tWindowRef);			SaveWindowPosition(tWindowRef, kWindowServer);			err = RemoveEventLoopTimer(tref);			DisposeEventLoopTimerUPP(timerUPP);			err = RemoveEventHandler(eref);			DisposeEventHandlerUPP(eventUPP);			CFRelease(tWindowRef);		}		DisposeNibReference(nibRef);	}	return (!npserver.dialogcancel);}
开发者ID:OV2,项目名称:snes9x-libsnes,代码行数:55,


示例19: main

int main(int argc, char* argv[]){    IBNibRef 		nibRef;    WindowRef 		window;    HIViewRef		textView;	OSStatus		err;    // Create a Nib reference passing the name of the nib file (without the .nib extension)    // CreateNibReference only searches into the application bundle.    err = CreateNibReference(CFSTR("main"), &nibRef);    require_noerr( err, CantGetNibRef );        // Once the nib reference is created, set the menu bar. "MainMenu" is the name of the menu bar    // object. This name is set in InterfaceBuilder when the nib is created.    err = SetMenuBarFromNib(nibRef, CFSTR("MenuBar"));    require_noerr( err, CantSetMenuBar );        // Then create a window. "MainDocumentWindow" is the name of the window object. This name is set in     // InterfaceBuilder when the nib is created.    err = CreateWindowFromNib(nibRef, CFSTR("MainDocumentWindow"), &window);    require_noerr( err, CantCreateWindow );    // We don't need the nib reference anymore.    DisposeNibReference(nibRef);	// Make the window's content area transparent	err = MakeWindowTransparent(window);    require_noerr( err, CantMakeWindowTransparent );	// Get a reference to the TextView in the main window	err = HIViewFindByID(HIViewGetRoot(window), gTextViewID, &textView);	require_noerr( err, CantGetTextView );	// Install our default options in the TextView	err = MySetTextViewOptions(textView);	require_noerr( err, CantSetTextViewOptions );	// Make the TextView partially transparent	err = TextViewSetAlpha(textView, 0.25);	require_noerr( err, CantSetTextViewOptions );	    // The window was created hidden so show it.    ShowWindow( window );    // Call the event loop    RunApplicationEventLoop();CantSetTextViewOptions:CantGetTextView:CantMakeWindowTransparent:CantCreateWindow:CantSetMenuBar:CantGetNibRef:	return err;}
开发者ID:fruitsamples,项目名称:HITextViewDemo,代码行数:55,


示例20: GetTextViewFromWindow

OSStatusGetTextViewFromWindow( WindowRef window, HIViewRef& textView ){	OSStatus status = paramErr;	if( window != NULL )	{		status = HIViewFindByID(HIViewGetRoot(window), kTextViewControlID, &textView);		check_noerr( status );	}	return status;}
开发者ID:arnelh,项目名称:Examples,代码行数:11,


示例21: GetValue

//-----------------------------------------------------------------------------------//	ValueChanged//-----------------------------------------------------------------------------------void TMultiPane::ValueChanged(){	HIViewRef subPane;	SInt32 value = GetValue();	SInt32 min = GetMinimum();	SInt32 max = GetMaximum();	for (SInt32 i = min; i <= max; ++i) {		HIViewID id = { kSubPanelSignature + mID, i };		OSStatus result = HIViewFindByID(GetViewRef(), id, &subPane);		if (result == noErr) {			HIViewSetVisible( subPane, false);                }	}	HIViewID id = { kSubPanelSignature + mID, value };	OSStatus result = HIViewFindByID(GetViewRef(), id, &subPane);	if (result == noErr) {		HIViewSetVisible( subPane, true);        }  	Invalidate();}
开发者ID:osoumen,项目名称:SFCEcho,代码行数:24,


示例22: InstallWindowEventHandlers

staticOSStatus InstallWindowEventHandlers( WindowRef windowRef ){	static const EventTypeSpec 	inputEventSpec[] = { 		{ kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } };			static const EventTypeSpec	windowEventSpec[] = {		{ kEventClassWindow, kEventWindowClosed },		{ kEventClassWindow, kEventWindowBoundsChanged } };	static const EventTypeSpec	viewEventSpec[] = {		{ kEventClassControl,	kEventControlDraw } };	OSStatus 			err;	DrawContextStruct	*newContext;	// allocate a new draw context	newContext = calloc( 1, sizeof( DrawContextStruct ) );	require_action( newContext != NULL, InstallWindowEventHandlers_err,		err = paramErr );		HIViewFindByID(HIViewGetRoot(windowRef), myHIViewID, &newContext->viewRef);	newContext->windowRef = windowRef;			// install a key event handler	err = InstallWindowEventHandler( windowRef, NewEventHandlerUPP( HandleKeyEvent ), GetEventTypeCount( inputEventSpec ), inputEventSpec, (void *) newContext, NULL );	require_noerr( err, InstallWindowEventHandlersEvent_err );		// install a general window event handler	err = InstallWindowEventHandler( windowRef, NewEventHandlerUPP( HandleWindowEvent ), GetEventTypeCount( windowEventSpec ), windowEventSpec, (void *) newContext, NULL );	require_noerr( err, InstallWindowEventHandlersEvent_err );		// install handler for the HI view	err = HIViewInstallEventHandler( newContext->viewRef, NewEventHandlerUPP( HandleViewEvent ), GetEventTypeCount( viewEventSpec ), viewEventSpec, (void *) newContext, NULL);	require_noerr( err, InstallWindowEventHandlersEvent_err );		// also, set the context as the window refcon	SetWRefCon( windowRef, (SRefCon) newContext );	return noErr;	InstallWindowEventHandlersEvent_err:	// make sure that if we're bailing to get rid of the allocated buffer	free( newContext );InstallWindowEventHandlers_err:		return err;}
开发者ID:fruitsamples,项目名称:ATSUIDirectAccessDemo,代码行数:52,


示例23: AutofireSliderActionProc

static pascal void AutofireSliderActionProc (HIViewRef slider, HIViewPartCode partCode){	HIViewRef	ctl;	HIViewID	cid;	char		num[10];	GetControlID(slider, &cid);	cid.signature = 'Num_';	HIViewFindByID(HIViewGetSuperview(slider), cid, &ctl);	sprintf(num, "%ld", GetControl32BitValue(slider));	SetStaticTextCStr(ctl, num, true);}
开发者ID:OV2,项目名称:snes9x-libsnes,代码行数:13,


示例24: AutofireReadAllSettings

static void AutofireReadAllSettings (int player, HIViewRef parent){	HIViewRef	ctl;	HIViewID	cid;	char		num[10];	AutofireReadSetting(player * 1,    autofireRec[player - 1].buttonMask, parent);	AutofireReadSetting(player * 11,   autofireRec[player - 1].toggleMask, parent);	AutofireReadSetting(player * 111,  autofireRec[player - 1].tcMask,     parent);	AutofireReadSetting(player * 1111, autofireRec[player - 1].invertMask, parent);	cid.id = player;	cid.signature = 'Num_';	HIViewFindByID(parent, cid, &ctl);	sprintf(num, "%ld", autofireRec[player - 1].frequency);	SetStaticTextCStr(ctl, num, false);	cid.signature = 'Slid';	HIViewFindByID(parent, cid, &ctl);	SetControl32BitValue(ctl, autofireRec[player - 1].frequency);}
开发者ID:OV2,项目名称:snes9x-libsnes,代码行数:22,


示例25: InputRateSliderActionProc

static pascal void InputRateSliderActionProc (HIViewRef slider, HIViewPartCode partCode){	HIViewRef	ctl;	HIViewID	cid;	char		num[10];	cid.signature = 'snd_';	cid.id = iNibSInputRateText;	HIViewFindByID(HIViewGetSuperview(slider), cid, &ctl);	sprintf(num, "%ld", GetControl32BitValue(slider));	SetStaticTextCStr(ctl, num, true);}
开发者ID:libretro,项目名称:snes9x,代码行数:13,


示例26: HIViewFindByID

//-----------------------------------------------------------------------------------//	Draw//-----------------------------------------------------------------------------------//	The fun part of the control//void TMultiPane::Draw(					  RgnHandle				inLimitRgn,					  CGContextRef			inContext ){    bool compositing = (inContext != 0);	if (!compositing) {            HIViewRef subPane;            TViewNoCompositingCompatible::Draw(inLimitRgn,inContext); // For background handling		// First look for 9999 : this is our background if we have one		HIViewID id = { kSubPanelSignature + mID, 9999 };		OSStatus result = HIViewFindByID(GetViewRef(), id, &subPane);		if (result == noErr) {			Draw1Control( subPane);		} else {			// Else, redraw just the subpane			HIViewID id = { kSubPanelSignature + mID, GetValue() };			OSStatus result = HIViewFindByID(GetViewRef(), id, &subPane);			if (result == noErr) {				Draw1Control( subPane);			}		}	}}
开发者ID:osoumen,项目名称:SFCEcho,代码行数:28,


示例27: AutofireWriteAllSettings

static void AutofireWriteAllSettings (int player, HIViewRef parent){	HIViewRef	ctl;	HIViewID	cid;	AutofireWriteSetting(player * 1,    &(autofireRec[player - 1].buttonMask), parent);	AutofireWriteSetting(player * 11,   &(autofireRec[player - 1].toggleMask), parent);	AutofireWriteSetting(player * 111,  &(autofireRec[player - 1].tcMask),     parent);	AutofireWriteSetting(player * 1111, &(autofireRec[player - 1].invertMask), parent);	cid.id = player;	cid.signature = 'Slid';	HIViewFindByID(parent, cid, &ctl);	autofireRec[player - 1].frequency = GetControl32BitValue(ctl);}
开发者ID:OV2,项目名称:snes9x-libsnes,代码行数:15,


示例28: HandleStarFrameBoundsChanged

/*	Ask the content view for its frame metrics then position the content	view based on those metrics.*/OSStatus HandleStarFrameBoundsChanged(	EventHandlerCallRef inCallRef,	EventRef inEvent,	StarFrameData* frameData){	OSStatus retVal = eventNotHandledErr;	HIViewRef contentView = NULL;	// If we can find our content view change it to match the new bounds	verify_noerr(HIViewFindByID(frameData->hiSelf, kHIViewWindowContentID, &contentView));	if(NULL != contentView) {		retVal = PositionContentViewWithMetrics(frameData->hiSelf, contentView);	}	return retVal;}
开发者ID:fruitsamples,项目名称:StarMenu,代码行数:20,


示例29: LittleArrowsActionProc

static pascal void LittleArrowsActionProc (HIViewRef arrows, HIViewPartCode partCode){	HIViewRef	ctl;	HIViewID	cid = { 'msc2', iNibMTurboSkipText };	char		num[8];	if (partCode == kControlUpButtonPart)		SetControl32BitValue(arrows, GetControl32BitValue(arrows) + 1);	else	if (partCode == kControlDownButtonPart)		SetControl32BitValue(arrows, GetControl32BitValue(arrows) - 1);	HIViewFindByID(HIViewGetSuperview(arrows), cid, &ctl);	sprintf(num, "%ld", GetControl32BitValue(arrows));	SetStaticTextCStr(ctl, num, true);}
开发者ID:libretro,项目名称:snes9x,代码行数:16,


示例30: DBItemNotificationCallBack

static pascal void DBItemNotificationCallBack (HIViewRef browser, DataBrowserItemID itemID, DataBrowserItemNotification message){	OSStatus	err;	HIViewRef	ctl;	HIViewID	cid = { kDelButton, 0 };	ItemCount	selectionCount;	switch (message)	{		case kDataBrowserSelectionSetChanged:			HIViewFindByID(HIViewGetRoot(wRef), cid, &ctl);			err = GetDataBrowserItemCount(browser, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, &selectionCount);			if (selectionCount == 0)				err = DeactivateControl(ctl);			else				err = ActivateControl(ctl);	}}
开发者ID:libretro,项目名称:snes9x,代码行数:19,



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


C++ HIWORD函数代码示例
C++ HIP_DEBUG函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。