New Idea: May we use some CSS like thing to do GUI? lazarus / 31-LCL ---------------------------------------------------------------------- JiaXing · 2020-04-24 16:51 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 ---------------------------------------------------------------------- MarkMLl · 2020-04-24 17:03 We look forward to seeing your proof of concept code. MarkMLl ---------------------------------------------------------------------- marcov · 2020-04-24 17:04 Please don't start threads that only ask to make something for you. You might be wanting to look at QT Quick too. ---------------------------------------------------------------------- lucamar · 2020-04-24 17:33 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. ---------------------------------------------------------------------- zeljko · 2020-04-24 17:40 LCL implementation of Qt/Qt5 supports QStyleSheet, so you can do a lot of styling. ---------------------------------------------------------------------- MarkMLl · 2020-04-24 18:49 Quote from: zeljko on April 24, 2020, 07:40:52 pmLCL 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 ---------------------------------------------------------------------- JiaXing · 2020-04-25 02:09 Quote from: marcov on April 24, 2020, 07:04:33 pmPlease 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. ---------------------------------------------------------------------- JiaXing · 2020-04-25 02:16 Quote from: MarkMLl on April 24, 2020, 08:49:28 pmQuote from: zeljko on April 24, 2020, 07:40:52 pmLCL 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. ---------------------------------------------------------------------- avra · 2020-04-25 13:12 Quote from: JiaXing on April 24, 2020, 06:51:38 pmCould we have something similar for Lazarus?CSS based interface example can be seen here: https://forum.lazarus.freepascal.org/index.php/topic,36502.msg35 4408.html#msg354408 It's a work in progress which you can join at https://github.com/pst2d/csscontrols/tree/dev ---------------------------------------------------------------------- lindomar · 2021-02-23 15:58 how to do this? Quote from: zeljko on April 24, 2020, 07:40:52 pmLCL implementation of Qt/Qt5 supports QStyleSheet, so you can do a lot of styling. ---------------------------------------------------------------------- Handoko · 2021-02-23 16:37 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 · 2021-02-23 17:46 Quote from: Handoko on February 23, 2021, 05:37:16 pmThe 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 · 2021-02-23 18:15 As far as I know, no, there is no video tutorial about installing interfaces. ---------------------------------------------------------------------- funlw65 · 2021-02-24 23:27 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. ---------------------------------------------------------------------- ASBzone · 2021-02-25 03:11 Quote from: JiaXing on April 25, 2020, 04:09:30 amIf 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". ---------------------------------------------------------------------- dbannon · 2021-02-25 06:11 Quote from: Handoko on February 23, 2021, 05:37:16 pmThe 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.  Oh, Handoko, I suspect that wiki page deserves the "most of of date wiki page" award !  Firstly, it seems to be about Qt4 not Qt5 and it assumes you need to do a whole lot of manual installing. All recent Lazarus versions come with Qt5 ready to run. On linux, all you need to do is install libqt5pas-dev to get the actual Qt5 libraries and then set the widget set to Qt5, recompile. Hmm, actually, its a small problem with older linux distros, I think from memory you (like me) use Ubuntu18.04 ?  The ubuntu repo libqt5pas is a bit too old, better to get the one from my github repo but, honestly, its about time we both updated to U20.04 anyway ! I am not saying the Qt5 style sheeting is easy, never tried it. But switching to qt5 widget set is delightfully easy. Davo ---------------------------------------------------------------------- Handoko · 2021-02-25 06:57 I remember I ever managed to make QT to works on my computer long ago and that's not easy. Yes, QT looks nice. Glad to know it's been easier now. ---------------------------------------------------------------------- MarkMLl · 2021-02-25 08:16 Quote from: Handoko on February 25, 2021, 07:57:27 amI remember I ever managed to make QT to works on my computer long ago and that's not easy. Yes, QT looks nice. Glad to know it's been easier now. I've never had any problems, but tend to use KDE as the desktop. Except that in the current/stable Debian release ("Buster") I had to go back to the previous release ("Stretch"?) to get the libqt4pas-dev package, and I've not really investigated the situation in the "Testing" ("Bullseye") release which I've just started running. MarkMLl MarkMLl