Recent

Author Topic: New component tab with graphic components like TArrow, TLed etc.  (Read 60966 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
TArrow was recently improved but it needs a revamp. It uses widgetset bindings which is not needed. The arrow is always drawn using graphics primitives. TArrow is an odd bird in the middle of Misc component tab. It does not really do anything. It only shows an arrow.

There could be a new "Industrial stuff" component tab with rewritten TArrow, then TLed, TLedNumber, TSemaphore, TPipe(s) etc.

The components would inherit from TGraphicControl.
If somebody is willing to make such lib or donate an existing one, it would be nice.
There are libraries like that, not sure if any are free / open.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #1 on: May 03, 2013, 01:13:15 pm »
Have you looked at Cindy components converted from Delphi by Lazarus CT team? It's not IOCOMP but still has useful and nice looking components. If I remember well it had MPL license.
« Last Edit: May 03, 2013, 01:17:58 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #2 on: May 03, 2013, 02:35:53 pm »
Have you looked at Cindy components converted from Delphi by Lazarus CT team? It's not IOCOMP but still has useful and nice looking components. If I remember well it had MPL license.

I found this thread about Cindy components :
  http://www.lazarus.freepascal.org/index.php/topic,13430.0.html

They look nice but the lib is much bigger than what I wanted for the new tab. The new comps should be simple and not pull in much dependencies.

CodeTyphon policy puzzles me. It seems they always fork the libraries they include in their product. They don't improve the original library by sending patches and maybe becoming developers.
I find it strange because those libraries often have lack of development resources, they would be happy to get contributions.
There would be no conflict of interest if CodeTyphon improved them and then included them in their product.

Yet, they have right to fork any GPL or MPL SW of course. I don't say it is bad, I am only wondering of the reasons.
They are clearly talented programmers there, kudos for that.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #3 on: May 03, 2013, 03:56:53 pm »
CodeTyphon policy puzzles me. It seems they always fork the libraries they include in their product. They don't improve the original library by sending patches and maybe becoming developers.
I find it strange because those libraries often have lack of development resources, they would be happy to get contributions.
There would be no conflict of interest if CodeTyphon improved them and then included them in their product.

Yet, they have right to fork any GPL or MPL SW of course. I don't say it is bad, I am only wondering of the reasons.
They are clearly talented programmers there, kudos for that.

I share your concern about CodeTyphon. I still don't understand their "raison d'etre". Why don't they give back their changes to the original component authors? It would surely be better for everybody.

JD
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #4 on: May 04, 2013, 09:29:13 am »
I still don't understand their "raison d'etre". Why don't they give back their changes to the original component authors? It would surely be better for everybody.

I share your point of view and I would also like them to improve original libraries instead, but just think about it. CT has more then 1000 components now. Would it be practical to contact 100 developers, work with their GIT, Mercurial, SVN, or even no CVS at all, and wait for patch approvals? Some developers are easy to work with, and some are not. Or if CT patches never get official then maintain that mess on so many version control systems? I would loose compass probably at 1/5 of current components, so I understand their approach. Probably not the best way, but it is practical and it works for them. They made many Laz/Delphi windows only components working on Linux, WinCE, FreeBSD and Solaris. And they really welcome suggestions for component conversions. If component is accepted, they do all the work. How bad can that be? Looking at other similar projects, Lazarus needs some big company sponsor to get attention it deserves. Till then, small CT team has done more for Lazarus then any other company I am aware of (please correct me if wrong). All that development time might not be in the direction everyone would like, but it's their time and they can spend it whatever they like. At the end we all benefit. Even people who don't find CT team's approach fit for their own development work, download Lazarus CT edition just to get new components or update old ones. I would expect some easier way to find a licensing terms for each component set, but hopefully that will be addressed soon. Some people don't like CT changing default toolbar positions, but if you can't wait for official solution which will make everyone happy, then look at their patches directory, find the 'evil one' and recycle it. Many people complained about hard time to reinstall everything with each new release, so CT team addressed it with a rolling update feature, which in theory should let you install LazCT just once and then just update it. I haven't tested that yet but it sounds promising and should solve a big problem CT had (it was not easy to update LazCT like Laz could). I myself use LazFPCUP and LazCT. In my opinion they are both great and solve different things. With fpcup I can easily test latest fpc/laz and keep older versions, or test some new component (waiting zillion components in CT with many active targets to recompile can not be called fast), or chase if some new bug existed with old fpc/laz. CT on the other hand is useful for it's zillion components and it's cross compile features.
« Last Edit: May 04, 2013, 09:33:28 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #5 on: May 04, 2013, 10:56:55 am »
True, the coordination between CT and the numerous library projects would be difficult. I guess they decided to only fork and never contribute for this reason. It is understandable.
Unfortunately sometimes it leads to duplicated effort. The original project is developed further and CT develops their forked version. Later it is very difficult to merge them.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #6 on: May 04, 2013, 08:29:45 pm »
I guess they decided to only fork and never contribute for this reason. It is understandable. Unfortunately sometimes it leads to duplicated effort. The original project is developed further and CT develops their forked version. Later it is very difficult to merge them.
Merging would be difficult if they continued enhancing forked components. I didn't see them doing that. They do the hard conversion from Delphi work, they make component compatible with as many targets as they can, they do the testing on all supported targets, they maintain merging with original component when it gets updated, contribute bug fix patches if there are any to the author, and that's all they do with a component if I understood them well. I might be wrong, but I didn't see them enhancing someone else's components if they didn't need it for the IDE or for their work. So, not much duplicated work after all. Just maintaining conversion patches when new component version shows up and they decide to update.
« Last Edit: May 04, 2013, 08:31:33 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #7 on: May 13, 2013, 01:00:29 am »
TArrow was recently improved but it needs a revamp. It uses widgetset bindings which is not needed. The arrow is always drawn using graphics primitives. TArrow is an odd bird in the middle of Misc component tab. It does not really do anything. It only shows an arrow.

There could be a new "Industrial stuff" component tab with rewritten TArrow, then TLed, TLedNumber, TSemaphore, TPipe(s) etc.

The components would inherit from TGraphicControl.
If somebody is willing to make such lib or donate an existing one, it would be nice.

The attached package could be a start for such a library. It contains a single TGraphicControl-derived arrow component. I've made it compatible with the existing TArrow in terms of properties and defaults, but disengaged it from any widgetset, and published Color and ArrowColor properties which TArrow lacks. It repaints immediately on property changes as components should (unlike TArrow), aligns correctly and sets minimum Height and Width constraints to reasonable values. I wondered about publishing the Enabled property, but decided there was little call for a visually distinct disabled arrow; nor could I decide what such a disabled arrow should look like. I'm also unsure whether there is any point in publishing drag/drop event handlers, so I've included them, but commented them out. I don't know how the "In" TShadowType enumerations should differ in appearance from "Out" TShadowTypes, so in this implementation they are identical, meaning that there are really only three shadow types (None, unEtched and Etched), although I've used the enumerated TShadowType which TArrow introduced without changing it. There is no unit test provided. It's more a proof of concept which a more experienced developer could refine.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #8 on: May 14, 2013, 02:37:41 pm »
hello,

howardpc, good job,  your component seems to be OK ( only tested in Windows 7) . I have put your component in a package named industrialStuff. i have added two other components Tled and TledNumber, converted from delphi for tled ( source freeware) and modified from the component  TvPLedLabel (package VisualPlanIt  License MPL) for TledNumber. I don't know if it is what Juha hopes. While Waiting look at the attachments. If i am in the good way, soon i will put the source here.

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #9 on: May 15, 2013, 03:41:09 am »
finally, my component Tled isn't OK on Linux  :(

don' t reinvent the wheel : the components from codeTyphon Cindy TcyLed and TcyAdvLed do the job.
The files used for these components are :
cyBaseLed.pas, cyLed.pas, cyAdvLed, cyTypes.pas, cyGraphics.pas, cyClasses.pas, cyBevel.pas.

delta Exec File size  (win32 with option -Cx -Xs -XX)  in my example with one component cyLed : 12 kb
the cyAdvLed use pictures for drawing the states. So the size depends of the size of the pictures.

For LedNumber there  are also components in codeTyphon :
TplLed7Seg, TplLCDLine from extra Controls package and TvpLedLabel from Visual PlanIt package.

For Arrow  look at TplSolidArrow in the Shapes package.

Friendly J.P
« Last Edit: May 15, 2013, 04:23:02 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #10 on: May 16, 2013, 04:29:22 pm »
Sorry for the delay guys. I almost missed the latest posts because there is so much traffic here.

The attached package could be a start for such a library. It contains a single TGraphicControl-derived arrow component. I've made it compatible with the existing TArrow in terms of properties and defaults, but disengaged it from any widgetset, and published Color and ArrowColor properties which TArrow lacks.
[...]

Vey nice!
I replaced the old TArrow component with yours. I only changed the name to TArrow and registered the component on "Industrial" tab, otherwise no changes.
I was able to remove tons of useless widgetset binding code, see r41221 yourself.
Thank you howardpc for this contribution.

This component is needed in the IDE, that is why I did not put it in a separate package. It is in LCLBase just like the old version was.
For example it is needed in the designer menu editor. The future "IndustrialStuff" package (or whatever name it has) should not be pulled in for the basic IDE compilation.

Now, the plan still is to have a new package. The components in that package would go to the same "Industrial" tab as the TArrow.
The requirements are :
1. Cross-platform
2. License is usable, LGPL or similar.
3. Not too many dependencies.

Number 3. worries me the most now.
Extracting from Cindy components is basically OK, but does it mean pulling lots of extra code with it?
If yes, then it would be better to include the whole Cindy lib.
There is also a question of positioning our project in the "market". Should we compete with CodeTyphon by including external libraries? IMO no, we have enough work with the IDE + LCL.
Yet, some light and often needed graphics components (led, semaphore etc...) could be usefull.

Jurassic Pork, what is your opinion?

Regards,
Juha
« Last Edit: May 16, 2013, 07:17:05 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #11 on: May 16, 2013, 05:39:01 pm »
The Leds components of Cindy package haven't too many dependencies :
The files used for these components are :
cyBaseLed.pas, cyLed.pas, cyAdvLed, cyTypes.pas, cyGraphics.pas, cyClasses.pas, cyBevel.pas.
delta Exec File size  (win32 with option -Cx -Xs -XX)  in my example with one component cyLed : 12 kb
the cyAdvLed use pictures for drawing the states. So the size depends of the size of the pictures.
those components are ok on ubuntu.  Also The TArrow.

i don't know what you name "LedNumber"  LCD 7 Segment ? 
and what is semaphore ? pipe ? a good link to see what they are   8)  ?

Sorry for my poor english

Friendly J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #12 on: May 16, 2013, 11:17:39 pm »
[...]
i don't know what you name "LedNumber"  LCD 7 Segment ? 
and what is semaphore ? pipe ? a good link to see what they are   8)  ?

Semaphore is like traffic lights.
Pipe is actually from Zeljan's list when we discussed this library. I am not sure what kind of pipe it would be. Must ask him.
7-Segments and such fit well into this idea.

If you want to collect a nice set of those components and put them into a package, please go ahead. I will add it under Lazarus components directory.
The name "Industrial Stuff" is also from Zeljan. I don't know why it is Industrial but I don't know any better name either.
The package name could be just "industrialstuff.lpk" unless there are better ideas. The component tab is already "Industrial" but it can be changed if needed.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #13 on: May 17, 2013, 06:53:21 am »
hello, Juha

in the attachment picture, tell me what the components you would want to be included in the industrial stuff. For the moment the components TStopLightSensor and TAnalogSensor are not sure.
For the pipe --> are they thick  poly lines ?

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: New component tab with graphic components like TArrow, TLed etc.
« Reply #14 on: May 17, 2013, 08:36:17 am »
in the attachment picture, tell me what the components you would want to be included in the industrial stuff. For the moment the components TStopLightSensor and TAnalogSensor are not sure.

They all look good, although I don't know how the AnalogSensors on last row work.
TgrArrow is already in LCL and renamed to TArrow.
What means the "converted from Delphi"? Are they your self-made Delphi components originally?

Quote
For the pipe --> are they thick  poly lines ?

I will figure out what Zeljan meant.
The idea is a Pipe or Tube which connects some other graphs or components together and shows an animated liquid or electricty flowing inside. The animation shows the direction of movement.
« Last Edit: May 17, 2013, 09:51:20 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018