Recent

Author Topic: Custom Drawing user interface  (Read 6926 times)

furious programming

  • Hero Member
  • *****
  • Posts: 858
Re: Custom Drawing user interface
« Reply #30 on: April 12, 2020, 12:29:46 pm »
Noone cares :D

So stop continuing this childish discussion.


Once I said that, and they say that Lazarus must look native.

Must? Because what? At most should, but I can't agree with that anyway. Maybe I should throw Lazarus in the trash, install Visual Studio and start programming in C#? Microsoft doesn't have such stupid restrictions and knows well that a lot of developers need a dark IDE.

Everything is slowly moving towards dark themes — operating systems, web browser skins and site rendering modes, websites themselves, etc. It's high time to adapt, because not everyone likes when the screen burns his eyes with bright colors. Changing the color scheme for source code editor only is not a solution.


Lazarus and the LCL are open source. So why not give the dev team a break (as many said, they have enough to work on already) and implement that yourself and provide that as a patch?

I don't have enough knowledge in the field of LCL internals and platforms to program such a mechanism. And probably a lot of Lazarus users also do not have such knowledge. Understanding hundreds of thousands of lines of code would take months or even years. But LCL dev team has such knowledge and are competent in this field to program skinning system in a much shorter time than someone from the outside (like me).

Reason enough? 8)
« Last Edit: April 12, 2020, 10:50:48 pm by furious programming »
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: Custom Drawing user interface
« Reply #31 on: April 12, 2020, 03:14:30 pm »
all that is required is to implement more OwnerDraw options in the controls and you make any one of them look like a skin..

 There are only few that don't have that option at this point.

 There is a package called "CustomDrawn" that has some controls in it but it isn't fully implemented, work stopped on it at some point but It has some interfaces for various targets
The only true wisdom is knowing you know nothing

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Custom Drawing user interface
« Reply #32 on: April 12, 2020, 05:09:20 pm »
We're working since a lot of years on BGRAControls.

We miss only:
- Menu
- Popup Menu
- Edit
- Tab Control (but already done in other packages)

ListBox can be owner drawn, we already made a combobox combining a button and a listbox-

I've added checkbox and radiobutton, that can be themed. We have a numeric edit as well, a progress bar, SVG viewer, image viewer, gif viewer, radial progress bar, a lot of buttons, some with animations as well.

If more people wants to contribute their controls we can add it to the package =)

Custom Drawn package is not updated anymore. I did a full theme for custom drawn, that's available with BGRAControls as well, all with bitmaps like Windows does since it got themes.

furious programming

  • Hero Member
  • *****
  • Posts: 858
Re: Custom Drawing user interface
« Reply #33 on: April 12, 2020, 10:48:11 pm »
@lainz: what about skinning the window itself? I mean window border and border content.
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Custom Drawing user interface
« Reply #34 on: April 13, 2020, 01:15:04 am »
@lainz: what about skinning the window itself? I mean window border and border content.

You can use any control for that, buttons and panels for example
https://raw.githubusercontent.com/bgrabitmap/bgracontrols/dev-bgracontrols/docs/img/bgraribbon.png

About any other shape, only possible on Windows AFAIK. But rectangles with custom borders like in the picture works in all major platforms.

furious programming

  • Hero Member
  • *****
  • Posts: 858
Re: Custom Drawing user interface
« Reply #35 on: April 13, 2020, 02:04:53 am »
You can use any control for that, buttons and panels for example

That was what I was afraid of.

But even if I set BorderStyle on bsNone and reconstruct the window border, there will still be elements that will be rendered in accordance with the system theme, e.g. the border of the context menu. I would have to reconstruct everything, and it's definitely unprofitable, so it's a shame to even think about it.
« Last Edit: April 13, 2020, 02:09:03 am by furious programming »
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Custom Drawing user interface
« Reply #36 on: April 13, 2020, 02:17:49 am »
I got it, like the different position of close buttons between windows and linux, for example, and the style.

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Custom Drawing user interface
« Reply #37 on: April 13, 2020, 02:22:14 am »
What do you want is to apply a Windows Style file to the entire application, so even dialogs are themed.

There are commercial things to do that in every language, of course commercial, I don't find one for lazarus, and you?

furious programming

  • Hero Member
  • *****
  • Posts: 858
Re: Custom Drawing user interface
« Reply #38 on: April 13, 2020, 12:33:40 pm »
What do you want is to apply a Windows Style file to the entire application, so even dialogs are themed.

Exactly. Everything should be possible to be themed — every single part of every single object (component and form).

Quote
There are commercial things to do that in every language, of course commercial, I don't find one for lazarus, and you?

Unfortunately, I didn't find anything sensible either — that's why I'm begging for a skinning system. 8)


Here it should be noted that such a skinning system should work slightly differently than the one known from RAD Studio, mainly because of heaviness and resourcefulness.

First of all, because rendering the interface entirely based on a set of PNG images (worse 32-bit) is inefficient on Windows, so the interface can flicker on weaker computers. Secondly, because it makes no sense to render single-color elements (e.g. component backgrounds) using images, since the same can be achieved using primitives, e.g. Canvas.Rectangle or Canvas.FillRect methods, saving a lot of computing power — which I belive is not possible in RAD Studio. The same for simple gradients — there is a Canvas.GradientFill method, which is much faster than the rendering of stretched image.

In addition, changing the theme should not force the form to be recreated (destroyed and recreated), because it significantly reduces the usability of this system.
« Last Edit: April 13, 2020, 12:46:34 pm by furious programming »
Lazarus 3.2 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on an acrade, action/adventure game in retro style (pixelart), programming the engine and shell from scratch, using Free Pascal and SDL. Release planned in 2026.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5481
  • Compiler Developer
Re: Custom Drawing user interface
« Reply #39 on: April 13, 2020, 02:17:13 pm »
Lazarus and the LCL are open source. So why not give the dev team a break (as many said, they have enough to work on already) and implement that yourself and provide that as a patch?

I don't have enough knowledge in the field of LCL internals and platforms to program such a mechanism. And probably a lot of Lazarus users also do not have such knowledge. Understanding hundreds of thousands of lines of code would take months or even years. But LCL dev team has such knowledge and are competent in this field to program skinning system in a much shorter time than someone from the outside (like me).

Reason enough? 8)

Then learn about it. Both projects, FPC and Lazarus are always in need of new people. And do you think I had a clue about compiler development when I handed in my first patches? No, but that didn't stop me. I'm also not firm in working inside the Lazarus IDE, but that didn't stop me to recently propose a patch for an extension and have another in the pipeline that could improve things for component developers in the future.

krolikbest

  • Full Member
  • ***
  • Posts: 246
Re: Custom Drawing user interface
« Reply #40 on: April 14, 2020, 08:11:03 pm »
Nice discussion under the influence of which I thought that I would make a borderless GUI for my applications on Windows and RPi. The similar code example you can find everywhere over internet. In fact in this example there is only a little my effort to create simply form and test it on Win and RPi platform.
Here you can see the result of yesterday's experimentation: https://www.youtube.com/watch?v=RLMNBb2-Yjk

 

TinyPortal © 2005-2018