Procedure

TfrmODCslt.btnServiceTreeClick

Module

fODConsult

Last Modified

7/15/2014 3:26:34 PM

Visibility

Public/Published

Owner

TfrmODCslt

Declaration

procedure btnServiceTreeClick(Sender: TObject);

Called-By Hierarchy


TfrmODCslt.btnServiceTreeClick
TfrmODCslt.treServiceKeyDown┘ 

Called-By

Name Declaration Comments
TfrmODCslt.treServiceKeyDown procedure treServiceKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); -


Source

955   procedure TfrmODCslt.btnServiceTreeClick(Sender: TObject);
956   var
957     i: integer;
958   begin
959     inherited;
960     Changing := True;
961     treService.Visible := not treService.Visible;
962     if treService.Visible then
963     begin
964     // for some reason screen reader is reading caption when tree view is not visible
965       treService.Caption := TX_SVC_HRCHY;
966       pnlServiceTreeButton.Caption := TX_CLOSE_SVC_HRCHY;
967       btnServiceTree.Hint := TX_CLOSE_SVC_HRCHY;
968       treService.SetFocus;
969       with treService do for i := 0 to Items.Count-1 do
970       begin
971         if Piece(TORTreeNode(Items[i]).StringData, U, 1) = cboService.ItemID then
972           begin
973             Selected := Items[i];
974             if Piece(TORTreeNode(Items[i]).StringData, U, 5) = '1' then Selected.Expand(True);
975             break;
976           end;
977       end;
978     end
979     else
980     begin
981       treService.Caption := '';
982       pnlServiceTreeButton.Caption := TX_VIEW_SVC_HRCHY;
983       btnServiceTree.Hint := TX_VIEW_SVC_HRCHY;
984       pnlServiceTreeButton.SetFocus;
985     end;
986     Changing := False;
987   end;