Recent

Author Topic: TControl self Parent / HTML behavior  (Read 154 times)

ps

  • Jr. Member
  • **
  • Posts: 79
TControl self Parent / HTML behavior
« 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?

IDE:  Lazarus 1.8 RC3/Trunk, Delphi XE OS:Windows 10, Ubuntu

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2264
    • havefunsoft.com
Re: TControl self Parent / HTML behavior
« Reply #1 on: August 19, 2019, 08:26:41 pm »
I think this is possible with ... Cocoa?
I doubt that.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

jamie

  • Hero Member
  • *****
  • Posts: 1897
Re: TControl self Parent / HTML behavior
« Reply #2 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.


wp

  • Hero Member
  • *****
  • Posts: 6137
Re: TControl self Parent / HTML behavior
« Reply #3 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
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10