📄 win_menu.gml
字号:
.****************************************************************************
.*
.* Open Watcom Project
.*
.* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
.*
.* ========================================================================
.*
.* This file contains Original Code and/or Modifications of Original
.* Code as defined in and that are subject to the Sybase Open Watcom
.* Public License version 1.0 (the 'License'). You may not use this file
.* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
.* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
.* provided with the Original Code and Modifications, and is also
.* available at www.sybase.com/developer/opensource.
.*
.* The Original Code and all software distributed under the License are
.* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
.* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
.* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
.* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
.* NON-INFRINGEMENT. Please see the License for the specific language
.* governing rights and limitations under the License.
.*
.* ========================================================================
.*
.* Description: Root file of VI documentation.
.*
.* Date By Reason
.* ---- -- ------
.* 03-aug-92 Craig Eisler initial draft
.* 02-oct-05 L. Haynes reformatted for hlp, figures
.*
.****************************************************************************/
.chap *refid=winmenu 'Windows and Menus'
:cmt. .if &e'&dohelp eq 0 .do begin
:cmt. . .section 'Introduction'
:cmt. .do end
.np
This chapter describes the &cmdline
commands devoted to configuring the
&edname.'s windows and menus. All windows are fully configurable:
dimension, colors, existence of borders. The menus are fully configurable:
all menu topics and menu items are user settable.
.np
A window is configured first by specifying a window. Once the
a window is specified, a number of properties may be set. These properties
are described in the following section.
.* ******************************************************************
.section 'Window Properties'
.* ******************************************************************
.np
Some of the following &cmdline
commands accept colors as parameters.
These colors may be numbers in the range 0 through 15. As well,
&edvi has symbolic names for these colors, they are:
:UL compact.
:LI.black
:LI.blue
:LI.green
:LI.cyan
:LI.red
:LI.magenta
:LI.brown
:LI.white
:LI.dark_gray
:LI.light_blue
:LI.light_green
:LI.light_cyan
:LI.light_red
:LI.light_magenta
:LI.yellow
:LI.bright_white
:eUL
.*
.fnlist begin 'Window Properties'
.*
.begfunc BORDER
.syntx * BORDER <.hasbord>. <.fg_clr>. <.bg_clr>.
.begdescr
This command specifies the type of border and its colors.
.np
&parm1 describes the type of border: if &parm1 is set to -1,
there is no border, if &parm1 is set to 1, there is a border.
.np
&parm2 is used to specify the foreground color of the border (0-15).
It is ignored for &parm1 of -1.
.np
&parm3 is used to specify the background color of the border (0-15).
It is ignored for &parm1 of -1.
.enddescr
.xmplsect begin
.begxmpl border -1
The currently selected window has no border.
.endxmpl
.begxmpl border 1 yellow black
The currently selected window has a yellow border with a black background.
.endxmpl
.xmplsect end
.endfunc
.begfunc DIMENSION
.syntx * DIMENSION <.x1>. <.y1>. <.x2>. <.y2>.
.begdescr
(&parm1, &parm2) specifies the coordinates of the upper left-hand corner
of the window, and (&parm3, &parm4) specifies the coordinates of the
lower right-hand corner of the window.
.np
&edname editor automatically senses the number of lines and columns
available. The global variables %(SW) (screen width) and %(SH)
(screen height) are always set. These are useful for coding
dimensions that are relative to the size of the screen.
All parameters may be coded as expressions.
.np
All coordinates are 0-based. The top left corner of the
screen is (0,0). The bottom right corner of the screen is
(%(SW)-1,%(SH)-1).
.enddescr
.xmplsect begin
.begxmpl dimension 0 1 %(SW)-1 %(SH)-3
Makes the currently selected window the full width of the screen.
Its y dimensions are from the second line of the screen and
to the third last line of the screen.
.endxmpl
.begxmpl dimension %(SW)-10 5 %(SW)-1 10
Makes the currently selected window's x dimension start at the tenth
column from the right of the screen and end at the rightmost column of the
screen. Its y dimensions range from the fifth line to the tenth line of
the screen.
.endxmpl
.xmplsect end
.endfunc
.begfunc ENDWINDOW
.syntx * ENDWindow
.begdescr
Ends entry of properties for the currently selected window. The currently
selected window is then redrawn with the new properties, if it
was previously visible.
.enddescr
.endfunc
.begfunc HILIGHT
.syntx * HILIGHT <.fg_clr>. <.bg_clr>.
.begdescr
&parm1 sets the foreground color and &parm2 sets the background color
of highlighted text in the currently selected window.
.enddescr
.xmplsect begin
.begxmpl hilight bright_white black
Sets the highlighted color of the currently selected window to be bright white
text with a black background.
.endxmpl
.xmplsect end
.endfunc
.begfunc TEXT
.syntx TEXT <.fg_clr>. <.bg_clr>.
.begdescr
&parm1 sets the foreground color and &parm2 sets the background color
of text in the currently selected window.
.enddescr
.xmplsect begin
.begxmpl text white black
Sets the text color of the currently selected window to be white
text with a black background.
.endxmpl
.xmplsect end
.endfunc
.*
.fnlist end
.* ******************************************************************
.section 'Window Types'
.* ******************************************************************
.np
This section describes all possible windows that may be selected. These
&cmdline commands select the window to start setting properties.
See the previous section for properties that may be set.
.*
.fnlist begin 'Window Types'
.*
.begfunc COMMANDWINDOW
.syntx * COMMANDWindow
.begdescr
This is the window that is displayed whenever &edname is prompting
for a &cmdline,
a search string, a filter command or any other command or data.
.enddescr
.endfunc
.begfunc COUNTWINDOW
.syntx * COUNTWindow
.begdescr
Window that opens when repeat counts are entered. This window is
disabled if
.keyref repeatinfo
is not set.
.enddescr
.endfunc
.begfunc DEFAULTWINDOW
.syntx * DEFAULTWindow
.begdescr
When the
.keyword defaultwindow
is selected, all windows get the properties that are set.
Note that this is best defined first to provide the default behaviour,
and all other windows that you want to be different from the
default can be specified after.
.enddescr
.endfunc
.begfunc DIRWINDOW
.syntx * DIRWindow
.begdescr
This is the window that you select a file from whenever no file
is specified from the &cmdline
commands
.keyref edit
or
.keyref read
:period.
.enddescr
.endfunc
.begfunc EDITWINDOW
.syntx * EDITWindow
.begdescr
This is the window that files are edited from.
.enddescr
.endfunc
.begfunc EXTRAINFOWINDOW
.syntx * EXTRAINFOWindow
.begdescr
This window contains extra information about possible things that
may be done.
It is displayed when selecting results from the &cmdline commands
.keyref fgrep
:cont.,
.keyref egrep
:cont.,
and
.keyref files
:period.
.enddescr
.endfunc
.begfunc FILEWINDOW
.syntx * FILEWindow
.begdescr
The window in which list of files currently being edited is displayed.
This is displayed when the &cmdline command
.keyref files
is executed.
.enddescr
.endfunc
.begfunc FILECWINDOW
.syntx * FILECWindow
.begdescr
This window contains list of possible file choices when
file completion cannot match one specific file. It is displayed
whenever the
.keyword TAB
key is pressed in a command window.
.enddescr
.endfunc
.begfunc LINENUMBERWINDOW
.syntx * LINENUMBERWindow
.begdescr
This is the window that line numbers are displayed in.
The dimension of this window is ignored, the absolute position of the window
is decided by the position of the edit window that it is associated with.
:cmt. However, the width of this window may be set using the
:cmt. .keyref linenumwidth
:cmt. setting.
.np
This window is disabled if
.keyref linenumbers
is not set.
.enddescr
.endfunc
.begfunc MENUWINDOW
.syntx * MENUWindow
.begdescr
This sets the properties of the windows that open whenever
a menu is activated. Any
.keyref dimension
given with this window is ignored; the position of each
menu is variable.
.enddescr
.endfunc
.begfunc MENUBARWINDOW
.syntx * MENUBARWindow
.begdescr
This window is the menu bar.
This is where all menus set up with the &cmdline
.keyref menu
are displayed.
.enddescr
.endfunc
.begfunc MESSAGEWINDOW
.syntx * MESSAGEWindow
.begdescr
The window in which all all editor feedback is reported.
The
.keyref hilight
color is the color that errors are reported in.
.np
This window needs to have two lines in order to view
&edname feedback; however, very few messages use two lines,
so you can get by with a message window that is only one line high.
.enddescr
.endfunc
.begfunc SETWINDOW
.syntx * SETWindow
.begdescr
The window in which &edname settings are displayed.
This window is displayed when the &cmdline
.keyref set
command is entered without parameters or with
.param 2
as its only parameter.
.enddescr
.endfunc
.begfunc SETVALWINDOW
.syntx * SETVALWindow
.begdescr
The window in which the new value of an editor setting is entered.
This window is displayed if a value change is requested
after entering the &cmdline
.keyref set
with
.param 2
as the parameter.
.enddescr
.endfunc
.begfunc STATUSWINDOW
.syntx * STATUSWindow
.begdescr
This is the window where the current line and column are reported.
The current line number is displayed in the first line of the window,
and the current column is displayed in the second line of the window.
This window is disabled if
.keyref statusinfo
is not set.
.enddescr
.endfunc
.*
.fnlist end
.* ******************************************************************
.section 'Sample Window Settings'
.* ******************************************************************
.np
The following examples are sample settings of the different types of
windows. These commands may be issued from the &cmdline
one at at time, or may be executed from a &edname script.
Typically, these commands will be found in the &edname
.keyword configuration script
:period.
.np
.keyword Commandwindow
:cont.:
.millust begin
commandwindow
dimension 2 %(SH)-7 %(SW)-3 %(SH)-5
text %(white) %(blud) 0
border 1 7 1
hilight %(highwhite) %(cyan) 1
endwindow
.millust end
.np
.keyword Countwindow
:cont.:
.millust begin
countwindow
dimension 28 %(SH)-5 43 %(SH)-3
border 1 7 1
text %(white) %(blue) 0
hilight %(highwhite) %(cyan) 1
endwindow
.millust end
.np
.keyword Dirwindow
:cont.:
.millust begin
dirwindow
dimension 15 2 %(SW)-12 %(SH)-7
border 1 7 1
text %(white) %(blue) 0
hilight %(highwhite) %(cyan) 1
endwindow
.millust end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -