Procedure

TfrmReportsAdhocSubItem1.btnRemoveSelClick

Module

fReportsAdhocSubItem1

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public/Published

Owner

TfrmReportsAdhocSubItem1

Declaration

procedure btnRemoveSelClick(Sender: TObject);

Called-By Hierarchy


  TfrmReportsAdhocSubItem1.btnRemoveSelClick
TfrmReportsAdhocSubItem1.ORListBox1EndDrag┘ 

Called-By

Name Declaration Comments
TfrmReportsAdhocSubItem1.ORListBox1EndDrag procedure ORListBox1EndDrag(Sender, Target: TObject; X, Y: Integer); -


Source

220   procedure TfrmReportsAdhocSubItem1.btnRemoveSelClick(Sender: TObject);
221   var
222     i: integer;
223     chk: integer;
224   begin
225     chk := 0;
226     If ORListBox1.Items.Count < 1 then
227       begin
228         InfoBox('There are no items to remove.', 'Information', MB_OK or MB_ICONINFORMATION);
229         Exit;
230       end
231     else
232       for i := 0 to ORListBox1.Items.Count - 1 do
233         if ORListBox1.Selected[i] then
234             chk := 1;
235       if chk = 0 then
236         begin
237           InfoBox('Please select the item you wish to remove', 'Information', MB_OK or MB_ICONINFORMATION);
238           Exit;
239         end;
240       With ORListBox1 do
241         begin
242           for i := uComponents.Count-1 downto 0 do
243             if piece(uComponents[i],'^',2) = Piece(Items[ItemIndex],'^',1) then
244               uComponents.Delete(i);
245           Items.Delete(ItemIndex);
246           uLimitCount := uLimitCount - 1;
247           if Items.Count < 1 then
248             begin
249               SpeedButton7.Enabled := false;
250               SpeedButton8.Enabled := false;
251             end;
252         end;
253   end;