Silverfrost Forums

Welcome to our forums

Another ClearWin+ beta

23 Jun 2013 9:40 #12458

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

23 Jun 2013 10:55 #12459

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.

23 Jun 2013 1:49 #12460

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:

[URL=http://imageshack.us/photo/my-images/203/kxpb.png/]http://imageshack.us/scaled/thumb/203/kxpb.png[/URL]

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

23 Jun 2013 3:13 #12461

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

23 Jun 2013 3:36 #12462

Paul,

it also seems, that the character ^ isn't working in the character string of %`mn. CHAR(9) ist working well.

Detlef

24 Jun 2013 7:23 #12465

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.

24 Jun 2013 8:13 #12468

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

24 Jun 2013 8:38 #12469

I think I see it now.

The old enhanced menus (%mn and %pm) can be replaced but they have their limitations.

24 Jun 2013 10:40 #12471

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

24 Jun 2013 11:17 #12473

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:

       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

24 Jun 2013 11:24 #12474

Detlef

When I have finished (hopefully later today) you will be able to change %mn and %pm menus on the fly (with or without %em). Also you can now use UTF-8 characters for non-ASCII text with a call to enable_utf8@(1).

24 Jun 2013 5:28 #12475

Hi Eddie,

this is exactly what I'm doing. But the user can change the language from a configuration menu and all the menus are updated to the new language by calling REPLACE_ENHANCED_MENU@ on the fly. You can check this by downloading and installing my program NETDRAW (a graphical editor for electrical networks and controllers) from www.netdraw.de.

Detlef

24 Jun 2013 5:29 #12476

Hi Paul,

this sounds very good. I will try it as soon as the new version will be available.

Detlef

24 Jun 2013 6:05 #12477

I have uploaded a new beta with two fixes and some new features that are described in the enclosed enh file.

26 Jun 2013 7:05 #12496

Paul,

the following menu string leads to a problem:

      RC=WINIO@('%em[W8]&')
      RC=WINIO@('%mn[Edit[Undo (Delete/Move)]]',M_UNDO)

The slash in the menu string lets Clearwin search for an icon 'Undo (Delete'.

Without %em it is working well.

Detlef

26 Jun 2013 1:15 #12498

If you need to use the slash as a character then we need a way around this. Any suggestions? A double slash is already in use.

26 Jun 2013 1:22 #12499

I have upload another beta update of salflibc.dll.

This one introduces another significant new feature so it should be considered as experimental. Make sure you have a backup before replacing the DLL.

I have introduced another format code (%nw) and this allows you to update existing menus. It also allows you to attach popup menus to given controls.

26 Jun 2013 1:28 #12500

Hi Paul,

maybe a backslash for the separation of icon name and menu string would have been better. Since it is still a beta version this change could be possible?

Detlef

26 Jun 2013 1:40 #12501

I think that I can probably remove the failure message and use the string when the icon resource cannot be found.

26 Jun 2013 2:14 #12502

I have made this change and done another beta upload.

Please login to reply.