繁體 简体

Q&A: Adding items to the User Tools toolbar

Question
I notice that the a_menu.ccl file defines the OSLO menu and toolbar structure. This means that it can be altered by any user. I also note that there is a special text window toolbar and graphics window toolbar, each named _USER_TOOLS_ . How do I get these toolbars to appear and how do I add items to the User Tools toolbar?

Synopsis
Adding items to the User Tools toolbar

Solution
Understanding this answer requires that you have a working knowledge of using OSLO’s CCL language. Some of the items that you need to be aware of are: 

  • How to create customized CCL commands within CCL files.
  • How to compile CCL commands (OSLO requires that you compile CCL files before changes to the files are recognized).
  • How to alter existing CCL commands (OSLO compiles the public and private CCL folders sequentially. Existing “public” commands that you want to alter would be copied into the private CCL folder and edited there. Commands in files in your private CCL folder take precedence over commands of the same name in the public CCL folder.)
  • How to alter OSLO preferences. (Many OSLO preferences are set and accessed through the set_preference (STP) command. Preferences can also be accessed from the “File>>Preferences>>Set Preference” menu item.)
  1. First, you need to define _USER_TOOLS_ so that it is recognized by your OSLO installation:
    You need to set the OSLO preference: “CCL_compiler_options”, to define “_USER_TOOLS_”. You can do this on the command line by issuing the command stp ccop “-D _USER_TOOLS_”;…Make sure that the quotes are included in the line of text on the command line.
  2. Now you re-compile all public and private CCL commands:
    Choose “Tools>>Compile CCL” from the OSLO menu and then choose “public>>all” as the subsequent options. Now hit the [Enter] key to accept the default text in the command line. After a few seconds, you should see the following message in the text window: *CCL COMPILATION MESSAGES: No errors detectedThis means that the compilation was completed successfully.
  3. Now you should see the “User Tools” toolbar appear among the toolbar options:
    Click on the text window “Setup Window/Toolbar” icon and note that that “User Tools” now appears at the bottom of the pop-up toolbar list. A “User Tools” toolbar will also appear in any graphics window.
  4. To add items to the “User Tools” toolbars, simply locate the proper positions in the “a_menu.ccl” file in the OSLO private CCL directory:
    There are already placeholders in the “a_menu.ccl” file for the definition of the “User Tools” toolbar. The definition for the graphics window “User Tools” toolbar starts at line 1278. The definition for the text window “User Tools” toolbar starts at line 1378. The placeholder looks as follows: #ifdef _USER_TOOLS_ menu toolbarXX // User textout toolbar {\t”separate2,” = “”, } #endif

30051 新竹市經國路二段160號9F-8
Tel : 03-5359299  Fax: 03-5358908
統編: 28521213

光學軟體設計領導者

© 2018 All rights reserved. Setup by Eidea