SlickEdit Product Discussion > SlickEdit®
Adding or removing menus and forms exclusively via config files
(1/1)
MC:
I've made a custom form for use within a specific tool bar that I want to distribute to other users for use in their SlickEdits. This tool bar utilizes buttons with custom icon images and new menus being called that the other users don't yet have in their setups.
To make this process as smooth as possible, I'd ideally like to be able to add the data for these new forms, buttons, and menus exclusively via config files so I don't have to manually set things up on each user's SlickEdit. After testing this by modifying the "vusrobjs.e" file in the My SlickEdit Config directory, sometimes the changes took and sometimes they didn't. This makes me think that file is part of the equation but that I'm also missing other necessary steps. Are there other files that would be involved to make this work? I noticed there are the files "userToolbars.xml" and "userMenus.xml" but I'm not sure if those are necessary to update or not. I'd like to get to a point where I could verify that changing the necessary config files updates this toolbar 100% of the time as I'd like after re-starting SlickEdit.
Testing the Export/Import Options from Tools > Options has been unsuccessful as it crashes every time for me so that's not a solution I can consider reliable.
I'm testing this between versions Pro 2021 (v26.0.3.1 64-bit Qt5) and Pro 2020 (v25.0.1.0 64-bit).
Graeme:
Sorry for the late reply. I suspect modifying xml files is not a good idea. You might need to package your stuff as a hotfix. If you have to cope with multiple versions of slickedit it can get even more complicated. I think you can detect the version of slick at runtime but maybe not at compile time, so you could write some slick code that loaded particular files according to the runtime version.
A long time ago I posted some macros that replaced some of the slick built in menus with extra things but the user had to manually set up a #define to indicate the version of slickedit.
--- Code: ---#define SLICK_V13
#ifdef SLICK_V12
_menu _projecttb_folder_menu {
submenu "&More","","","" {
"Add &new file","projecttb-add-new-file-here","","","Add new file to project";
"Add new item from &template","projecttb-add-template-item-here","","","Add item to project from template";
"New &folder","projecttb-add-folder-here","","","Create new folder here";
"&Explore","projecttb-explore-from-here","","","Shell explorer";
"&Open file","projecttb-open-from-here","","","Open file to edit";
"-","","","","";
"She&ll from here","projecttb_shell_from_here","","","Open OS shell";
"Folder &MRU","projecttb-show-folder-MRU","","","";
"Add to folder MR&U","projecttb-add-to-folder-MRU","","","";
"Change &directory to here","projecttb-cd-to-here","","","";
"-","","","","";
"Copy pathname","projecttb-copy-path","","","";
"Copy file pathname","projecttb-copy-filename-full-path","","","";
"-","","","","";
"&Project properties","projecttb-project-properties","","","";
}
submenu "&Add","","Displays Add To Folder menu","ncw" {
"New File...","projecttbAddNewFile","","","";
"Files...","projecttbAddFiles","","","";
"Tree...","projecttbAddTree","","","";
"Wildcard...","projecttbAddWildcard","","","";
"Folder...","projecttbAddFolder","","","";
}
"-","","","","";
"Move &Up","projecttbMoveUp","","","";
"Move &Down","projecttbMoveDown","","","";
"Cut\tCtrl+X","projecttbCut","","","";
"Copy\tCtrl+C","projecttbCopy","","","";
"Paste\tCtrl+V","projecttbPaste","","","";
"Remove\tDel","projecttbRemove","","","";
"-","","","","";
"Folder &Properties...","projecttbFolderProperties","","","";
}
--- End code ---
Navigation
[0] Message Index
Go to full version