Картотека пациентов

1. Имя файла: onl_man.gml

gml [ color "lightgray" pixmap { return( PMAPS.."purple_marble.png") }
    grid [ color "pink" ]
#    font [ name "Serif" style "italic" size 16
#	text [ str "Картотека пациентов" x 0 y 15 color "red"]
#    ]
    frame [ name "onl_man" maximizable "true" iconifiable "true"
	title "Картотека пациентов" modal "false"
	menubar [
	    include [
		src {
		    indexes = {
			{ name="m_date => 'DTOC(DATE)'     ", enable=false },
			{ name="m_fio => 'FIO'             ", enable=true },
			{ name="m_uch => 'UCH+FIO'         ", enable=false },
			{ name="m_udate => 'UCH+DTOC(DATE)'", enable=false },
			{ name="m_med => 'SMED+STR(NMED)'  ", enable=false },
			count = 5
		    }
		    view = Man
		    data = "man"
		    base = man
		    return( DEMO.."ils.gml")
		}
	    ]
	    include [
		src {
		    view = Man
		    data = "man"
		    base = man
		    return( DEMO.."navi.gml")
		}
	    ]
	    include [
		src { return( DEMO.."prn_man.gml") }
	    ]
	    menu [ str "Помощь" icon { return( ICONS.."help.png") }
		item [ str "Список полей"
		    src {
			fields = {
				"N	N  6	Рег.номер",
				"VID	C  1 	Вид пациента",
				"FIO	C 40	Фамилия И.О.",
				"POL	C  1 	Пол",
				"NAC	C  3 	Национальность",
				"UCH	C  2 	Участок",
				"VADR	C  1 	Вид проживания",
				"RON	C  2 	Код района",
				"ADR    C 50	Адрес",
				"PHONE  C  6	Телефон",
				"DATE	D	Дата рождения",
				"DREG	D	Дата регистрации",
				"DOUT	D	Дата выбытия",
				"PARENT	C 30	Фамилия И.О. матери",
				"SDOC	C  6	Серия свидетельства",
				"NDOC	N  6	Номер свидетельства",
				"SMED	C  8	Серия мед.страх.полиса",
				"NMED	N  8	Номер мед.страх.полиса",
				"DMED	D	Дата открытия полиса",
				"SPAS	C  6	Серия паспорта",
				"NPAS	N  6	Номер паспорта",
			    count = 21
			}
			title = "MAN.DBF"
			return( DEMO.."dbh.gml")
		    }
		]
	    ]
	    menu [ str "Выход" icon { return( ICONS.."exit.png") }
		item [ str "Выход"
		    include [
			str { onl_man:close() }
		    ]
		]
	    ]
	]
	include [
	    str {
		pol = { ["М"]="Мужской", ["Ж"]="Женский" }
	    }
	]
	include [
	    src { return( DEMO.."nactab.gml") }
	]
	include [
	    src { return( DEMO.."mantab.gml") }
	]
	include [
	    src { return( DEMO.."adrtab.gml") }
	]
	include [
	    src { return( DEMO.."rontab.gml") }
	]
	include [
	    src { return( DEMO.."l_man.gml") }
	]
    ]
    rect [ color "black" ]
]

2. Имя файла: l_man.gml

font [ size 16
    include [
	src { return( BASE.."man_0.gml") }
    ]
    box [ type "col"
	include [
	    src { 
		task = "onl_man.gml"
		data = "man"
		base = man
		return( DEMO.."header.gml")
	    }
	]
	box [ type "row"
	    list [ name "Man" rows 17
#		border "boxraised" title "Пациенты"
		selected [
		    include [
			str { man.select = Man:getSelectedIndex() + 1 }
		    ]
		    emit [ signal "SELECTED" ]
		]
		key [ name "F1"
		    message [ title "Диалог" type "info" window "false"
			str { return( "Номер записи " .. man [man.select].recno) }
		    ]
		]
		include [
		    src {
			view = Man
			data = "man"
			base = man
			return( DEMO.."page.gml")
		    }
		]
		key [ name "ESCAPE"
		    include [
			str { onl_man:close() }
		    ]
		]
		head [
		    field [ len 6 align "right" str "Номер" ]
		    field [ len 35 str "Фамилия Имя Отчество" ]
		]
		repeat [ name "J" from 1 step 1 until { return( man.count) }
		    item [
			field [ align "right" str { return( man [J:getValue()].recno) } ]
			field [ str { return( man [J:getValue()].fio) } ]
		    ]
		]
		count { return( man.count) }
		select { return( man.select - 1) }
	    ]
	    box [ type "col"
		box [ type "col" border "boxraised" title "Даты"
		    box [ type "row"
			label [ color "blue" str "Дата регистрации:" ]
			label [ name "Dreg" border "boxsunken" len 10
			    str { return( Ctod( man [man.select].dreg)) }
			]
			space [ type "glue" ]
		    ]
		    box [ type "row"
			label [ color "blue" str "Дата выбытия:" ]
			label [ name "Dout" border "boxsunken" len 10
			    str { return( Ctod( man [man.select].dout)) }
			]
			space [ type "glue" ]
		    ]
		]
		box [ type "col" border "boxraised" title "Общие данные"
		    box [ type "row"
			label [ color "blue" str "Пол:" ]
			label [ name "Pol" border "boxsunken" len 10
			    str {
				return( Codetab( pol, man [man.select].pol))
			    }
			]
			space [ type "glue" ]
		    ]
		    box [ type "row"
			label [ color "blue" str "Дата рождения:" ]
			label [ name "Dbirth" border "boxsunken" len 10
			    str { return( Ctod( man [man.select].date)) }
			]
			space [ type "glue" ]
		    ]
		    box [ type "row"
			label [ color "blue" str "Национальн.:" ]
			label [ name "Nac" border "boxsunken" len 15
			    str {
				return( Codetab( nac, man [man.select].nac))
			    }
			]
			space [ type "glue" ]
		    ]
		]
		box [ type "col" border "boxraised" title "Участок"
		    box [ type "row"
			label [ color "blue" str "Вид:" ]
			label [ name "Vid" border "boxsunken" len 20
			    str {
				return( Codetab( mantab, man [man.select].vid))
			    }
			]
			space [ type "glue" ]
		    ]
		    box [ type "row"
			label [ color "blue" str "Участок:" ]
			label [ name "Uch" len 3 border "boxsunken"
			    str { return( man [man.select].uch) }
			]
			space [ type "glue" ]
		    ]
		    box [ type "row"
			label [ color "blue" str "Район:" ]
			label [ name "Ron" border "boxsunken" len 20
			    str {
				return( Codetab( rontab, man [man.select].ron))
			    }
			]
			space [ type "glue" ]
		    ]
		]
		space [ type "glue" ]
		box [ type "col" border "boxraised" title "Страховой полис"
		    box [ type "row"
			label [ color "blue" str "Серия/Номер:" ]
			label [ name "Med" len 15 border "boxsunken"
			    str {
				return( man [man.select].smed .. "/" .. man [man.select].nmed)
			    }
			]
			space [ type "glue" ]
		    ]
		    box [ type "row"
			label [ color "blue" str "Дата выдачи:" ]
			label [ name "Dmed" len 10 border "boxsunken"
			    str {
				return( Ctod( man [man.select].dmed))
			    }
			]
			space [ type "glue" ]
		    ]
		]
	    ]
	]
	box [ type "col" border "boxraised" title "Проживание"
	    box [ type "row"
		label [ color "blue" str "Родители:" ]
		label [ name "Parent" len 35 border "boxsunken"
		    str { return( man [man.select].parent) }
		]
		space [ type "glue" ]
		box [ type "row"
		    label [ color "blue" str "Вид:" ]
		    label [ name "Vadr" border "boxsunken" len 22
			str {
			    return( Codetab( adrtab, man [man.select].vadr))
			}
		    ]
		]
	    ]
	    box [ type "row"
		label [ color "blue" str "Адрес:" ]
		label [ name "Adr" len 50 border "boxsunken"
		    str { return( man [man.select].adr) }
		]
		space [ type "glue" ]
	    ]
	]
    ]
    event [ signal "SELECTED"
	include [
	    str {
		Base:refresh()
		Dreg:refresh()
		Dout:refresh()
		Vid:refresh() ;
		Uch:refresh() ;
		Ron:refresh() ;
		Vadr:refresh() ;
		Parent:refresh()
		Adr:refresh()
		Dbirth:refresh()
		Pol:refresh()
		Nac:refresh()
		Med:refresh()
		Dmed:refresh()
	    }
	]
   ]
]