//**************************************************************************** // $Module type: Class // $Module name: cDbDSNRadioGroup // $Author : Nils G. Svedmyr // Created : 2002-11-21 @ 08:14 // // Description : // // $Rev History: // 2002-11-21 Module header created //**************************************************************************** Use cRDSDbRadioGroup.pkg Use cFileDSNButton.pkg Use cODBCAdminButton.pkg Use SyncFuncs.pkg // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:24 #IF (!@ >= 120) { OverrideProperty=Size InitialValue=72,244 } { OverrideProperty=Label InitialValue="Select an ODBC Data Source Type" } #ENDIF Class cDbDSNRadioGroup is a cRDSDbRadioGroup Procedure Construct_Object Handle ho Forward Send Construct_Object Property Handle phoDD (Main_DD(Self)) Property Handle phoServerObject 0 // (oSnctable_FromServer(Self)) Property Handle phoTextBox 0 Property Handle phoFileDSN_bn 0 Property Handle phoODBCAdminButton 0 Property Integer piDbType 0 // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:25 #IF (!@ >= 120) { InitialValue=True } #ENDIF Property Boolean pbFrom True //Set Size To 72 244 //Set Location To 10 288 //Set peAnchors To anTopRight Set Label To "Select an ODBC Data Source Type" Set Entry_msg To DoCheckEntering // Create three radio button child objects: Get Create U_Radio To ho // Radio 1 Set Label Of ho To "&User Data Sources" Set Size Of ho To 10 77 Set Location Of ho To 10 5 Get Create U_Radio To ho // Radio 2 Set Label Of ho To "Syste&m Data Sources" Set Size Of ho To 10 85 Set Location Of ho To 10 83 Set Status_Help Of ho To "Click to se the descriptive text below change" Get Create U_Radio To ho // Radio 3 Set Label Of ho To "&File Data Sources" Set Size Of ho To 10 73 Set Location Of ho To 10 170 Set Status_Help Of ho To "Press the 'Select File' button to select a Data Source" // Create the textbox object: Get Create U_Textbox To ho // phoTextBox Set phoTextBox To ho Set Label Of ho To "An ODBC File data source allows you to connect to a data provider..." Set Auto_Size_State Of ho To FALSE Set Location Of ho To 28 7 Set Size Of ho To 23 233 Set Justification_Mode Of ho To jMode_Left Set TypeFace Of ho To "MS Sans Serif" // Create the cFileDSNButton object: Get Create U_cFileDSNButton To ho // phoFileDSN_bn Set phoFileDSN_bn To ho Set Label Of ho To "Sele&ct File" Set Size Of ho To 14 50 Set Location Of ho To 55 134 Set Status_Help Of ho To "Button is only enabled when the 'File Data Sources' radio button has been selected." Set peAnchors Of ho To anTopRight Set Bitmap Of ho To "FolderO16.bmp" Set piTransparentColor Of ho To clWhite Set pbFrom Of ho To TRUE // Create the cODBCAdminButton object: Get Create U_cODBCAdminButton To ho // cODBCAdminButton Set phoODBCAdminButton To ho Set Label Of ho To "O&DBC Admin" Set Size Of ho To 14 60 Set Location Of ho To 55 184 Set Status_Help Of ho To "Start Windows 'ODBC Data Source Administrator'." Set peAnchors Of ho To anTopRight Set Bitmap Of ho To "ODBC16.bmp" Set piTransparentColor Of ho To clWhite On_Key Key_Alt+Key_C Send OnClick Of (phoFileDSN_bn(Self)) On_Key Key_Alt+Key_D Send OnClick Of (phoODBCAdminButton(Self)) End_Procedure // Construct_Object Procedure End_Construct_Object Handle ho Forward Send End_Construct_Object If (pbFrom(Self)) Get DDObjectId (phoDD(Self)) SncTable.File_Number "FromServer" To ho // Function in SyncFuncs.pkg Else Get DDObjectId (phoDD(Self)) SncTable.File_Number "ToServer" To ho Set phoServerObject To ho End_Procedure // End_Construct_Object Procedure DoCheckEntering // If Not (Visible_State(Self)) Send Next // Else If Not (Enabled_State(Self)) Send Next End_Procedure // DoCheckEntering Procedure DoEnableDisable Integer iValue Set piDbType To iValue // Set Visible_State To (iValue = 4) // If (Visible_State(Self)) Set Current_Radio To 0 Set Enabled_State To (iValue = 4) Set Current_Radio To 0 End_Procedure // DoEnableDisable Procedure Notify_Select_State Integer iToItem Integer iFromItem Handle ho Integer iFile iField Forward Send Notify_Select_State iToItem iFromItem Get Data_File To iFile Get Data_Field To iField Set File_Field_Changed_Value Of (phoDD(Self)) iFile iField To iToItem Move (phoTextBox(Self)) To ho If (iToItem = 0) Set Value Of ho item 0 To ; ("An ODBC User data source stores information about how to connect to" * ; "the indicated data provider. A User data source is only visible to you," * ; "and can only be used on the current machine.") If (iToItem = 1) Set Value Of ho item 0 To ; ("An ODBC System data source stores information about how to connect to" * ; "the indicated data provider. A System data source is visible to all users" * ; "on this machine, including NT services.") If (iToItem = 2) Begin Set Value Of ho item 0 To ; ("An ODBC File data source allows you to connect to a data provider. File" * ; "DSNs can be shared by users who have the same drivers installed. NOTE:" * ; "You can now press the 'Select File' button.") End // If (iToItem = 2) Begin Set Enabled_State Of (phoFileDSN_bn(Self)) To (iToItem = 2) If (iToItem <> 2) Begin If (pbFrom(Self)) Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.FromFilePath To "" Else Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.ToFilePath To "" End // If (iToItem <> 2) Begin If (iToItem <> iFromItem) Send DoEnableDisable Of (phoServerObject(Self)) (piDbType(Self)) End_Procedure // Notify_Select_State End_Class // cDbDSNRadioGroup