|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Sep 01, 2011 8:53 pm Post subject: %di, and icons in menus |
|
|
I'm sure that the entry for %di has been refined between when I puzzled over it several versions ago and now. I still can't fathom it out. Probably, it's because I don't have the demonstration codes installed, and don't know how to. And also haven't integrated with Visual Studio either. So, for example, this instruction:
Quote: | Ensure the FTN95 utilities and examples components are installed |
is not particularly helpful!
%di doesn't feature in the alphabetical list of format codes, and several of the useful things found somewhere in the "using dialog resources" section (e.g. that %`ts is possible and useful) doesn't feature in the description of %ts. Other useful things listed here that probably work even without %di are options for %ps and %th, and functions such as the subroutine SET_TOOLTIP_TEXT@ (not listed in the functions reference).
What does however intrigue me is the paragraph:
Quote: | A menu that is defined as a resource can also include small bitmaps. When used, the bitmap replaces the check mark in a menu item and normally has the same size (12x12 pixels for "Small Fonts" display). If the id is the same as the id for a bitmap in the resource then the bitmap is automatically loaded into the item. |
The last sentence here has me completely baffled - maybe all would be clear if I could see an example. However, the preceding sentence suggests that it ought not to be overly difficult to have a straightforward Clearwin function to put a 12x12 pixel icon in a menu - if only I could find out what the menu ID was, and the bitmap ID in my resources section, and then presumably some marriage could be arranged even without the complexities of %di ... and as FTN95 or some bit of it knows both, maybe the function could be:
SET_MENU_BITMAP@ ('%mn[File[Open]]', 'OPEN_BMP')
(just a suggestion!). Alternatively since # triggers recognition that the menu item needs a check mark and a check mark control variable is then required in WINIO@, couldn't another code trigger recognition that an icon is to be used instead, for example using caret (not used in menus) instead:
WR=WINIO@('%mn[File[^Open]&', OPEN_BMP, CALLBACK)
I wonder if there is anyone out there who could let me have the example codes, and if there is anyone out there who has succeeded in putting those bitmaps into menus, especially if this can be done in any way without a resource editor (or perhaps using a freebie from the web) then I'd be interested to hear from them. Indeed, if anyone has actually used %di and can explain it further, then I'd be interested.
Presumably the 12x12 is 75% of the font height in small fonts, so for large fonts it would be 15x15.
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Fri Sep 02, 2011 7:12 am Post subject: |
|
|
If you have installed FTN95 fairly recently then by default you will find the samples in
My Documents\FTN95 Examples\clearwin\di
Please ask again if the samples do not provide all of the answers. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Sep 02, 2011 10:36 am Post subject: |
|
|
They aren't there. I'll find a machine with a clean install of Windows, and install FTN95 to see if the files are created.
Eddie |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Sep 02, 2011 7:56 pm Post subject: |
|
|
Hmmm .... They do go in there in a clean install. But, can I work out what is going on - that may take some time!
E |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Wed Sep 07, 2011 12:41 pm Post subject: |
|
|
I've had a look now. Clearly one needs a resource editor, and there are lots on the web free, as I don't operate Visual Studio. Still, it looks to me that in order to do a simple job of adding a few icons to the menus, I'd need to throw away what I've got already and do it from a resource script. Looks a bit elaborate from me.
However, FTN95 must "know" all the IDs already - so what about the suggestions I made a couple of posts ago for an enhancement to Clearwin?
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed Sep 07, 2011 3:59 pm Post subject: |
|
|
For the most part %di is provided to give accurate positioning when all else fails.
I have not had chance to look at your suggestions in detail yet.
However, adding icons to a standard menu was not a simple extension last time I looked. The code that I wrote in Plato for this purpose is quite complex and is not suited to ClearWin+. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Wed Sep 07, 2011 5:32 pm Post subject: |
|
|
Paul,
My reading of MSDN and elsewhere convinced me already that it wasn't simple (to put an icon against a menu text), but I can't for the life of my see why it should be so. (In order to generate a menu onscreen, Windows must know that the menu "exists", how it is structured, and what the response its to it. Moreover, all we would seem to be telling Windows is: "for this menu, put this bitmap where you would otherwise put a tick" - or maybe "this one if the menu item is not greyed, that one if it is").
Moreover, plenty of the discussion I found on the web takes various different standpoints as to the utility of those icons. For me, they need to be simply an aide memoire as to what toolbar button simplifies the task, so that eventually users don't go for the menu, but use the toolbar.
Windows 7, in particular, appears to have reserved quite a big space in the standard menus for such icons (or ticks), but MS Office with its ribbon means that you don't see classic menus anyway - and some MS applications seem not to use menu icons at all, some make great use. If the menus were still XP style, I wouldn't bother, but in Win 7 style there is a great big empty space for them!
I wasn't looking forward to trying to do a 12x12 bitmap (although what may be a 15x15 for "large fonts" could be easier) for a significant number of options - fortunately, the general web advice seems to be to only do a few.
Anyway, I have somewhat retreated from my ambitions to have them, as clearly none of the other Clearwin users know to do it, or they might have chipped in to this thread - and you (who have done it) say it isn't simple.
Thanks for looking at it.
Eddie |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|