Module

fIconLegend

Path

C:\CPRS\CPRS30\fIconLegend.pas

Last Modified

7/15/2014 3:26:36 PM

Units Used in Interface

Name Comments
dShared -
fAutoSz -
mImgText -

Units Used in Implementation

Name Comments
fFrame -
uConst -

Classes

Name Comments
TfrmIconLegend -

Procedures

Name Owner Declaration Scope Comments
btnOKClick TfrmIconLegend procedure btnOKClick(Sender: TObject); Public/Published -
FormClose TfrmIconLegend procedure FormClose(Sender: TObject; var Action: TCloseAction); Public/Published -
FormDestroy TfrmIconLegend procedure FormDestroy(Sender: TObject); Public/Published -
FormKeyDown TfrmIconLegend procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); Public/Published -
SetFontSize TfrmIconLegend class procedure SetFontSize( NewFontSize: integer); Public -
ShowIconLegend - procedure ShowIconLegend(IconType: TIconLegendType; Restart: boolean = FALSE); Interfaced -
ShowTab TfrmIconLegend procedure ShowTab(tb: TIconLegendType); Private -
SnapLabels TfrmIconLegend procedure SnapLabels; Private -

Global Variables

Name Type Declaration Comments
FirstSize Boolean FirstSize: boolean = TRUE; -
frmIconLegend TfrmIconLegend frmIconLegend: TfrmIconLegend = nil; -
LastX Integer LastX, LastY: integer; -
LastY Integer LastX, LastY: integer; -

Constants

Name Declaration Scope Comments
ilConsults TIconLegendType Interfaced -
ilLast TIconLegendType Interfaced -
ilNotes TIconLegendType Interfaced -
ilReminders TIconLegendType Interfaced -
ilSurgery TIconLegendType Interfaced -
ilTemplates TIconLegendType Interfaced -


Module Source

1     unit fIconLegend;
2     
3     interface
4     
5     uses
6       Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, dShared,
7       ComCtrls, StdCtrls, ExtCtrls, ImgList, mImgText, Menus, fAutoSz,
8       VA508AccessibilityManager;
9     
10    type
11      TIconLegendType = (ilLast, ilNotes, ilTemplates, ilReminders, ilConsults, ilSurgery);
12    
13      TfrmIconLegend = class(TfrmAutoSz)
14        pcMain: TPageControl;
15        pnlBottom: TPanel;
16        Templates: TTabSheet;
17        Reminders: TTabSheet;
18        btnOK: TButton;
19        fraImgText1: TfraImgText;
20        fraImgText2: TfraImgText;
21        fraImgText3: TfraImgText;
22        fraImgText4: TfraImgText;
23        fraImgText5: TfraImgText;
24        fraImgText6: TfraImgText;
25        fraImgText7: TfraImgText;
26        fraImgText12: TfraImgText;
27        Panel1: TPanel;
28        fraImgText8: TfraImgText;
29        fraImgText10: TfraImgText;
30        fraImgText15: TfraImgText;
31        fraImgText16: TfraImgText;
32        fraImgText17: TfraImgText;
33        fraImgText13: TfraImgText;
34        fraImgText14: TfraImgText;
35        Panel2: TPanel;
36        fraImgText22: TfraImgText;
37        fraImgText20: TfraImgText;
38        fraImgText19: TfraImgText;
39        fraImgText18: TfraImgText;
40        fraImgText21: TfraImgText;
41        fraImgText11: TfraImgText;
42        fraImgText9: TfraImgText;
43        fraImgText23: TfraImgText;
44        fraImgText24: TfraImgText;
45        Label1: TLabel;
46        Label2: TLabel;
47        Label3: TLabel;
48        Notes: TTabSheet;
49        fraImgText25: TfraImgText;
50        fraImgText26: TfraImgText;
51        fraImgText27: TfraImgText;
52        fraImgText28: TfraImgText;
53        fraImgText29: TfraImgText;
54        fraImgText30: TfraImgText;
55        fraImgText31: TfraImgText;
56        fraImgText32: TfraImgText;
57        fraImgText33: TfraImgText;
58        fraImgText34: TfraImgText;
59        Consults: TTabSheet;
60        Panel3: TPanel;
61        fraImgText35: TfraImgText;
62        fraImgText36: TfraImgText;
63        fraImgText43: TfraImgText;
64        Panel4: TPanel;
65        Label5: TLabel;
66        fraImgText41: TfraImgText;
67        fraImgText37: TfraImgText;
68        fraImgText38: TfraImgText;
69        fraImgText39: TfraImgText;
70        fraImgText40: TfraImgText;
71        Label4: TLabel;
72        fraImgText44: TfraImgText;
73        Surgery: TTabSheet;
74        fraImgText42: TfraImgText;
75        fraImgText45: TfraImgText;
76        fraImgText46: TfraImgText;
77        fraImgText47: TfraImgText;
78        fraImgText48: TfraImgText;
79        fraImgText49: TfraImgText;
80        fraImgText50: TfraImgText;
81        fraImgText51: TfraImgText;
82        fraImgText52: TfraImgText;
83        fraImgText53: TfraImgText;
84        fraImgText54: TfraImgText;
85        fraImgText55: TfraImgText;
86        fraImgText56: TfraImgText;
87        fraImgText57: TfraImgText;
88        fraImgText58: TfraImgText;
89        fraImgText59: TfraImgText;
90        fraImgText60: TfraImgText;
91        fraImgText61: TfraImgText;
92        procedure btnOKClick(Sender: TObject);
93        procedure FormClose(Sender: TObject; var Action: TCloseAction);
94        procedure FormDestroy(Sender: TObject);
95        procedure FormKeyDown(Sender: TObject; var Key: Word;
96          Shift: TShiftState);
97      private
98        procedure ShowTab(tb: TIconLegendType);
99        procedure SnapLabels;
100     public
101       class procedure SetFontSize( NewFontSize: integer);
102     end;
103   
104   procedure ShowIconLegend(IconType: TIconLegendType; Restart: boolean = FALSE);
105   
106   implementation
107   
108   uses
109     fFrame, uConst, ORFn;
110   
111   {$R *.DFM}
112   
113   var
114     frmIconLegend: TfrmIconLegend = nil;
115     LastX, LastY: integer;
116     FirstSize: boolean = TRUE;
117   
118   procedure ShowIconLegend(IconType: TIconLegendType; Restart: boolean = FALSE);
119   begin
120     if assigned(frmIconLegend) and Restart then
121       FreeAndNil(frmIconLegend);
122     if not assigned(frmIconLegend) then
123     begin
124       frmIconLegend := TfrmIconLegend.Create(Application);
125       frmIconLegend.Surgery.TabVisible := frmFrame.TabExists(CT_SURGERY);
126     end;
127     frmIconLegend.ShowTab(IconType);
128     TfrmIconLegend.SetFontSize( MainFontSize );
129     frmIconLegend.Show;
130   end;
131   
132   procedure TfrmIconLegend.btnOKClick(Sender: TObject);
133   begin
134     Close;
135   end;
136   
137   procedure TfrmIconLegend.ShowTab(tb: TIconLegendType);
138   begin
139     case tb of
140       ilTemplates: pcMain.ActivePage := Templates;
141       ilReminders: pcMain.ActivePage := Reminders;
142       ilNotes:     pcMain.ActivePage := Notes;
143       ilConsults:  pcMain.ActivePage := Consults;
144       ilSurgery:   pcMain.ActivePage := Surgery;
145     end;
146   end;
147   
148   procedure TfrmIconLegend.FormClose(Sender: TObject;
149     var Action: TCloseAction);
150   begin
151     Action := caFree;
152   
153   end;
154   
155   procedure TfrmIconLegend.FormDestroy(Sender: TObject);
156   begin
157     LastX := Left;
158     LastY := Top;
159     frmIconLegend := nil;
160   end;
161   
162   class procedure TfrmIconLegend.SetFontSize( NewFontSize: integer);
163   begin
164     if Assigned(frmIconLegend) then begin
165       if FirstSize or (frmIconLegend.Font.Size <> NewFontSize) then begin
166         ResizeFormToFont(frmIconLegend);
167         frmIconLegend.Font.Size := NewFontSize;
168         frmIconLegend.SnapLabels;
169         FirstSize := FALSE;
170         LastX := (Screen.Width - frmIconLegend.Width) div 2;
171         LastY := (Screen.Height - frmIconLegend.Height) div 2;
172       end;
173       frmIconLegend.Left := LastX;
174       frmIconLegend.Top := LastY;
175     end;
176   end;
177   
178   procedure TfrmIconLegend.SnapLabels;
179   var
180     i: integer;
181   begin
182     for i := 0 to ComponentCount-1 do
183       if Components[i] is TfraImgText then
184         with TfraImgText(Components[i]).lblText do
185           if (AutoSize and WordWrap) then begin
186           {Snap width to fit.  We turn autosize off and on to snap height, too.
187           If we don't tweak AutoSize, it tends to give the frame a vertical
188           scroll bar.}
189           AutoSize := False;
190           Width := Parent.Width - Left - ScrollBarWidth;
191           AutoSize := True;
192         end;
193   end;
194   
195   procedure TfrmIconLegend.FormKeyDown(Sender: TObject; var Key: Word;
196     Shift: TShiftState);
197   begin
198     inherited;
199     if (Key = VK_TAB) then begin
200       if (ssCtrl in Shift) then begin
201         if not (ActiveControl is TCustomMemo) or not TMemo(ActiveControl).WantTabs then begin
202           pcMain.SelectNextPage( not (ssShift in Shift));
203           Key := 0;
204         end;
205       end;
206     end;
207   end;
208   
209   end.

Module Calls (2 levels)


fIconLegend
 ├mImgText
 ├fAutoSz
 │ └fBase508Form
 ├fFrame
 │ ├fPage
 │ ├uConst
 │ ├VERGENCECONTEXTORLib_TLB
 │ ├fBase508Form...
 │ ├XuDsigS
 │ ├rCore
 │ ├fPtSelMsg
 │ ├fPtSel
 │ ├fCover
 │ ├fProbs
 │ ├fMeds
 │ ├fOrders
 │ ├rOrders
 │ ├fNotes
 │ ├fConsults
 │ ├fDCSumm
 │ ├rMisc
 │ ├fLabs
 │ ├fReports
 │ ├rReports
 │ ├fPtDemo
 │ ├fEncnt
 │ ├fPtCWAD
 │ ├uCore
 │ ├fAbout
 │ ├fReview
 │ ├fxBroker
 │ ├fxLists
 │ ├fxServer
 │ ├fRptBox
 │ ├rODAllergy
 │ ├uInit
 │ ├fLabInfo
 │ ├uReminders
 │ ├fReminderTree
 │ ├fDeviceSelect
 │ ├fDrawers
 │ ├fReminderDialog
 │ ├fOptions
 │ ├fGraphs
 │ ├fGraphData
 │ ├rTemplates
 │ ├fSurgery
 │ ├rSurgery
 │ ├uEventHooks
 │ ├uSignItems
 │ ├rECS
 │ ├fIconLegend...
 │ ├uOrders
 │ ├uSpell
 │ ├uOrPtf
 │ ├fPatientFlagMulti
 │ ├fAlertForward
 │ ├UBAGlobals
 │ ├UBACore
 │ ├fOrdersSign
 │ ├uVitals
 │ ├fMHTest
 │ ├uFormMonitor
 │ ├fOtherSchedule
 │ ├uVA508CPRSCompatibility
 │ ├fIVRoutes
 │ ├fPrintLocation
 │ ├fTemplateEditor
 │ └fCombatVet
 └uConst

Module Called-By (2 levels)


                fIconLegend
                   fFrame┤ 
              CPRSChart┤ │ 
                  fPage┤ │ 
                uOrders┤ │ 
                fODBase┤ │ 
                UBACore┤ │ 
                fOrders┤ │ 
                   uPCE┤ │ 
      fBALocalDiagnoses┤ │ 
             fEncVitals┤ │ 
                fVitals┤ │ 
                 fCover┤ │ 
                 rCover┤ │ 
              fPtSelMsg┤ │ 
                 fPtSel┤ │ 
            fOrdersSign┤ │ 
         fPrintLocation┤ │ 
                  fMeds┤ │ 
                fRptBox┤ │ 
                 fNotes┤ │ 
               fReports┤ │ 
                 fEncnt┤ │ 
                 fProbs┤ │ 
          fReportsPrint┤ │ 
                fGraphs┤ │ 
              fConsults┤ │ 
                fDCSumm┤ │ 
        fReminderDialog┤ │ 
                  fLabs┤ │ 
              fLabPrint┤ │ 
                fReview┤ │ 
         fIconLegend...┤ │ 
           fOrdersPrint┤ │ 
               fSurgery┤ │ 
uVA508CPRSCompatibility┤ │ 
           fOrdersRenew┤ │ 
             fODConsult┤ │ 
                fODProc┤ │ 
                 fODRad┤ │ 
                 fODLab┤ │ 
                fODMeds┤ │ 
               fODMedIV┤ │ 
              fODVitals┤ │ 
                fODAuto┤ │ 
                 fOMSet┤ │ 
         fOrdersRelease┤ │ 
              fODMedNVA┤ │ 
         fOrdersOnChart┤ │ 
             fOCSession┤ │ 
              fODActive┤ │ 
               fPCEEdit┘ │ 
                 fDrawers┤ 
              fFrame...┤ │ 
                dShared┤ │ 
             uReminders┤ │ 
              fNotes...┤ │ 
           fConsults...┤ │ 
             fDCSumm...┤ │ 
        fTemplateEditor┤ │ 
            fSurgery...┘ │ 
            uReminders...┤ 
                fNotes...┤ 
             fConsults...┤ 
               fDCSumm...┤ 
       fTemplateEditor...┤ 
              fSurgery...┘