Ignore:
Timestamp:
May 7, 2015, 12:34:29 PM (9 years ago)
Author:
healthsevak
Message:

Updating the working copy to CPRS version 28

File:
1 edited

Legend:

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

    r830 r1679  
    8686    procedure lstSourcesEnter(Sender: TObject);
    8787    procedure lstSourcesExit(Sender: TObject);
     88    procedure lstOtherSourcesEnter(Sender: TObject);
     89    procedure lstOtherSourcesExit(Sender: TObject);
    8890    procedure radSourceAllClick(Sender: TObject);
    8991
     
    9698      aListBox: TORListBox; var addtolist: boolean);
    9799    procedure AssignHints;
    98     procedure AssignProfile(aList: TStrings; aProfile: string; UserNum: integer; allitems: boolean);
    99     procedure AssignProfilePre(aList: TStrings; var aProfile: string; UserNum: integer);
     100    procedure AssignProfile(aList: TStrings; aProfile: string; UserNum: int64; allitems: boolean);
     101    procedure AssignProfilePre(aList: TStrings; var aProfile: string; UserNum: int64);
    100102    procedure AssignProfilePost(aList: TStrings; var aProfile, typedata: string);
    101103    procedure CheckPublic;
    102104    procedure FillSource(aList: TORListBox);
    103105    function ProfileExists(aName, aType: string): boolean;
    104     procedure btnAddAllClick(Sender: TObject);
     106    procedure lstOtherSourcesChange(Sender: TObject);
    105107  private
    106108    FHintPauseTime: integer;
     
    193195          GtslViews.Insert(0, VIEW_CURRENT + '^<current selections>^' + aSelections)
    194196        else if Piece(GtslViews[0], '^', 1) <> VIEW_CURRENT then
    195           GtslViews.Insert(0, VIEW_CURRENT + '^<current selections>^' + aSelections)
    196         else if GtslViews.Count > 0 then
    197           GtslViews[0] := VIEW_CURRENT + '^<current selections>^' + aSelections;
     197          GtslViews.Insert(0, VIEW_CURRENT + '^<current selections>^' + aSelections);
    198198      end;
    199199      ResizeAnchoredFormToFont(frmGraphProfiles);
     
    256256  begin
    257257    radSourceAll.Checked := true;
    258     //radSourcePat.Enabled := false;
     258    radSourcePat.Enabled := false;
    259259  end
    260260  else if GtslData.Count < 1 then
    261261  begin
    262262    radSourceAll.Checked := true;
    263     //radSourcePat.Enabled := false;
     263    radSourcePat.Enabled := false;
    264264  end;
    265265  cboAllItems.Visible := radSourceAll.Checked;
     
    304304  begin
    305305    lstOtherSources.Tag := BIG_NUMBER;
    306     lstSourcesChange(lstOtherSources);
     306    lstOtherSourcesChange(lstOtherSources);
    307307  end;
    308308end;
     
    310310procedure TfrmGraphProfiles.lstSourcesChange(Sender: TObject);
    311311var
     312// CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS
    312313  UserNum: int64;
    313314  filetype, typedata: string;
    314   aListBox, oppositeListBox: TORListBox;
    315   viewselected: boolean;
     315  aListBox: TORListBox;
    316316begin
    317317  CheckPublic;
    318318  aListBox := (Sender as TORListBox);
    319   if aListBox = lstSources then
    320   begin
    321     oppositeListBox := lstOtherSources;
    322     UserNum := User.DUZ;
    323   end
    324   else
    325   begin
    326     oppositeListBox := lstSources;
    327     UserNum := cboUser.ItemID;
    328   end;
    329   if aListBox.Tag <> BIG_NUMBER then
     319  if aListBox = lstOtherSources then
    330320    exit;
    331   oppositeListBox.ItemIndex := -1;
     321  if lstSources.Tag <> BIG_NUMBER then
     322    exit;
     323  UserNum := User.DUZ;
     324  lstOtherSources.ItemIndex := -1;
    332325  cboAllItems.Items.Clear;
    333326  cboAllItems.Text := '';
     
    348341  or (filetype = VIEW_CURRENT) then
    349342  begin
    350     RadSourceAll.Checked := true;
    351     RadSourcePat.Enabled := false;
    352343    AssignProfile(cboAllItems.Items, typedata, UserNum, false);
    353344    FastAssign(cboAllItems.Items, lstItemsSelection.Items);
    354     viewselected := true;
    355345  end
    356346  else
    357347  begin
    358     RadSourcePat.Enabled := true;
    359348    AllItemsBefore(typedata);
    360349    AllItemsAfter(filetype, typedata);
    361     viewselected := false;
    362   end;
    363   lstItemsSelection.Visible := viewselected or radSourcePat.Checked;
    364   cboAllItems.Visible := not lstItemsSelection.Visible;
     350  end;
    365351  cboAllItemsChange(cboAllItems);
    366 end;
    367 
    368 procedure TfrmGraphProfiles.lstSourcesEnter(Sender: TObject);
    369 begin
    370   (Sender as TORListBox).Tag := BIG_NUMBER;
    371 end;
    372 
    373 procedure TfrmGraphProfiles.lstSourcesExit(Sender: TObject);
    374 begin
    375   (Sender as TORListBox).Tag := 0;
    376352end;
    377353
     
    387363  begin
    388364    if lstItemsSelection.Items.Count < 1 then exit;
    389     //lstItemsSelection.Selected[0] := true;
     365    lstItemsSelection.Selected[0] := true;
    390366    cboAllItemsClick(lstItemsSelection);
    391     btnAddAllClick(self);
    392   end;
     367  end;
     368end;
     369
     370procedure TfrmGraphProfiles.lstSourcesEnter(Sender: TObject);
     371begin
     372  lstSources.Tag := BIG_NUMBER;
     373end;
     374
     375procedure TfrmGraphProfiles.lstSourcesExit(Sender: TObject);
     376begin
     377  lstSources.Tag := 0;
     378end;
     379
     380procedure TfrmGraphProfiles.lstOtherSourcesChange(Sender: TObject);
     381var
     382// CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS
     383  UserNum: int64;
     384  filetype, typedata: string;
     385  aListBox: TORListBox;
     386begin
     387  CheckPublic;
     388  aListBox := (Sender as TORListBox);
     389  if aListBox = lstSources then
     390    exit;
     391  if lstOtherSources.Tag <> BIG_NUMBER then
     392    exit;
     393  UserNum := cboUser.ItemID;
     394  lstSources.ItemIndex := -1;
     395  cboAllItems.Items.Clear;
     396  cboAllItems.Text := '';
     397  if aListBox.ItemIndex = -1 then exit;
     398  typedata :=  aListBox.Items[aListBox.ItemIndex];
     399  if pos(LLS_FRONT, typedata) > 0 then  // <clear all selections>
     400  begin
     401    lstItemsSelection.Clear;
     402    cboAllItems.Items.Clear;
     403    cboAllItems.Text := '';
     404    exit;
     405  end;
     406  filetype := Piece(typedata, '^', 1);
     407  if (filetype = VIEW_PERSONAL)
     408  or (filetype = VIEW_PUBLIC)
     409  or (filetype = VIEW_LABS) then
     410  begin
     411    AssignProfile(cboAllItems.Items, typedata, UserNum, false);
     412    FastAssign(cboAllItems.Items, lstItemsSelection.Items);
     413  end
     414  else
     415  begin
     416    AllItemsBefore(typedata);
     417    AllItemsAfter(filetype, typedata);
     418  end;
     419  cboAllItemsChange(cboAllItems);
     420end;
     421
     422procedure TfrmGraphProfiles.lstOtherSourcesEnter(Sender: TObject);
     423begin
     424  lstOtherSources.Tag := BIG_NUMBER;
     425end;
     426
     427procedure TfrmGraphProfiles.lstOtherSourcesExit(Sender: TObject);
     428begin
     429  lstOtherSources.Tag := 0;
    393430end;
    394431
     
    409446
    410447procedure TfrmGraphProfiles.cboAllItemsChange(Sender: TObject);
    411 //var
    412  //astring: string;
     448var
     449 astring: string;
    413450begin
    414451 if (Sender is TORListBox) then
     
    420457   btnAddAll.Enabled := lstItemsSelection.Items.Count > 0;
    421458   btnAdd.Enabled := lstItemsSelection.ItemIndex > -1;
    422    //if btnAdd.Enabled then
    423      //astring := lstItemsSelection.Items[lstItemsSelection.ItemIndex];
     459   if btnAdd.Enabled then
     460     astring := lstItemsSelection.Items[lstItemsSelection.ItemIndex];
    424461 end
    425462 else
     
    431468
    432469procedure TfrmGraphProfiles.cboAllItemsClick(Sender: TObject);
    433 var
    434   i: integer;
    435470begin
    436471  if Sender is TButton then
     
    439474    begin
    440475      if Sender = btnAddAll then
    441       begin
    442         for i := 0 to lstItemsSelection.Items.Count - 1 do
    443         begin
    444           lstItemsSelection.Selected[i] := true;
    445           lstItemsSelection.ItemIndex := i;
    446           ListBoxSetup(lstItemsSelection);
    447         end;
    448         lstItemsSelection.Clear;
    449       end
    450       else
    451       begin
    452         lstItemsDisplayed.ItemIndex := 0;
    453         ListBoxSetup(lstItemsSelection);
    454       end;
    455       lstItemsDisplayedChange(self);
    456       CheckToClear;
    457       exit;
     476        lstItemsSelection.ItemIndex := 0;
     477      Sender := lstItemsSelection;
    458478    end
    459479    else
    460480    begin
    461       if Sender = btnAdd then
    462       begin
    463         ComboBoxSetup(cboAllItems);
    464         lstItemsDisplayedChange(self);
    465         CheckToClear;
    466         exit;
    467       end;
     481      if Sender = btnAddAll then
     482        cboAllItems.ItemIndex := 0;
     483      Sender := cboAllItems;
    468484    end;
    469485  end;
     
    509525  QualifierDelete(line);
    510526  lstItemsDisplayedChange(self);
    511 end;
    512 
    513 procedure TfrmGraphProfiles.btnAddAllClick(Sender: TObject);
    514 begin
    515   if cboAllItems.Visible then
    516   begin
    517     if cboAllItems.Items.Count < 1 then exit;
    518     cboAllItems.ItemIndex := 0;
    519     cboAllItemsClick(cboAllItems);
    520   end
    521   else
    522   begin
    523     if lstItemsSelection.Items.Count < 1 then exit;
    524     cboAllItemsClick(btnAddAll);
    525   end;
    526527end;
    527528
     
    978979    else
    979980      AddToList(selection, lstItemsDisplayed);
    980     //if ItemIndex = 0 then Clear;        //profile or type <any>
     981    if ItemIndex = 0 then Clear;        //profile or type <any>
    981982    ItemIndex := -1;
    982983  end;
     
    11351136var
    11361137  i: integer;
    1137   itemdata, itemname: string;
     1138  itemdata: string;
    11381139begin
    11391140  with lstItemsSelection.Items do
     
    11411142    Clear;
    11421143    lstItemsSelection.Sorted := true;
    1143     itemname := Piece(typedata, '^', 3);
    1144     if copy(itemname, 1, 1) = ' ' then
    1145     begin
    1146       itemname := copy(itemname, 2, length(itemname));   // strip preceding space
    1147       typedata := '0^' + Piece(typedata, '^', 2) + '^ ' + itemname;
    1148     end
    1149     else
    1150       typedata := '0^' + Piece(typedata, '^', 1) + '^ ' + itemname;
     1144    //typedata := '0^' + Piece(typedata, '^', 1) + '^ ' + Piece(typedata, '^', 2) + ' <any>';
     1145    typedata := '0^' + Piece(typedata, '^', 1) + '^ ' + Piece(typedata, '^', 3);
    11511146    Insert(0, typedata);
    11521147    Insert(1, '^' + LLS_LINE);
     
    12951290end;
    12961291
    1297 procedure TfrmGraphProfiles.AssignProfile(aList: TStrings; aProfile: string; UserNum: integer; allitems: boolean);
     1292// CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS
     1293procedure TfrmGraphProfiles.AssignProfile(aList: TStrings; aProfile: string; UserNum: int64; allitems: boolean);
    12981294var
    12991295  i, k: integer;
     
    13911387end;
    13921388
    1393 procedure TfrmGraphProfiles.AssignProfilePre(aList: TStrings; var aProfile: string; UserNum: integer);
     1389// CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS
     1390procedure TfrmGraphProfiles.AssignProfilePre(aList: TStrings; var aProfile: string; UserNum: int64);
    13941391var
    13951392  i: integer;
     
    14731470procedure TfrmGraphProfiles.FillSource(aList: TORListBox);
    14741471var
    1475   i, UserNum: integer;
     1472  i: integer;
     1473// CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS
     1474  UserNum: Int64;
    14761475  dfntype, firstline, listline: string;
    14771476begin
     
    16481647  if length(profilename) > 0 then
    16491648    lblSave.Hint := profilename;
    1650   //btnClearClick(self);
     1649  btnClearClick(self);
    16511650  lstScratch.Items.Clear;
    16521651  lstSources.Items.Clear;
Note: See TracChangeset for help on using the changeset viewer.