📄 list_opts.idlg
字号:
/*
_list_opts.idlg Common list options
*! VERSION 1.1.1 31mar2005
// SCRIPTS and PROGRAMS for external use
* SCRIPT list_opts_subvarname_disable
*/
DIALOG opt, tabtitle("Options")
BEGIN
GROUPBOX gb_for _lft _top _cwd1 _ht6, ///
label("Output formats")
DEFINE holdy @y
RADIO rb_def _ilft _ss _inwd ., ///
label("Use default format") first ///
onclickon(program table_on) option(NONE)
RADIO rb_tab @ _ss @ ., ///
label("Force table format") option(table) ///
onclickon(program table_on)
RADIO rb_disp @ _ss @ ., ///
label("Force display format") last option(display) ///
onclickon(script table_off)
GROUPBOX gb_head _lft2 holdy _cwd1 _ht6, ///
label("Variable header")
RADIO rb_head _indent _ss _inwd ., ///
first onclickon(opt.sp_hean.disable) ///
label("Display once")
RADIO rb_noh @ _ss @ ., ///
option(noheader) label("Suppress") ///
onclickon(opt.sp_hean.disable)
RADIO rb_hean @ _ss _rbwd ., ///
option(header) onclickon(opt.sp_hean.enable) last
SPINNER sp_hean _rbsep @ _spwd ., ///
option(header) min(1) max(10000) default(10) ///
label("Display every N lines")
TEXT tx_hean _spsep @ _rbspr2b ., ///
label("Display every N lines")
GROUPBOX gb_table _lft _xls _iwd _ht10h, ///
label("Table options")
CHECKBOX ck_clean _ilft _ss _cwd2 ., ///
option(clean) label("Force a clean table") ///
onclickon(script clean_on) onclickoff(program clean_off)
CHECKBOX ck_div _lft2 @ @ ., ///
option(divider) label("Draw divider lines between columns")
GROUPBOX gb_sep _ilft _ls _ibwd _ht4h, ///
label("Separators")
RADIO rb_sep _indent _ss _cwd3 ., ///
onclickon(opt.sp_sep.enable) ///
onclickoff(opt.sp_sep.disable) first ///
label("Place separators every N lines")
DEFINE y @y
SPINNER sp_sep _indent2 _ss _spwd ., ///
option(separator) ///
min(0) max(10000) default(5)
TEXT tx_sep _spsep @ _rbspr2b ., ///
label("Lines (default: 5)")
RADIO rb_sepby _lft2 y _cwd3 ., ///
label("When these variables change:") ///
onclickon(opt.vl_sepby.enable) ///
onclickoff(opt.vl_sepby.disable) ///
option(sepby) last
VARLIST vl_sepby _indent2 _ss _inwd ., ///
label("Draw separator when these variables change") ///
option(sepby)
CHECKBOX ck_nolab _lft _xxxls _iwd ., ///
option(nolabel) ///
label("Display numeric codes rather than label values")
END
PROGRAM table_on
BEGIN
call gaction opt.gb_table.enable
call gaction opt.ck_clean.enable
if !opt.ck_clean {
call program clean_off
}
END
SCRIPT table_off
BEGIN
opt.gb_table.disable
opt.ck_clean.disable
script clean_on
END
SCRIPT clean_on
BEGIN
opt.ck_div.disable
opt.gb_sep.disable
opt.rb_sep.disable
opt.sp_sep.disable
opt.tx_sep.disable
opt.rb_sepby.disable
opt.vl_sepby.disable
END
PROGRAM clean_off
BEGIN
call gaction opt.ck_div.enable
call gaction opt.gb_sep.enable
call gaction opt.rb_sep.enable
if opt.rb_sep {
call gaction opt.sp_sep.enable
}
call gaction opt.tx_sep.enable
call gaction opt.rb_sepby.enable
if opt.rb_sepby {
opt.vl_sepby.enable
}
END
DIALOG summary, tabtitle("Summary")
BEGIN
CHECKBOX ck_mean _lft _top _iwd ., ///
option(mean) ///
onclickon(program mean_on) ///
onclickoff(program mean_off) ///
label("Mean: (leave empty for all variables)")
VARLIST vl_mean _indent2 _ss _inwd ., ///
option(mean) ///
allowcat ///
label("Mean")
CHECKBOX ck_sum _lft _ls _iwd ., ///
option(sum) ///
onclickon(program sum_on) ///
onclickoff(program sum_off) ///
label("Sum: (leave empty for all variables)")
VARLIST vl_sum _indent2 _ss _inwd ., ///
option(sum) allowcat label("Sum")
CHECKBOX ck_N _lft _ls _iwd ., ///
option(N) ///
onclickon(program N_on) ///
onclickoff(program N_off) ///
label("Number of observations: (leave empty for all variables)")
VARLIST vl_N _indent2 _ss _inwd ., ///
option(N) allowcat label("Number of observations")
CHECKBOX ck_lab _lft _ls _iwd ., ///
onclickon(summary.vn_lab.enable) ///
onclickoff(summary.vn_lab.disable) ///
label("Substitute summary value with summary name of variable:")
VARNAME vn_lab _indent2 _ss _vnwd ., ///
option(labvar) ///
label("Substitute summary value with summary name of variable")
END
PROGRAM mean_on
BEGIN
call gaction summary.vl_mean.enable
call gaction summary.ck_lab.enable
if summary.ck_lab{
call gaction summary.vn_lab.enable
}
END
PROGRAM mean_off
BEGIN
call gaction summary.vl_mean.disable
if !summary.ck_sum & !summary.ck_N {
call gaction summary.ck_lab.disable
call gaction summary.vn_lab.disable
}
END
PROGRAM sum_on
BEGIN
call gaction summary.vl_sum.enable
call gaction summary.ck_lab.enable
if summary.ck_lab {
call gaction summary.vn_lab.enable
}
END
PROGRAM sum_off
BEGIN
call gaction summary.vl_sum.disable
if !summary.ck_mean & !summary.ck_N {
call gaction summary.ck_lab.disable
call gaction summary.vn_lab.disable
}
END
PROGRAM N_on
BEGIN
call gaction summary.vl_N.enable
call gaction summary.ck_lab.enable
if summary.ck_lab {
call gaction summary.vn_lab.enable
}
END
PROGRAM N_off
BEGIN
call gaction summary.vl_N.disable
if !summary.ck_sum & !summary.ck_mean {
call gaction summary.ck_lab.disable
call gaction summary.vn_lab.disable
}
END
DIALOG adv, tabtitle("Advanced")
BEGIN
CHECKBOX ck_cons _lft _top _iwd _ht4, ///
option(constant) groupbox ///
onclickon(adv.vl_cons.enable) ///
onclickoff(adv.vl_cons.disable) ///
label("Separate and list variables that are constant only once")
TEXT tx_cons _ilft _ss _inwd ., ///
label("Constant variables: (leave empty for Stata to determine)")
VARLIST vl_cons @ _ss @ ., ///
option(constant) allowcat label("Constant variables")
CHECKBOX ck_notrim _lft _xls _iwd ., ///
option(notrim) label("Suppress string trimming")
CHECKBOX ck_abs @ _ms @ ., ///
option(absolute) ///
label("Display overall observation numbers when using by variable")
CHECKBOX ck_nodotz @ _ms @ ., ///
option(nodotz) ///
label("Display numerical values equal to .z as field of blanks")
CHECKBOX ck_subv @ _ms @ ., ///
option(subvarname) ///
label("Substitute characteristic for variable name in header")
CHECKBOX ck_lsize @ _ms _iwd ., ///
onclickon(script adv_lsize_on) ///
onclickoff(script adv_lsize_off) ///
label("Override default number of columns")
SPINNER sp_lsize _indent2 _ss _spwd ., ///
option(linesize) ///
min(1) max(255) default(79)
TEXT tx_lsize _spsep @ _cksprb ., ///
label("Columns")
END
SCRIPT adv_lsize_on
BEGIN
adv.sp_lsize.enable
adv.tx_lsize.enable
END
SCRIPT adv_lsize_off
BEGIN
adv.sp_lsize.disable
adv.tx_lsize.disable
END
PROGRAM list_opts_output
BEGIN
option radio (opt rb_def rb_tab rb_disp)
if !opt.rb_disp {
option opt.ck_clean
if !opt.ck_clean {
option opt.ck_div
if opt.rb_sep {
optionarg /hidedefault opt.sp_sep
}
if opt.rb_sepby {
optionarg opt.vl_sepby
}
}
}
option opt.rb_noh
if opt.rb_hean {
optionarg opt.sp_hean
}
option opt.ck_nolab
/* summary tab */
if summary.ck_mean {
if summary.vl_mean {
optionarg summary.vl_mean
}
if !summary.vl_mean {
option summary.ck_mean
}
}
if summary.ck_sum {
if summary.vl_sum {
optionarg summary.vl_sum
}
if !summary.vl_sum {
option summary.ck_sum
}
}
if summary.ck_N {
if summary.vl_N {
optionarg summary.vl_N
}
if !summary.vl_N {
option summary.ck_N
}
}
if summary.ck_lab {
require summary.vn_lab
optionarg summary.vn_lab
}
/* advanced tab */
if adv.ck_cons {
if adv.vl_cons {
optionarg adv.vl_cons
}
if !adv.vl_cons {
option adv.ck_cons
}
}
option adv.ck_notrim
option adv.ck_abs
option adv.ck_nodotz
option adv.ck_subv
if adv.ck_lsize {
require adv.sp_lsize
optionarg adv.sp_lsize
}
END
// For external use by duplicates examples and duplicates list
SCRIPT list_opts_subvarname_disable
BEGIN
adv.ck_subv.hide
adv.ck_lsize.setposition . 165 . .
adv.tx_lsize.setposition . 185 . .
adv.sp_lsize.setposition . 185 . .
adv.sp_lsize.show
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -