Recent

Author Topic: Modern UI in Lazarus  (Read 190332 times)

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: Modern UI in Lazarus
« Reply #60 on: April 22, 2017, 09:19:33 am »
Is there a way to make Lazarus look like Visual Studio Code?
I can change the colors of the editor but the rest stays the same.

No you can't. With Lazarus IDE you can only change the editor syntax highlighting colors. As for any LCL based applications (that includes Lazarus IDE), you can't theme the UI separately from the OS theme. One of the many issues I have with LCL. If only Lazarus IDE was written in fpGUI, then everything would be 100% themeable - independent of the OS.

Is it possible to build a cross-platform solution in Lazarus Component Library (LCL) similar to Delphi FireMonkey?
http://stackoverflow.com/questions/21515576/how-to-programmatically-change-the-fontcolor-of-a-tlabel
Code: Pascal  [Select][+][-]
  1. Label1.StyledSettings := Label1.StyledSettings - [TStyledSetting.FontColor, TStyledSetting.Size];
  2. Label1.FontColor := TAlphaColors.Aquamarine;
  3. Label1.Font.Size := 14;
  4.  
  5. Label2.StyledSettings := Label1.StyledSettings - [TStyledSetting.FontColor, TStyledSetting.Size];
  6. Label2.FontColor := TAlphaColors.Dodgerblue;
  7. Label2.Font.Size := 16;

Or similar to Delphi VCL Styles?
VCL in XE7: Styles
http://blog.marcocantu.com/blog/2014-september-vcl-xe7-styles.html

Tuning VCL Styles for Forms and Controls
https://edn.embarcadero.com/article/42812
« Last Edit: April 22, 2017, 09:22:31 am by valdir.marcos »

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Modern UI in Lazarus
« Reply #61 on: April 22, 2017, 12:56:21 pm »

Or similar to Delphi VCL Styles?
VCL in XE7: Styles
http://blog.marcocantu.com/blog/2014-september-vcl-xe7-styles.html

Tuning VCL Styles for Forms and Controls
https://edn.embarcadero.com/article/42812

I didn't know about VCL "styles".
Now I am very interested -- does VCL now draws controls from scratch or there is a way to apply this "style" on native Windows controls? Does anybody know? What do you think?

Wargan

  • New Member
  • *
  • Posts: 48
    • 'This way' site
Re: Some principles of modern design UI (links)
« Reply #62 on: April 22, 2017, 01:42:25 pm »
I don't see why you couldn't implement a "flat design" with Lazarus. The web technologies are optimized for it and there are more crappy, ugly websites out there then good looking and usable ones. What I want to say is that there is no such thing as 'out of the box'. You mentioned Microsoft's Modern UI, this is a mega large company and they even struggle with their own design standard. Just look around in the windows control panel...

I wonder if you even designed a 'modern user interface' in any language/framework before. The screenshots you attached contain lots of symbols/icons which have to be created individually. The links to the pages about flat design that you postet have a quite different flavour than the screenshots of the UI-Toolkits. The former ones need a lot of custom design, the latter ones are more or less just colored rectangles and thus easy to implement with the LCL.

You do not quite understand me.
My idea is not that you need to make applications in the Modern UI style.
My idea is that it is possible (and necessary) to create a flexible framework for creating modern interfaces, for example the Modern interface. It's really modern. It really will be powerful. I see - on FreePascal, if such a project is implemented, then our community will compete with technologies such as XAML, Java or even node.js (for creating interfaces).

It sounds like a utopia, but it's possible.

Lazarus at the moment is not the best editor in the world, Freepascal is not a recognized and well-known compiler, but they hides a huge potential.
So let's make Lazarus great again
.
« Last Edit: April 22, 2017, 01:56:41 pm by Wargan »
Lazarus 1.8RC5+ FPC 3.0.4.
Windows 7 x32, RAM 3 Gb.

Carver413

  • Full Member
  • ***
  • Posts: 119
Re: Some principles of modern design UI (links)
« Reply #63 on: April 22, 2017, 04:57:27 pm »
You do not quite understand me.
My idea is not that you need to make applications in the Modern UI style.
My idea is that it is possible (and necessary) to create a flexible framework for creating modern interfaces, for example the Modern interface. It's really modern. It really will be powerful. I see - on FreePascal, if such a project is implemented, then our community will compete with technologies such as XAML, Java or even node.js (for creating interfaces).
It sounds like a utopia, but it's possible.

Lazarus at the moment is not the best editor in the world, Freepascal is not a recognized and well-known compiler, but they hides a huge potential.
So let's make Lazarus great again
.

You are not the first to suggest such an Idea, nor will you be the last. but they all end up the same, no one is really interested enough to join your cause so you will have to mostly do it alone and try to gain support along the way.if still interested then I would focus on the graphic core for now and not worry about the rest. modern design will require something like modern opengl,vulkan,directx,metal. anything less would be a waste of time.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Modern UI in Lazarus
« Reply #64 on: April 22, 2017, 06:05:03 pm »
The core problem with such reasoning is that to become popular you have to do more than getting on par with other offerings at a later time. Even then, the other offerings will be still be from more popular parties, there will be more stuff to find etc etc.

That is of course assuming you will get on par the first time (we are still working on Delphi compatibility, 20 years after it was decided to pursue it)

I think any big effort should be focussed on people who actually use Lazarus, rather than gunning for big external hordes that never come.


lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Modern UI in Lazarus
« Reply #65 on: April 22, 2017, 10:17:12 pm »
I personally will not do nothing since:
- For complex UI I use HTML.
- For any 'old looking' software native look is almost right.

And I recommend anyone interested really on making the UI suite or whatever:
- Look at any existing UI things (BGRAControls, Custom Drawn, 'AT' prefixed controls, fpGUI, any existing Delphi control that's freely available).

So you don't need to do everything from scratch, for example I made a dark theme for custom drawn with bgrabitmap: "BGRA Custom Drawn". Doing that I never write a single line of code of functionality, I focused on UI looking only, since custom drawn already works (well not 100% but works).

That's my advise.

mse

  • Sr. Member
  • ****
  • Posts: 286
Re: Modern UI in Lazarus
« Reply #66 on: April 23, 2017, 07:37:15 am »
Once more, such a tool for Free Pascal exists already:
http://forum.lazarus-ide.org/index.php/topic,36502.msg243396.html#msg243396

kupferstecher

  • Hero Member
  • *****
  • Posts: 583
Re: Modern UI in Lazarus
« Reply #67 on: April 23, 2017, 10:03:01 am »
Once more, such a tool for Free Pascal exists already:

Quote from the wiki page:
http://wiki.freepascal.org/MSEide_&_MSEgui#Architecture_overview
Quote
For the individual GUI elements no operating system resources are required - only the main windows are known to the operating system. The entire processing of external events (keyboard, mouse, focus control ...) happens within MSEgui on a Pascal level.
How about the performance here? I'd think that OS-managed applications are faster, as the OS can use the GPU for overlaying (But no idea).

Is Java doing it the same way (self-managing its application window)?

mse

  • Sr. Member
  • ****
  • Posts: 286
Re: Modern UI in Lazarus
« Reply #68 on: April 23, 2017, 11:26:48 am »

Quote from the wiki page:
http://wiki.freepascal.org/MSEide_&_MSEgui#Architecture_overview
Quote
For the individual GUI elements no operating system resources are required - only the main windows are known to the operating system. The entire processing of external events (keyboard, mouse, focus control ...) happens within MSEgui on a Pascal level.
How about the performance here? I'd think that OS-managed applications are faster, as the OS can use the GPU for overlaying (But no idea).
MSEgui uses the drawing primitives of the OS, X11 on Linux and FreeBSD and gdi32/gdi+ on Windows. The drawing primitives often are hardware accelerated. There is also an experimental OpenGL backend, an EGL/GLES backend is planned.
MSEgui applications normally are (much) faster and need less resources than Lazarus programs. MSEide for example is absolutely usable on an old Raspberry Pi 2.
Quote
Is Java doing it the same way (self-managing its application window)?
I don't know.
« Last Edit: April 23, 2017, 11:29:05 am by mse »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Modern UI in Lazarus
« Reply #69 on: April 23, 2017, 02:44:57 pm »
How about the performance here? I'd think that OS-managed applications are faster, as the OS can use the GPU for overlaying (But no idea).

GDI hardly uses GPU. Since Vista the desktop is doublebuffer on the OS level though and the composition of those double buffers uses GPU.

In general, I wouldn't worry about that. Modern UI is mostly empty monochromic  coloured space, that is fast on nearly everything. Antialiased font rendering is usually the most expensive of GUI anyway nowadays, not straight painting.

Modern UI was developed in the hope that one single application would work for various screenformats (PC- Tablet - telephone) without designing screens for every application.

In practice, most mobile screens are still manually designed though, to make the most of the available surface area. (though maybe that will change in time since mobile resolutions are growing fast)

Quote
Is Java doing it the same way (self-managing its application window)?

Swing did. I believe AWT tried to be a bit more

Note that Delphi's Windows 10 controls are modelled after their UWP app counterparts but are afaik also for quite a large part ownerdrawn. Ownerdrawn within the LCL/VCL framework though, not a 3rd party library with its own philosophies like MSIDE.
« Last Edit: April 23, 2017, 09:29:33 pm by marcov »

kupferstecher

  • Hero Member
  • *****
  • Posts: 583
Re: Modern UI in Lazarus
« Reply #70 on: April 23, 2017, 10:16:10 pm »
mse and marcov, thanks for your explanations.

I always wondered why an application would need the help of the OS to manage the controls inside its own window. From application side it doesn't seem easier than just drawing the complete window. Especially in the case of Lazarus, where different systems have to be supported. Using the native style sure is one reason, but it would be imaginable that the OS passes a bitmap of e.g. a button to the application, which puts it whereever it likes. So I still think it might be a performance question, in the past more than today with the high performing CPUs and large memories.

My conclusion is: Native controls are preferable for (complex) desktop applictations and a self managed application is preferable on small devices with simple UIs.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Modern UI in Lazarus
« Reply #71 on: April 23, 2017, 10:30:55 pm »
I always wondered why an application would need the help of the OS to manage the controls inside its own window. From application side it doesn't seem easier than just drawing the complete window.

There is more to a control than just straight drawing.  Consistent theming, keyboard and mouse support (drag, copy/paste etc), assistive technologies etc etc, are typically better with OS controls, adapting to OS font and DPI support.

Also, in the case of remote UI, native controls don't necessarily have to copy the bitmap over the wire. This is very noticable when e.g. using browsers (which are mostly owner drawn) with slow (or high latency) terminal services and internet connections. However that was for NT4,W2k and a bit XP. However I wonder how much is left of that with all the added theming (also for native widgets)

mse

  • Sr. Member
  • ****
  • Posts: 286
Re: Modern UI in Lazarus
« Reply #72 on: April 24, 2017, 07:43:25 am »
My conclusion is: Native controls are preferable for (complex) desktop applictations and a self managed application is preferable on small devices with simple UIs.
I think that real cross platform solutions are difficult to achieve with native controls, especially for complex desktop applications. There are too much limitations with the native widgets approach IMO.
I do not understand why you think that internally managed widgets need more CPU-power than widgets which are managed by the OS?
BTW, MSEgui applications use the X11 protocol and don't draw client side pixmaps which must be transferred pixel by pixel over the network in remote case. There is also MSEifirem which connects MSEgui clients and servers by a byte stream without the need to transfer graphic data.
http://mseide-msegui.sourceforge.net/pics/mseifiremote.mpeg
10'000 MSEgui buttons on a form:
http://mseide-msegui.sourceforge.net/pics/tenthousandbuttons.mpeg
https://gitlab.com/mseide-msegui/mseuniverse/tree/master/testcase/benchmark/runtimebutton
« Last Edit: April 24, 2017, 11:17:37 am by mse »

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Modern UI in Lazarus
« Reply #73 on: April 24, 2017, 11:14:49 am »
I would like to see a UI framework which can be used in web apps and native desktop apps.
One source compiled for either web or desktop (write once compile anywhere).
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Modern UI in Lazarus
« Reply #74 on: April 24, 2017, 11:42:10 am »
I think that real cross platform solutions are difficult to achieve with native controls, especially for complex desktop applications.
+1
Just see all the inconsistencies in LCL, and also the reason why there is a "Restricted" tab in the Object Inspector of Lazarus IDE. MSEgui and fpGUI don't have such restrictions or inconsistencies across platforms.

Quote
I do not understand why you think that internally managed widgets need more CPU-power than widgets which are managed by the OS?
Indeed, especially if I constantly receive emails that fpGUI applications run faster and have much less latency (especially in sound) applications.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

 

TinyPortal © 2005-2018