Silverfrost Forums

Welcome to our forums

Another ClearWin+ beta

19 Jun 2013 9:08 #12434

I have uploaded another beta version of salflibc.dll to

http://www.silverfrost.com/beta/salflibc.exe

This is a self-extracting executable that produces three files...

salflibc.dll salflibc.lib and cwplus.enh

At the end of the enh file you will find information on a new format code %em that enables you to add icons to %mn and %pm menu items.

19 Jun 2013 9:51 #12435

Paul,

So this Salflibc.dll also supports the %bb mods too?

If you have %em, you don't need either %mn or %pm?

Congratulations on already addressing w7 & w8 differences.

Eddie

19 Jun 2013 9:58 #12436

Yes, this supports the latest %bb and Yes, %em provides an alternative to %mn and %pm.

19 Jun 2013 6:56 #12439

Paul, All, always provide small few lines example everywhere you can, specifically in cwplus.enh and in Help file. That increases adoption rate by orders of magnitude.

20 Jun 2013 9:16 (Edited: 20 Jun 2013 9:56) #12442

(Edit) Message was incomplete.

20 Jun 2013 9:16 (Edited: 20 Jun 2013 9:56) #12443

(Edit) Message was incomplete

20 Jun 2013 9:19 #12444

Oh dear, posted twice without the full message. Here's the text:

I'm having difficulty with %em. I can confirm that the modifications for %bb work for me. When I try %em, I get an error message that 'Could not find icon resource Road (IP.'. This string does not occur in the code, with or without the final full stop, nor does it occur in the separately compiled resource file. The substrings 'Road' and 'IP' only occur in the last WINIO@ in the code segment above. The error message points at the subroutine where menus are set up, which contains the following code (in fixed format style):

Thinking that perhaps at least one menu item needed an icon, I tried that, but still get the error. Everything works fine without %em. Clearly, %em is intended to work without an icon on every menu item, because that is standard, and if it were the case (that icons were required on all), then I would have expected the error to come up with the first %mn. I have tried it on two separate computers, one running v6.10 and the other the latest FTN95pe. The beta salflibc.dll is in the same directory as the executable.

I get the same result with and without [w7].

It occurs to me that I don't understand what salflibc.lib does. Is my problem this lack of understanding? If so, please help! The beta download salflibc.lib is also in the directory with the sources and executable.

Eddie

20 Jun 2013 9:20 #12445

... and here's the code:

      IA=WINIO@('%em[w7]&')
      IA=WINIO@('%mn[File[~New...'//CHAR(9)//'Ctrl+N,'//
     &                   '~Open...'//CHAR(9)//'Ctrl+O,'//
     &                   '~Close'//CHAR(9)//'Ctrl+X,'//
     &                   '~Save'//CHAR(9)//'Ctrl+S,'//
     &                   '~Save As...'//CHAR(9)//'Ctrl+P,|,'//
     &                   '~Print...,|,Exit]]&',
     &          MY_File_Grey(1),           File_New_FN,
     &          MY_File_Grey(2), 'FILE_OPENR[Open SCAMPS data file]',
     &                                     Filenm,               
     &                                     File_Open_FN,
     &          MY_File_Grey(3),           File_Close_FN,
     &          MY_File_Grey(4),           File_Save_FN,
     &          MY_File_Grey(5),'FILE_OPENW[Save SCAMPS data file]',
     &                                     Filenm, 
     &                                     File_SaveAs_FN,
     &          MY_File_Grey(6),           MY_Print_FN,
     &                                     File_Exit_FN)

      IA=WINIO@('%mn[~Major control[Manual Input...,'//
     &                            '~Import Coords...,|,'//
     &                            '~Lock major control]]&',
     &          Major_Grey(10),
     &                                     Manual_Main_FN,
     &          Major_Grey(2),             Import_Major_FN,
     &          Major_Grey(3),             Lock_Main_FN )


      IA=WINIO@('%mn[~Traverses[~Select traverse...'//CHAR(9)//'Ctrl+T'
     &                        //',|,'//
     &                        '~Edit traverse parameters...,'//
     &                        '~Edit observations...,'//
     &                        '~Calculate and adjust...,'//
     &                        '~Visualise traverse...,'//
     &                        '~View coordinates...,|,'//
     &                        '~Return to map view]]&',
     &          MY_Traverse_Grey(10),
     &          MY_Traverse_Grey(1),       Select_Trav_FN,
     &          MY_Traverse_Grey(2),       Edit_Trav_FN,
     &          MY_Traverse_Grey(3),       AnglesandDists_Trav_FN,
     &          MY_Traverse_Grey(4),       See_Misclosure_FN,
     &          MY_Traverse_Grey(5),       Plot_Trav_FN,
     &          MY_Traverse_Grey(6),       View_Trav_FN,
     &          My_View_Grey(3),           Map_FN)

      IA=WINIO@('%mn[~Road design['//
     &                          '~Road with grid input...,|,'//
     &                          '~Create ends (new road)...,'//
     &                          '~Create IPs...,'//
     &                          '|,~Modify ends...,'//
     &                          '~Modify IPs...,'//
     &                          '|,~Delete IPs,'//
     &                          '~Delete road,'//
     &                          '|,~Set chainage interval...]]&',
     &          MY_Road_Grey(10),
     &          MY_Road_Grey(10),          Road_Grid_FN,
     &          MY_Road_Grey(1),           Road_Input_FN,
     &          MY_Road_Grey(2),           Road_IPs_New_FN,
     &          MY_Road_Grey(3),           Road_Ends_FN,
     &          MY_Road_Grey(4),           Road_IPs_FN,
     &          MY_Road_Grey(5),           DEL_IP_FN,
     &          MY_Road_Grey(6),           DEL_Road_FN,
     &          MY_Road_Grey(7),           Chainage_interval_FN)
20 Jun 2013 9:27 #12446

It looks like something is going wrong with the Fortran concatenation. Somehow %mn is finding a forward slash before the menu item text.

Try creating the whole string separately and print it out to see what it looks like.

By the way, you can now use the character ^ in place of //char(9)//.

20 Jun 2013 9:29 #12447

Paul you got an answer before I could even see it had posted correctly. Is it possible to remove the two failed posts (and this one) or should I go in and edit them shorter?

E

20 Jun 2013 9:58 #12448

No, it doesn't help. I divided the menu item up into sections so as not to have concatenation (as below), with the same effect:

      IA=WINIO@('%mn[~Road design[~Road with grid input...,|]]&', 
     &          MY_Road_Grey(10),  MY_Road_Grey(10),  Road_Grid_FN)
      IA=WINIO@('%mn[[~Create ends (new road)...]]&', 
     &          MY_Road_Grey(1),           Road_Input_FN)
      IA=WINIO@('%mn[[~Create IPs...]]&',
     &          MY_Road_Grey(2),           Road_IPs_New_FN)
      IA=WINIO@('%mn[[|,~Modify ends...]]&',
     &          MY_Road_Grey(3),           Road_Ends_FN)
      IA=WINIO@('%mn[[~Modify IPs...]]&',
     &          MY_Road_Grey(4),           Road_IPs_FN)
      IA=WINIO@('%mn[[|,~Delete IPs]]&',
     &          MY_Road_Grey(5),           DEL_IP_FN)
      IA=WINIO@('%mn[[~Delete road]]&',
     &          MY_Road_Grey(6),           DEL_Road_FN)
      IA=WINIO@('%mn[[|,~Set chainage interval...]]&',
     &          MY_Road_Grey(7),           Chainage_interval_FN)

Eddie

20 Jun 2013 11:11 #12449

Ha, recompiled everything, and problem disappeared! It's so long since I had to do something like that I had forgotten that it sometimes works ...

E

20 Jun 2013 11:14 #12450

I don't have administrator access to the forum so the easiest way is for you to edit and shorten the posts.

Your sample works OK for me. Here is my program...

      winapp
      program main
      integer ia,winio@
      integer MY_Road_Grey(20)
      integer,external:: cb
      MY_Road_Grey = 1
      IA=WINIO@('%em%mn[~Road design[~Road with grid input...,|]]&', 
     &          MY_Road_Grey(10),  MY_Road_Grey(10),  cb) 
      IA=WINIO@('%mn[[~Create ends (new road)...]]&', 
     &          MY_Road_Grey(1),           cb) 
      IA=WINIO@('%mn[[~Create IPs...]]&', 
     &          MY_Road_Grey(2),           cb) 
      IA=WINIO@('%mn[[|,~Modify ends...]]&', 
     &          MY_Road_Grey(3),           cb) 
      IA=WINIO@('%mn[[~Modify IPs...]]&', 
     &          MY_Road_Grey(4),           cb) 
      IA=WINIO@('%mn[[|,~Delete IPs]]&', 
     &          MY_Road_Grey(5),           cb) 
      IA=WINIO@('%mn[[~Delete road]]&', 
     &          MY_Road_Grey(6),           cb) 
      IA=WINIO@('%mn[[|,~Set chainage interval...]]&', 
     &          MY_Road_Grey(7),           cb)
      ia=winio@('%bb[OK]')
      end

      integer function cb()
      cb = 1
      end
20 Jun 2013 12:02 #12451

On further testing I find that your last sample does not work for me with %em[w7] so I will get back to you on this.

20 Jun 2013 4:17 #12452

I have fixed this problem and uploaded a new beta. There is also a new %em option that is described in the enh file.

20 Jun 2013 6:10 #12453

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:

      IA=WINIO@('%em%mn[~Road design[~Road with grid input...,|]]&', 
     &          MGrey,  MGrey,  cb)

but if you write:

      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

20 Jun 2013 6:46 #12454

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].

21 Jun 2013 6:26 #12455

Thanks for the feedback. If you avoid w7 and w8 for now I should be able to provide a fix shortly.

21 Jun 2013 9:40 #12456

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.

21 Jun 2013 10:01 #12457

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

Please login to reply.