RE:cerrar todas las ventanas hijas de un mdi
sintaxis del codigo
1. primero deves obtener la cantidad de hojas habiertas.
crea una funcion
of_getsheets( ref window aw_sheets[]) return integer
// script de la funcion
// iw_handle es una variable declarada en instancia de tipo window que va a tomar el nombre del mdi.
Integer li_counter
window lw_sheet
// valido el window solicitante
if IsNull(iw_handle) or not IsValid(iw_handle) then
return -1
end if
// obtengo toda las hojas abiertas
lw_sheet = iw_handle.GetFirstsheet( )
if IsValid(lw_sheet) then
do
li_counter++
aw_sheets[li_counter] = lw_sheet
lw_sheet = iw_handle.GetNextSheet(lw_sheet)
loop until IsNull(lw_sheet) or not IsValid(lw_sheet)
end if
return li_counter
// crea un evento (puede ser en tu propio mdi o lo puedes encapsular en algun objeto no visual con fin de reutizar el codigo)
event ue_closeall() return integer
integer li_sheetcount
integer li_cnt
window lw_sheet[]
window lw_activesheet
if IsNull(iw_handle) or not IsValid(iw_handle) then
return -1
end if
// obtengo toda las hojas abiertas
li_sheetcount = of_getsheets( lw_sheet)
if li_sheetcount > 0 then
// muestro las ventanas en iconos
// of_setcurrentstate( icons!)
for li_cnt = 1 to li_sheetcount
close(lw_sheet[li_cnt])
next
end if
return li_sheetcount
llama a este evento desde el menu.
nota : si deseas encontrar mas opciones de alineacion de hojas
cascada
horizontal
vertical
capa
----
minimizar toda las ventanas
cerrar toda las ventanas
busca en este foro, no recuerdo el titulo pero puedes buscar por mi nombre seguro lo encontrarás.