Ignore:
Timestamp:
Jul 7, 2010, 4:51:54 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Upgrading to version 27

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/trunk/CPRS-Chart/fMedCopy.pas

    r456 r830  
    66  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    77  StdCtrls, ORDtTm, ORCtrls, ORFn, rOrders, uCore, rCore, mEvntDelay, fAutoSz,
    8   ExtCtrls, UConst;
     8  ExtCtrls, UConst, fBase508Form, VA508AccessibilityManager;
    99
    1010type
    11   TfrmMedCopy = class(TForm)
    12     Panel1: TPanel;
    13     lblPtInfo: TLabel;
    14     Panel2: TPanel;
     11  TfrmMedCopy = class(TfrmBase508Form)
     12    pnlTop: TPanel;
     13    lblPtInfo: TVA508StaticText;
     14    pnlInpatient: TPanel;
    1515    lblInstruction: TStaticText;
    1616    Image1: TImage;
    17     Label1: TStaticText;
    18     Panel3: TPanel;
    19     GroupBox2: TGroupBox;
     17    lblInstruction2: TStaticText;
     18    pnlMiddle: TPanel;
     19    gboxMain: TGroupBox;
    2020    radDelayed: TRadioButton;
    2121    radRelease: TRadioButton;
    2222    cmdOK: TButton;
    2323    cmdCancel: TButton;
    24     Panel4: TPanel;
     24    pnlBottom: TPanel;
    2525    fraEvntDelayList: TfraEvntDelayList;
    2626    procedure cmdOKClick(Sender: TObject);
     
    3939    FDelayEvent: TOrderDelayEvent;
    4040    FOKPressed: Boolean;
     41    procedure AdjustFormSize;
    4142  public
    4243    { Public declarations }
     
    5152{$R *.DFM}
    5253
    53 uses  fODBase, fOrdersTS, fOrders;
     54uses  fODBase, fOrdersTS, fOrders, VAUtils;
    5455
    5556const
     
    113114    end;
    114115    ResizeAnchoredFormToFont(frmMedCopy);
     116    frmMedCopy.AdjustFormSize;
    115117    CurrTS := Piece(GetCurrentSpec(Patient.DFN),'^',1);
    116118    if Length(CurrTS)>0 then
     
    127129        frmMedCopy.lblPtInfo.Caption := Patient.Name + ' currently is an outpatient.' + SpeCap;
    128130    end;
     131    frmMedCopy.AdjustFormSize;
    129132    frmMedCopy.fraEvntDelayList.EvntLimit := LimitEvent;
    130133    if Pos('transfer',RadCap)>0 then
     
    134137    if LimitEvent='D' then
    135138    begin
    136       frmMedCopy.Panel2.Visible := False;
    137       frmMedCopy.Height := frmMedCopy.Panel1.Height + frmMedCopy.GroupBox2.Height;
     139      frmMedCopy.pnlInpatient.Visible := False;
     140      frmMedCopy.AdjustFormSize;
    138141    end;
    139142    frmMedCopy.ShowModal;
     
    223226  radRelease.Checked := True;
    224227  if not Patient.Inpatient then
    225     panel2.Visible := False;
    226   if not radDelayed.Checked then
    227   begin
    228     if not panel2.Visible then
    229       Height := Height - fraEvntDelayList.Height - panel2.Height
    230     else
    231       Height := Height - fraEvntDelayList.Height;
    232   end;
     228    pnlInpatient.Visible := False;
     229  AdjustFormSize;
    233230end;
    234231
     
    261258end;
    262259
     260procedure TfrmMedCopy.AdjustFormSize;
     261var
     262  y: integer;
     263begin
     264  y := lblPtInfo.Height + 8; // allow for font changes
     265  if pnlInpatient.Visible then
     266  begin
     267    lblInstruction2.top := lblInstruction.Height; // allow for font change
     268    pnlInpatient.Height := lblInstruction2.top + lblInstruction2.Height;
     269    inc(y,pnlInpatient.Height);
     270  end;
     271  pnlTop.Height := y;
     272  inc(y, pnlMiddle.Height);
     273  if fraEvntDelayList.Visible then
     274  begin
     275    inc(y, fraEvntDelayList.Height);
     276  end;
     277  VertScrollBar.Range := y;
     278  ClientHeight := y;
     279end;
     280
    263281procedure TfrmMedCopy.cmdCancelClick(Sender: TObject);
    264282begin
     
    278296  if fraEvntDelayList.mlstEvents.Items.Count < 1 then
    279297  begin
    280     ShowMessage(WarningMSG);
     298    ShowMsg(WarningMSG);
    281299    radRelease.Checked := True;
    282300  end else
    283301  begin
    284     Height := Height + fraEvntDelayList.Height;
    285302    fraEvntDelayList.Visible := True;
    286303  end;
     304  AdjustFormSize;
    287305end;
    288306
     
    291309  inherited;
    292310  fraEvntDelayList.Visible := False;
    293   Height := Height - fraEvntDelayList.Height;
     311  AdjustFormSize;
    294312end;
    295313
     
    326344  Shift: TShiftState);
    327345begin
     346  inherited;
    328347  if Key = VK_RETURN then
    329348    cmdOKClick(Self);
Note: See TracChangeset for help on using the changeset viewer.