umodifylegend.pas

来自「用DELPHI 和MAPX的基础练习.是学习的好资料」· PAS 代码 · 共 63 行

PAS
63
字号
unit UModifyLegend;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,MapXLib_TLB;

type
  TFModifyLegend = class(TForm)
    Label1: TLabel;
    ComboBox1: TComboBox;
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FModifyLegend: TFModifyLegend;
  list:TStringList;

implementation

uses UMap;

{$R *.dfm}

procedure TFModifyLegend.Button2Click(Sender: TObject);
begin
close;
end;

procedure TFModifyLegend.FormShow(Sender: TObject);
var
i,j:integer;
begin
  List:=TStringList.Create;
  for i:=1 to FMap.Map1.DataSets.Count do
      begin
        for j:=1 to  FMap.Map1.DataSets[i].Themes.Count do
            begin
              ComboBox1.Items.Add(FMap.Map1.DataSets[i].Themes[j].Name);
              list.Add(inttostr(i));
            end;
      end;
ComboBox1.ItemIndex:=0;
end;

procedure TFModifyLegend.Button1Click(Sender: TObject);
var
i:integer;
begin
i:= strtoint(List[ComBoBox1.ItemIndex]);
Fmap.Map1.DataSets[i].Themes[ComBoBox1.Text].Legend.LegendDlg(EmptyParam,EmptyParam);
end;
end.

⌨️ 快捷键说明

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