// **************************************************************************** // // ** ** // // ** Class : cWizard ** // // ** ** // // ** Purpose : This package defines the following classes: ** // // ** cWizard ** // // ** cWelcomePage ** // // ** cInteriorPage ** // // ** cCompletionPage ** // // ** ** // // ** This package also defines the following private classes: ** // // ** cTextBox cBackButton cNextButton ** // // ** cCancelButton cWizardPage cExteriorPage ** // // ** ** // // ** ** // // ** Author : Emil Stojanov ** // // ** Quantaris ** // // ** ** // // ** Date : 16-10-2000 ** // // ** ** // // **************************************************************************** // Use Windows.Pkg // Standard Windows package Use DfLine.Pkg // LineControl class Use DfBitmap.Pkg // BitmapContainer class Use DfClient.Pkg // dbContainer3d class Use Data_Set.Pkg // To support dataset's Register_Function piCurrentPage Returns Integer Register_Function pbWelcomePage Returns Integer Register_Function pbCompletionPage Returns Integer Register_Function piWelcomePage Returns Integer Register_Function piCompletionPage Returns Integer Register_Procedure CancelWizard Define DS_3DLOOK For |CI$0004 Define DS_MODALFRAME For |CI$80 // Can be combined with WS_CAPTION Define DS_SETFONT For |CI$40 // User specified font for Dlg controls Define WIZARD_FORWARD_NAVIGATE For 2 Define WIZARD_BACKWARD_NAVIGATE For 1 Class cTextBox Is A TextBox Procedure Set Label String sLabel Set Value Item 0 To (Replaces ("\n", sLabel, Character(13))) End_Procedure // Set Label Function Label Returns String Function_Return (Replaces (Character(13), Value (Self, 0), "\n")) End_Function // Label End_Class // cTextBox Class cBackButton Is A Button Procedure Construct_Object Forward Send Construct_Object Set Label To "< &Back" Set Location To 237 195 Set Size To 14 50 End_Procedure // Construct_Object Procedure OnClick Send SwitchPage WIZARD_BACKWARD_NAVIGATE End_Procedure // OnClick End_Class // cBackButton Class cNextButton Is A Button Procedure Construct_Object Forward Send Construct_Object Set Label To "&Next >" Set Location To 237 245 Set Size To 14 50 Set Default_State To True End_Procedure // Construct_Object Procedure OnClick If (piCurrentPage (Self) = piCompletionPage (Self)) Begin Send FinishWizard End Else Begin Send SwitchPage WIZARD_FORWARD_NAVIGATE End End_Procedure // OnClick End_Class // cNextButton Class cCancelButton Is A Button Procedure Construct_Object Forward Send Construct_Object Set Label To "Cancel" Set Location To 237 302 Set Size To 14 50 End_Procedure // Construct_Object Procedure OnClick Send CancelWizard End_Procedure // OnClick End_Class // cCancelButton // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Size InitialValue=272,362 } { OverrideProperty=Size DesignTime=False } { OverrideProperty=Bitmap InitialValue="cWizard.Bmp" } { OverrideProperty=Bitmap DesignTime=False } { OverrideProperty=Bitmap_Style InitialValue=Bitmap_Actual } { OverrideProperty=Bitmap_Style EnumList="Bitmap_Actual, Bitmap_Stretch, Bitmap_Tile, Bitmap_Center" } { OverrideProperty=Bitmap_Style DesignTime=False } { OverrideProperty=Border_Style InitialValue=Border_Dialog } { OverrideProperty=Border_Style EnumList="Border_None, Border_Normal, Border_Dialog, Border_Thick, Border_ClientEdge, Border_WindowEdge, Border_StaticEdge" } { OverrideProperty=Border_Style DesignTime=False } { OverrideProperty=Caption_Bar InitialValue=True } { OverrideProperty=Caption_Bar DesignTime=False } { OverrideProperty=Color InitialValue=clLtGray } { OverrideProperty=Color DesignTime=False } { OverrideProperty=TextColor InitialValue=clWindowText } { OverrideProperty=TextColor DesignTime=False } { OverrideProperty=Label InitialValue="Wizard label, set this label via psLabel in the wizard" } { OverrideProperty=Label DesignTime=False } { OverrideProperty=Minimize_Icon InitialValue=False } { OverrideProperty=Minimize_Icon DesignTime=False } { OverrideProperty=Maximize_Icon InitialValue=False } { OverrideProperty=Maximize_Icon DesignTime=False } { OverrideProperty=Sysmenu_Icon InitialValue=True } { OverrideProperty=Sysmenu_Icon DesignTime=False } #ENDIF Class cWizard Is A DbModalPanel //BasicPanel Procedure Construct_Object Forward Send Construct_Object Property String psHeaderGraphic Property String Private.psLabel Property Integer piCurrentPage -1 Property Integer piWelcomePage -1 Property Integer piCompletionPage -1 Set Minimize_Icon To False Set Maximize_Icon To False // Set Modal_State To True Set Size To 272 362 // Set Border_Style To Border_Dialog Object oWizardPages Is An Array End_Object // oWizardPages Object oBottomLine Is A LineControl Set GuiSize To 2 1600 Set Location To 228 0 End_Object // oBottomLine Object oBackButton Is A cBackButton End_Object // oBackButton Object oNextButton Is A cNextButton End_Object // oNextButton Object oCancelButton Is A cCancelButton End_Object // oCancelButton On_Key kCancel Send OnClick To oCancelButton On_Key Key_Alt+Key_N Send OnClick To oNextButton On_Key Key_Alt+Key_B Send OnClick To oBackButton On_Key kClose_Panel Send CancelWizard // Set Window_Style To WS_POPUPWINDOW False // Set Window_Style To WS_CLIPCHILDREN False // Set Window_Style To WS_CAPTION True // Set Window_Style To WS_POPUP True // Set Window_Style To DS_3DLOOK True // Set Window_Style To DS_SETFONT True // Set Window_Style To DS_MODALFRAME True // Set Extended_Window_Style To WS_EX_DLGMODALFRAME True // Set Extended_Window_Style To WS_EX_CONTROLPARENT True End_Procedure // Construct_Object Procedure Set psLabel String sLabel Set private.psLabel To sLabel Set Label To sLabel End_Procedure // Set psLabel Function psLabel Returns String String sLabel Get private.psLabel To sLabel Function_Return sLabel End_Function // psLabel Function NumberOfPages Returns Integer Integer iPageCount Get Item_Count Of oWizardPages To iPageCount Function_Return iPageCount End_Function // NumberOfPages Procedure AddPage Integer hoObject Integer iPageCount Get NumberOfPages To iPageCount If (pbWelcomePage (hoObject)) Begin Set piWelcomePage To iPageCount End If (pbCompletionPage (hoObject)) Begin Set piCompletionPage To iPageCount End Set Value Of oWizardPages Item iPageCount To hoObject End_Procedure // AddPage Procedure Activate_Group Integer iWelComePage Forward Send Activate_group Send Delete_Data To oWizardPages Broadcast Send RegisterPage Get piWelComePage To iWelComePage Send SwitchToPage -1 iWelComePage WIZARD_FORWARD_NAVIGATE End_Procedure // Activate_Group Procedure SwitchToPage Integer iFrom Integer iTo Integer iDirection Integer hoFrom hoTo hoWizardPages Move oWizardPages To hoWizardPages Get Value Of hoWizardPages Item iTo To hoTo If (iFrom <> -1) Begin Get Value Of hoWizardPages Item iFrom To hoFrom Send OnLeaving To hoFrom iTo iDirection Send OnPageChange To hoFrom iFrom iTo iDirection Set Visible_State Of hoFrom To False End Set piCurrentPage To iTo Set Visible_State Of hoTo To True // 2002-01-28 ------------------------------------ Start Nils G. Svedmyr Send Page of hoTo // Necessary to re-display the Welcome page upon second wizard activation. // 2002-01-28 ------------------------------------ Stop Nils G. Svedmyr Set Enabled_State Of oBackButton To (Not (pbWelcomePage (hoTo))) If (pbCompletionPage (hoTo)) Begin Set Label Of oNextButton To "Finish" End Else Begin Set Label Of oNextButton To "&Next >" End Send OnEntering To hoTo iFrom iDirection End_Procedure // SwitchToPage Procedure SwitchPage Integer iDirection Integer hoFrom hoTo iFrom iTo hoWizardPages Boolean bOk Move oWizardPages To hoWizardPages Get piCurrentPage To iFrom Get Value Of hoWizardPages Item iFrom To hoFrom If (iDirection = WIZARD_BACKWARD_NAVIGATE) Begin Get piPreviousPage Of hoFrom To iTo End Else Begin Get piNextPage Of hoFrom To iTo End If (iTo >= 0) Begin Get Value Of hoWizardPages Item iTo To hoTo Get ConfirmPageChange Of hoFrom iDirection To bOk If (bOk) Begin Send SwitchToPage iFrom iTo iDirection End End End_Procedure // SwitchPage Procedure FinishWizard Send Close_Panel End_Procedure // FinishWizard Procedure CancelWizard Integer iResult Get YesNo_Box "Are you sure you want to close the wizard?" (psLabel(Self)) To iResult If (iResult = MBR_NO) Begin Procedure_Return End Send Close_Panel End_Procedure // CancelWizard Procedure OnEntering Integer iFrom Integer iDirection End_Procedure // OnEntering Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection End_Procedure // OnPageChange Procedure OnLeaving Integer iTo Integer iDirection End_Procedure // OnLeaving End_Class // cWizard // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Sysmenu_Icon InitialValue=True } { OverrideProperty=Sysmenu_Icon DesignTime=False } #ENDIF // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Visible_State InitialValue=False } { OverrideProperty=Location InitialValue=0,0 } { OverrideProperty=Location DesignTime=False } { OverrideProperty=Size InitialValue=228,362 } { OverrideProperty=Size DesignTime=False } { OverrideProperty=Bitmap_Style InitialValue=Bitmap_Actual } { OverrideProperty=Bitmap_Style EnumList="Bitmap_Actual, Bitmap_Stretch, Bitmap_Tile, Bitmap_Center" } { OverrideProperty=Bitmap_Style DesignTime=False } { OverrideProperty=Border_Style InitialValue=Border_None } { OverrideProperty=Border_Style EnumList="Border_None, Border_Normal, Border_Dialog, Border_Thick, Border_ClientEdge, Border_WindowEdge, Border_StaticEdge" } { OverrideProperty=Border_Style DesignTime=False } { OverrideProperty=Color InitialValue=clLtGray } { OverrideProperty=Color DesignTime=False } { OverrideProperty=TextColor InitialValue=clWindowText } { OverrideProperty=TextColor DesignTime=False } #ENDIF Class cWizardPage Is A dbContainer3d Procedure Construct_Object Forward Send Construct_Object // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { InitialValue=False } { DesignTime=False } #ENDIF Property Integer pbWelcomePage Public False // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { InitialValue=False } { DesignTime=False } #ENDIF Property Integer pbCompletionPage Public False Property Integer Private.piPreviousPage Public -1 Property Integer Private.piNextPage Public -1 Set Location To 0 0 Set Size To 228 362 Set Border_Style To Border_None Set Visible_State To False Set Attach_Parent_State To True End_Procedure // Construct_Object // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { InitialValue=0 } #ENDIF Procedure Set piPreviousPage Integer iPage Set Private.piPreviousPage To iPage End_Procedure // Set piPreviousPage Function piPreviousPage Returns Integer Integer iPreviousPage If (pbWelcomePage (Self)) Begin Move -1 To iPreviousPage End Else Begin If (Private.piPreviousPage (Self) = -1) Begin Move (piCurrentPage (Self) - 1) To iPreviousPage End Else Begin Move (Private.piPreviousPage (Self)) To iPreviousPage End End Function_Return iPreviousPage End_Function // piPreviousPage // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { InitialValue=0 } #ENDIF Procedure Set piNextPage Integer iPage Set Private.piNextPage To iPage End_Procedure // Set piNextpage Function piNextPage Returns Integer Integer iNextPage If (pbCompletionPage (Self)) Begin Move -1 To iNextPage End Else Begin If (Private.piNextPage (Self) = -1) Begin Move (piCurrentPage (Self) + 1) To iNextPage End Else Begin Move (Private.piNextPage (Self)) To iNextPage End End Function_Return iNextPage End_Function // piNextPage Function ConfirmPageChange Integer iDirection Returns Boolean Function_Return True End_Function // ConfirmPageChange Procedure RegisterPage Integer hoSelf hoParent Move Self To hoSelf Move (Parent (hoSelf)) To hoParent Send AddPage To hoParent hoSelf End_Procedure // RegisterPage End_Class // cWizardPage // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Sysmenu_Icon InitialValue=True } { OverrideProperty=Sysmenu_Icon DesignTime=False } #ENDIF // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=TextColor InitialValue=clWindowText } { OverrideProperty=TextColor DesignTime=False } #ENDIF Class cExteriorPage Is A cWizardPage Procedure Construct_Object Forward Send Construct_Object Set Color To clWhite Object oWatermark Is A BitmapContainer Set Location To 0 0 Set Size To 228 109 Set Border_Style To Border_None Set Focus_Mode To NonFocusable End_Object // oWatermark // Object oHeaderGraphic Is A BitmapContainer // Set Focus_Mode To NonFocusable // Set Location To 11 55 // Set Size To 38 41 // Set Color To clWhite // Set Border_Style To Border_None // Set Bitmap_Style To Bitmap_Center // Set Bitmap To (psHeaderGraphic (Self)) // End_Object // oHeaderGraphic Object oTitle Is A cTextbox Set Location To 8 115 Set Size To 24 225 Set Auto_Size_State To False Set Justification_Mode To jMode_Left Set Label To "" Set Color To clWhite Set TypeFace To "VERDANA" Set FontSize To 19 9 End_Object // oTitle Object oDescription Is A cTextbox Set Location To 37 115 Set Size To 125 225 Set Auto_Size_State To False Set Justification_Mode To jMode_Left Set Label To "" Set Color To clWhite End_Object // oDescription Object oBottomText Is A cTextbox Set Location To 209 115 Set Size To 10 225 Set Auto_Size_State To False Set Justification_Mode To jMode_Left Set Label To "" Set Color To clWhite End_Object // oBottomText End_Procedure // Construct_Object Procedure Set psWatermark String sBitmap Set Bitmap Of oWatermark To sBitmap End_Procedure // Set psWatermark Function psWatermark Returns String String sBitmap Get Bitmap Of oWaterMark To sBitmap Function_Return sBitmap End_Function // psWatermark Procedure Set psTitle String sValue Set Label Of oTitle To sValue End_Procedure // Set psTitle Function psTitle Returns String String sTitle Get Label Of oTitle To sTitle Function_Return sTitle End_Function // psTitle Procedure Set psDescription String sValue Set Label Of oDescription To sValue End_Procedure // Set psDescription Function psDescription Returns String String sDescription Get Label Of oDescription To sDescription Function_Return sDescription End_Function // psDescription Procedure Set psBottomText String sValue Set Label Of oBottomText To sValue End_Procedure // Set psBottomText Function psBottomText Returns String String sBottomText Get Label Of oBottomText To sBottomText Function_Return sBottomText End_Function // psBottomText End_Class // cExteriorPage // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Bitmap InitialValue="cInteriorPage.Bmp" } { OverrideProperty=Bitmap DesignTime=False } #ENDIF // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Sysmenu_Icon InitialValue=True } { OverrideProperty=Sysmenu_Icon DesignTime=False } #ENDIF // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=TextColor InitialValue=clWindowText } { OverrideProperty=TextColor DesignTime=False } #ENDIF Class cInteriorPage Is A cWizardPage Procedure Construct_Object Forward Send Construct_Object Object oHeader Is A Container3d Set Size To 37 362 Set Color To clWhite Set Border_Style To Border_None Object oTitle Is A cTextbox Set Location To 7 14 Set Size To 10 250 Set Auto_Size_State To False Set Justification_Mode To jMode_Left Set Label To "" Set Color To clWhite Set FontWeight To 600 End_Object // oTitle Object oSubTitle Is A cTextbox Set Location To 17 28 Set Size To 20 280 Set Auto_Size_State To False Set Justification_Mode To jMode_Left Set Color To clWhite End_Object // oSubTitle Object oHeaderGraphic Is A BitmapContainer Set Location To 0 317 Set Size To 38 40 Set Color To clWhite Set Border_Style To Border_None Set Bitmap_Style To Bitmap_Center Set Bitmap To (psHeaderGraphic (Self)) End_Object // oHeaderGraphic End_Object // oHeader Object oLineControl Is A LineControl Set Size To 2 362 Set Location To 37 0 End_Object // oLineControl End_Procedure // Construct_Object Procedure Set psTitle String sValue Set Label Of (oTitle (oHeader (Self))) To sValue End_Procedure // Set psTitle Function psTitle Returns String String sTitle Get Label Of (oTitle (oHeader (Self))) To sTitle Function_Return sTitle End_Function // psTitle Procedure Set psSubTitle String sValue Set Label Of (oSubTitle (oHeader (Self))) To sValue End_Procedure // Set psSubTitle Function psSubTitle Returns String String sSubTitle Get Label Of (oSubTitle (oHeader (Self))) To sSubTitle Function_Return sSubTitle End_Function // psSubTitle End_Class // cInteriorPage // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Bitmap InitialValue="cWelcomePage.Bmp" } { OverrideProperty=Bitmap DesignTime=False } { OverrideProperty=Bitmap_Style InitialValue=Bitmap_Actual } { OverrideProperty=Bitmap_Style EnumList="Bitmap_Actual, Bitmap_Stretch, Bitmap_Tile, Bitmap_Center" } { OverrideProperty=Bitmap_Style DesignTime=False } { OverrideProperty=pbWelcomePage InitialValue=True } { OverrideProperty=pbWelcomePage DesignTime=False } { OverrideProperty=pbCompletionPage InitialValue=False } { OverrideProperty=pbCompletionPage DesignTime=False } #ENDIF Class cWelcomePage Is A cExteriorPage Procedure Construct_Object Forward Send Construct_Object Set pbWelcomePage To True Set pbCompletionPage To False End_Procedure // Construct_Object End_Class // cWelcomePage // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Bitmap InitialValue="cCompletionPage.Bmp" } { OverrideProperty=Bitmap DesignTime=False } { OverrideProperty=pbWelcomePage InitialValue=False } { OverrideProperty=pbWelcomePage DesignTime=False } { OverrideProperty=pbCompletionPage InitialValue=True } { OverrideProperty=pbCompletionPage DesignTime=False } #ENDIF Class cCompletionPage Is A cExteriorPage Procedure Construct_Object Forward Send Construct_Object Set pbWelcomePage To False Set pbCompletionPage To True End_Procedure // Construct_Object End_Class // cCompletionPage