/* Third version of mygenerate.dlg This version has a tab added for if/in */ VERSION 16.0 POSITION . . 410 250 DIALOG main, label("generate - Generate a new variable") tabtitle("Main") BEGIN TEXT tx_gen 10 10 120 ., label("Generate variable:") EDIT ed_gen 10 +20 120 ., error("Generate variable") TEXT tx_exp 10 +25 390 ., label("Contents:") EXP ex_exp 10 +20 390 ., label("Create ...") /// error("Contents") TEXT tx_type 10 +30 200 ., /// label("Generate variable as type:") COMBOBOX cb_type @ +20 120 ., /// dropdownlist /// contents(type_list) CHECKBOX ck_vlab 215 -20 185 ., /// label("Attach value label:") /// onclickon(script main_ck_vlab_on) /// onclickoff(script main_ck_vlab_off) COMBOBOX cb_vlab @ +20 @ ., /// contents(valuelabels) dropdown END LIST type_list BEGIN float double long int byte str END SCRIPT main_ck_vlab_on BEGIN main.cb_vlab.enable END SCRIPT main_ck_vlab_off BEGIN main.cb_vlab.disable END DIALOG sub, tabtitle("if/in") BEGIN GROUPBOX gb_sub 10 10 390 100, /// label("Restrict observations") TEXT tx_if 20 +30 20 ., /// label("if:") /// right EXP ex_if 45 @ 340 ., /// label("Create...") CHECKBOX ck_in 20 +40 100 ., /// label("Obs. in range:") /// onclickon(script sub_inon) /// onclickoff(script sub_inoff) SPINNER sp_from 125 @ 60 ., /// min(1) /// max(c(N)) /// default(1) TEXT tx_to 190 @ 15 ., /// label("to:") /// right SPINNER sp_to 215 @ 60 ., /// min(1) /// max(c(N)) /// default(c(N)) END SCRIPT sub_inon BEGIN sub.sp_from.enable sub.sp_to.enable END SCRIPT sub_inoff BEGIN sub.sp_from.disable sub.sp_to.disable END OK ok1, label("OK") CANCEL can1, label("Cancel") SUBMIT sub1, label("Submit") HELP hlp1, view("help generate") RESET res1 COPY copy1 PROGRAM command BEGIN put "generate " put main.cb_type " " require main.ed_gen put main.ed_gen " " if main.ck_vlab { put ": " put main.cb_vlab " " } put "= " require main.ex_exp put main.ex_exp " " if sub.ex_if { put "if " sub.ex_if " " } inrange sub.sp_from sub.sp_to END