View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Jun 20, 2013 7:10 pm Post subject: |
|
|
Paul,
Now that's what I call truly stunning. I never cease to be amazed at how Clearwin+ makes Windows accessible to Fortran, but every now and again one of the enhancements takes it further in leaps and bounds. I am also impressed with Jalih's contribution to this. A really big Thank You to both of you. It is a small thing, but it makes an application look even more professional.
One thing I discovered while experimenting is that when you separate a big menu structure into multiple WINIO@ calls, if you put the beginning of a submenu in a different WINIO@ to the top level menu, Clearwin+ expects a callback for the top level menu, e.g. it is fine with this:
Code: | IA=WINIO@('%em%mn[~Road design[~Road with grid input...,|]]&',
& MGrey, MGrey, cb) |
but if you write:
Code: | IA=WINIO@('%em%mn[~Road design]&', MGrey)
IA=WINIO@('%mn[[~Road with grid input...,|]]&',
& MGrey), cb) |
then it asks for a callback for the top level menu (i.e. the first of these WINIO@s). I stopped experimenting at this point ! No doubt there is some halfway house that is separated but still works.
Eddie |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Jun 20, 2013 7:46 pm Post subject: |
|
|
Drat,
I've found another issue. A submenu item with a sub-sub-menu won't take an icon, and without one, the text is misaligned - but only with [w7] and [w8]. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Fri Jun 21, 2013 7:26 am Post subject: |
|
|
Thanks for the feedback. If you avoid w7 and w8 for now I should be able to provide a fix shortly. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Fri Jun 21, 2013 10:40 am Post subject: |
|
|
I have uploaded another beta that should address the outstanding problem with %em. I have not yet looked at the issue concerning the position of the callback which presumably concerns %mn in general. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Jun 21, 2013 11:01 am Post subject: |
|
|
Yes, the callback issue concerns %mn in general. Whether or not it needs a "fix" is up to you, but I thought it was worth a mention. I have not explored the extents of the issue, because it was straightaway obvious that even providing a "do nothing" callback had the potential to conflict with the automatic behaviour.
For the time being I simply pushed the submenus up a level.
Eddie |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Sun Jun 23, 2013 10:40 am Post subject: |
|
|
At this time I am using %`mn to update menu strings "on the fly" as described for enhanced menus in the FTN95 help by calling REPLACE_ENHANCED_MENU@. I am also using the -bm option for representing bitmap menus.
How to do this with %em?
I succeeded in using icons with %em, but I don't know how to replace the menu string like before.
Detlef |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Sun Jun 23, 2013 11:55 am Post subject: |
|
|
At the moment you cannot replace a %em menu on the fly.
I will take a look to see what would be involved.
You can use the %mn[[*]] feature to add items to the end. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Sun Jun 23, 2013 2:49 pm Post subject: |
|
|
I was going to note that %mn[[*]] was a new one to me, but a bit of hunting in FTN95.CHM finds it documented in "Dynamic menus". I don't think I understood it the first few (hundreds!) of times I read it, but one gets to understand handles better each time!
I do believe that there is a slight transparency or positioning glitch associated with the tick symbol when you have a # menu item:
As %`mn items can have the alternative radio-button form of check box, is this something that could be provided, perhaps with %##mn, instead of a tick? Not that this is a very big need, as if anyone can explain what is the difference, I would find it interesting to know - I see it in some programs, but it seems to do the same job as far as I am concerned.
Eddie |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Sun Jun 23, 2013 4:13 pm Post subject: |
|
|
Paul,
maybe you can create a new option for %`mn:
-ic[MYICON/mytext]
similar to
-bm[MYBITMAP]
This would lead to a minimum of changes in the existing program code.
Detlef |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Sun Jun 23, 2013 4:36 pm Post subject: |
|
|
Paul,
it also seems, that the character ^ isn't working in the character string of %`mn.
CHAR(9) ist working well.
Detlef |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon Jun 24, 2013 8:23 am Post subject: |
|
|
Thanks for the feedback.
Eddie, can you provide more details about the glitch with the tick symbol?
Detlef, I think that I can easily make %mn and %pm editable (so that they can be changed on the fly) but anything else (involving %`mn and %`pm) would be too big a task. This would mean that old %mn and new %em%mn menus could be replaced on the fly (and the same for %pm). This would be quite a nice new feature because it would mean that you could have different popup menus for different controls. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon Jun 24, 2013 9:13 am Post subject: |
|
|
Hi Paul,
In the enlarged image I posted (I screen-dumped the menu, imported it into Paint, cut out the relevant area and put it in a new file, enlarged that to the maximum, re-captured the screen and cut out the relevant bit again), you can see a horizontal line of different coloured pixels above the tick. It is barely perceptible at normal scale. Can you see the image I posted? If not, then you may need to take the link direct to Imageshack. It's a visual glitch, not a programming one.
I have (rightly or wrongly) guessed that this is either (a) misplacing the tick bitmap down by one row of pixels, or (b) having a line of pixels at the top of the tick bitmap with the wrong transparency information. In either case the fix ought to be fairly simple.
Apologies for intervening in the correspondence with Detlef, but aren't %`mn and %`pm already the editable versions of %mn and %pm? (And don't they already allow you to have different popup menus for different controls?)
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon Jun 24, 2013 9:38 am Post subject: |
|
|
I think I see it now.
The old enhanced menus (%`mn and %`pm) can be replaced but they have their limitations. |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Mon Jun 24, 2013 11:40 am Post subject: |
|
|
Hi Paul, hi Eddie,
at the moment I'm using %`mn because my application offers a multilingual user interface for the menus. This is working very well: the user can change the application language on the fly.
Furthermore I have used the -bm option to represent a bitmap with a text (i.e Open File). These are looking ugly, because the menu text has to be included in the bitmap.
Therefore I was very interested in the new %em. Here I can use the ICON and a normal menu text, but I can't change the language on the fly anymore.
My proposal to add a new option -ic for %`mn seems the easiest way to add the new ICON feature without changing to much in my program code.
Detlef |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Mon Jun 24, 2013 12:17 pm Post subject: |
|
|
Hi Detlef, My own method of being "multilingual" is to write separate subroutines or code segments for each case. For one or two options it isn't so bad. For more it is difficult and ugly. You can also splice in sections of text in different languages building up a WINIO@ string using concatenation, for example:
Code: | IF (LANG .EQ. 44) THEN ! UK English
OpenString = 'Open'
FileString='File'
ELSE IF (LANG .EQ. 39) THEN ! Italian
OpenString = 'Apri Cartella'
FileString='File'
etc
IA=WINIO@('%mn['//FileString(1:LEN_TRIM(FileString))//
& '['//OpenString(1:LEN_TRIM(OpenString)) ..... etc |
(This is a badly coded example, but you will get the point, I hope). You could save the strings and their lengths in a file, or in BLOCKDATA in a set of arrays. Finally, there is always %di !!!
Eddie |
|
Back to top |
|
|
|