Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > OOP Powerplant for Mac > font panel even...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 409 of 482
Post > Topic >>

font panel event in carbon

by "vcmac" <projectleader@[EMAIL PROTECTED] > Jul 25, 2005 at 01:52 AM

I want  to catch the font panel events in my carbon applications(in
XCode). I tried  with the code given in the xcode documentations but I am
not able to catch the event. I am giving code bellow. Please look at it
and suggest.  regards sanjay   
 // DEFINING EVENT TYPES
const EventTypeSpec events[]= 		{
			{kEventClassFont,kEventFontPanelClosed},
			{kEventClassFont,kEventFontSelection},
			{kEventClassCommand,kEventCommandProcess} 				 		};   // INSTALLING THE
EVENT HANDLLER OSStatus status = InstallWindowEventHandler (window,
NewEventHandlerUPP (MyApplicationEventHandler), 
			GetEventTypeCount(events), events,(void*) window, NULL);  // EVENT
HANDLLER PROC pascal OSStatus MyApplicationEventHandler
(EventHandlerCallRef myHandler,  								EventRef event, void *userData) {
	OSStatus    status = eventNotHandledErr; 	HICommand   command; 	UInt32 
eventClass; 	UInt32  eventKind; 	 	eventClass = GetEventClass(event);  		
	switch (eventClass)  	{ 		case kEventClassCommand :  		{
				GetEventParameter (event, kEventParamDirectObject,  				typeHICommand,
NULL,sizeof (HICommand), NULL, &command); 			 				 switch
(command.commandID) 				 { 					case kHICommandShowHideFontPanel : //
'shfp' 					{ 						status = FPShowHideFontPanel();  						if
(FPIsFontPanelVisible()) 						{ 							 						} 						else  						{
							 						} 						break; 					}	 				} 				break; 		} 		case
kEventClassFont : 		{ 			eventKind  = GetEventKind (event); 			switch
(eventKind) 			{ 				case kEventFontPanelClosed :     				{
					StandardAlert(2,"\p kEventFontPanelClosed",NULL,NULL,0); 					break;
				} 				case kEventFontSelection :      				{ 					StandardAlert(2,"\p
kEventFontSelection",NULL,NULL,0); 					//status = MyGetFontSelection
(event); 					break;  				} 			 } 			break; 		} 		default : 		{ 			 status
= eventNotHandledErr; 			 break; 		} 	} 	return status; }
 




 4 Posts in Topic:
font panel event in carbon
"vcmac" <pro  2005-07-25 01:52:05 
Re: font panel event in carbon
David Phillip Oster <o  2005-07-27 03:45:15 
Re: font panel event in carbon
"vcmac" <pro  2005-08-03 01:19:50 
Re: font panel event in carbon
David Phillip Oster <o  2005-08-04 04:15:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 18:04:14 CDT 2008.