Ignore:
Timestamp:
Jun 17, 2011, 9:52:46 AM (13 years ago)
Author:
george
Message:
  • Modified: Selection form set selected item id.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UItemSelect.pas

    r21 r23  
    2323    procedure ListView1Resize(Sender: TObject);
    2424  private
     25    function GetSelectedId: Integer;
    2526    { private declarations }
    2627  public
     
    2930    ListObject: TChronisObject;
    3031    procedure LoadList;
     32    property SelectedId: Integer read GetSelectedId;
    3133  end;
    3234
     
    5052  with TReportLine(Report[Item.Index]) do begin
    5153    Item.Caption := Items[0];
     54    Item.Data := Pointer(Id);
    5255    for I := 1 to Items.Count - 1 do
    5356    if not TReportColumn(Report.Columns[I]).VirtualItem then
     
    6265  for I := 0 to ListView1.Columns.Count - 1 do
    6366    ListView1.Columns[I].Width := ListView1.Width div ListView1.Columns.Count;
     67end;
     68
     69function TItemSelectForm.GetSelectedId: Integer;
     70begin
     71  if Assigned(ListView1.Selected) then Result := Integer(ListView1.Selected.Data)
     72    else Result := -1;
    6473end;
    6574
Note: See TracChangeset for help on using the changeset viewer.