Changeset 1679 for cprs/trunk/CPRS-Chart/fGraphProfiles.pas
- Timestamp:
- May 7, 2015, 12:34:29 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/trunk/CPRS-Chart/fGraphProfiles.pas
r830 r1679 86 86 procedure lstSourcesEnter(Sender: TObject); 87 87 procedure lstSourcesExit(Sender: TObject); 88 procedure lstOtherSourcesEnter(Sender: TObject); 89 procedure lstOtherSourcesExit(Sender: TObject); 88 90 procedure radSourceAllClick(Sender: TObject); 89 91 … … 96 98 aListBox: TORListBox; var addtolist: boolean); 97 99 procedure AssignHints; 98 procedure AssignProfile(aList: TStrings; aProfile: string; UserNum: int eger; allitems: boolean);99 procedure AssignProfilePre(aList: TStrings; var aProfile: string; UserNum: int eger);100 procedure AssignProfile(aList: TStrings; aProfile: string; UserNum: int64; allitems: boolean); 101 procedure AssignProfilePre(aList: TStrings; var aProfile: string; UserNum: int64); 100 102 procedure AssignProfilePost(aList: TStrings; var aProfile, typedata: string); 101 103 procedure CheckPublic; 102 104 procedure FillSource(aList: TORListBox); 103 105 function ProfileExists(aName, aType: string): boolean; 104 procedure btnAddAllClick(Sender: TObject);106 procedure lstOtherSourcesChange(Sender: TObject); 105 107 private 106 108 FHintPauseTime: integer; … … 193 195 GtslViews.Insert(0, VIEW_CURRENT + '^<current selections>^' + aSelections) 194 196 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); 198 198 end; 199 199 ResizeAnchoredFormToFont(frmGraphProfiles); … … 256 256 begin 257 257 radSourceAll.Checked := true; 258 //radSourcePat.Enabled := false;258 radSourcePat.Enabled := false; 259 259 end 260 260 else if GtslData.Count < 1 then 261 261 begin 262 262 radSourceAll.Checked := true; 263 //radSourcePat.Enabled := false;263 radSourcePat.Enabled := false; 264 264 end; 265 265 cboAllItems.Visible := radSourceAll.Checked; … … 304 304 begin 305 305 lstOtherSources.Tag := BIG_NUMBER; 306 lst SourcesChange(lstOtherSources);306 lstOtherSourcesChange(lstOtherSources); 307 307 end; 308 308 end; … … 310 310 procedure TfrmGraphProfiles.lstSourcesChange(Sender: TObject); 311 311 var 312 // CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS 312 313 UserNum: int64; 313 314 filetype, typedata: string; 314 aListBox, oppositeListBox: TORListBox; 315 viewselected: boolean; 315 aListBox: TORListBox; 316 316 begin 317 317 CheckPublic; 318 318 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 330 320 exit; 331 oppositeListBox.ItemIndex := -1; 321 if lstSources.Tag <> BIG_NUMBER then 322 exit; 323 UserNum := User.DUZ; 324 lstOtherSources.ItemIndex := -1; 332 325 cboAllItems.Items.Clear; 333 326 cboAllItems.Text := ''; … … 348 341 or (filetype = VIEW_CURRENT) then 349 342 begin 350 RadSourceAll.Checked := true;351 RadSourcePat.Enabled := false;352 343 AssignProfile(cboAllItems.Items, typedata, UserNum, false); 353 344 FastAssign(cboAllItems.Items, lstItemsSelection.Items); 354 viewselected := true;355 345 end 356 346 else 357 347 begin 358 RadSourcePat.Enabled := true;359 348 AllItemsBefore(typedata); 360 349 AllItemsAfter(filetype, typedata); 361 viewselected := false; 362 end; 363 lstItemsSelection.Visible := viewselected or radSourcePat.Checked; 364 cboAllItems.Visible := not lstItemsSelection.Visible; 350 end; 365 351 cboAllItemsChange(cboAllItems); 366 end;367 368 procedure TfrmGraphProfiles.lstSourcesEnter(Sender: TObject);369 begin370 (Sender as TORListBox).Tag := BIG_NUMBER;371 end;372 373 procedure TfrmGraphProfiles.lstSourcesExit(Sender: TObject);374 begin375 (Sender as TORListBox).Tag := 0;376 352 end; 377 353 … … 387 363 begin 388 364 if lstItemsSelection.Items.Count < 1 then exit; 389 //lstItemsSelection.Selected[0] := true;365 lstItemsSelection.Selected[0] := true; 390 366 cboAllItemsClick(lstItemsSelection); 391 btnAddAllClick(self); 392 end; 367 end; 368 end; 369 370 procedure TfrmGraphProfiles.lstSourcesEnter(Sender: TObject); 371 begin 372 lstSources.Tag := BIG_NUMBER; 373 end; 374 375 procedure TfrmGraphProfiles.lstSourcesExit(Sender: TObject); 376 begin 377 lstSources.Tag := 0; 378 end; 379 380 procedure TfrmGraphProfiles.lstOtherSourcesChange(Sender: TObject); 381 var 382 // CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS 383 UserNum: int64; 384 filetype, typedata: string; 385 aListBox: TORListBox; 386 begin 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); 420 end; 421 422 procedure TfrmGraphProfiles.lstOtherSourcesEnter(Sender: TObject); 423 begin 424 lstOtherSources.Tag := BIG_NUMBER; 425 end; 426 427 procedure TfrmGraphProfiles.lstOtherSourcesExit(Sender: TObject); 428 begin 429 lstOtherSources.Tag := 0; 393 430 end; 394 431 … … 409 446 410 447 procedure TfrmGraphProfiles.cboAllItemsChange(Sender: TObject); 411 //var412 //astring: string;448 var 449 astring: string; 413 450 begin 414 451 if (Sender is TORListBox) then … … 420 457 btnAddAll.Enabled := lstItemsSelection.Items.Count > 0; 421 458 btnAdd.Enabled := lstItemsSelection.ItemIndex > -1; 422 //if btnAdd.Enabled then423 //astring := lstItemsSelection.Items[lstItemsSelection.ItemIndex];459 if btnAdd.Enabled then 460 astring := lstItemsSelection.Items[lstItemsSelection.ItemIndex]; 424 461 end 425 462 else … … 431 468 432 469 procedure TfrmGraphProfiles.cboAllItemsClick(Sender: TObject); 433 var434 i: integer;435 470 begin 436 471 if Sender is TButton then … … 439 474 begin 440 475 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; 458 478 end 459 479 else 460 480 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; 468 484 end; 469 485 end; … … 509 525 QualifierDelete(line); 510 526 lstItemsDisplayedChange(self); 511 end;512 513 procedure TfrmGraphProfiles.btnAddAllClick(Sender: TObject);514 begin515 if cboAllItems.Visible then516 begin517 if cboAllItems.Items.Count < 1 then exit;518 cboAllItems.ItemIndex := 0;519 cboAllItemsClick(cboAllItems);520 end521 else522 begin523 if lstItemsSelection.Items.Count < 1 then exit;524 cboAllItemsClick(btnAddAll);525 end;526 527 end; 527 528 … … 978 979 else 979 980 AddToList(selection, lstItemsDisplayed); 980 //if ItemIndex = 0 then Clear; //profile or type <any>981 if ItemIndex = 0 then Clear; //profile or type <any> 981 982 ItemIndex := -1; 982 983 end; … … 1135 1136 var 1136 1137 i: integer; 1137 itemdata , itemname: string;1138 itemdata: string; 1138 1139 begin 1139 1140 with lstItemsSelection.Items do … … 1141 1142 Clear; 1142 1143 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); 1151 1146 Insert(0, typedata); 1152 1147 Insert(1, '^' + LLS_LINE); … … 1295 1290 end; 1296 1291 1297 procedure TfrmGraphProfiles.AssignProfile(aList: TStrings; aProfile: string; UserNum: integer; allitems: boolean); 1292 // CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS 1293 procedure TfrmGraphProfiles.AssignProfile(aList: TStrings; aProfile: string; UserNum: int64; allitems: boolean); 1298 1294 var 1299 1295 i, k: integer; … … 1391 1387 end; 1392 1388 1393 procedure TfrmGraphProfiles.AssignProfilePre(aList: TStrings; var aProfile: string; UserNum: integer); 1389 // CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS 1390 procedure TfrmGraphProfiles.AssignProfilePre(aList: TStrings; var aProfile: string; UserNum: int64); 1394 1391 var 1395 1392 i: integer; … … 1473 1470 procedure TfrmGraphProfiles.FillSource(aList: TORListBox); 1474 1471 var 1475 i, UserNum: integer; 1472 i: integer; 1473 // CQ #15852 - Changed UserNum to Int64 for a long DUZ - JCS 1474 UserNum: Int64; 1476 1475 dfntype, firstline, listline: string; 1477 1476 begin … … 1648 1647 if length(profilename) > 0 then 1649 1648 lblSave.Hint := profilename; 1650 //btnClearClick(self);1649 btnClearClick(self); 1651 1650 lstScratch.Items.Clear; 1652 1651 lstSources.Items.Clear;
Note:
See TracChangeset
for help on using the changeset viewer.