Procedure

TfrmFrame.FitToolbar

Module

fFrame

Last Modified

3/11/2015 8:41:44 AM

Comments

Resizes and repositions the panels & labels used in the toolbar 
var
WidthNeeded: integer;

Visibility

Private

Owner

TfrmFrame

Declaration

procedure FitToolbar;

Called-By Hierarchy


                                        TfrmFrame.FitToolbar
                            TfrmFrame.DisplayEncounterText┤ 
                        TfrmDCSumm.mnuActAddIDEntryClick┤ │ 
                        TfrmConsults.mnuActCompleteClick┤ │ 
                      TfrmConsults.mnuActAddIDEntryClick┤ │ 
                                  TfrmFrame.SetupPatient┤ │ 
                             UpdatePatientInfoForAlert┤ │ │ 
                          TfrmFrame.mnuFileNextClick┘ │ │ │ 
                        TfrmFrame.mnuFileOpenClick┤   │ │ │ 
                            TfrmFrame.UMInitiate┤ │   │ │ │ 
                   TfrmFrame.mnuFileNextClick...┤ │   │ │ │ 
                   TfrmFrame.mnuFileRefreshClick┤ │   │ │ │ 
                   TfrmOrders.CheckOrderStatus┤ │ │   │ │ │ 
               TfrmOrders.mnuActChgEvntClick┤ │ │ │   │ │ │ 
                  TfrmOrders.mnuActHoldClick┤ │ │ │   │ │ │ 
                TfrmOrders.mnuActUnholdClick┤ │ │ │   │ │ │ 
                 TfrmOrders.mnuActRenewClick┤ │ │ │   │ │ │ 
                TfrmOrders.mnuActChangeClick┤ │ │ │   │ │ │ 
                  TfrmOrders.mnuActCopyClick┘ │ │ │   │ │ │ 
                        TfrmMeds.mnuActDCClick┤ │ │   │ │ │ 
                       TfrmMeds.CheckMedStatus┘ │ │   │ │ │ 
                    TfrmMeds.mnuActHoldClick┤   │ │   │ │ │ 
                   TfrmMeds.mnuActRenewClick┤   │ │   │ │ │ 
                  TfrmMeds.mnuActUnholdClick┤   │ │   │ │ │ 
                  TfrmMeds.mnuActChangeClick┤   │ │   │ │ │ 
                    TfrmMeds.mnuActCopyClick┤   │ │   │ │ │ 
                  TfrmMeds.mnuActRefillClick┘   │ │   │ │ │ 
                              TfrmFrame.ViewInfo┘ │   │ │ │ 
                           TfrmDCSumm.ViewInfo┤   │   │ │ │ 
                         TfrmConsults.ViewInfo┤   │   │ │ │ 
                 TfrmFrame.pnlRemindersMouseUp┤   │   │ │ │ 
                  TfrmFrame.RemindersChanged┘ │   │   │ │ │ 
                      TfrmFrame.FormCreate┘   │   │   │ │ │ 
                        TfrmFrame.pnlCIRNClick┤   │   │ │ │ 
                  TfrmFrame.pnlVistaWebClick┤ │   │   │ │ │ 
                       TfrmFrame.FormKeyDown┘ │   │   │ │ │ 
                     TfrmFrame.pnlPatientClick┤   │   │ │ │ 
                       TfrmFrame.pnlVisitClick┤   │   │ │ │ 
                 TfrmFrame.pnlPrimaryCareClick┤   │   │ │ │ 
                   TfrmFrame.pnlRemindersClick┤   │   │ │ │ 
                    TfrmFrame.pnlPostingsClick┤   │   │ │ │ 
                        TfrmFrame.pnlFlagClick┤   │   │ │ │ 
                          TfrmFrame.laMHVClick┤   │   │ │ │ 
                         TfrmFrame.laVAA2Click┤   │   │ │ │ 
                           TfrmOrders.ViewInfo┤   │   │ │ │ 
                             TfrmMeds.ViewInfo┤   │   │ │ │ 
                          TfrmSurgery.ViewInfo┤   │   │ │ │ 
                            TfrmNotes.ViewInfo┤   │   │ │ │ 
                         TfrmProblems.ViewInfo┘   │   │ │ │ 
                 TfrmFrame.mnuFileNotifRemoveClick┤   │ │ │ 
                         TfrmFrame.NextButtonClick┘   │ │ │ 
                       TfrmFrame.SetUpNextButton┘     │ │ │ 
                 TfrmFrame.mnuFileOpenClick...┤       │ │ │ 
                          TfrmFrame.FormResize┘       │ │ │ 
                        TfrmFrame.ChangeFont┘         │ │ │ 
                TfrmFrame.LoadSizesForUser┤           │ │ │ 
           TfrmFrame.LoadUserPreferences┘ │           │ │ │ 
                  TfrmFrame.UMInitiate┘   │           │ │ │ 
                TfrmFrame.mnuFontSizeClick┘           │ │ │ 
                         TfrmFrame.mnuFileOpenClick...┤ │ │ 
                      TfrmFrame.AllowCCOWContextChange┤ │ │ 
                       TfrmFrame.mnuFileNextClick...┤ │ │ │ 
                       TfrmFrame.mnuFileOpenClick...┤ │ │ │ 
              TfrmFrame.mnuFileResumeContextSetClick┘ │ │ │ 
                           TfrmFrame.UpdateCCOWContext┤ │ │ 
                       TfrmFrame.mnuFileOpenClick...┤ │ │ │ 
                     TfrmFrame.ctxContextorCommitted┤ │ │ │ 
                      TfrmFrame.StartCCOWContextor┘ │ │ │ │ 
                            TfrmFrame.FormCreate┘   │ │ │ │ 
              TfrmFrame.mnuFileResumeContextGetClick┘ │ │ │ 
                TfrmFrame.mnuFileResumeContextSetClick┘ │ │ 
                           TfrmFrame.mnuFileOpenClick...┤ │ 
                         TfrmFrame.mnuFileEncounterClick┤ │ 
                                 TfrmFrame.ViewInfo...┤ │ │ 
                    TfrmODMedIV.SetValuesFromResponses┤ │ │ 
                             TfrmODMedIV.SetupDialog┤ │ │ │ 
                   TfrmODMedIV.cboSolutionMouseClick┘ │ │ │ 
                       TfrmODMedIV.cboSolutionExit┘   │ │ │ 
                  TfrmODMedIV.cboSolutionMouseClick...┤ │ │ 
                     TfrmODMedIV.cboAdditiveMouseClick┤ │ │ 
                         TfrmODMedIV.cboAdditiveExit┘ │ │ │ 
                                TfrmODAuto.SetupDialog┤ │ │ 
                                   ActivateOrderDialog┤ │ │ 
                           TfrmRemDlg.btnFinishClick┤ │ │ │ 
           TfrmConsults.mnuActNewConsultRequestClick┤ │ │ │ 
                   TfrmConsults.cmdNewConsultClick┘ │ │ │ │ 
                TfrmConsults.mnuActNewProcedureClick┤ │ │ │ 
                      TfrmConsults.cmdNewProcClick┘ │ │ │ │ 
                                        ChangeOrders┤ │ │ │ 
                      TfrmOrders.mnuActChangeClick┤ │ │ │ │ 
                        TfrmMeds.mnuActChangeClick┘ │ │ │ │ 
                                     ChangeOrdersEvt┤ │ │ │ 
                                          CopyOrders┤ │ │ │ 
                        TfrmOrders.mnuActCopyClick┤ │ │ │ │ 
                          TfrmMeds.mnuActCopyClick┤ │ │ │ │ 
                           TfrmODActive.btnOKClick┘ │ │ │ │ 
                                      TransferOrders┤ │ │ │ 
                        TfrmOrders.mnuActCopyClick┤ │ │ │ │ 
                          TfrmMeds.mnuActCopyClick┤ │ │ │ │ 
                           TfrmODActive.btnOKClick┘ │ │ │ │ 
                            TfrmOrders.lstWriteClick┤ │ │ │ 
               TfrmOrders.PlaceOrderForDefaultDialog┤ │ │ │ 
                  TfrmOrders.DisplayDefaultDlgList┤ │ │ │ │ 
                       TfrmOrders.ResetOrderPage┘ │ │ │ │ │ 
               TfrmOrders.btnDelayedOrderClick┘   │ │ │ │ │ 
                                 DisplayEvntDialog┤ │ │ │ │ 
                             SetDelayEventForMed┘ │ │ │ │ │ 
                      TfrmMeds.mnuActCopyClick┘   │ │ │ │ │ 
                                 DisplayEvntDialog┤ │ │ │ │ 
                                  SetViewForCopy┘ │ │ │ │ │ 
                    TfrmOrders.mnuActCopyClick┘   │ │ │ │ │ 
                                 DisplayEvntDialog┘ │ │ │ │ 
                                ExecuteChangeEvt┘   │ │ │ │ 
                 TfrmOrders.mnuActChgEvntClick┘     │ │ │ │ 
                             TfrmMeds.mnuActNewClick┤ │ │ │ 
                           TfrmOMNavA.ActivateDialog┤ │ │ │ 
                         TfrmOMNavA.grdMenuKeyDown┤ │ │ │ │ 
                         TfrmOMNavA.grdMenuMouseUp┘ │ │ │ │ 
                                TfrmOMSet.DoNextItem┘ │ │ │ 
                              TfrmOMSet.InsertList┤   │ │ │ 
                               ActivateOrderList┘ │   │ │ │ 
                     TfrmRemDlg.btnFinishClick┤   │   │ │ │ 
                             ActivateOrderHTML┤   │   │ │ │ 
                    TfrmOrders.lstWriteClick┤ │   │   │ │ │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┘ │   │   │ │ │ 
                              ActivateOrderSet┤   │   │ │ │ 
                   TfrmRemDlg.btnFinishClick┤ │   │   │ │ │ 
TfrmConsults.mnuActNewConsultRequestClick...┤ │   │   │ │ │ 
     TfrmConsults.mnuActNewProcedureClick...┤ │   │   │ │ │ 
                    TfrmOrders.lstWriteClick┤ │   │   │ │ │ 
    TfrmOrders.PlaceOrderForDefaultDialog...┤ │   │   │ │ │ 
                     TfrmMeds.mnuActNewClick┤ │   │   │ │ │ 
                TfrmOMNavA.ActivateDialog...┤ │   │   │ │ │ 
                     TfrmOMSet.DoNextItem...┘ │   │   │ │ │ 
                       TfrmOMNavA.DoSelectList┘   │   │ │ │ 
                     TfrmOMNavA.grdMenuKeyUp┤     │   │ │ │ 
                   TfrmOMNavA.grdMenuMouseUp┘     │   │ │ │ 
                                        SkipToNext┤   │ │ │ 
                         TfrmOMSet.DoNextItem...┘ │   │ │ │ 
                            TfrmOMSet.UMDelayEvent┘   │ │ │ 
                               TfrmOMSet.InsertList...┤ │ │ 
                                TfrmODMeds.SetupDialog┤ │ │ 
                             TfrmODMeds.btnSelectClick┤ │ │ 
                             TfrmODMeds.UMDelayClick┘ │ │ │ 
                                    ExecuteRenewOrders┘ │ │ 
                         TfrmOrders.mnuActRenewClick┤   │ │ 
                           TfrmMeds.mnuActRenewClick┘   │ │ 
                         TfrmFrame.UpdatePtInfoOnRefresh┤ │ 
                         TfrmFrame.mnuFileOpenClick...┤ │ │ 
                          TfrmFrame.mnuFileReviewClick┤ │ │ 
                            TfrmOrders.mnuActSignClick┤ │ │ 
                               TfrmODActive.btnOKClick┘ │ │ 
                                        EncounterPresent┤ │ 
                                      ReadyForNewOrder┤ │ │ 
                           TfrmRemDlg.btnFinishClick┤ │ │ │ 
        TfrmConsults.mnuActNewConsultRequestClick...┤ │ │ │ 
             TfrmConsults.mnuActNewProcedureClick...┤ │ │ │ 
                                     ChangeOrders...┤ │ │ │ 
                                     ChangeOrdersEvt┤ │ │ │ 
                                       CopyOrders...┤ │ │ │ 
                                   TransferOrders...┤ │ │ │ 
                            TfrmOrders.lstWriteClick┤ │ │ │ 
                             TfrmMeds.mnuActNewClick┘ │ │ │ 
                                     ReadyForNewOrder1┤ │ │ 
            TfrmOrders.PlaceOrderForDefaultDialog...┘ │ │ │ 
                              TfrmOrders.mnuActDCClick┤ │ │ 
                             TfrmOrders.mnuActRelClick┤ │ │ 
                            TfrmOrders.mnuActHoldClick┤ │ │ 
                          TfrmOrders.mnuActUnholdClick┤ │ │ 
                           TfrmOrders.mnuActRenewClick┤ │ │ 
                         TfrmOrders.mnuActReleaseClick┤ │ │ 
                         TfrmOrders.mnuActOnChartClick┤ │ │ 
                            TfrmOrders.mnuActSignClick┤ │ │ 
                                TfrmMeds.mnuActDCClick┤ │ │ 
                              TfrmMeds.mnuActHoldClick┤ │ │ 
                             TfrmMeds.mnuActRenewClick┤ │ │ 
                            TfrmMeds.mnuActUnholdClick┤ │ │ 
                              TfrmMeds.mnuActCopyClick┤ │ │ 
                            TfrmMeds.mnuActRefillClick┘ │ │ 
                                     EncounterPresentEDO┤ │ 
                                   ReadyForNewOrder...┤ │ │ 
                         TfrmOrders.mnuActChgEvntClick┤ │ │ 
                          TfrmOrders.mnuActChangeClick┤ │ │ 
                            TfrmOrders.mnuActCopyClick┤ │ │ 
                       TfrmOrders.btnDelayedOrderClick┤ │ │ 
                            TfrmMeds.mnuActChangeClick┤ │ │ 
                              TfrmMeds.mnuActCopyClick┘ │ │ 
                                PrintOrdersOnSignRelease┤ │ 
                          PrintOrdersOnSignReleaseMult┤ │ │ 
                                   ExecuteSignOrders┤ │ │ │ 
                        TfrmOrders.mnuActSignClick┘ │ │ │ │ 
                               TfrmReview.cmdOKClick┘ │ │ │ 
                                     ReviewChanges┘   │ │ │ 
                 TfrmFrame.AllowContextChangeAll┤     │ │ │ 
                      TfrmFrame.FormCloseQuery┤ │     │ │ │ 
                 TfrmFrame.mnuFileNextClick...┤ │     │ │ │ 
                 TfrmFrame.mnuFileOpenClick...┤ │     │ │ │ 
                 TfrmFrame.ctxContextorPending┤ │     │ │ │ 
             TfrmFrame.StartCCOWContextor...┘ │ │     │ │ │ 
            TfrmFrame.ctxContextorCommitted...┤ │     │ │ │ 
        TfrmFrame.mnuFileResumeContextGetClick┤ │     │ │ │ 
        TfrmFrame.mnuFileResumeContextSetClick┘ │     │ │ │ 
                        TfrmFrame.FormCloseQuery┤     │ │ │ 
                    TfrmFrame.mnuFileReviewClick┤     │ │ │ 
                                 UpdateEncounter┘     │ │ │ 
            TfrmFrame.mnuFileEncounterClick...┤       │ │ │ 
                           EncounterPresent...┤       │ │ │ 
                        EncounterPresentEDO...┤       │ │ │ 
                                   UpdateVisit┤       │ │ │ 
                                 EditPCEData┤ │       │ │ │ 
                   TfrmSurgery.cmdPCEClick┤ │ │       │ │ │ 
                       UpdateEncounterInfo┘ │ │       │ │ │ 
                   TfrmNotes.cmdPCEClick┘   │ │       │ │ │ 
              TfrmVitals.btnEnterVitalsClick┘ │       │ │ │ 
                                   UpdateVisit┤       │ │ │ 
                              EncounterPresent┘       │ │ │ 
               TfrmProblems.lstProbActsClick┘         │ │ │ 
           TfrmProblems.wgProbDataDblClick┤           │ │ │ 
                 TfrmProblems.lstViewClick┘           │ │ │ 
         TfrmProblems.HighlightDuplicate┘             │ │ │ 
               TfrmProblems.AddProblem┤               │ │ │ 
    TfrmProblems.lstProbActsClick...┤ │               │ │ │ 
       TfrmProblems.lstProbPickClick┤ │               │ │ │ 
    TfrmProblems.lstProbPickDblClick┤ │               │ │ │ 
    TfrmProblems.edProbEntKeyPress┘ │ │               │ │ │ 
            TfrmProblems.UMPLLexicon┘ │               │ │ │ 
         TfrmdlgProb.bbChangeProbClick┘               │ │ │ 
                                  ExecuteReleaseOrders┤ │ │ 
                       TfrmOrders.mnuActReleaseClick┘ │ │ │ 
                                  ExecuteOnChartOrders┤ │ │ 
                       TfrmOrders.mnuActOnChartClick┘ │ │ │ 
                             ExecuteReleaseEventOrders┤ │ │ 
                           TfrmOrders.mnuActRelClick┘ │ │ │ 
                                  ExecuteSignOrders...┤ │ │ 
                              TfrmReview.cmdOKClick...┘ │ │ 
                                 TfrmOrders.RequestPrint┤ │ 
                           TfrmFrame.mnuFilePrintClick┘ │ │ 
                                          EditPCEData...┤ │ 
                              TfrmSurgery.mnuActNewClick┤ │ 
                           TfrmSurgery.cmdNewNoteClick┘ │ │ 
                                TfrmNotes.mnuActNewClick┤ │ 
                             TfrmNotes.cmdNewNoteClick┘ │ │ 
                         TfrmNotes.mnuActAddIDEntryClick┤ │ 
                         TfrmPrintLocation.PrintLocation┤ │ 
                                  ExecuteSignOrders...┤ │ │ 
                              TfrmReview.cmdOKClick...┘ │ │ 
                TfrmPrintLocation.SwitchEncounterLoction┤ │ 
                    TfrmFrame.UpdatePtInfoOnRefresh...┤ │ │ 
                              TfrmReview.cmdOKClick...┘ │ │ 
                                     EncounterPresent...┤ │ 
                          TfrmVitals.btnEnterVitalsClick┘ │ 
                                   TfrmFrame.ChangeFont...┘ 

Called-By

Name Declaration Comments
TfrmFrame.ChangeFont procedure ChangeFont(NewFontSize: Integer); -
TfrmFrame.DisplayEncounterText procedure DisplayEncounterText; -


Source

2603  procedure TfrmFrame.FitToolBar;
2604  { resizes and repositions the panels & labels used in the toolbar }
2605  const
2606    PATIENT_WIDTH = 29;
2607    VISIT_WIDTH   = 36;
2608    POSTING_WIDTH = 11.5;
2609    FLAG_WIDTH    = 5;
2610    CV_WIDTH      = 15; //14; WAT
2611    CIRN_WIDTH    = 11;
2612    MHV_WIDTH     = 6;
2613    LINES_HIGH2    = 2;
2614    LINES_HIGH3    = 3;    //lblPtMHTC line change
2615    M_HORIZ       = 4;
2616    M_MIDDLE      = 2;
2617    M_NVERT       = 4;
2618    M_WVERT       = 6;
2619    TINY_MARGIN   = 2;
2620  //var
2621    //WidthNeeded: integer;
2622  begin
2623    if lblPtMHTC.caption = '' then
2624    begin
2625      lblPtMHTC.Visible := false;
2626      pnlToolbar.Height  := (LINES_HIGH2 * lblPtName.Height) + M_HORIZ + M_MIDDLE + M_HORIZ + M_MIDDLE
2627    end
2628    else
2629    begin
2630      if (lblPtAttending.Caption <> '') and (lblPtAttending.Caption <> lblPtMHTC.Caption) then
2631      begin
2632        lblPtMHTC.Visible := true;
2633        pnlToolbar.Height  := (LINES_HIGH3 * lblPtName.Height) + M_HORIZ + M_MIDDLE + M_HORIZ + M_HORIZ;
2634      end;
2635      if lblPtAttending.Caption = '' then
2636      begin
2637        lblPtAttending.Caption := lblPtMHTC.Caption;
2638        lblPtMHTC.Visible := false;
2639        pnlToolbar.Height  := (LINES_HIGH2 * lblPtName.Height) + M_HORIZ + M_MIDDLE + M_HORIZ + M_MIDDLE;
2640      end;
2641    end;
2642    pnlPatient.Width   := HigherOf(PATIENT_WIDTH * MainFontWidth, lblPtName.Width + (M_WVERT * 2));
2643    lblPtSSN.Top       := M_HORIZ + lblPtName.Height + M_MIDDLE;
2644    lblPtAge.Top       := lblPtSSN.Top;
2645    lblPtAge.Left      := pnlPatient.Width - lblPtAge.Width - M_WVERT;
2646    pnlVisit.Width     := HigherOf(LowerOf(VISIT_WIDTH * MainFontWidth,
2647                                           HigherOf(lblPtProvider.Width + (M_WVERT * 2),
2648                                                    lblPtLocation.Width + (M_WVERT * 2))),
2649                                   PATIENT_WIDTH * MainFontWidth);
2650    lblPtProvider.Top  := lblPtSSN.Top;
2651    lblPtAttending.Top := lblPtSSN.Top;
2652    lblPtMHTC.Top       := M_MIDDLE + lblPtSSN.Height + lblPtSSN.Top;
2653    pnlPostings.Width  := Round(POSTING_WIDTH * MainFontWidth);
2654    if btnCombatVet.Visible then
2655     begin
2656      pnlCVnFlag.Width   := Round(CV_WIDTH * MainFontWidth);
2657      pnlFlag.Width      := Round(CV_WIDTH * MainFontWidth);
2658      btnCombatVet.Height := Round(pnlCVnFlag.Height div 2);
2659     end
2660    else
2661     begin
2662      pnlCVnFlag.Width   := Round(FLAG_WIDTH * MainFontWidth);
2663      pnlFlag.Width      := Round(FLAG_WIDTH * MainFontWidth);
2664     end;
2665    pnlRemoteData.Width := Round(CIRN_WIDTH * MainFontWidth) + M_WVERT;
2666    pnlVistaWeb.Height := pnlRemoteData.Height div 2;
2667    paVAA.Width        := Round(MHV_WIDTH * MainFontWidth) + M_WVERT + 2;
2668    with lblPtPostings do
2669      SetBounds(M_WVERT, M_HORIZ, pnlPostings.Width-M_WVERT-M_WVERT, lblPtName.Height);
2670    with lblPtCWAD     do
2671      SetBounds(M_WVERT, lblPtSSN.Top, lblPtPostings.Width, lblPtName.Height);
2672    //Low resolution handling: First, try to fit everything on by shrinking fields
2673    if pnlPrimaryCare.Width < HigherOf( lblPtCare.Left + lblPtCare.Width, HigherOf(lblPtAttending.Left + lblPtAttending.Width,lblPtMHTC.Left + lblPtMHTC.Width)) + TINY_MARGIN then
2674    //if pnlPrimaryCare.Width < HigherOf( lblPtCare.Left + lblPtCare.Width, lblPtAttending.Left + lblPtAttending.Width) + TINY_MARGIN then
2675    begin
2676      lblPtAge.Left := lblPtAge.Left - (lblPtName.Left - TINY_MARGIN);
2677      lblPtName.Left := TINY_MARGIN;
2678      lblPTSSN.Left := TINY_MARGIN;
2679      pnlPatient.Width := HigherOf( lblPtName.Left + lblPtName.Width, lblPtAge.Left + lblPtAge.Width)+ TINY_MARGIN;
2680      lblPtLocation.Left := TINY_MARGIN;
2681      lblPtProvider.Left := TINY_MARGIN;
2682      pnlVisit.Width := HigherOf( lblPtLocation.Left + lblPtLocation.Width, lblPtProvider.Left + lblPtProvider.Width)+ TINY_MARGIN;
2683    end;
2684    //If that is not enough, add scroll bars to form
2685    {if pnlPrimaryCare.Width < HigherOf( lblPtCare.Left + lblPtCare.Width, lblPtAttending.Left + lblPtAttending.Width) + TINY_MARGIN then
2686    begin
2687      WidthNeeded := HigherOf( lblPtCare.Left + lblPtCare.Width, lblPtAttending.Left + lblPtAttending.Width) + TINY_MARGIN - pnlPrimaryCare.Width;
2688      HorzScrollBar.Range := ClientWidth + WidthNeeded;
2689      Width := Width + WidthNeeded;
2690    end
2691    else }   // commented out - BA
2692      HorzScrollBar.Range := 0;
2693  end;