Recent

Author Topic: There is a plugin for Lazarus that improves its appearance.  (Read 1732 times)

Nera

  • Full Member
  • ***
  • Posts: 103
There is a plugin for Lazarus that improves its appearance.
« on: February 07, 2020, 12:28:15 pm »
I would like to leave my programs in the Windows 10 style, with rounded corners and more elegant buttons, as shown in the attached figure.
« Last Edit: February 07, 2020, 12:52:39 pm by Nera »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: There is a plugin for Lazarus that improves its appearance.
« Reply #1 on: February 07, 2020, 03:22:59 pm »
That doesn't look like a native Windows box, but like something owner drawn.

Even if the looks could be emulated by windows 10 settings, the program would have to be changed to provide the word "question".

The yes/no ignroe buttons look like Win98+ bitbtns, which are available in lazarus afaik

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: There is a plugin for Lazarus that improves its appearance.
« Reply #2 on: February 08, 2020, 10:26:11 am »
I would like to leave my programs in the Windows 10 style, with rounded corners and more elegant buttons, as shown in the attached figure.

To achieve this on Windows you'd need to do the following:
- set the form's BorderStyle to bsNone
- you need to adjust the window region of your form (an example for a completely round form is here)
- you need to draw the window decorations (title, buttons) yourself and also react to mouse events so that your window can be moved around

There is one caveat though: You can not adjust the dialogs generated by the standard dialog functions like MessageBox etc. or the file dialogs. If you want these adjusted as well you'll have to duplicate all their functionality.

That doesn't look like a native Windows box, but like something owner drawn.

Even if the looks could be emulated by windows 10 settings, the program would have to be changed to provide the word "question".

The yes/no ignroe buttons look like Win98+ bitbtns, which are available in lazarus afaik

I think that screenshot is from a Lazarus running on Linux, cause it a) contains the default X11 icon, but b) the default message icons for LCL dialogs. Nera posted it to show what they want to achieve.

sash

  • Sr. Member
  • ****
  • Posts: 366
Re: There is a plugin for Lazarus that improves its appearance.
« Reply #3 on: February 08, 2020, 11:32:50 am »
Screenshot clearly shows linux's 2 decade old retro window decoration theme called "Ceramic" (or its twin) and still available in some distros. And buttons even more aged: they came from Borland's OWL era.  :D
Lazarus 2.0.10 FPC 3.2.0 x86_64-linux-gtk2 @ Ubuntu 20.04 XFCE

Otto

  • Full Member
  • ***
  • Posts: 226
Re: There is a plugin for Lazarus that improves its appearance.
« Reply #4 on: February 20, 2020, 02:40:26 pm »

- you need to adjust the window region of your form (an example for a completely round form is here)


To fit the code to FPC, add the Windows uses.

Code: Pascal  [Select][+][-]
  1. ...
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
  9.   Windows;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)  
  16.     procedure FormCreate(Sender: TObject);
  17.   private
  18.  
  19.   public
  20.  
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.lfm}
  29.  
  30. { TForm1 }    
  31.  
  32. procedure TForm1.FormCreate(Sender: TObject);
  33. var
  34.   hRegion: HRGN;
  35. begin
  36.   BorderStyle := bsNone;
  37.   hRegion := CreateEllipticRgn(1, 1, 200, 200);
  38.   SetWindowRgn(Handle, hRegion, True);
  39. end;        
  40.  
  41. ...
  42.  

Otto.
« Last Edit: February 20, 2020, 02:42:38 pm by Otto »
Kind regards.

 

TinyPortal © 2005-2018