Recent

Author Topic: Tool to visually create custom controls/pacakages  (Read 8310 times)

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Tool to visually create custom controls/pacakages
« on: July 08, 2014, 07:22:44 pm »
Hello ,
i'm testing lazarus and found is lucking the existance of a visula tool to allow users to create visual components/packages easier.
Am i right? or i just didn't found the right tool?
In order to put 4 labels in a tpanel and align them with no visual toll is not the easiest thing to do :)
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Tool to visually create custom controls/pacakages
« Reply #1 on: July 08, 2014, 07:43:34 pm »
you mean a composite control I assume. in that case use a frame.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Tool to visually create custom controls/pacakages
« Reply #2 on: July 08, 2014, 07:49:39 pm »
what is the deference if a frame is used instead of a tpanel?
the process is the same you have to rebuild lazarus zillion times until you get the gol.
expecting to found a tool to create visual controls easy as is the form designer
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Tool to visually create custom controls/pacakages
« Reply #3 on: July 08, 2014, 07:49:46 pm »
Shift click to select all four labels, right click and choose Align... from the context menu. Gives you various alignment options (see image below).

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Tool to visually create custom controls/pacakages
« Reply #4 on: July 08, 2014, 07:59:09 pm »
this is available in the form designer.
i am talking about a new custom control.
ref : http://wiki.freepascal.org/How_To_Write_Lazarus_Component
i am not able to see anything unless i recompile the ide for every change.
Am i missing something?
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Tool to visually create custom controls/pacakages
« Reply #5 on: July 08, 2014, 08:08:20 pm »
what is the deference if a frame is used instead of a tpanel?

The frame can be created and used inside your application with out installing it on the application. it is a fast way to visually create composite controls and write the events needed for them to work together. There is one catch though you have to imported on all applications you need to use it it can't be simple placed on a form when the frame is not included in the project.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Tool to visually create custom controls/pacakages
« Reply #6 on: July 08, 2014, 08:15:40 pm »
taazz i'm not able to follow you
is out there an example to look at?
i just follow the instructions of the wiki http://wiki.freepascal.org/How_To_Write_Lazarus_Component
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Tool to visually create custom controls/pacakages
« Reply #7 on: July 08, 2014, 08:23:38 pm »

Am i missing something?

No, there is no such tool for visual design of composite components. I see now what you are asking.
In addition to what taazz says about the use of TFrame as a visual container, alignment of four subcomponents via code is fairly straightforward in Lazarus (slightly easier than early Delphis, anyway) because of more powerful anchoring, sizing and alignment methods such as AnchorToNeighbour, AnchorToCompanion, AnchorAsAlign etc., and properties such as BoundsRect, AnchorSide, Constraints and so on.

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Tool to visually create custom controls/pacakages
« Reply #8 on: July 08, 2014, 08:29:38 pm »
Quote
No, there is no such tool for visual design of composite components. I see now what you are asking.
Are there any plans on building one? i think it will increase productivity dramatically

Quote
In addition to what taazz says about the use of TFrame as a visual container, alignment of four subcomponents via code is fairly straightforward in Lazarus (slightly easier than early Delphis, anyway) because of more powerful anchoring, sizing and alignment methods such as AnchorToNeighbour, AnchorToCompanion, AnchorAsAlign etc., and properties such as BoundsRect, AnchorSide, Constraints and so on.
I am aware of these capabilities
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Tool to visually create custom controls/pacakages
« Reply #9 on: July 08, 2014, 08:30:58 pm »
taazz i'm not able to follow you
is out there an example to look at?

No. The way to use a frame is straight forward. On a new project select the menu "file\new"  select the frame from the dialog that opens, drop your controls on the frame align them as you see fit write the events you need to make sure that the controls will do what ever you need them to do and after that select the tframe control from the component palette it is on the standard tab second from the right and place it on a form, it will show a dialog to select a frame from the project to add to the form after you select your frame it will be shown on your form.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Tool to visually create custom controls/pacakages
« Reply #10 on: July 08, 2014, 08:43:14 pm »
tazz i think this is a completely different process ,
in a future change you will have to change every single line of code.
I think howardpc answered the question.
Thank you very much for your efforts
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Tool to visually create custom controls/pacakages
« Reply #11 on: July 08, 2014, 08:47:50 pm »
tazz i think this is a completely different process ,

the only process that has the visual designer you are looking for.

in a future change you will have to change every single line of code.
If I read that correctly then you are wrong on all levels. as I said a frame is a quick way to write a composite control for your application once the frame code is changed then all forms that have that frame in them will be changed, there is a way to even override the events already written and call the inherited method you wrote.

try it you will be surprised how easy it is to use them.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1272
Re: Tool to visually create custom controls/pacakages
« Reply #12 on: July 08, 2014, 08:49:17 pm »
Taazz is right.  Frames sound they'll fit your need.
http://wiki.freepascal.org/Frames
Lazarus Trunk/FPC latest fixes on Windows 11
  I'm getting old and stale.  Slowly getting used to git, I'll get there...

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Tool to visually create custom controls/pacakages
« Reply #13 on: July 08, 2014, 08:51:05 pm »
Thank you very much tazz and Mike.Cornflake
  i'll give it a try and i will respond
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

Never

  • Sr. Member
  • ****
  • Posts: 409
  • OS:Win7 64bit / Lazarus 1.4
Re: Tool to visually create custom controls/pacakages
« Reply #14 on: July 08, 2014, 09:40:46 pm »
Just implement a test app looks like that this the way to go.
Thanks a lot the three of you(tazz-howardpc-Mike.Cornflake) for the quick response and the correct directions.
Please forgive my ignorance as i said i am still testing / learning lazarus and i had the feeling that something i was missing.
Νέπε Λάζαρε λάγγεψων οξωκά ο φίλοσ'ς αραεύσε

 

TinyPortal © 2005-2018