SlickEdit Product Discussion > SlickEdit User Macros

SymHighlights GUI

(1/7) > >>

jporkkahtc:
I've enhanced SymHighlight to include a UI that displays the set of highlighted words.
Each line has 2 check boxes: Enable and WordOnly.
WordOnly lets you set for each highlight if it should match a word exactly, or any match.


SymHighlight.e is heavily modified from the original by marksun.




I don't really know how to distribute this easily.
I've included a zip with several *.e files.




HighlightsDlgDef.e: This is the dialog definition. Normally it would be in your "vusrobjs.e" file.




To install:
Extract all the files to your slick config directory.
From the slick command line, run "HighlightsDlgDef.e" to install the dialog definition.
Then use Macro->Load Module on each of:

* [size=78%]SymHighlightJOE.e[/size]
* [size=78%]colorDistance.e[/size]
* [size=78%]HighlightDialog.e[/size]Then bind the commands

* [size=78%]CycleSymHighlight[/size]
* [size=78%]ToggleSymHighlight[/size]
* [size=78%]ClearAllSymHighlight[/size]to keys as you would with SymHighlight.e


To open the dialog, run the command
  run_highlights

at5dapa1:
Thank you for this beautiful macro.
In case you have not updated in the meantime I have few tips for:

* for "TODO: Add new item" in ctl_new_button.lbutton_up():

--- Code: ---static int dummyIndex = 0;
void ctl_new_button.lbutton_up()
{
    WordInfo wordSymDummy;
    // 139 is the nr of s_symColour elements from SymHighlightJOE.e
    wordSymDummy.m_Color = dummyIndex % 139;
    wordSymDummy.m_Enabled = true;
    wordSymDummy.m_WordMatch = true;
    wordSymDummy.m_Word = "text" :+ dummyIndex++;
    AddHighlightWord(wordSymDummy);
}

--- End code ---

    - The dummyIndex can be re-zeroed in a separate DoClearDialog() method called from ClearAllSymHighlight().

* add a dummy Close button in the dialog with p_cancel=true; so that it can be dismissed via Esc key.

* add an alternate name to your exported commands, e.g. quick_SymHighlights_Toggle, quick_SymHighlights_Cycle, quick_SymHighlights_ClearAll, quick_SymHighlights_ShowDlg, so that it's easier to access them via command line.
Then also a code like below can help the user to quickly set some shortcuts to them:

--- Code: ---// set shorcut keys in SlickEdit
_command void quick_SymHighlightsSetSEKeys() name_info(','VSARG2_EDITORCTL|VSARG2_MACRO)
{
  gui_bind_to_key("quick-SymHighlights-");
}

--- End code ---

Clark:

--- Quote from: jporkkahtc on June 26, 2015, 06:57:42 am ---I don't really know how to distribute this easily.
I've included a zip with several *.e files.

--- End quote ---
There isn't a great way to package macros right now. The current plan is to support macro plugins for v22 (not v21 which is the next major release).

hs2:
As workaround a hotfix package could be used. HS2

jporkkahtc:
Thanks for the tips.
I've not worked on this for awhile, but I have plans to, so I will try to incorporate these changes.
I was motivated to write this while I needed to work with some horrible log files for debugging  - something I've not been doing much of lately.



Navigation

[0] Message Index

[#] Next page

Go to full version