GpStructuredStorage file  # $%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~sqli.vtd6 sqliForm.vtdsqliFormName.vtd. sqliStep.vtdWsqliStepFile.vtd8sqliStepStr.vtd6sqliStepStrEvent.vtd sqliVar.vtd { sqliVer.vtd!sqliReports.vtd"acKeyacNamed acIsDebugacType acVarInINI acAutoStart acAutoClose acEndMessageacLocalization2acFormNameAuthoracActive anVersion acLogType acInstCoded anUserChg anUserIns adTimeChg adTimeIns acNoteacCompiledScriptDEMO001&Selecting type for user defined fieldsFAFFFTRT0G٭SBB acKey acFormName2 acDocType acObjectName2acType acKeyShortCut2acTabSheetName2 anUserChg anUserIns adTimeChg adTimeIns acFormTypeDEMO001SifUser<>DbBbB1DEMO001 Form_Delavci<>DbBbB1 acFormName2acName2acKeyanNoacViewacSetOfacDescracReportacFileCreateTableanFileDelimiter acFileNameacFileTableName acFileDest acFileType acFileTypeXML acShowIfEmptyacTitleButtons anTitleLinesanBeginFromRecord anUserChg anUserIns adTimeChg adTimeIns acCharSet2 acStyleSheet acUnitName2 acNewThreadacDFMacPAS acSQLExport2acSQLExpacNoteDEMO001GPFAENF0cBdB windows-1250 AresProjectF//DPA za nastavljanje tipa uporabnikim poljem. //author: Matej Golob //last change: 25/03/2008 Program AresProject; uses sysutils, classes, forms, dialogs, FFormSetup, FFormEditField, TargetFieldModification; var sOwnerClass: string; begin sOwnerClass := UpperCase(OwnerForm.ClassName); case sOwnerClass of 'TARIDE' : //nastavitve with TFormSetup.create(nil) do begin showmodal; free; end; 'TSIFUSER' : //integracija na administratorsko konzolo FFormEditField.IntegrateOnOwnerForm; 'TFORM_DELAVCI' : //integracija na personalno mapo ModifyTargetFields; end; end. DEMO001GFFAENFUoBdB windows-1250 FFormSetupF&object FormSetup: TForm Tag = 99 Left = 510 Top = 240 Caption = 'Nastavitve integracije:' ClientHeight = 205 ClientWidth = 514 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False Position = poDesigned PixelsPerInch = 96 TextHeight = 13 object dlcxPanel1: TdlcxPanel Left = 0 Top = 164 Width = 514 Height = 41 Align = alBottom Alignment = taLeftJustify BorderStyle = bsNone BorderSize = 1 BorderColor3D = clWhite Border3D = False BorderColor = clGray Color = 15065304 ColorTo = 15065304 ComponentSize = csSmall Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] Options = [] ParentColor = False PanelType = ptNone TabOrder = 0 Templatable = False Transparent = False HeaderVisible = False HeaderColor = 15065304 HeaderColorTo = 15065304 HeaderHeight = 0 HeaderFont.Charset = DEFAULT_CHARSET HeaderFont.Color = clWindowText HeaderFont.Height = -11 HeaderFont.Name = 'Tahoma' HeaderFont.Style = [] HeaderAlignment = taLeftJustify HeaderPanelType = ptNone HotColor = clBlack HotColorTo = clBlack CheckedColor = clBlack CheckedColorTo = clBlack Checked = False object dlcxButton1: TdlcxButton Left = 9 Top = 11 Width = 75 Height = 25 Cancel = False Caption = 'OK' ComponentSize = csSmall Templatable = False Default = True ModalResult = 0 TabOrder = 0 ImmediatePopUp = False end object dlcxButton2: TdlcxButton Left = 92 Top = 11 Width = 75 Height = 25 Cancel = False Caption = 'Prekli'#269'i' ComponentSize = csSmall Templatable = False Default = False ModalResult = 0 TabOrder = 1 ImmediatePopUp = False end end object dlcxLabeledImageComboBox1: TdlcxLabeledImageComboBox Left = 185 Top = 11 AutoSize = False Properties.Items = < item Description = 'Text 01' ImageIndex = 0 Value = 'fPrsntext01' end item Description = 'Text 02' Value = 'fPrsntext02' end item Description = 'Text 03' Value = 'fPrsntext03' end item Description = 'Text 04' Value = 'fPrsntext04' end item Description = 'Text 05' Value = 'fPrsntext05' end item Description = 'Text 06' Value = 'fPrsntext06' end item Description = 'Text 07' Value = 'fPrsntext07' end item Description = 'Text 08' Value = 'fPrsntext08' end item Description = 'Text 09' Value = 'fPrsntext09' end item Description = 'Text 10' Value = 'fPrsntext10' end> Properties.ReadOnly = False Properties.ClearValue = Null Style.BorderStyle = ebsFlat Style.Color = 15065304 Style.LookAndFeel.Kind = lfFlat Style.LookAndFeel.NativeStyle = False Style.Shadow = False Style.ButtonStyle = btsSimple Style.ButtonTransparency = ebtAlways Style.PopupBorderStyle = epbsDefault StyleDisabled.LookAndFeel.Kind = lfFlat StyleDisabled.LookAndFeel.NativeStyle = False StyleFocused.Color = 14347503 StyleFocused.LookAndFeel.Kind = lfFlat StyleFocused.LookAndFeel.NativeStyle = False StyleHot.LookAndFeel.Kind = lfFlat StyleHot.LookAndFeel.NativeStyle = False TabOrder = 1 LabelPosition = lpoLeft LabelSpacing = 3 LabelVisible = True EditLabel.Left = 30 EditLabel.Top = 14 EditLabel.Width = 152 EditLabel.Height = 13 EditLabel.Caption = 'Polje - Administratorska konzola' EditLabel.FocusControl = dlcxLabeledImageComboBox1 EditLabel.Transparent = True ComponentSize = csSmall Templatable = False Caption = 'Polje - Administratorska konzola' ReadOnly = False Height = 19 Width = 313 end object dlcxLabeledImageComboBox2: TdlcxLabeledImageComboBox Left = 185 Top = 39 AutoSize = False Properties.Items = < item Description = 'Combo' ImageIndex = 0 Value = 1 end item Description = 'Lookup Combo' Value = 2 end item Description = 'Check box' Value = 3 end item Description = 'Check box - multi' Value = 4 end> Properties.ReadOnly = False Properties.ClearValue = Null Style.BorderStyle = ebsFlat Style.Color = 15065304 Style.LookAndFeel.Kind = lfFlat Style.LookAndFeel.NativeStyle = False Style.Shadow = False Style.ButtonStyle = btsSimple Style.ButtonTransparency = ebtAlways Style.PopupBorderStyle = epbsDefault StyleDisabled.LookAndFeel.Kind = lfFlat StyleDisabled.LookAndFeel.NativeStyle = False StyleFocused.Color = 14347503 StyleFocused.LookAndFeel.Kind = lfFlat StyleFocused.LookAndFeel.NativeStyle = False StyleHot.LookAndFeel.Kind = lfFlat StyleHot.LookAndFeel.NativeStyle = False TabOrder = 2 LabelPosition = lpoLeft LabelSpacing = 3 LabelVisible = True EditLabel.Left = 168 EditLabel.Top = 42 EditLabel.Width = 14 EditLabel.Height = 13 EditLabel.Caption = 'Tip' EditLabel.FocusControl = dlcxLabeledImageComboBox2 EditLabel.Transparent = True ComponentSize = csSmall Templatable = False Caption = 'Tip' ReadOnly = False Height = 19 Width = 121 end object dlcxButton3: TdlcxButton Left = 185 Top = 69 Width = 75 Height = 25 Cancel = False Caption = 'Nastavitev' ComponentSize = csSmall Templatable = False Default = False ModalResult = 0 TabOrder = 3 ImmediatePopUp = False end object _evsaver: TEventCom events = 'dlcxButton1.OnClick=dlcxButton1Click'#13#10'dlcxButton2.OnClick=dlcxBu' + 'tton2Click'#13#10'dlcxButton3.OnClick=dlcxButton3Click'#13#10 end end Unit FFormSetup; interface uses Forms, Controls, StdCtrls, SysUtils, Classes, Graphics, dlcomponents, Dialogs; type TFormSetup = class(TarForm) dlcxPanel1: TdlcxPanel; dlcxButton1: TdlcxButton; dlcxButton2: TdlcxButton; dlcxLabeledImageComboBox1: TdlcxLabeledImageComboBox; dlcxLabeledImageComboBox2: TdlcxLabeledImageComboBox; dlcxButton3: TdlcxButton; procedure dlcxButton3Click(Sender: TObject); procedure dlcxButton2Click(Sender: TObject); procedure dlcxButton1Click(Sender: TObject); private procedure LoadSettings; procedure SaveSettings; public constructor Create(AOwner: TComponent); override; end; var FormSetup: TFormSetup; implementation uses FFormEditField; constructor TFormSetup.Create(AOwner: TComponent); begin inherited Create(AOwner); ares.AssignObjectsToForm('FFormSetup',Self); dlcxPanel1 := FindComponent('dlcxPanel1'); dlcxButton1 := FindComponent('dlcxButton1'); dlcxButton2 := FindComponent('dlcxButton2'); dlcxLabeledImageComboBox1 := FindComponent('dlcxLabeledImageComboBox1'); dlcxLabeledImageComboBox2 := FindComponent('dlcxLabeledImageComboBox2'); dlcxButton3 := FindComponent('dlcxButton3'); dlcxButton3.OnClick := dlcxButton3Click; dlcxButton2.OnClick := dlcxButton2Click; dlcxButton1.OnClick := dlcxButton1Click; LoadSettings; end; procedure TFormSetup.LoadSettings; var i: integer; begin //lokacija na ak dlcxLabeledImageComboBox1.Editvalue := ares.dbVariables['location']; i := ares.dbVariables.asInteger['type', 0]; dlcxLabeledImageComboBox2.Editvalue := i; end; procedure TFormSetup.SaveSettings; begin ares.dbVariables['location'] := dlcxLabeledImageComboBox1.Editvalue; ares.dbVariables['type'] := dlcxLabeledImageComboBox2.Editvalue; end; procedure TFormSetup.dlcxButton1Click(Sender: TObject); begin SaveSettings; close; end; procedure TFormSetup.dlcxButton2Click(Sender: TObject); begin close; end; procedure TFormSetup.dlcxButton3Click(Sender: TObject); begin ares.dbVariables['location'] := dlcxLabeledImageComboBox1.Editvalue; ShowEditForm; end; end. DEMO001GFFAENFoBdB windows-1250FFormEditFieldFobject FormEditField: TForm Tag = 99 Left = 510 Top = 240 Caption = 'Nabor' ClientHeight = 206 ClientWidth = 312 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False Position = poDesigned PixelsPerInch = 96 TextHeight = 13 object dlcxPanel1: TdlcxPanel Left = 0 Top = 169 Width = 312 Height = 37 Align = alBottom Alignment = taLeftJustify BorderStyle = bsNone BorderSize = 1 BorderColor3D = clWhite Border3D = False BorderColor = clGray Color = 15065304 ColorTo = 15065304 ComponentSize = csSmall Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] Options = [] ParentColor = False PanelType = ptNone TabOrder = 0 Templatable = False Transparent = False HeaderVisible = False HeaderColor = 15065304 HeaderColorTo = 15065304 HeaderHeight = 0 HeaderFont.Charset = DEFAULT_CHARSET HeaderFont.Color = clWindowText HeaderFont.Height = -11 HeaderFont.Name = 'Tahoma' HeaderFont.Style = [] HeaderAlignment = taLeftJustify HeaderPanelType = ptNone HotColor = clBlack HotColorTo = clBlack CheckedColor = clBlack CheckedColorTo = clBlack Checked = False object dlcxButton1: TdlcxButton Left = 6 Top = 4 Width = 75 Height = 25 Cancel = False Caption = 'OK' ComponentSize = csSmall Templatable = False Default = True ModalResult = 1 TabOrder = 0 ImmediatePopUp = False end object dlcxButton2: TdlcxButton Left = 88 Top = 4 Width = 75 Height = 25 Cancel = False Caption = 'Prekli'#269'i' ComponentSize = csSmall Templatable = False Default = False ModalResult = 0 TabOrder = 1 ImmediatePopUp = False end end object dlcxDBMemo1: TdlcxDBMemo Left = 0 Top = 0 Align = alClient DataBinding.DataField = 'acSQLExp' DataBinding.DataSource = DataSource1 Style.BorderStyle = ebsFlat Style.Color = 15065304 Style.LookAndFeel.Kind = lfFlat Style.LookAndFeel.NativeStyle = False Style.Shadow = False StyleDisabled.LookAndFeel.Kind = lfFlat StyleDisabled.LookAndFeel.NativeStyle = False StyleFocused.Color = 14347503 StyleFocused.LookAndFeel.Kind = lfFlat StyleFocused.LookAndFeel.NativeStyle = False StyleHot.LookAndFeel.Kind = lfFlat StyleHot.LookAndFeel.NativeStyle = False TabOrder = 1 ComponentSize = csSmall Templatable = False Height = 169 Width = 312 end object _evsaver: TEventCom end object DataSource1: TDataSource DataSet = dlDataset1 Left = 11 Top = 45 end object dlDataset1: TdlDataset SQL.Strings = ( 'select * from tpa_sqliStep where acKey = :acKey and anNo = 3') AutoCalcFields = False Cached = False LocateInsert = False Editable = True RequestLive = False QueryRecCount = False DetailDelay = 0 LocalMasterDetail = False StrictUpdate = False TrimFixedChar = True TrimVarChar = True AddRowidToSQL = False ORACompatibility = True Left = 46 Top = 45 ParamData = < item DataType = ftUnknown Name = 'acKey' end> end end TUnit FFormEditField; interface uses Forms, Controls, StdCtrls, SysUtils, Classes, Graphics, dlcomponents, Dialogs, dlDatabase, db; type TFormEditField = class(TarForm) dlcxPanel1: TdlcxPanel; dlcxButton1: TdlcxButton; dlcxButton2: TdlcxButton; dlcxDBMemo1: TdlcxDBMemo; DataSource1: TDataSource; dlDataset1: TdlDataset; procedure dlcxButton2Click(Sender: TObject); procedure dlcxButton1Click(Sender: TObject); public constructor Create(AOwner: TComponent); override; end; TmyButton = class(TdlcxButton) private procedure DoMyClick(sender: TObject); public constructor Create(AOwner: TComponent); end; procedure ShowEditForm; procedure IntegrateOnOwnerForm; function GetStrFromDPA(AnNo: integer): string; var FormEditField: TFormEditField; implementation uses Konstante; //prikaz forme za urejanje procedure ShowEditForm; var typ: integer; fr1: TFormEditField; begin //preverim tip typ := ares.dbVariables.asInteger[DBVAR_TYPE, 1]; case typ of 1, 4: begin fr1 := TFormEditField.create(nil); try fr1.caption := COMBO_SELECT; fr1.showModal; finally fr1.free; end; end; 2: begin fr1 := TFormEditField.create(nil); try fr1.caption := SQL_QUERY; fr1.showModal; finally fr1.free; end; end; else showmessage(Format(EDIT_ERROR1, [typ])); end; end; //integracija na administratorsko konzolo procedure IntegrateOnOwnerForm; var sField: string; fld: TdlcxLabeledDBTextEdit; btn: TmyButton; begin sField := ares.dbVariables[DBVAR_LOCATION]; if sField = '' then begin showmessage(ERROR_MISSING_SETTING); exit; end; //showmessage(OwnerForm.FindComponent(sField).className); fld := TdlcxLabeledDBTextEdit(OwnerForm.FindComponent(sField)); btn := TmyButton.create(OwnerForm); btn.caption := '...'; btn.parent := fld.Parent; btn.top := fld.Top; btn.height := fld.height; btn.width := 20; //zmanjam irino fld.width := fld.width - 22; btn.left := fld.left + fld.width + 2; //distanca 2 piki end; function GetStrFromDPA(AnNo: integer): string; var ds: TdlDataset; begin ds := TdlDataset.create(nil); try ds.sql.Text := 'select acSQLexp from tpa_sqliStep where acKey = :acKey and anNo = :anNo'; ds.paramByName('acKey').asString := ares.ackey; ds.ParamByname('anNo').asinteger := anNo; ds.open; result := ds.fieldByname('acSQLexp').asString; finally ds.free; end; end; constructor TFormEditField.Create(AOwner: TComponent); begin inherited Create(AOwner); ares.AssignObjectsToForm('FFormEditField',Self); dlcxPanel1 := FindComponent('dlcxPanel1'); dlcxButton1 := FindComponent('dlcxButton1'); dlcxButton2 := FindComponent('dlcxButton2'); dlcxDBMemo1 := FindComponent('dlcxDBMemo1'); DataSource1 := FindComponent('DataSource1'); dlDataset1 := FindComponent('dlDataset1'); dlDataset1.ParamByName('acKey').asString := ares.AcKey; dlDataset1.active := true; dlcxButton1.OnClick := dlcxButton1Click; dlcxButton2.OnClick := dlcxButton2Click; end; procedure TFormEditField.dlcxButton1Click(Sender: TObject); begin if dlDataset1.state = dsEdit then dlDataset1.post; close; end; procedure TFormEditField.dlcxButton2Click(Sender: TObject); begin if dlDataset1.state = dsEdit then dlDataset1.cancel; close; end; constructor TMyButton.Create(AOwner: TComponent); begin inherited; self.OnClick := DoMyClick; end; procedure TMyButton.DoMyClick(Sender: TObject); begin ShowEditForm; end; end. DEMO001GMQTa korak je samo za to, da je noter shranjena vsebina combota. Se ne sme brisati!FAENFϩuTBdB windows-12503Fena dva tri DEMO001GUFAENF`SBdB windows-1250TargetFieldModificationF Unit TargetFieldModification; interface uses dlComponents, db, dlDatabase, classes, dialogs; procedure ModifyTargetFields; implementation uses FFormSetup, FFormEditField, Konstante; procedure ModifyTargetFields; var cmb: TdlcxLabeledDBComboBox; typ: integer; fld: TdlcxLabeledDBTextEdit; ccb: TcxDBCheckComboBox; cb: TdlcxDBCheckBox; lkp: TdlcxDBLookupComboBox; dSet: TdlDataset; dSource: TDataSource; sField: string; sl: TStringList; begin sField := ares.dbVariables[DBVAR_LOCATION]; if sField = '' then begin showmessage(ERROR_MISSING_SETTING); exit; end; sField := ReplaceStr(sField, 'fPrsntext', 'tText'); //napravim konverzijo polja //showmessage(OwnerForm.FindComponent(sField).className); fld := TdlcxLabeledDBTextEdit(OwnerForm.FindComponent(sField)); typ := ares.dbVariables.asInteger[DBVAR_TYPE, 1]; case typ of 1: begin //combo box cmb := TdlcxLabeledDBComboBox.create(OwnerForm); cmb.caption := ''; cmb.left := fld.left; cmb.top := fld.top; cmb.width := fld.width; cmb.height := fld.Height; cmb.parent := fld.Parent; cmb.databinding.datasource := fld.databinding.datasource; cmb.databinding.dataField := fld.databinding.dataField; cmb.properties.items.text := GetStrFromDPA(3); fld.visible := false; end; 2: begin //lookup combo box lkp := TdlcxDBLookupComboBox.create(OwnerForm); lkp.caption := ''; lkp.left := fld.left; lkp.top := fld.top; lkp.width := fld.width; lkp.height := fld.Height; lkp.parent := fld.Parent; lkp.databinding.datasource := fld.databinding.datasource; lkp.databinding.dataField := fld.databinding.dataField; dSet := TdlDataset.create(OwnerForm); dSource := TDataSource.create(OwnerForm); dsource.dataset := dset; dset.sql.text := GetStrFromDPA(3); dset.open; lkp.properties.keyFieldNames := dset.fields[0].fieldName; lkp.properties.ListFieldNames := dset.fields[0].fieldName; lkp.properties.listSource := dSource; fld.visible := false; end; 3: begin //checkbox cb := TdlcxDBCheckBox.Create(OwnerForm); cb.caption := ''; cb.left := fld.left; cb.top := fld.top; cb.width := fld.width; cb.height := fld.Height; cb.parent := fld.Parent; cb.databinding.datasource := fld.databinding.datasource; cb.databinding.dataField := fld.databinding.dataField; fld.visible := false; end; 4: begin //checkbox - multi ccb := TcxDBCheckComboBox.create(OwnerForm); ccb.left := fld.left; ccb.top := fld.top; ccb.width := fld.width; ccb.height := fld.Height; ccb.parent := fld.Parent; ccb.databinding.datasource := fld.databinding.datasource; ccb.databinding.dataField := fld.databinding.dataField; sl := TStringList.create; try sl.text := GetStrFromDPA(3); while sl.count > 0 do begin ccb.properties.items.AddCheckItem(sl[0], sl[0]); sl.delete(0); end; finally sl.free; end; fld.visible := false; end; end; end; end. DEMO001GUFAENF2BdB windows-1250 KonstanteFHUnit Konstante; interface const DBVAR_LOCATION = 'location'; DBVAR_TYPE = 'type'; //messages SQL_QUERY = 'SQL poizvedba'; ERROR_MISSING_SETTING = 'Napaka. Ciljno polje ni nastavljeno'; COMBO_SELECT = 'Nabor nizov'; EDIT_ERROR1 = 'Napaen tip polja %d'; implementation end. acKeyanNoanSeqNoacHField2acHType anHLengthanHDecacPField2acPTypeanPLegthanPDec acPFormat acPSeparator anUserChg anUserIns adTimeChg adTimeIns acKeyanNoanSeqNo acFieldName2 anFieldSize acFieldTitleacFieldReadOnly acEditType acFieldConst anUserChg anUserIns adTimeIns adTimeChg acFieldFormatacFieldDefault acKeyanNo acDataEventacDataReturnValue acKeyAndNo anUserChg anUserIns adTimeChg adTimeIns acKey acWhereKeyanNo acFieldName acParamVar acFieldType acFieldREQacFieldCaption2 acDefaultExpacDefaultValue acLookUpSQL acOperator acVarHint2 acAddApostrof anUserChg anUserIns adTimeChg adTimeIns acPrtCritDEMO001locationFCF0 fPrsntext020ޭSB