Barzola.
yo ya lo implementé toda las opciones de ventana incluido el closeall, minimizedall. gracias a tu ayuda he llegado a contruir este (nvo) que tiene encapsulado el codigo para toda las opciones de ventana (tile,tilehorizontal,layer,cascade,icons) y minizar todas las ventans y cerrar todas las ventanas.
lo deposito este código espero les seá util para quienes lo necesiten, solo tienen que hacer el grabar el archivo como n_cst_sheetmanager.sru y luego importar a su librería.
forward
global type n_cst_sheetmanager from nonvisualobject
end type
end forward
global type n_cst_sheetmanager from nonvisualobject
event type integer ue_minimizedall ( )
event type integer ue_closeall ( )
end type
global n_cst_sheetmanager n_cst_sheetmanager
type variables
w_master iw_handle
end variables
forward prototypes
public function integer of_setcurrentstate (arrangetypes ae_arrange)
public function integer of_getsheets (ref window aw_sheets[])
public function integer of_setrequestor (w_master aw_handle)
end prototypes
event type integer ue_minimizedall();Integer li_sheetcount
integer li_cnt
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
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
lw_sheet[li_cnt].windowstate = minimized!
next
end if
return li_sheetcount
end event
event type integer ue_closeall();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
end event
public function integer of_setcurrentstate (arrangetypes ae_arrange);//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Nombre :of_SetCurrentState
// Objectivo : Seteo el estado de las hojas mostradas en el mdi (tile!,horizontal!,vertical!,layer!,cascade!,icons!)
// Creado : Jorge W. Escobar
// Fecha : 25/04/2007
// Arguments : ae_arrange
// Retorno : integer (1 se ejecuta el proceso, - 1 error )
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
integer li_rc = 1
integer li_cnt
integer li_count
window lw_sheets[]
if IsNull(iw_handle) or not IsValid(iw_handle) then
return -1
end if
iw_handle.arrangesheets(ae_arrange)
return li_rc
end function
public function integer of_getsheets (ref window aw_sheets[]);//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Nombre :of_GetSheets
// Objectivo : obtener la cantidad de horas abiertas
// Creado : Jorge W. Escobar
// Fecha : 25/04/2007
// Arguments : aw_shets[]
// Retorno : integer (cantidad de hojas abiertas)
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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
end function
public function integer of_setrequestor (w_master aw_handle);//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Nombre :of_SetRequestor
// Objectivo : Seteo el iw_handle con la ventana mdi
// Creado : Jorge W. Escobar
// Fecha : 25/04/2007
// Arguments : aw_handle ( mdi)
// Retorno : integer (1 Success, - 1 Failed )
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if IsNull(aw_handle) or not IsValid(aw_handle) then
return -1
end if
// solo el mdi pueden utlizar este servicio
if aw_handle.windowtype <> mdi! and aw_handle.windowtype <> mdihelp! then
return -1
end if
iw_handle = aw_handle
return 1
end function
on n_cst_sheetmanager.create
call super::create
TriggerEvent( this, "constructor" )
end on
on n_cst_sheetmanager.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on