Author Topic: Edit and load vusrs15.0.0.6i.e  (Read 4083 times)

SJA

  • Community Member
  • Posts: 17
  • Hero Points: 0
Edit and load vusrs15.0.0.6i.e
« on: June 11, 2010, 03:39:01 pm »
I made substantial additions to _mdi_menu in an earlier version of SickEdit.  I want to cut and paste them into vusrs15.0.0.6i.e and then activate them.  I can't use "Load Module" because the file ends with defmain().  I've done this before, a long time ago, but I don't remember how.

hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 288
Re: Edit and load vusrs15.0.0.6i.e
« Reply #1 on: June 11, 2010, 08:05:06 pm »
I think you can just invoke it on SE cmdline b/c it's a 'batch macro' module.
Maybe check the docs for defmain/batch macros.
Good luck, HS2

SJA

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Edit and load vusrs15.0.0.6i.e
« Reply #2 on: June 15, 2010, 04:33:58 pm »
Thanks for the suggestion.  That did compile vusrs15.0.0.6i but it didn't add the menu entries to _mdi_menu.

Graeme

  • Senior Community Member
  • Posts: 2274
  • Hero Points: 294
Re: Edit and load vusrs15.0.0.6i.e
« Reply #3 on: August 14, 2010, 02:51:03 am »
Thanks for the suggestion.  That did compile vusrs15.0.0.6i but it didn't add the menu entries to _mdi_menu.

Did you figure this out?

I just did some tests.  In the help file on menus, it says you can create a menu in a source file and then "run the macro" to apply the resource change.  It doesn't say what "run the macro" means.  I suspect if you "insert" the mdi menu into a .e source file, edit it then load it using the load command, your changes will take effect.

From testing I found that if you edit the mdi menu in vusrs15.0.0.6i.e, then use the menus command on the macro menu and edit the mdi menu, you will see you changes there and if you click ok (you might first have to change something in the menu editor), it will load a new menu with your changes.  This takes immediate effect on the menu bar.

Alternatively, if you edit vusrs15.0.0.6i.e then types its name on the status bar to execute it, slick does execute defmain but because defmain is empty, nothing (much) happens and slick doesn't realise your configuration has changed.  Even if you do save-config, slick won't update your configuration.  To get the configuration change flags set you need to do what vusrobjs.e does and add

Code: [Select]
defmain()
{
   _config_modify_flags(CFGMODIFY_RESOURCE);
}

Then if you run the macro and do save-config, slick will save your changed mdi menu.  However, slick still doesn't change what appears on the actual menu until you close and re-open slick, or you use the menu editor to reload the menu.

I think if you use the load command to load a source file with a menu in it, slick saves the menu source in vusrobjs.e.  Slick also generates a file called userMenus.xml in your configuration folder  - dunno what that's for.

Slick V15 also allows you to export your customised menus in tools -> options -> import/export.  Slick V14 didn't do this.

Graeme

SJA

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Edit and load vusrs15.0.0.6i.e
« Reply #4 on: August 16, 2010, 07:23:38 pm »
Thanks, Graeme.  SlickEdit Support (Ashley) helped me with the defmain() change you suggested.