Lazarus

Programming => LCL => Topic started by: ps on August 19, 2019, 05:23:59 pm

Title: TControl self Parent / HTML behavior
Post by: ps on August 19, 2019, 05:23:59 pm
I'm thinking about better way to create UI with LCL. In HTML/CSS it's very easy to place "control" inside of another "control". For example: <button class="button">Nice button <div class="icon">with icon</div></button>.

In LCL we must create custom control with individual behavior (with two icons, with left, right icons ...) instead of place TImage inside of TButton. I think this is possible with QT, Firemonkey and Cocoa? It's possible do this with LCL?

Title: Re: TControl self Parent / HTML behavior
Post by: skalogryz on August 19, 2019, 08:26:41 pm
I think this is possible with ... Cocoa?
I doubt that.
Title: Re: TControl self Parent / HTML behavior
Post by: jamie on August 19, 2019, 11:27:47 pm
you can place controls inside others with the LCL too.

looks like you want a HTML rendering output. Don't think you'll like the results since you need a lot of overhead to support it.

 Using a browser object would but then may fail when the OS updates.

Title: Re: TControl self Parent / HTML behavior
Post by: wp on August 19, 2019, 11:50:56 pm
In LCL we must create custom control with individual behavior (with two icons, with left, right icons ...) instead of place TImage inside of TButton.
Did you try TBitBtn or TSpeedButton? They are prepared for an attached image (property "Glyph").

See https://wiki.lazarus.freepascal.org/TBitBtn