Recent

Author Topic: New Idea: May we use some CSS like thing to do GUI?  (Read 3940 times)

JiaXing

  • Jr. Member
  • **
  • Posts: 75
New Idea: May we use some CSS like thing to do GUI?
« on: April 24, 2020, 06:51:38 pm »
I got this idea from here: https://github.com/qPCR4vir/nana-docs/wiki/Using-place-for-layouts

It's easily to see the syntax is somewhat looks like CSS. It's a C++ GUI library. Could we have something similar for Lazarus?

At first I think it's a bit difficult to write. But after I looked how it was used to develop professional software like this I changed my mind. It's totally possible to do advanced/complex GUI with this approach.

https://github.com/qPCR4vir/nana-docs/wiki/Screenshots
I'm subscribed to the church of 440bx. Say no to OOP  :P

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #1 on: April 24, 2020, 07:03:04 pm »
We look forward to seeing your proof of concept code.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11382
  • FPC developer.
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #2 on: April 24, 2020, 07:04:33 pm »
Please don't start threads that only ask to make something for you.

You might be wanting to look at QT Quick too.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #3 on: April 24, 2020, 07:33:40 pm »
IIRC, there was recently a discussion of almost exactly this, "Modern UI with Lazarus" or something like that, which included a "proof of concept" initial implementation.

Do a search in the forum for "Modern UI Lazarus" or "CSS GUI" or some such.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #4 on: April 24, 2020, 07:40:52 pm »
LCL implementation of Qt/Qt5 supports QStyleSheet, so you can do a lot of styling.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #5 on: April 24, 2020, 08:49:28 pm »
LCL implementation of Qt/Qt5 supports QStyleSheet, so you can do a lot of styling.

Which I think is oriented towards JavaScript, if OP's into that sort of thing.

I'm sorry, but whenever I see a "shouldn't the project go off in this direction" thread my natural inclination is to query the technical acumen of the originator: does he understand the language's syntax, can be write a parser, and does he at least know the basics of code generation. By and large, people who meet those requirements don't make off-the-wall suggestions, they just work on the problem quietly and produce something demonstrable.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

JiaXing

  • Jr. Member
  • **
  • Posts: 75
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #6 on: April 25, 2020, 04:09:30 am »
Please don't start threads that only ask to make something for you.

You might be wanting to look at QT Quick too.

OK. But I only found the idea to be cool and want to know if others think so, too. I didn't ask for someone to do it for me. If they think the same as me finally we will gain enough traction and someone capable will come out with his implementation. I'm fine with the current GUI, though.
I'm subscribed to the church of 440bx. Say no to OOP  :P

JiaXing

  • Jr. Member
  • **
  • Posts: 75
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #7 on: April 25, 2020, 04:16:43 am »
LCL implementation of Qt/Qt5 supports QStyleSheet, so you can do a lot of styling.

Which I think is oriented towards JavaScript, if OP's into that sort of thing.

I'm sorry, but whenever I see a "shouldn't the project go off in this direction" thread my natural inclination is to query the technical acumen of the originator: does he understand the language's syntax, can be write a parser, and does he at least know the basics of code generation. By and large, people who meet those requirements don't make off-the-wall suggestions, they just work on the problem quietly and produce something demonstrable.

MarkMLl

At least read the page I mentioned and you will found the idea. I have nothing to do with JavaScript or the actual CSS. I wrote it crystal clear in the title: CSS-like, not CSS. Take a look at my links and you will see, they got the idea from CSS (at least it's what I think) but their code is perfectly standard C++.

p/s: Take a look at Div syntax, it's the most important part I want to show you.
I'm subscribed to the church of 440bx. Say no to OOP  :P

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #8 on: April 25, 2020, 03:12:02 pm »
Could we have something similar for Lazarus?
CSS based interface example can be seen here: https://forum.lazarus.freepascal.org/index.php/topic,36502.msg354408.html#msg354408
It's a work in progress which you can join at https://github.com/pst2d/csscontrols/tree/dev
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

lindomar

  • Newbie
  • Posts: 3
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #9 on: February 23, 2021, 04:58:58 pm »
how to do this?


LCL implementation of Qt/Qt5 supports QStyleSheet, so you can do a lot of styling.

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #10 on: February 23, 2021, 05:37:16 pm »
The very first thing is, you need to enable QT interface on your Lazarus and that is relatively not easy.
https://wiki.lazarus.freepascal.org/Qt_Interface

But, please don't be discouraged.  :)

alaa123456789

  • Sr. Member
  • ****
  • Posts: 260
  • Try your Best to learn & help others
    • youtube:
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #11 on: February 23, 2021, 06:46:28 pm »
The very first thing is, you need to enable QT interface on your Lazarus and that is relatively not easy.
https://wiki.lazarus.freepascal.org/Qt_Interface

But, please don't be discouraged.  :)
is there any video on it ?

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #12 on: February 23, 2021, 07:15:00 pm »
As far as I know, no, there is no video tutorial about installing interfaces.

funlw65

  • Full Member
  • ***
  • Posts: 148
    • Visual Pin Configurator for Nucleo 64pin boards
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #13 on: February 25, 2021, 12:27:18 am »
Qt5 has great styles and a lot of styling is done in different Linux distros. But you don't need to have Lazarus "skinned" with Qt5 to be able to compile your application for Qt5. At least, not yet.

https://wiki.lazarus.freepascal.org/Qt5_Interface

A focusing of developers exclusively on Qt will save a lot of work. But your application must comply with Qt licenses... a vulnerability that today can't be addressed. Not until our own CustomDrawn interface.
FreePascal 3.2.2, C 10.2.1, D 1.24 under Linux(init,musl,glibc), DragonflyBSD, NetBSD
gui: gtk2, qt5, raylib4.x+raygui3.x, nanovg 
tui: freevision, tvision2, termbox2+widgets, finalcut
db: typhoon-1.11...

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: New Idea: May we use some CSS like thing to do GUI?
« Reply #14 on: February 25, 2021, 04:11:15 am »
If they think the same as me finally we will gain enough traction and someone capable will come out with his implementation.

I don't think you can call it "traction" if everyone is just waiting for someone, somewhere to spring into action.

That's more like "anticipation" than "traction".  :D
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

 

TinyPortal © 2005-2018