Jump to content
luciano_f

How to change the TVirtualImageList editor?

Recommended Posts

I use it a lot but your editor is horrible, how could I generate a new bpl and make some changes including saving the size and position

What is the pas file and the dfm? How could I reregister the editor when clicking on the component?

Share this post


Link to post

The source file of Image List Editor is: "C:\Program Files (x86)\Embarcadero\Studio\22.0\source\Property Editors\ImgEdit.pas"

 

How to construct a new property editor and register it is behind my knowledge.

 

P.S.: I don't know if the releases (Community, Professional) have those sources.

Edited by DelphiUdIT

Share this post


Link to post
25 minutes ago, DelphiUdIT said:

The source file of Image List Editor is: "C:\Program Files (x86)\Embarcadero\Studio\22.0\source\Property Editors\ImgEdit.pas"

 

How to construct a new property editor and register it is behind my knowledge.

 

P.S.: I don't know if the releases (Community, Professional) have those sources.

How could I generate the property record by changing these files?

Share this post


Link to post
1 hour ago, DelphiUdIT said:

The source file of Image List Editor is: "C:\Program Files (x86)\Embarcadero\Studio\22.0\source\Property Editors\ImgEdit.pas"

This Editor is for TImageList, not for TVirtualImageList. AFAIK, the editor for TVirtualImageList is not shipped as source.

  • Thanks 1

Share this post


Link to post
9 minutes ago, Uwe Raabe said:

This Editor is for TImageList, not for TVirtualImageList. AFAIK, the editor for TVirtualImageList is not shipped as source.

Even though it is not supplied with the sources, there must be some way to create a form that inherits it so that I can change and register this new editor

Share this post


Link to post
13 hours ago, luciano_f said:

Even though it is not supplied with the sources, there must be some way to create a form that inherits it so that I can change and register this new editor

Looking through ProcessHacker I found the class but I didn't find the files that refer to it  "TImageCollectionEditorForm"

Share this post


Link to post
57 minutes ago, luciano_f said:

but I didn't find the files that refer to it  "TImageCollectionEditorForm"

Try unit Imagecollectioneditorthe in the dclwinx package.

Edited by Uwe Raabe

Share this post


Link to post
2 minutes ago, Uwe Raabe said:

Try unit Imagecollectioneditorthe in the dclwinx package.

 


where do I find this ?

can you put the link ?

Share this post


Link to post

The package is part of the Delphi installation and the unit is included in the package. There is no source.

Share this post


Link to post
17 minutes ago, Uwe Raabe said:

The package is part of the Delphi installation and the unit is included in the package. There is no source.

I didn't find it and I looked on the web and there aren't even any references.

 

Can you attach it here?

 

Tell me will you do what I need ?

 

Share this post


Link to post

dclwinx.dcp is located in lib\win32\release in the Delphi folder and the corresponding design package (dclwinx280.bpl for Delphi 11) is located in the bin folder.

 

You won't find anything on the web for it, neither the package nor the unit, because Embarcadero doesn't provide any information for it.

Share this post


Link to post
1 hour ago, Uwe Raabe said:

dclwinx.dcp is located in lib\win32\release in the Delphi folder and the corresponding design package (dclwinx280.bpl for Delphi 11) is located in the bin folder.

 

You won't find anything on the web for it, neither the package nor the unit, because Embarcadero doesn't provide any information for it.

I don't understand your explanation because this file "ImageCollectionEditor" doesn't exist
I downloaded the trial architect 11.3 version and couldn't find it

Can you attach the file here on the forum please

Share this post


Link to post
10 hours ago, Uwe Raabe said:

Try unit Imagecollectioneditorthe in the dclwinx package.


Do you have this file on your machine ?

 

Share this post


Link to post
8 hours ago, luciano_f said:

Can you attach the file here on the forum please

It's not allowed to submit some files from Delphi, i think

Share this post


Link to post
10 hours ago, luciano_f said:

I don't understand your explanation because this file "ImageCollectionEditor" doesn't exist

I didn't say the file exists. When a unit is neither provided as source nor as a compiled DCU, it can still be provided inside a DCP file, which is the case for the unit ImageCollectionEditor. It is contained inside dclwinx.dcp and thus can be used in other design packages. I cannot give a link or attach that file because it is not listed under the Redist folder of Delphi.

Share this post


Link to post
24 minutes ago, Uwe Raabe said:

I didn't say the file exists. When a unit is neither provided as source nor as a compiled DCU, it can still be provided inside a DCP file, which is the case for the unit ImageCollectionEditor. It is contained inside dclwinx.dcp and thus can be used in other design packages. I cannot give a link or attach that file because it is not listed under the Redist folder of Delphi.

Could you explain to me then how I could use it? From the dcp?
 

Share this post


Link to post

@Softacom Company

 

Sorry for my ignorance, as I don't have enough knowledge to create and change components, could my colleague give me some help?

How could I create a new form that inherits from "TImageCollectionEditorForm" and I can make changes to it? I tried but I couldn't and also how could I register this BPL, see attached what I did

 

ImageListEdit Form.7z

 

If I could have access to the form I would change more things, such as this huge image preview area, see attached.

 

 

Change Forms.png

Edited by luciano_f

Share this post


Link to post
1 hour ago, Softacom Company said:

As we see – you don’t have any experience at component development. If you don't have original sources - you can't just make form in designer, you must do all your changes by your sources.


...
  Self.BorderIcons := [biSystemMenu, biMinimize, biMaximize, biHelp];
  Self.SourceImagesView.Margins.Bottom := 5;
...

we add into your package example how we can make component editor for TImageCollection with using of decedent of TImageCollectionEditorForm.

If you want - you can develop completely new form and use it by this editor. Also, you can make any other component editors for TVirtualImageList or any other components.

ImageListEdit Form.7z

P.S. Our recomentation - first read some doc about what is it "Component Editors" and how to make it.

 

I am very grateful

I managed to place the Splitter, Maximize form button but the create is not triggered See how I did it

 

constructor TMyImageCollectionEditorForm.Create(AOwner: TComponent);
begin
  inherited;

 
  Showmessage('Test'); do not execute this message

Self.BorderIcons := [biSystemMenu, biMaximize];

end;

 

procedure TMyImageCollectionEditor.ExecuteVerb(Index: Integer);
Var Splitter1: TSplitter;
begin
  //here we implement action when someone click on our menu item
  inherited;

  case Index of
    0: begin
      if Self.Component is TImageCollection then begin
        var xImCol := Self.Component as TImageCollection;
        var xMyEditor := TMyImageCollectionEditorForm.CreateEx(Nil, xImCol);
        try
          xMyEditor.BorderIcons := [biSystemMenu, biMaximize];

          xMyEditor.GroupBox1.Margins.Top := 3;
          xMyEditor.GroupBox1.Margins.Bottom := 3;
          xMyEditor.GroupBox1.Margins.Left := 3;
          xMyEditor.GroupBox1.Margins.Right := 10;

          xMyEditor.GroupBox2.Margins.Top := 3;
          xMyEditor.GroupBox2.Margins.Bottom := 3;
          xMyEditor.GroupBox2.Margins.Left := 3;
          xMyEditor.GroupBox2.Margins.Right := 10;

          Splitter1 := TSplitter.Create(xMyEditor);
          Splitter1.Parent := xMyEditor;
          Splitter1.Visible := True;
          Splitter1.Align := alBottom;
          Splitter1.Height := 9;
          Splitter1.Color := clHighlight;
          Splitter1.Top := xMyEditor.GroupBox2.Top + xMyEditor.GroupBox2.Height;

          xMyEditor.ShowModal;
        finally
          xMyEditor.Free;
        end;
      end;
    end;
  end;
end;

 

Change Forms 2.png

Share this post


Link to post
1 minute ago, Softacom Company said:

Your showmessage does not trigger because you override constructor Create, but call constructor CreateEx.

Unfortunately, you cannot override CreateEx, because embarcadero does not made it virtual, but you can create your own additional constructor or class method which will call inherited CreateEx inside.


Can you create an example for my understanding?

Grateful.

Share this post


Link to post

Sorry, this is pretty off topic.

Frankly, I don't understand why you feel the need to create a descendant of TVirtualImageList. Yes, the bottom part is high. But you don't gain much by narrowing it down.
One serious reason is that you don't know anything about it. If you just want to learn, that's fine.

I use this approach:
I have a TImageCollection on a DataModule. N - normal, D - disable, H - hot.

1443784678_Snmkaobrazovky2023-10-02174537.png.7ab3ff2e471cb43f9c42e4e8ea4559d9.png
I create the corresponding TVirtualImageList-s on the concrete forms. Personally, I have only two types. Namely for:

  1. main form: the number of images depends on the application
  2. other forms: here I have images only for DBNavigator

If I create a new form, I just copy the existing TVirtualImageList-s there. Alternatively, I will edit them.
Personally, I have no problem with displaying a large number of images. But if you have a 14" monitor...

974777879_Snmkaobrazovky2023-10-02174614.thumb.png.18b582b226adf3bd6a9b8fcc374e973f.png

Share this post


Link to post

@Softacom Company

 

Simply fantastic

Last question for Master of Mages

How did you extract the Form Components without having access to it ?  file "ImageCollectionEditorForm.dfm"

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×