예제 #1
0
파일: menubar.c 프로젝트: dvincent/frontier
static boolean getmenutobuild (bigstring bsmenu, boolean flhierarchic, short *id, hdlmenu *hmenu, boolean *flbuiltin) {
	
	/*
	5.0a24 dmb: before allocating a new menu, see if we want to 
	build onto a builtin menu
	*/
	
	boolean flinfrontier;

	#ifdef flcomponent
		THz savezone;
		#if TARGET_API_MAC_CARBON == 1
		savezone = LMGetApplZone();
		#else
		 savezone = GetZone ();
		 #endif
		
		#endif
	
	#ifdef MACVERSION
		flinfrontier = iscurrentapplication (langipcself);
	#else
		flinfrontier = true;
	#endif
	
	if (flinfrontier && !flhierarchic && shelltgetmainmenu (bsmenu, hmenu, id)) {
		
		*flbuiltin = true;
		
		#ifdef WIN95VERSION
			// about needs to be last, but resource compiler doesn't allow empty menus
			if (*id == helpmenu)
				deletemenuitem (*hmenu, aboutitem);
		#endif
	
		return (true);
		}
	
	*flbuiltin = false;

	if (*id <= 0) { /*allocate a new menu id*/
		
		if (!meallocmenuid (id))
			return (false);
		}
	
	#ifdef flcomponent
		#if TARGET_API_MAC_CARBON == 1
		//Code change by Timothy Paustian Monday, June 26, 2000 9:29:46 PM
		//This code makes no sense to me.
		LMSetApplZone(LMGetApplZone());
		#else		
		SetZone (ApplicationZone ());
		#endif
		
	#endif
	
	*hmenu = Newmenu (*id, bsmenu);
	
	#ifdef flcomponent
		#if TARGET_API_MAC_CARBON == 1
		LMSetApplZone(savezone);
		#else
		SetZone (savezone);
		#endif
		
		
	#endif
	
	return (hmenu != nil);
	} /*getmenutobuild*/
예제 #2
0
long MaxBlock(void)
{
	return LMGetApplZone()->minCBFree;
}