Ignore:
Timestamp:
Jul 6, 2008, 8:20:14 PM (16 years ago)
Author:
Kevin Toppenberg
Message:

Uploading from OR_30_258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/foia-cprs/CPRS-Chart/Options/fOptionsTeams.pas

    r459 r460  
    3737    procedure cboSubscribeKeyDown(Sender: TObject; var Key: Word;
    3838      Shift: TShiftState);
     39    procedure cboSubscribeMouseClick(Sender: TObject);
    3940  private
    4041    FKeyBoarding: boolean;
     
    224225procedure TfrmOptionsTeams.cboSubscribeClick(Sender: TObject);
    225226begin
     227  FKeyBoarding := False
     228end;
     229
     230procedure TfrmOptionsTeams.btnRemoveClick(Sender: TObject);
     231begin
     232  with lstTeams do
     233    if InfoBox('Do you want to remove yourself from '
     234      + Piece(Items[ItemIndex], '^', 2) + '?',
     235      'Confirmation', MB_YESNO or MB_ICONQUESTION) = IDYES then
     236  begin
     237    rpcRemoveList(ItemIEN);
     238    Items.Delete(ItemIndex);
     239    lstTeamsClick(self);
     240    FillATeams;
     241  end;
     242end;
     243
     244procedure TfrmOptionsTeams.mnuPatientIDClick(Sender: TObject);
     245begin
     246  DisplayPtInfo(lstPatients.ItemID);
     247end;
     248
     249procedure TfrmOptionsTeams.lstPatientsMouseDown(Sender: TObject;
     250  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
     251begin
     252  mnuPopPatient.AutoPopup := (lstPatients.Items.Count > 0)
     253                              and (lstPatients.ItemIndex > -1)
     254                              and (Button = mbRight);
     255end;
     256
     257procedure TfrmOptionsTeams.cboSubscribeKeyDown(Sender: TObject;
     258  var Key: Word; Shift: TShiftState);
     259begin
     260  case Key of VK_RETURN:
     261    if (cboSubscribe.ItemIndex > -1) then
     262    begin
     263      FKeyBoarding := False;
     264      cboSubscribeMouseClick(self); // Provide onmouseclick behavior.
     265    end;
     266  else
     267    FKeyBoarding := True; // Suppress onmouseclick behavior.
     268  end;
     269end;
     270
     271procedure TfrmOptionsTeams.cboSubscribeMouseClick(Sender: TObject);
     272begin
    226273  if FKeyBoarding then
    227274    FKeyBoarding := False
     
    229276  begin
    230277    with cboSubscribe do
    231     if InfoBox('Do you want to join '
     278    if ItemIndex < 0 then
     279      exit
     280    else if InfoBox('Do you want to join '
    232281      + Piece(Items[ItemIndex], '^', 2) + '?',
    233282      'Confirmation', MB_YESNO or MB_ICONQUESTION) = IDYES then
     
    249298end;
    250299
    251 procedure TfrmOptionsTeams.btnRemoveClick(Sender: TObject);
    252 begin
    253   with lstTeams do
    254     if InfoBox('Do you want to remove yourself from '
    255       + Piece(Items[ItemIndex], '^', 2) + '?',
    256       'Confirmation', MB_YESNO or MB_ICONQUESTION) = IDYES then
    257   begin
    258     rpcRemoveList(ItemIEN);
    259     Items.Delete(ItemIndex);
    260     lstTeamsClick(self);
    261     FillATeams;
    262   end;
    263 end;
    264 
    265 procedure TfrmOptionsTeams.mnuPatientIDClick(Sender: TObject);
    266 begin
    267   DisplayPtInfo(lstPatients.ItemID);
    268 end;
    269 
    270 procedure TfrmOptionsTeams.lstPatientsMouseDown(Sender: TObject;
    271   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    272 begin
    273   mnuPopPatient.AutoPopup := (lstPatients.Items.Count > 0)
    274                               and (lstPatients.ItemIndex > -1)
    275                               and (Button = mbRight);
    276 end;
    277 
    278 procedure TfrmOptionsTeams.cboSubscribeKeyDown(Sender: TObject;
    279   var Key: Word; Shift: TShiftState);
    280 begin
    281   case Key of VK_RETURN:
    282     if (lstTeams.ItemIndex > 0) then
    283       cboSubscribeClick(self); // Provide onclick behavior.
    284   else
    285     FKeyBoarding := True; // Suppress onclick behavior.
    286   end;
    287 end;
    288 
    289300end.
Note: See TracChangeset for help on using the changeset viewer.