AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Menu Customization Example

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
keith



Joined: 05 Dec 2010
Posts: 9

PostPosted: Wed Dec 08, 2010 2:25 am    Post subject: Menu Customization Example Reply with quote

Hello All,

The plugin documentation mentions that you can rebuild the entire main menu but does not provide an example for doing this. I have decided to post my customized menu for anyone else that might be looking to do this too.

BTW - If anyone knows how to display the hotkeys associated to a menu function I would be interested. I can put the text there but it does not line up the way the user would expect. I also tried using the "\t" sequence but that did not work either.

Code:
CLEAR
"&File" Index(0)
{
   "&New" Command(4101)
   "New &Window" Command(4102)
   "&Open..." Command(4103)
   "&Revert" Command(4104)
   SEPARATOR
   "&Save" Command(4105)
   "Save &As..." Command(4106)
   SEPARATOR
   "Pa&ge Setup..." Command(4107)
   "Print Pre&view..." Command(4114)
   "&Print..." Command(4108)
   SEPARATOR
   "Recent &Files"
   {
      RECENTFILES
      SEPARATOR
      "&Clear Missing Files" Command(5001)
   }
SEPARATOR
"E&xit" Command(4109)
}
"&Edit" Index(1)
{
   "U&ndo" Command(4151)
   "R&edo" Command(4152)
   SEPARATOR
   "&Cut" Command(4153)
   "C&opy" Command(4154)
   "&Paste" Command(4155)
   "Select &All" Command(4157)
   SEPARATOR
   "&Find..." Command(4158)
   "Find Next Do&wn" Command(4159)
   "Find Next &Up" Command(4160)
   "&Replace..." Command(4161)
   "&Go To..." Command(4162)
   SEPARATOR
   "Data"
   {
      "Remove Duplicate &Lines" Call(Lines::RemoveDuplicates)
      "&Reverse Sorting" Call(Lines::Reverse)
      "&Sort Ascending" Call(Lines::SortStrAsc)
      "Sort &Descending" Call(Lines::SortStrDesc)
      "Sort On 1st &Number (Asc)" Call(Lines::SortIntDesc)
      "Sort On &1st Number (Des)" Call(Lines::SortIntDesc)
   }   
   "Insert C&haracter" Command(4163)
   "Insert Da&te" Command(4183)
   "&Selection"
   {
      "Columnar Paste" Command(4192)
      "Ta&b Indent" Command(4165)
      "&Tab Unindent" Command(4167)
      "Spa&ce Indent" Command(4169)
      "Sp&ace Unindent" Command(4171)
      "Delete &First Char" Command(4173)
      "Trim Trailing &Whitespace" Command(4174)
      SEPARATOR
      "&Uppercase" Command(4175)
      "&Lowercase" Command(4176)
      "Se&ntence Case" Command(4177)
      "Title &Case" Command(4178)
      "In&vert Case" Command(4179)
      SEPARATOR
      "Change Codepage..." Command(4182)
   }
   "Newline &format"
   {
      "DOS/Windows (CRLF)" Command(4184)
      "Unix (LF)" Command(4185)
      "Mac (CR)" Command(4186)
   }
   "Harden Word Wrap" Call(Lines::FixWrap)
}
"&View" Index(2)
{
   "&Word Wrap" +Command(4209)
   "Syntax &Highlighting" +Call("Coder::HighLight") Icon("%a\AkelFiles\Plugs\Coder.dll", 0)
   "Code &Folding" +Call("Coder::CodeFold") Icon("%a\AkelFiles\Plugs\Coder.dll", 1)
   "Special Characters" +Call("SpecialChar::Main") Icon("%a\AkelFiles\Plugs\SpecialChar.dll", 0)
   "Text Size &+" Command(4204)
   "Text Size &-" Command(4205)
   SEPARATOR
   "&Bookmarks" Icon("%a\AkelFiles\Plugs\LineBoard.dll", 0)
   {
      "Enable" +Call("LineBoard::Main")
      SEPARATOR
      "Next bookmark" Call("LineBoard::Main::NextBookmark")
      "Previous bookmark" Call("LineBoard::Main::PrevBookmark")
      SEPARATOR
      "Set Bookmark" Call("LineBoard::Main::SetBookmark")
      "Delete Bookmark" Call("LineBoard::Main::DelBookmark")
      "Delete All Bookmarks" Call("LineBoard::Main::DelAllBookmark")
      SEPARATOR
      "Settings..." Call("LineBoard::Settings")
   }   
   "&Explorer Bar" +Call("Explorer::Main") Icon("%a\AkelFiles\Plugs\Explorer.dll", 0)
   "He&x Panel" +Call("HexSel::Main")
   "&Status Bar" +Command(4211)
   "Tool Bar" +Call("ToolBar::Main")
   SEPARATOR
   "S&plit window" Command(4212)
   "&Always On Top" +Command(4210)
}
"&Tools" Index(3)
{
   "&Execute" Command(4251)
   "&Plug-Ins..." Command(4259)
   -"Macros..." +Call("Macros::Main") Icon("%a\AkelFiles\Plugs\Macros.dll", 0)
   -"&Scripts..." +Call("Scripts::Main") Icon("%a\AkelFiles\Plugs\Scripts.dll", 0)
   SEPARATOR
   "Statistics..." Call("Stats::Main")
}      
"&Options" Index(4)
{
   "&General..." Command(4260)
   "&Font..." Command(4201)
   "&Colors..." Command(4202)
   "&Programming..." Call("Coder::Settings") Icon("%a\AkelFiles\Plugs\Coder.dll", 0)
   "&Special Characters..." Call("SpecialChar::Settings") Icon("%a\AkelFiles\Plugs\SpecialChar.dll", 0)
   SEPARATOR
   "Read Only" Command(4216)
   "Keep Left Spaces" Command(4254)
   "Watch File Change" Command(4253)
   "Preserve File Time" Command(4252)
   "Don't Open A File Twice" Command(4255)
   "Don't Open Program Twice" Command(4256)
   SEPARATOR
   "&Window mode"
   {
      "&Single-window (SDI)" Command(4261)
      "&Multi-window (MDI)" Command(4262)
      "&Pseudo multi-window (PMDI)" Command(4263)
   }
}
"&Help" Index(5)
{
   "User Manual" Exec("HH.exe %a\AkelPad4-Eng.chm")
   "Plug-in Manual" Exec("HH.exe %a\Plugins-Eng.chm")
   SEPARATOR
   "&About" Command(4351)
}


I pretty much run mine in SDI mode so I removed a lot of the Windows functions but you can easily put those back if you prefer MDI. I also only work with English documents so the language option is also missing.

Hope it helps someone.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5513

PostPosted: Wed Dec 08, 2010 9:03 am    Post subject: Reply with quote

keith
Quote:
I also tried using the "\t" sequence but that did not work either.
Input tab character - in ContextMenu dialog it is inserted with Ctrl+Tab.

Standard main menu with icons available here:
http://akelpad.sourceforge.net/files/plugs/ContextMenu/
Back to top
View user's profile Send private message Send e-mail
keith



Joined: 05 Dec 2010
Posts: 9

PostPosted: Wed Dec 08, 2010 2:36 pm    Post subject: Reply with quote

Thank you for the icon reference it was a big help.

The CTRL+TAB in the ContextMenu dialog did not seem to have any effect. I am using version 4.51, does the newer version support this?
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5513

PostPosted: Wed Dec 08, 2010 2:42 pm    Post subject: Reply with quote

keith
Yes, it should.
Code:
"&New[here press CTRL+TAB]Ctrl+N" Command(4101)
Back to top
View user's profile Send private message Send e-mail
keith



Joined: 05 Dec 2010
Posts: 9

PostPosted: Wed Dec 08, 2010 10:44 pm    Post subject: Reply with quote

Sorry about that, I went back and tried again and it worked.

It is a bit disappointing in that there is no way to save the hotkeys in an easy to read script like the one above. I even looked in the registry and the INI file and it seems that the program reads/saves the menus in binary format. That certainly makes sense from a performance point of view.

I did however find a small bug when working on this project. I was using a clean version of AkelPad and made all of the changes we noted using the ContextMenu dialog. I clicked OK on the dialog and all of the menus looked correct. I then opened settings and changed from registry to INI. The context menu was reverted back to the original. I made some more changes in INI mode and then switched back to registry. When I made the switch back all of my original changes were still there. I guess the settings update is not triggering ContextMenu or perhaps the main program is not dumping the entire registry. Either way I thought you should know.

BTW - The icon for new window is the same as new document. This can be a bit confusing so your users can also use this: Icon("%windir%\system32\shell32.dll", 2)
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2060
Location: Vinnitsa, Ukraine

PostPosted: Wed Dec 08, 2010 11:05 pm    Post subject: Reply with quote

Quote:
I did however find a small bug when working on this project. I was using a clean version of AkelPad and made all of the changes we noted using the ContextMenu dialog. I clicked OK on the dialog and all of the menus looked correct. I then opened settings and changed from registry to INI. The context menu was reverted back to the original. I made some more changes in INI mode and then switched back to registry. When I made the switch back all of my original changes were still there. I guess the settings update is not triggering ContextMenu or perhaps the main program is not dumping the entire registry. Either way I thought you should know.
(Neither AkelPad nor plugins does not dump registry. They are reading settings from it(when settings storage is Registry), and then saving settings there(again only if settings storage is Registry).
When you switching AkelPad from one settings storsge to other(INI->Reg or Reg->INI), AkelPad mark this internally(not writing any data). When AkelPad exits correctly, it saves settings into configured storage.
ContextMenu and other plugins save their settings only when it is necessary: when something changes them(via UI or some internals conditions). So if you want pluings to save settings in newly selected storage you should open their settings UI and apply settings there(just press Ok, not changing anything). If you have not did that and reloaded AkelPad, plugins will try to read their settings from new location which is perhaps old or not exists(default values will be loadad).
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
keith



Joined: 05 Dec 2010
Posts: 9

PostPosted: Fri Dec 10, 2010 12:57 pm    Post subject: Reply with quote

I would then ask that this be turned into a feature request as it is not very intuitive. It is also one thing that could actually anger a customer. In my case it was no big deal but to others moving their settings from one computer to another might be a little upset if not all of their settings were saved.

I think even you have to admit that cycling through all of your plugin settings can be a little tedious.
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2060
Location: Vinnitsa, Ukraine

PostPosted: Fri Dec 10, 2010 2:00 pm    Post subject: Reply with quote

Quote:
I think even you have to admit that cycling through all of your plugin settings can be a little tedious.
Yes, may be it is tedious, but I personally will not support this feature request. I already requested such feature in past, but since I developed my first plugin I have changed my mind.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
keith



Joined: 05 Dec 2010
Posts: 9

PostPosted: Sat Dec 11, 2010 6:28 pm    Post subject: Reply with quote

What if I coded the change for you then? Why are you so opposed to the idea?
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2060
Location: Vinnitsa, Ukraine

PostPosted: Sat Dec 11, 2010 7:31 pm    Post subject: Reply with quote

keith, I cannot explain why in two words. I spent a number of hours developing plugins. I spent a number of hours analysing AkelPad source. And I know one gold rule: if it works then do not touch it without critical necessity. I do not consider your feature request as critical necessity, so will not support.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
VladSh



Joined: 29 Nov 2006
Posts: 2702
Location: ,

PostPosted: Mon Dec 13, 2010 10:06 am    Post subject: Reply with quote

keith wrote:
I think even you have to admit that cycling through all of your plugin settings can be a little tedious.
It's true. I support you.
Back to top
View user's profile Send private message Visit poster's website
warnercraft
Guest





PostPosted: Wed Jul 31, 2013 8:38 pm    Post subject: Custom Menu? Reply with quote

Hello,

I have recenltly started using AP, and know nothing about programming yet.

My primary use for AP was to attempt to automate the word processing of large .txt files I receive almost daily from their strict 80 column format to something much less restrictive.

Did I miss something or is the keyboard command to highlight specific columns (blocks) of text missing from the menus? And can this custom menu correct that?

By mere trial and error, and intuition, the command is Alt-Shift-Left Mouse (and drag to highlight the desired column (block).

Thank You
Back to top
opk44



Joined: 16 Jan 2010
Posts: 366

PostPosted: Wed Jul 31, 2013 11:03 pm    Post subject: Re: Custom Menu? Reply with quote

warnercraft
1) When using the mouse is enough Alt+LMouse (Shift not required)
If you use only the keyboard Alt+Shift+Arrow
And check the word wrap mode is disabled!

2) If you are not afraid to use scripts, then ColumnsDuplicateSelect.js will good for you
Back to top
View user's profile Send private message
warnercraft
Guest





PostPosted: Thu Aug 01, 2013 3:17 pm    Post subject: Reply with quote

Thanks I will try it out.

My dilemma was that I had used AP months ago, quit for the summer. Came back to it and couldnt remember where I saw the command on how to select the column or block., I couldnt find it in any commands menu, only how to paste it. It seemed like an oversight.

We all know Ctrl S saves, Ctrl C copys, and Ctrl Alt Delete ... well.

When do we get a Ctrl-$ to have a million bucks deposited electronically?
Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group