Recent

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

ps

  • Full Member
  • ***
  • Posts: 136
    • CSS
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?

Small simple CSS/box model implementation: https://github.com/pst2d/csscontrols/tree/dev

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • 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.

jamie

  • Hero Member
  • *****
  • Posts: 6128
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.

The only true wisdom is knowing you know nothing

wp

  • Hero Member
  • *****
  • Posts: 11910
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

 

TinyPortal © 2005-2018