home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!usc!cs.utexas.edu!uwm.edu!caen!uvaarpa!concert!samba!usenet
- From: Bathsheba.Grossman@launchpad.unc.edu (Bathsheba Grossman)
- Subject: Re: Menus with another font than Chcago
- Message-ID: <1992Dec18.064817.27264@samba.oit.unc.edu>
- Sender: usenet@samba.oit.unc.edu
- Nntp-Posting-Host: lambada.oit.unc.edu
- Organization: University of North Carolina Extended Bulletin Board Service
- References: <5848@krafla.rhi.hi.is> <1992Dec17.223202.13243@dcs.qmw.ac.uk>
- Date: Fri, 18 Dec 1992 06:48:17 GMT
- Lines: 50
-
- In article <1992Dec17.223202.13243@dcs.qmw.ac.uk> jeremyr@dcs.qmw.ac.uk (Jeremy Roussak;Guest of Distributed Systems Lab) writes:
- >In <5848@krafla.rhi.hi.is> rson@rhi.hi.is (Mimir Reynisson) writes:
- >>How can I let the standard MDEF display it's contents with something
- >>other than Chicago? Geneva 9 to be precise? Is it sufficent
- >>just to change the system font global variable? and then change it
- >>back after PopupSelect?
- >
- >You have to set the font and size you want into the low-memory
- >globals SysFontFam and SysFontSize. Then set LastSPExtra and
- >CurFMInput to -1. Finally, save the txSize field of the
- >WMgrPort (and, if you have colour QD, the WMgrCPort) and set it
- >(them) to zero.
- >
- >Then PopUpMenuSelect.
- >
- >Then restore the txSize fields, restore SysFontFam and
- >SysFontSize and set LastSPExtra and CurFMInput to -1.
-
-
- Is this a joke? Why not just do it the documented way: when creating the
- popup menu, just give it the procID, popupMenuCDEFProc + popupUseWFont =
- 1016. Then set the window or dialog font to whatever floats your boat.
- IM VI, 3-18.
-
- Also, there's been some complaint about the difficulty of writing MDEF's.
- I've found that if you're only trying to add a few pretty dingbats,
- like MSWord's shift characters, you can bypass the nasty bits by calling
- the system MDEF from within your own and then doing the extras on top. So
- something like the following appears in your MDEF:
-
- GetResource('MDEF',textMenuProc); /*get system MDEF*/
- savMDEF = (*theMenu)->menuProc;
- (*theMenu)->menuProc = sysMDEF; /*pass message to it*/
- if (message == mChooseMsg) /*store *which because sysMDEF will mung it*/
- whichCopy = *which;
-
- CallPascal(message,theMenu,menuRect,hitPt,which,*sysMDEF);
- (*theMenu)->menuProc = (Handle)savMDEF; /*and put me back*/
-
-
- Now mSizeMsg can be ignored, you get free balloon help and standard items, and
- you need only draw, highlight, and unhighlight your own features.
-
- -Sheba
-
- --
- The opinions expressed are not necessarily those of the University of
- North Carolina at Chapel Hill, the Campus Office for Information
- Technology, or the Experimental Bulletin Board Service.
- internet: laUNChpad.unc.edu or 152.2.22.80
-