Recent

Author Topic: How to create a simple extended component and can change his properties  (Read 10486 times)

dcelso

  • Full Member
  • ***
  • Posts: 158
Re: How to create a simple extended component and can change his properties
« Reply #15 on: March 04, 2013, 12:29:06 am »
....
But it is not that Im searching in this thread. I'm searching the interconection of two visual components, like, I insist, tshelllistview do with tshelltreeview. When you Drop a tshelllistview to your form in a property called shelltreeview you can select an object of this tipe, for example you can drop to your project three tshelltreeviews, and in your shelllistview1.shelltreeview property you can see shelltreeview1,shelltreeview2 and shelltreeview3 to select one of this.
...
Anyone knows how to do it?

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to create a simple extended component and can change his properties
« Reply #16 on: March 04, 2013, 12:58:23 am »
I am not sure that I perfectly understand. TShellTreeView is just for browsing files. If you want to browse different paths in one ShellTreeView, you can only change its "root" property. It can be done in many ways. You can use TTabControl, TComboBox, Buttons etc. There's no need to create new component.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

dcelso

  • Full Member
  • ***
  • Posts: 158
Re: How to create a simple extended component and can change his properties
« Reply #17 on: March 04, 2013, 01:25:45 am »
Don't
tshelllistview have a property called shelltreeview, this property can be changed in object inspector in design time, to select an object of tshelltreeview type. At press in this property in object inspector a combobox open a list of all of yours objects of this type have in your project to selec one. for example if you drop two tshelltreeview from the components palette to your form, you will have two objects of tshelltreeview, shelltreeview1 and shelltreeview2, and those names You will see when you try to change the shelltreeview propertry of your shelllistview1 in the object inspector.
This kind of interconection of objects Is that I`m trying to simulate. ;)

dcelso

  • Full Member
  • ***
  • Posts: 158
Re: How to create a simple extended component and can change his properties
« Reply #18 on: March 06, 2013, 07:01:08 pm »
 :), I done it. I'm the best  ;)
You only need extend of TComponent your two classes. And register they in the component palette. And automatically you can interconect they as tshellistview and tshelltreeview do.

dcelso

  • Full Member
  • ***
  • Posts: 158
Re: How to create a simple extended component and can change his properties
« Reply #19 on: March 06, 2013, 07:29:30 pm »
But now, I don`t do it circular.
I have a tmyedit and a tmylabel, and tmyedit have a porperty called mylabel that you can select an object of tmylabel dropped from palette.

I'm trying to do now the same in tmylabel,ie, a property called myedit that you can select and object of tmyedit. But when it add umylabel unit lazarus sais that there is a circular reference beteen umyedit an umylabel, and it does not compile.
:'(

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4709
  • I like bugs.
Re: How to create a simple extended component and can change his properties
« Reply #20 on: March 06, 2013, 07:42:10 pm »
I'm trying to do now the same in tmylabel,ie, a property called myedit that you can select and object of tmyedit. But when it add umylabel unit lazarus sais that there is a circular reference beteen umyedit an umylabel, and it does not compile.

In that case the cross-reference really must be in the interface part. The only solution is to copy the components into one unit.
LCL has the same problem with many components. The code is divided into smaller files by using include files for the implementation part.
Lazarus IDE fully understands and supports include files.

About the original problem:
The best way to know how a certain component works, is to look at its source code. This is open source after all.
Just Ctrl-Click TShelLlistView or TShellTreeView and you are taken to its sources. Maybe you did just that, I don't know.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018