SlickEdit Community
SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: Graeme on October 15, 2007, 08:52:52 PM
-
Hi
Attached is some code for a list manager I've written. I renounce all copyright statements in it or any other code I've posted on this forum - you can use it freely.
I don't have time to describe it fully right now but you can figure out most things by trying it and looking at the code - roughly, it allows you to create named lists of files. A shortcut key can be assigned to a file. The lists are stored in an xml file - multiple lists per file. You can also have multiple xml files - selected by the "switch master" button. Shortcut keys can be one-key or two-key sequences. For the two-key sequence, you assign the first of the keys to GFM_two_key_check_shortcut_keys() and the second key you assign using the listman dialog itself. For a one-key sequence you assign the key (or multiple keys) to GFM_check_shortcut_keys() and also assign it to the particular file you want opened using the listman dialog itself.
The idea is that even though a slick project allows you to have a list of files, you have to have the project active to use the list - whereas listman is independent of any project and allows you to create a named list of files that you can select from at any time. You'll need to check the code to see what keys do what - down-arrow, up-arrow move up down the list of files and ctrl-up, ctrl-down move up down the list of lists.
The code has been working well for me for a while but a couple of things aren't implemented - the 3 check buttons you'll see, and the "projects" radio button, also the combo box labelled F9.
The ListmanConfig code might be useful - it allows you to create your own config dialog. You can add a new config item in 4 easy steps - add the struct item (e.g. see Listman_persistent_config_data), add the widget to the dialog, add a MAKE_CONFIG_FUNC line, add a line to call_config_funcs().
I'll try to update this later.
[update] - forgot to mention, you need to create a folder called Listman\ListDataFiles\ in your config folder, to hold the xml list files - it's not auto-created. Also, you can click on any of the headings in the "file-list" view to sort the list of files - this uses a hidden column zero in the tree-view to get the desired sorting.
Graeme
-
Oops, forgot some bitmaps are needed too.
Attached is a bitmaps folder which should be placed as a sub-folder of a GFileman folder which is in your config folder.
The attached zip file includes the latest GFileman toolbar code - it is slightly better organized now and also includes the ability to show the shortcut key assigned to a file (if any) by Listman. GFileman also provides multiple GFileman windows - one of which can be used as a temporary popup window that shows you the list of currently active shortcut keys, then disappears when you choose one using the kotkey - in the GFileman config dialog, this is selected by checking "show shortcuts on demand". The GFilemanForms.e file provided, includes 3 GFileman forms - GFileman1, GFileman2, GFileman3 - it's not hard to add more. You need to associate a form with a toolbar (see view->toolbars->customise->new).
In Listman GFM_two_key_check_shortcut_keys() there is a call-list
call_list('_listman_key2', keyt);
and in GFileman.e there is _listman_key1_GFileman() which pops up a temporary GFileman window to show the list of current shortcuts - if you want the window to stay up instead of dying, click the mouse somewhere on it.
[Edit] - actually there is both call_list('_listman_key1'); and the one above. "key1" job is to show the form, "key2" job is to delete it.
The attached GFileman code has some other improvements
- on the config dialog there is an "update now" button that allows changes to fonts etc to be seen immediately
- the "hint" info-window now works correctly - previously a Z-order issue made it appear all purple with no info - now it uses a picture component (I think).
- There's now an _on_load_module_GFileman() function which kills the callback timer whe GFileman is loaded.
- GFileman_timer_callback now checks the global flag _use_timers and exits immediately if it's true.
- code that generates the underlying display data is now all in the one place, starting with generate_display_list_data() and ending with process_listviewx_right_mouse_click() - a class mechanism would have been nice for this.
Haven't fixed up the funny scrollbar coz I don't use it much - I usually have the window set to two columns and pop it up using the command GFM_filename_entry_mode. See also my earlier post from last year for the original GFileman code. Haven't got round to all of Dennis's suggestions yet, but one day...
Graeme
[Edit] - here's the link to the original GFileman posting
http://community.slickedit.com/index.php?topic=589.msg2575#msg2575 (http://community.slickedit.com/index.php?topic=589.msg2575#msg2575)
-
Thanks ... i think i will try it and if mayend up part of my SE : ) thanks
-
Here's a version that works with SE2008. I had to change it because of a change in the tree control. I plan to do some more work on it soon. I probably didn't explain how to use it very well. One thing I should have mentioned was that to bring up the dialog itself, you can assign a key (using slick key bindings dialog) to GFM_two_key_check_shortcut_keys() - then if you press that key twice, it brings up the listman dialog. I'll post a better description with the next version.
Graeme