pfc_default


pfcapsrv.pbl   >   pfc_w_print   >   pfc_default   

Full name pfc_w_print.pfc_default
Access public
Extend of
Return value
Prototype event pfc_default()

Name Datatype
No Data

Name Datatype
li_copies integer
ll_frompage long
ll_topage long
ls_invalidpagerange string

event pfc_default;call super::pfc_default;//////////////////////////////////////////////////////////////////////////////
//
//	Event:  pfc_default
//
//	Arguments:  none
//
//	Returns:  none
//
//	Description:
//	Populate printdlg structure based on user selections and return it
//	in the message object.
//
//////////////////////////////////////////////////////////////////////////////
//	
//	Revision History
//
//	Version
//	5.0.02   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

integer	li_copies
long	ll_frompage
long	ll_topage
string	ls_invalidpagerange

ls_invalidpagerange = "This value is not in the page range.~r~n" + &
	"Please enter a number between " + String (il_minpage) + " and " + 	String (il_maxpage) + "."

ll_frompage = Long (em_frompage.text)
ll_topage = Long (em_topage.text)

// Validate page range
if rb_pages.enabled and rb_pages.checked then
	if ll_frompage < il_minpage or ll_frompage > il_maxpage then
		of_MessageBox ("pfc_print_invalidpagerange", "Print", ls_invalidpagerange, &
			exclamation!, Ok!, 1)
		em_frompage.SetFocus()
		return
	end if

	if ll_topage < il_minpage or ll_topage > il_maxpage then
		of_MessageBox ("pfc_print_invalidpagerange", "Print", ls_invalidpagerange, &
			exclamation!, Ok!, 1)
		em_topage.SetFocus()
		return
	end if
	
	if ll_frompage > ll_topage then
		of_MessageBox ("pfc_print_invalidfromvalue", "Print", &
			"The 'From' value cannot be greater than the 'To' value.", &
			exclamation!, Ok!, 1)
		em_frompage.SetFocus()
		return
	end if
end if

// Validate number of copies
li_copies = Integer (em_copies.text)
if li_copies <= 0 then
	of_MessageBox ("pfc_print_invalidcopies", "Print", &
		"Copies must be greater than zero", exclamation!, Ok!, 1)
	em_copies.SetFocus()
	return
end if

// Populate printdlg structure with values that the user selected
// from the print dialog
istr_printdlg.b_allpages = rb_all.checked
istr_printdlg.b_pagenums = rb_pages.checked
istr_printdlg.b_selection = rb_selection.checked
istr_printdlg.b_collate = cbx_collate.checked
istr_printdlg.l_copies = li_copies
istr_printdlg.b_printtofile = cbx_printtofile.checked
istr_printdlg.l_frompage = ll_frompage
istr_printdlg.l_topage = ll_topage

// Update the b_disablepagenums element which will be
// used to indicate that the default action was taken
istr_printdlg.b_disablepagenums = true

CloseWithReturn (this, istr_printdlg)
end event

     
Name Owner
pfc_w_print.cb_ok.clicked cb_ok

     
Name Owner
dragobject.setfocus dragobject
systemfunctions.closewithreturn systemfunctions
systemfunctions.integer systemfunctions
systemfunctions.long systemfunctions
systemfunctions.string systemfunctions
pfc_w_master.of_messagebox pfc_w_master
pfc_w_response.pfc_default pfc_w_response

     
Full name
pfc_w_print
s_printdlgattrib
pfc_w_print.rb_all
pfc_w_print.em_frompage
pfc_w_print.em_copies

     
Name Scope
No Data