CambridgeSoft   Schrodinger   CrystalMaker   EndNote   Systat 
  ´º½º     ¼ÒÇÁÆ®¿þ¾î     ÇÑ±Û È¨ ÆäÀÌÁö     ±â¼úÁö¿ø     È¸»ç     ÁÖ¹®     ÁúÀÇ/ÀÀ´ä  
WinEdt Logo (3 KB)
  WinEdt Ȩ | ¸ÞÀϸµ ¸®½ºÆ® | ¼Ò°³ | Snapshots | ÁÖ¿ä »ç¾ç | °¡°Ý/ÁÖ¹® | ¼³Ä¡ ¿ä·É | ´Ù¿î·Îµå  
  WinEdt Ȩ < ÁÖ¿ä »ç¾ç < Modfying the default Menu

Modifying the default Menu

WinEdt's Menu is completely customizable. You can add new items to accomplish the tasks that are not covered in the default settings. You may also want to change the default shortcuts and implement a different shortcut scheme which you may be accustomed to from some other editor. Modifications to WinEdt's Menu should be made through the Menu Setup Dialog in the Options Menu.

Options Menu (5 KB)

Menu Setup Popup (1 KB) Menu Setup (8 KB)

Example: Suppose you want to introduce a new command that duplicates the current line and assign F4 to this menu item. Placing the menu item in an invisible menu Shortcuts is a good idea. Double-click on the Item Shortcuts in the List of all main menus in the above dialog. This makes the menu Shortcuts ready to be modified:

Menu Setup Popup (3 KB) Menu Setup (12 KB)

Find a position where you would like to insert a new item. From the Context Popup Menu (response to the right click on the list control) Choose Insert: Macro.

Menu Setup Popup (4 KB)

Give the new macro item a name (eg. Duplicate Line) and enter a macro definition as:

        CMD("Go To Beginning Of Line");Ins('%L%\');

Click on the Shortcut Control and press the F4 button. From the context popup menu in the Shortcut control you can verify if the assigned shortcut is already used. You can also start a special interface "More Keys..." that allows you to assign characters that cannot be typed directly in the control (such as Enter, ESC, Backspace, Tab). Pressing and releasing the Shift or Ctrl key while in the Shortcut Control will erase the shortcut.

Menu Setup Dialog (13 KB)

Depending on where you want to end you can change the definition and use Mark(1);...Goto(1);:

        Mark(1);CMD("Go To Beginning Of Line");Ins('%L%\');Goto(1);

if you want to stay where you were... WinEdt's Macro Manual explains the meaning of Macro functions that are used in such definitions.

To get the result you want you have to disable wrapping or else use Soft Wrapping or else the line should be exempt from wrapping (eg. indented)...

This is a relatively short macro and a direct definition as a one-line macro definition in the Menu Setup Dialog makes sense. However, macros can be much more sophisticated and longer (there are plenty examples in WinEdt's Macro Folder). Such macros should be saved in in an foo.edt script and the menu item should then be defined as:

        Exe('%b\Macros\foo.edt');

It is a common misconceptions that buttons in WinEdt's Toolbar are assigned functionality independently. The buttons have to be assigned to the Menu Items and they inherit all attributes from the menu item to which they are assigned. The Help on Toolbar Setup explains how to place or remove buttons from the actual toolbar while the interface in the menu setup dialog allows you to assign a button to each menu item.

The Help in the Menu Setup Dialog will guide you if you need more assistance. You'll notice that even simple shortcuts such as Left, Right, Up and Down arrows are assigned their meaning in the Menu Setup Dialog and they can be changed or customized (although it is not very likely that you want to change the default meaning of such keystrokes). If, on the other hand, you want to assign a different shortcut to the LaTeX command (eg. F9 instead of the default Ctrl+Shift+L) you can easily accomplish the task through the above interface.

If you want to define additional menu items (eg. extra accessories) it is recommended that you take a look at the existing default menu items. The default settings often use macro scripts (.edt files in Exec folder) in order to take into consideration the current execution mode. However, a simple external application is usually defined through the macro Run:

     Run("Command Line","Startup Directory",
         Maximized,Background: 0..1,
         "Caption",Focus,Append: 0..1);

       Starts an application with parameters as specified by the
       command line. You can omit specification of optional parameters
       if you are satisfied with the default values (Empty String and
       0 for string and numeric parameters respectively)...

For example the Acrobat Reader in the Accessories menu is defined as:

         Run(|%$('AcroRead'); "%P\%N.pdf"|,'%P',0,0,"%$('Acro-Title');");

You may wonder what is the meaning of %$('AcroRead'); and %$('Acro-Title');. These are local WinEdt variables that are initialized in WinEdt's Startup Macro where Acrobat or Acrobat Reader is detected from Windows Registry. The TeX Configuration explains how this is done and how to manually fix the Startup Macro if the registry doesn't contain the required information. Here is the section in Startup.edt where Acrobat is detected:

  // AcroRd32 or Acrobat Executable: File Type associations with .pdf files
  LetReg(0,`%@('HKEY_CLASSES_ROOT','AcroExch.Document','shell','open','command',' '); `);
  // Prompt(`%!0`); // Debugging

  FindInString('%!0','"',1,2,1010,0);
  IfNum("%!1","0","=",>
     !`FindInString('%!0','"',1,2,1010,1)`,>
     !`FindInString('%!0','%%',1,2,1010,0);>
       IfOK(!``FindInString('%!0',' ',1,2,1110,%!1-1);LetRegNum(1,"%!1-1")``,!``LetReg(1,"0");``)`);   IfNum("%!1","0",">",!"ExtractByIndex(0, `%!0`, 0,%!1)");
  GetLength(1, "%!0");
  
IfNum(%!1,9,"<","LetReg(0,'')");
  Assign('AcroRead',`%!0`);
  // Prompt(`%$('AcroRead')`); // Debugging
  IfStr("%$('AcroRead')","","=",>
  !"Assign('AcroRead','AcroRd32.exe')"); // Acrobat Reader not associated with pdf files?
  // Prompt(`%$('AcroRead')`); // Debugging
  //? Assign('AcroRead','"C:\Program Files\Adobe\Acrobat 5.0\Reader\AcroRd32.exe"'); // Acrobat Reader

The TeX Configuration Wizard Explains how to make any fixes to the Startup Macro or TeX System macro. With most installations WinEdt should detect all the accessories used in the default settings from Windows Registry.


Example: add ConTeXt to WinEdt's Menu and Toolbar

You have successfully install WinEdt and fpTeX (TeXLive). You can do the basic edit-compile-preview cycle. However, you would like to use a similar interface in WinEdt to compile your ConTeXt documents. What should you do?

fpTeX comes with an executable "texexec.exe" and normally you would compile such document by typing

        texexec "your_document"

in the command prompt (since TeX's Binary folder is on your PATH you don't have to worry about the exact location of the executable). To provide an interface in WinEdt proceed as follows.

Start the Options: Menu Setup Dialog. In the list of the main menu items double-click on the Accessories item. Choose the place where you would like to insert the new menu item &ConTeXt. Right-click on the list control and from the Context Popup Menu choose: Insert -> Macro.

Enter &ConTeXt in the Item Name and define the macro as:

        Run('texexec.exe "%N%T"','%P',0,0,'ConTeXt...',1,1);

The rest of the fields can be based on the TeX definition (the help in the dialog explains their meaning). You can assign a shortcut (eg. Ctrl+Shift+X) to your newly defined item. You can right-click on the Shortcut control and choose the command "Is Used?" from the context popup menu to see that this shortcut is not already used for some other item and if so you can decide if you want to overwrite it with the new definition.

In the menu setup dialog you see two (empty) buttons in the Images and Hint group. The left button can be pressed to assign a toolbar button to this menu item while the right one allows us to choose the 16x16 icon that is displayed on the left on the menu item. In our case we'll settle for a Brown TeX lion icon and we'll specify "ConTeXt..." as a hint which will be displayed when a mouse cursor is placed on top of the button:

Menu Setup Popup (3 KB) Menu Setup (12 KB)

The Toolbar button (as well as the menu image) is selected or changed from a special interface which is displayed after you press on associated button (Images and Hint) in the Menu Setup Dialog:

Tool Bar Icons (13 KB)

The hint displayed next to the Selected Icon will tell you if the icon is already assigned to some other menu item (again you can overwrite the previous definition). While each Toolbar Icon can only be assigned to one menu item there is no such restriction for Menu Images. Note that Menu images serve no purpose expect to help you visually navigate through menus...

Press OK in both Menu Setup Dialog and you'll notice that the item is now in the Accessories Menu but it is not automatically placed in the Toolbar. You have to modify the toolbar separately.

Right-click on the Menu/ Toolbar area and form the context popup menu choose "Enter Toolbar Setup". You are now in a special mode where you can click on a button that you would like to move into or out of the visible rows of the toolbar. Then find the new spot and click on the button in front of which the pressed toolbar button should be moved. When you are done you can select the "Apply" command in the context popup menu. If you need more assistance check the Help topic on Toolbar Setup.

If you have a habit of switching between different configurations and you want your change to the accessories menu and toolbar become a permanent part of fpTeX configuration you should execute the Options -> Configurations -> Update configurations Command (before you switch to any other configuration which would overwrite your changes).

A similar procedure should be followed if you want to provide an interface to any other executable. If you are puzzled about the meaning of the macro function Run() and if the parameters such as %N look mysterious to you you should consult the Macro Manual in WinEdt's Help Menu. You'll find explanations and more... If you actually perform a task like this you'll find that it is not quite as complicated as it may appear before you try it.


Shortcuts: fixing possible conflicts...

It is unlikely but remotely possible that some shortcuts in the default WinEdt's Scheme suppress shortcuts defined on a system or keyboard level (there are many different keyboards out there). For example you may not be able to enter curly braces using your keyboard Ctrl+Alt+Shift+[] shortcut scheme with some non-English keyboards.

Note: AltGr (not present on US Keyboard) is an equivalent of Ctrl+Alt!

Should you experience any such problem don't panick: it is just a matter of locating and disabling (or changing) the problematic shortcut in WinEdt's Menu Setup Dialog.

Start the Menu Setup Dialog and double-click on the Alternatives Item. The last item in the menu is a "dummy" macro entry "Shortcut Test". Select this item and click on the Shortcut Control. Now type the problematic shortcut into this control. Right-click on the control and choose: "Is Used?" from the context popup menu to see where is the item used. If so and you would like to suppress it press OK to overwrite the original (problematic) definition. Double-click the Alternatives Menu Again and erase this temporary shortcut (you can use the context popup menu or else press and release Shift or Ctrl key). Alternatively you can cancel editing the Alternatives Menu, locate the conflicting (as reported by the "Is Used?" command) item and assign it a different shortcut.

Menu Setup (12 KB)

By default the alternatives menu contains entries that simulate typing curly and square braces. If your keyboard doesn't provide any keys for these characters you can assign a shortcut of your choice to any of these items. This makes it possible to type such characters into WinEdt's documents even if your keyboard is configured differently...

WARNING: WinEdt's Shortcuts are completely customizable and even the meaning of keys such as Arrows or Page Up/Down are defined in the Shortcuts Menu and can be overwritten. The result may not be what you expected and in fact it can render WinEdt useless until you restore the shortcuts. You can use Options -> Configurations Backup, Restore and Default commands to selectively restore any menus that were accidentally corrupted during your menu setup experiment.

After any customizations to your Menu (or other configurations) remember to execute the

Options -> Configurations -> Backup

Command! This allows you to restore your customizations should "something" go wrong... For more check the section on:

Configurations: Backup, Restore, Default...

Example:

You are accustomed to simple emacs shortcuts (such as Ctrl+F, Ctrl+B, ...) and you would prefer to use such shortcuts to arrows.

Proceed as follows: in the menu setup dialog copy and Paste the whole Menu Shortcuts (using the Toolbar Buttons or the context popup menu in the dialog). Now double click on the first instance and immediately press OK: this ensures that the shortcuts in the Second Instance have been erased. Select the Second Instance and Rename the Item to Shortcuts/emacs (or something like that- it does not matter much since the menu is invisible). Double-click on the emacs Shortcut menu and one by one assign the shortcuts of your choice to the items in the list. One can add macro items to implement the commands for which WinEdt doesn't provide a shortcut interface and the commands that don't have shortcut equivalents in emacs can be left unassigned (the default shortcuts in the original Shortcuts Menu still apply). Thus you can end up with dual shortcut scheme: default (eg. Right and Left arrows) and emacs (Ctrl+F and Ctrl+B), etc...

Through the Invisible Popup Menus it is possible to assign double-shortcuts. There are quite a few such menus and associated double-shortcut schemes available but by default disabled. You can enable double-shortcuts for Greek letters, etc... The Double-Shortcuts for international characters are by default implemented as follows:

     Popup Menus:
     ============
        Grave              Ctrl+` (Invisible)
        Acute              Ctrl+' (Invisible)
        Umlaut             Shift+Ctrl+' (Invisible)
        Tilde              Shift+Ctrl+` (Invisible)
        Circumflex         Alt+Shift+Ctrl+6 (Invisible)

     Thus Ctrl+` followed by a character "a" produces "?, etc...
     This works with Western fonts!

WinEdt's Help Explains how to take advantage of "Invisible Popup Menus" to implement double-shortcut schemes. The Defaults are pretty much free of such shortcuts since most new users don't expect them and the majority prefers GUI. Manu such Popup menus are defined but disabled in the default settings. You may want to take a look and enable those that are of interest to you. The only exception (in the default settings) are the Bookmark Shortcuts (check Al+= Alt+H) and the shortcuts used for Accented characters.

For more information consult WinEdt's Help!

WinEdt Ȩ | ¸ÞÀϸµ ¸®½ºÆ® | ¼Ò°³ | Snapshots | ÁÖ¿ä »ç¾ç | °¡°Ý/ÁÖ¹® | ¼³Ä¡ ¿ä·É | ´Ù¿î·Îµå
Copyright ¨Ï 1998-2008 by Aleksander Simonic (alex@winedt.com). All rights reserved.
 È¨ ÆäÀÌÁö | ¼ÒÇÁÆ®¿þ¾î | ÇÑ±Û È¨ÆäÀÌÁö | ±â¼úÁö¿ø | È¸»ç | ÁÖ¹® | ÁúÀÇ/ÀÀ´ä