:box
命令格式
简单格式
wbat box 横坐标,纵坐标 (colors) "内容" 选项1,选项2 #默认选项,等待时间
高级格式
call w.bat box 横坐标,纵坐标 (colors) @菜单内容文件:标志
:标志 这里输入标题栏
菜单内容文件
这里是一下是普通显示内容
方括号括起来的是按钮
方括号只有一个. 表示单选项
是 否
最多可以设置9个单选框
返回的变量为 %WRB%
变量值根据选中的项目依次为 1 or 2 or 3 ...
例子:
if %WRB%==1 goto 选中执行命令行
方括号只有一个! 表示多选项
多选
最多可以设置9个多选框
返回的变量为 %WCB1% - %WCB9%
变量值 0 (未选中) 1 (选中)
例子:
if %WCB1%==1 goto 选中执行命令行
表示一个编辑框可以输入内容
逗号后面的数字表示输入内容的长度的限制
参数包括
U force upper case (大写?)
P 密码输入框 显示的是 ***
! 除非按ESC关闭窗口 否则必须输入
等待时间最长为3600(秒)
按照按钮的顺序设置返回值
从上到下从左到右 返回值依次为 1,2,3...
ESC的返回值为100
制作批处理的时候判断返回值应由高到低
最先判断 100 然后判断 ...3,2,1
========================================================
:list
命令(无返回值):wbat list 横坐标,纵坐标 (colors) @内容文件:标志
(有返回值):call wbat list 横坐标,纵坐标 (colors) @内容文件:标志
显示内容 和 box 差别在于没有 特殊标记(如多选框,按钮等)
只能一行一行的选择
特点可以卷屏 最大可以显示 32KB 大小的文件
可以用于显示实时生成的目录 文件等
可以通过 up/down PageUp/PaegDown 翻页
可以通过按 字母键 快速定位到相应字母开头的位置
返回的变量为 %wbat%
变量值为 选择的那一行的文本
例子: 显示当前目录下的所有文件
DIR *.* /b/a-d/one > %%temp%%\temp.txt
call W.BAT list 3,60 %%temp%%\temp.txt
DIR参数说明 /b 只显示文件名
/a-d 不显示目录
/one 按文件名排序
========================================================
:text
命令: wbat text 横坐标,纵坐标 (colors) "内容"
wbat text 横坐标,纵坐标 (colors) @内容文件:标志
显示小的文本 超过屏幕宽度被截断
========================================================
:cls
命令: wbat CLS (white on blue)
用指定颜色清屏
~(white on blue)~ 自定义颜色 (前景色 on 背景色) 这个可忽略
如果忽略使用 Wbat.ini 里面的设置
========================================================
:pal
命令: wbat pal
表示调用自定义调色板
调色板配置文件由 wbat.ini 文件设置
默认为 pal.ini
========================================================
:font
命令: wbat font
更改dos窗口的行数 33行或者25行
========================================================
:cursor
命令: wbat cursor 行数
wbat cursor 25+滚动次数
移动光标到指定行
========================================================
:fill
命令: wbat FILL position (dimensions) (colors) "string" +s
~position~ 位置 从左上角开始,默认: 1,1
~dimensions~ 尺寸 高,宽 (注意用括号括起来)
如果忽略此参数 默认: 填充到右下角
~colors~ 配色, 如果忽略此参数 默认调用 WBAT.INI 里面的设置
~string~ 填充的内容; " " 填充一个空格表示清除内容;
如果忽略此参数 默认:只填充颜色
(原来的文本会保留下来)
可以使用 @文件名:标志 表示填充内容
或者 :标志 调用默认文件相应标志的内容
~+s~ 每一行向左移动填充的文本 s 表示移动几个字符
wbat 中文demo 主要的box参数教程已经完成
其他的未完成
打开附件
:
:box
Command Format
Simple Format
wbat box horizontal coordinate, vertical coordinate (colors) "content" option 1, option 2 #default option, waiting time
Advanced Format
call w.bat box horizontal coordinate, vertical coordinate (colors) @menu content file: flag
:flag Here enter the title bar
Menu Content File
Here are the following are ordinary display contents
Content in square brackets is a button
A single square bracket means a single option
is no
Up to 9 radio buttons can be set
The returned variable is %WRB%
The variable value is 1 or 2 or 3... in turn according to the selected item
Example:
if %WRB%==1 goto execute command line when selected
A single exclamation mark in square brackets means multiple options
Multiple selection
Up to 9 checkboxes can be set
The returned variables are %WCB1% - %WCB9%
Variable value 0 (not selected) 1 (selected)
Example:
if %WCB1%==1 goto execute command line when selected
Represents an edit box that can enter content
The number after the comma indicates the limit of the length of the input content
Parameters include
U force upper case (uppercase?)
P password input box, displayed as ***
! Must enter unless the window is closed by ESC
The maximum waiting time is 3600 (seconds)
Set the return value according to the order of the buttons
From top to bottom and left to right, the return values are 1,2,3... in turn
The return value of ESC is 100
When making a batch processing, the return value should be judged from high to low
First judge 100, then judge...3,2,1
========================================================
:list
Command (no return value): wbat list horizontal coordinate, vertical coordinate (colors) @content file: flag
(With return value): call wbat list horizontal coordinate, vertical coordinate (colors) @content file: flag
The display content is different from box in that there are no special marks (such as checkboxes, buttons, etc.)
Can only select line by line
Features can scroll, can display files with a maximum size of 32KB
Can be used to display real-time generated directories, files, etc.
Can turn pages through up/down PageUp/PaegDown
Can quickly locate to the position starting with the corresponding letter by pressing the letter key
The returned variable is %wbat%
The variable value is the text of the selected line
Example: Display all files in the current directory
DIR *.* /b/a-d/one > %%temp%%\temp.txt
call W.BAT list 3,60 %%temp%%\temp.txt
DIR parameter description /b only display file name
/a-d do not display directory
/one sort by file name
========================================================
:text
Command: wbat text horizontal coordinate, vertical coordinate (colors) "content"
wbat text horizontal coordinate, vertical coordinate (colors) @content file: flag
Display small text, truncated if it exceeds the screen width
========================================================
:cls
Command: wbat CLS (white on blue)
Clear the screen with the specified color
~(white on blue)~ Custom color (foreground color on background color) This can be ignored
If ignored, use the settings in Wbat.ini
========================================================
:pal
Command: wbat pal
Means to call the custom color palette
The palette configuration file is set by the wbat.ini file
The default is pal.ini
========================================================
:font
Command: wbat font
Change the number of lines of the dos window, 33 lines or 25 lines
========================================================
:cursor
Command: wbat cursor line number
wbat cursor 25+scroll count
Move the cursor to the specified line
========================================================
:fill
Command: wbat FILL position (dimensions) (colors) "string" +s
~position~ Position, starting from the upper left corner, default: 1,1
~dimensions~ Size, height, width (note to enclose in parentheses)
If this parameter is ignored, the default: fill to the lower right corner
~colors~ Color matching, if this parameter is ignored, the default calls the settings in WBAT.INI
~string~ Filled content; " " fill a space to clear the content;
If this parameter is ignored, the default: only fill the color
(The original text will be retained)
You can use @file name: flag to indicate the filled content
Or :flag to call the content of the corresponding flag in the default file
~+s~ Each line moves to the left by s characters of the filled text s means how many characters to move
The main box parameter tutorial of the wbat Chinese demo has been completed
Others are not completed
Open attachment