File: w_response.srw
Size: 2273
Date: Mon, 07 Apr 2008 21:31:06 +0200
$PBExportHeader$w_response.srw
$PBExportComments$Base Response Window
forward
global type w_response from w_main
end type
type uo_sizegrip from u_sizegrip within w_response
end type
end forward

global type w_response from w_main
integer width = 1879
integer height = 1276
boolean controlmenu = false
boolean minbox = false
boolean maxbox = false
boolean resizable = false
windowtype windowtype = response!
uo_sizegrip uo_sizegrip
end type
global w_response w_response

type variables
Protected:
Boolean #AllowResize = TRUE
end variables

forward prototypes
public subroutine of_makeresizable ()
end prototypes

public subroutine of_makeresizable ();IF #AllowResize THEN
   n_svc_mgr lnv_svc
   n_svc_window lnv_win
   
   lnv_svc.of_LoadSvc(lnv_win, CSvc.WINDOW)
   lnv_win.of_MakeResizable(lnv_svc, this)
END IF
end subroutine

on w_response.create
int iCurrent
call super::create
this.uo_sizegrip=create uo_sizegrip
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.uo_sizegrip
end on

on w_response.destroy
call super::destroy
destroy(this.uo_sizegrip)
end on

event ke_preopen;call super::ke_preopen;IF #AllowResize THEN 
   this.ControlMenu = FALSE
   this.POST of_MakeResizable()
END IF
end event

event ke_postopen;call super::ke_postopen;this.BringToTop = TRUE
end event

event ke_minmax;IF #AllowResize THEN
   //we must override since the base class uses the
   //Resizable property w/c is always false
   //for response windows
   n_svc_mgr lnv_svcman
   n_svc_window lnv_svcwin
   
   lnv_svcman.of_loadsvc(lnv_svcwin, CSvc.WINDOW)
   
   IF (#MinWidth > 0 ) OR (#MinHeight > 0) THEN
      lnv_svcwin.of_setmin(lnv_svcman, minmaxinfo, #MinWidth, #MinHeight)
   END IF
   IF (#MaxWidth > 0) OR (#MaxHeight > 0) THEN
      lnv_svcwin.of_setmax(lnv_svcman, minmaxinfo, #MaxWidth, #MaxHeight)        
   END IF
END IF
end event

event ke_resize;call super::ke_resize;IF NOT uo_sizegrip.visible  AND #AllowResize THEN 
   uo_sizegrip.Show()
   uo_sizegrip.BringToTop = FALSE
END IF

uo_sizegrip.Move(newwidth - uo_sizegrip.width, newheight - uo_sizegrip.height)
end event

type uo_sizegrip from u_sizegrip within w_response
boolean visible = false
integer x = 1664
integer y = 896
long #sizeorder = -1
end type