View Issue Details

IDProjectCategoryView StatusLast Update
0002121JEDI VCL00 JVCL Componentspublic2005-04-12 09:41
ReportermschumannAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 BETA 
Target VersionFixed in Version3.10 
Summary0002121: jvThumbViews onGetTitle doesnt always get called
DescriptionI extended jvThumbViews to call the event OnGetTitle also with Files read from a directory. This allows changing all Titles not only those of pics added manually. IMO this is the correct behaviour - the event GetTitle should be called with every thumbnail.
Additional InformationHere are the proposed changes (marked with // *** added by micha schumann):

procedure TJvThumbView.SetDirectory(Value: string);
var
  Counter1, FStartTime: DWORD;
  Cancel: Boolean;
  ReadFileList: TStringList;
  OldCursor: TCursor;

  // *** added by micha schumann
  // *** allow to change title also with scanned files
  FFont: TFont;
  FColor: TColor;
  ThumbnailTitle: string;
  // *** end addition by micha schumann

// Pic: TPicture;
begin
  FSelected := -1;
  // If Not FPainted then
  // begin
  // postMessage(Self.Handle,WM_LoadWhenReady,0,0);
  // Exit;
  // end;
  FDiskSize := 0;
  if FFilling then
    Exit;
  if Value <> '' then
  begin
    ReadFileList := TStringList.Create;
    OldCursor := Cursor;
    try
      FFilling := True;
    // if Assigned(ReadFileList) then FreeAndNil(ReadFileList);
      FStartTime := GetTickCount;
      GetFiles(Value);
      if FSorted then
        ReadFileList.Assign(FFileListSorted)
      else
        ReadFileList.Assign(FFileList);
      EmptyList;
      FDirectory := Value;
      if Assigned(FOnStartScanning) then
        FOnStartScanning(Self, ReadFileList.Count - 1);
      if ReadFileList.Count > 0 then
      begin
        Cancel := False;
        for Counter1 := 0 to ReadFileList.Count - 1 do
        begin
          if Assigned(FOnScanProgress) then
            FOnScanProgress(Self, Counter1 + 1, Cancel);
          if Cancel then
            Break;
          AddThumb(ExtractFilename(ReadFileList.Strings[Counter1]), True);
          TJvThumbnail(FThumbList.Objects[Counter1]).FileName := ReadFileList.Strings[Counter1];

          // *** added by micha schumann
          // *** allow to change title also with scanned files
          if Assigned(FOnGetTitle) then
          begin
            FFont := TFont.Create;
            FColor := clBtnFace;
            FOnGetTitle(Self, ReadFileList.Strings[Counter1], ThumbnailTitle, FFont, FColor);

TJvThumbnail(FThumbList.Objects[Counter1]).SetTitlePanel(ThumbnailTitle, FFont, FColor);
            FreeAndNil(FFont);
          end;
          // *** end addition by micha schumann

          Inc(FDiskSize, TJvThumbnail(FThumbList.Objects[Counter1]).FileSize);
          if (Cursor <> crHourGlass) and (GetTickCount - FStartTime > 1000) then
            Cursor := crHourGlass;
        end;
      end;
      if Assigned(FOnStopScanning) then
        FOnStopScanning(Self);
    finally
      FreeAndNil(ReadFileList);
      FFilling := False;
      Cursor := OldCursor;
    end
  end
  else
    EmptyList;
  FDirectory := Value;
  if (FThumbList.Count > 0) and (Selected < 0) then
    SetSelected(0);
  Invalidate;
end;
TagsNo tags attached.

Activities

obones

2005-04-12 08:43

administrator   ~0006970

Could you check with the lates JVCL and let us know if this is still required ?

mschumann

2005-04-12 09:35

reporter   ~0006978

No - no longer required. Sorry for forgetting to report that. Thanks for all your effort!

Issue History

Date Modified Username Field Change
2004-09-05 04:31 mschumann New Issue
2005-04-12 08:43 obones Note Added: 0006970
2005-04-12 08:43 obones Status new => feedback
2005-04-12 09:35 mschumann Note Added: 0006978
2005-04-12 09:41 obones Status feedback => resolved
2005-04-12 09:41 obones Resolution open => fixed
2005-04-12 09:41 obones Assigned To => obones