File: w_main.srw
Size: 2387
Date: Sun, 03 Feb 2019 16:54:22 +0100
$PBExportHeader$w_main.srw
forward
global type w_main from window
end type
type dw_cust from u_dw within w_main
end type
type cb_cancel from commandbutton within w_main
end type
end forward

global type w_main from window
integer width = 2853
integer height = 1640
boolean titlebar = true
string title = "Grid DataWindow Service"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
dw_cust dw_cust
cb_cancel cb_cancel
end type
global w_main w_main

on w_main.create
this.dw_cust=create dw_cust
this.cb_cancel=create cb_cancel
this.Control[]={this.dw_cust,&
this.cb_cancel}
end on

on w_main.destroy
destroy(this.dw_cust)
destroy(this.cb_cancel)
end on

event open;// needed because datawindow is not retrieved
dw_cust.Sort()
dw_cust.Event RetrieveEnd(dw_cust.RowCount())
dw_cust.Event RowFocusChanged(1)

end event

event resize;cb_cancel.X = newwidth  - 375
cb_cancel.Y = newheight - 135

dw_cust.Width  = newwidth  - 75
dw_cust.Height = newheight - 200

end event

type dw_cust from u_dw within w_main
integer x = 37
integer y = 32
integer width = 2711
integer height = 1316
integer taborder = 10
string dataobject = "d_customer"
boolean hscrollbar = true
boolean vscrollbar = true
boolean border = false
end type

event constructor;call super::constructor;// load sort service
If this.of_StartService("GridStyle") Then
   iSrv_GridStyle.of_SetStyle(True, True, True, True)
   iSrv_GridStyle.of_AddAutoWidth("fname")
   iSrv_GridStyle.of_AddAutoWidth("lname")
   iSrv_GridStyle.of_AddAutoWidth("address")
   iSrv_GridStyle.of_AddAutoWidth("city")
   iSrv_GridStyle.of_AddAutoWidth("state")
   iSrv_GridStyle.of_AddAutoWidth("company_name")
End If

// load selectrow service
If this.of_StartService("Select") Then
   iSrv_Select.of_SetSelectStyle("extend")
End If

end event

type cb_cancel from commandbutton within w_main
integer x = 2414
integer y = 1376
integer width = 334
integer height = 100
integer taborder = 10
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "Cancel"
boolean cancel = true
end type

event clicked;Close(Parent)

end event