⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 udlgopprmisattributevalue.pas

📁 ADaM is a data mining and image processing toolkit
💻 PAS
字号:
unit UDlgOpPrmISAttributeValue;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UDlgBaseOperatorParameter, ComCtrls, StdCtrls, ExtCtrls;

type
  TDlgOpPrmISAttributeValue = class(TDlgBaseOperatorParameter)
    Label1: TLabel;
    cmbAttribute: TComboBox;
    Label2: TLabel;
    cmbValue: TComboBox;
    procedure cmbAttributeChange(Sender: TObject);
  private
    { D閏larations priv閑s }
  public
    { D閏larations publiques }
    procedure   ApplyModifications(); override;
    procedure   SetParameters(); override;
  end;

var
  DlgOpPrmISAttributeValue: TDlgOpPrmISAttributeValue;

implementation

uses UCompISAttributeValue, UDatasetDefinition, UDatasetImplementation;

{$R *.dfm}

{ TDlgOpPrmISAttributeValue }

procedure TDlgOpPrmISAttributeValue.ApplyModifications;
var prm: TOpPrmISAttValue;
begin
 prm:= OpPrm as TOpPrmISAttValue;
 prm.AttName:= self.cmbAttribute.Text;
 prm.AttValue:= self.cmbValue.Text;
end;

procedure TDlgOpPrmISAttributeValue.SetParameters;
var prm: TOpPrmISAttValue;
    operator: TOpISAttValue;
    att: TAttribute;
    j,idAtt: integer;
begin
 prm:= OpPrm as TOpPrmISAttValue;
 operator:= prm.Operator as TOpISAttValue;
 //lister les attributs candidats dans la combo-box
 cmbAttribute.Items.Clear();
 idAtt:= -1;
 for j:= 0 to pred(operator.WorkData.LstAtts[asAll].Count) do
  begin
   att:= operator.WorkData.LstAtts[asAll].Attribute[j];
   if att.isCategory(caDiscrete)
    then
     begin
       self.cmbAttribute.Items.AddObject(att.Name,att);
       //new -- 18/07/2006 -- m鄇 correctement le num閞o de l'閘閙ent, souci lorsqu'il y avait m閘ange d'attributs continus et discrets
       if (att.Name = prm.AttName) then idAtt:= pred(self.cmbAttribute.Items.Count);
     end;
  end;
 self.cmbAttribute.ItemIndex:= idAtt;
 self.cmbAttributeChange(NIL);
end;

procedure TDlgOpPrmISAttributeValue.cmbAttributeChange(Sender: TObject);
var att: TAttribute;
    sValue: string;
    k,idValue: integer;
begin
 if (self.cmbAttribute.ItemIndex>=0)
  then
   begin
    att:= self.cmbAttribute.Items.Objects[self.cmbAttribute.ItemIndex] as TAttribute;
    self.cmbValue.Items.Clear();
    idValue:= -1;
    for k:= 1 to att.LstValues.getNbValues() do
     begin
      sValue:= att.LstValues.getDescription(k);
      if (sValue = (OpPrm as TOpPrmISAttValue).AttValue)
       then idValue:= pred(k);
      self.cmbValue.Items.Add(sValue);
     end;
    self.cmbValue.ItemIndex:= idValue;
   end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -