Procedure

TfrmConsults.FormDestroy

Module

fConsults

Last Modified

7/15/2014 3:26:34 PM

Comments

Procedure TfrmConsults.lstNotesDrawItem(Control: TWinControl;
  Index: Integer; Rect: TRect; State: TOwnerDrawState);
var
  x: string;
const
  STD_DATE = 'MMM DD,YY';
begin
  inherited;
   with (Control as TORListBox).Canvas do  {draw on control canvas, not on the form }
    begin
      FImageFlag.LoadFromResourceName(hInstance, 'BMP_IMAGEFLAG_1');
      x := (Control as TORListBox).Items[Index];
      (Control as TORListBox).ItemHeight := HigherOf(TextHeight(x), FImageFlag.Height);
      FillRect(Rect);       {clear the rectangle }
      if StrToIntDef(Piece(x, U, 7), 0) > 0 then
        begin
          if StrToIntDef(Piece(x, U, 7), 0) = 1 then
            FImageFlag.LoadFromResourceName(hInstance, 'BMP_IMAGEFLAG_1')
          else if StrToIntDef(Piece(x, U, 7), 0) = 2 then
            FImageFlag.LoadFromResourceName(hInstance, 'BMP_IMAGEFLAG_2')
          else if StrToIntDef(Piece(x, U, 7), 0) > 2 then
            FImageFlag.LoadFromResourceName(hInstance, 'BMP_IMAGEFLAG_3');
          BrushCopy(Bounds(Rect.Left, Rect.Top, FImageFlag.Width, FImageFlag.Height),
            FImageFlag, Bounds(0, 0, FImageFlag.Width, FImageFlag.Height), clRed); {render ImageFlag}
        end;
      TextOut(Rect.Left + FImageFlag.Width, Rect.Top, Piece(x, U, 2));
      TextOut(Rect.Left + FImageFlag.Width + TextWidth(STD_DATE), Rect.Top, Piece(x, U, 3));
    end;
end;

Visibility

Public/Published

Owner

TfrmConsults

Declaration

procedure FormDestroy(Sender: TObject);

Calls Hierarchy


TfrmConsults.FormDestroy
 └KillDocTreeObjects
   └ResetDocTreeObjectStrings

Calls

Name Declaration Comments
KillDocTreeObjects procedure KillDocTreeObjects(TreeView: TORTreeView); -


Source

3558  procedure TfrmConsults.FormDestroy(Sender: TObject);
3559  begin
3560    FDocList.Free;
3561    FCsltList.Free;
3562    FImageFlag.Free;
3563    KillDocTreeObjects(tvCsltNotes);
3564    inherited;
3565  end;