File: w_main.srw
Size: 2361
Date: Wed, 13 Feb 2019 02:47:06 +0100
$PBExportHeader$w_main.srw
forward
global type w_main from window
end type
type cb_add from commandbutton 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 = 1367
integer height = 692
boolean titlebar = true
string title = "Printer Install"
boolean controlmenu = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
cb_add cb_add
cb_cancel cb_cancel
end type
global w_main w_main

type prototypes
Function long ShellExecute ( &
   long hwnd, &
   string lpOperation, &
   string lpFile, &
   string lpParameters, &
   string lpDirectory, &
   long nShowCmd &
   ) Library "shell32.dll" Alias For "ShellExecuteW"

end prototypes

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

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

type cb_add from commandbutton within w_main
integer x = 73
integer y = 64
integer width = 882
integer height = 164
integer taborder = 20
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "Add Sybase DataWindow PS"
end type

event clicked;n_addprinter ln_addptr
String ls_pathname, ls_filename, ls_initdir
Integer li_rc

If DirectoryExists("C:\Program Files\gs") Then
   ls_initdir = "C:\Program Files\gs"
Else
   If DirectoryExists("C:\Program Files (x86)\gs") Then
      ls_initdir = "C:\Program Files (x86)\gs"
   End If
End If

li_rc = GetFileOpenName("Select Printer Setup File", &
            ls_pathname, ls_filename, "inf", &
            "Setup Information file (*.inf), *.inf", ls_initdir)

If li_rc = 1 Then
   ln_addptr.of_AddDataWindowPS(ls_pathname)
   MessageBox("Add Printer", "Complete!")
End If

end event

type cb_cancel from commandbutton within w_main
integer x = 951
integer y = 448
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