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 > Re: font panel ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 409 of 484
Post > Topic >>

Re: font panel event in carbon

by "vcmac" <projectleader@[EMAIL PROTECTED] > Aug 3, 2005 at 01:19 AM

Sorry, I could  not communicate with you because the NET was down for
couple of days due to torential rains here in Mumbai (India).

I am reposting the same mail with clarity.
 
I want  to catch the font panel events in my carbon applications(in
XCode). I tried  with the code given in the xcode do***entations 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)
{ 			
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 pfclosed",NULL,NULL,0); 
     break; 
    }
   case kEventFontSelection : 
   { 
     StandardAlert(2,"\pselection",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 Tue Oct 7 18:59:34 CDT 2008.