Procedure

TfrmProblems.EditProblem

Module

fProbs

Last Modified

7/15/2014 3:26:38 PM

Visibility

Public

Owner

TfrmProblems

Declaration

procedure EditProblem(const why:char);

Calls Hierarchy


TfrmProblems.EditProblem
 ├TfrmProblems.MString
 └TfrmdlgProb.Create

Called-By Hierarchy


                  TfrmProblems.EditProblem
           TfrmProblems.lstProbActsClick┤ 
       TfrmProblems.wgProbDataDblClick┤ │ 
             TfrmProblems.lstViewClick┘ │ 
     TfrmProblems.HighlightDuplicate┘   │ 
           TfrmProblems.AddProblem┤     │ 
TfrmProblems.lstProbActsClick...┤ │     │ 
   TfrmProblems.lstProbPickClick┤ │     │ 
TfrmProblems.lstProbPickDblClick┤ │     │ 
TfrmProblems.edProbEntKeyPress┘ │ │     │ 
        TfrmProblems.UMPLLexicon┘ │     │ 
     TfrmdlgProb.bbChangeProbClick┘     │ 
             TfrmProblems.RestoreProblem┘ 
      TfrmProblems.lstProbActsClick...┘   

Calls

Name Declaration Comments
TfrmdlgProb.Create constructor Create(AOwner: TComponent); override ; -
TfrmProblems.MString function MString( index: integer): string; -

Called-By

Name Declaration Comments
TfrmProblems.lstProbActsClick procedure lstProbActsClick(Sender: TObject); -
TfrmProblems.RestoreProblem procedure RestoreProblem; -


Source

1400  procedure TfrmProblems.EditProblem(const why: char);
1401  var
1402    prob: string;
1403    reas: string;
1404  begin
1405    prob := Piece(MString(wgProbData.ItemIndex), U, 1);
1406    if (prob <> '') and (ProbRec = nil) then
1407      begin
1408        StatusText('Retrieving selected problem...') ;
1409        bbCancel.Enabled := False ;
1410        bbOtherProb.enabled := false; {don't let them invoke lexicon till edit completed}
1411        case why of
1412          'E','e','C','c' : reas := 'Edit Problem';
1413          'D','d'         : reas := 'Display Problem';
1414          'R','r'         : reas := 'Remove Problem';
1415        end;
1416        pnlRight.Caption   := lblProbList.caption ;
1417        lblProbList.caption     := reas;
1418        wgProbData.Caption := lblProbList.Caption;
1419        pnlProbDlg.Visible := True;
1420        pnlProbDlg.BringToFront ;
1421        //prevents JAWS from reading the top item in the wgProbData caption listbox when hidden from view.
1422        pnlProbDlg.SetFocus;
1423        dlgProbs           := TfrmdlgProb.Create(pnlProbDlg);
1424        dlgProbs.HorzScrollBar.Range := dlgProbs.ClientWidth;
1425        dlgProbs.VertScrollBar.Range := dlgProbs.ClientHeight;
1426        dlgProbs.parent    := pnlProbDlg;
1427        dlgProbs.Align     := alClient ;
1428        dlgProbs.Reason    := why;
1429        with wgProbData do dlgProbs.subjProb:=prob + u + Trim(Piece(Piece(Piece(MString(itemindex), U, 3), #13, 1), '(', 1)) + u + Piece(MString(itemindex), U, 14);
1430        StatusText('') ;
1431        dlgProbs.Show;
1432        PostMessage(dlgProbs.Handle, UM_TAKEFOCUS, 0, 0);
1433        wgProbData.TabStop := False;  //fixes part (c) of CQ #15531: 508 Problems tab [CPRS v28.1] {TC}.
1434        //prevents the selected problem or last entered problem from the PL captionlistbox
1435        //underneath pnlProbDlg to be focused & read by Jaws
1436      end
1437    else
1438      begin
1439        case why of
1440          'E','e','C','c' : reas := 'Edited';
1441          'D','d'         : reas := 'Displayed';
1442          'R','r'         : reas := 'Removed';
1443        end;
1444        InfoBox('Current Add/Edit/Display activity must be completed' + #13#10 +
1445          'before another record may be ' + reas,
1446          'Information', MB_OK or MB_ICONINFORMATION);
1447      end;
1448  end;