Recent

Author Topic: fpgui support full theming ?!!  (Read 23035 times)

ROCABDEL

  • New Member
  • *
  • Posts: 41
fpgui support full theming ?!!
« on: November 23, 2013, 06:38:07 pm »
Hi Graeme, hi all.
I'm trying to create some themes for this nice widgetset, but I still blocking, TfpgStyle does not allow to customize all, most components have their own procedure HandlePaint that handles all or part of the drawing of the component, for creating a full theme i need to rewrite almost all components, and i can not modify images in fpgImages without affecting all other themes ...


sorry for my bad english
Processor:IntelCore 2 2.19GHz - RAM 2GB
(Lazarus1.0.4 / fpc2.6.0 / qt4.7.3 at4pas2.5 / Xcode4.0)
-Windows 7/8-Intel Mac OS X 10.6.8-Haiku-Openidiana,Solaris11-PC-BSD,GhostBSD-openSUSE,Ubuntu,Fedora,mageia,Sabayon,Chakra..

avra

  • Hero Member
  • *****
  • Posts: 1717
    • Additional info
Re: fpgui support full theming ?!!
« Reply #1 on: November 24, 2013, 02:13:35 pm »
Only if you can not find a solution for fpGUI theming, maybe some alternatives may be of use:
http://forum.lazarus.freepascal.org/index.php/topic,21911.msg128785.html#msg128785
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: fpgui support full theming ?!!
« Reply #2 on: November 25, 2013, 02:55:17 pm »
@ROCABDEL
I thought I modified all widgets to use the fpgStyle instance to do the actual customised drawing. I'll take another look tonight. In the mean time if you have some specific examples of issues, just let me know and we can come up with some solution.

Are you using the latest fpGUI from the 'develop' branch?
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Dibo

  • Hero Member
  • *****
  • Posts: 1045
Re: fpgui support full theming ?!!
« Reply #3 on: November 25, 2013, 03:27:15 pm »
I have also created "system color" themes for fpGUI (currently only for GTK and Win apps, Qt is in progress). Here are details (with screenshots and source):
http://opensoft.homeip.net/webnews/webnews.cgi?user=Guest;showold=true;group=fpgui.support;sortorder=date;article=1432

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
Re: fpgui support full theming ?!!
« Reply #4 on: November 25, 2013, 03:37:09 pm »
Quote
I have also created "system color"

Wow, superb  ;)
I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
Re: fpgui support full theming ?!!
« Reply #5 on: November 25, 2013, 04:01:37 pm »
Quote
Are you using the latest fpGUI from the 'develop' branch?

=> https://github.com/graemeg/fpGUI/tree/develop

Click on Download ZIP button, on right side... ;)
I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

ROCABDEL

  • New Member
  • *
  • Posts: 41
Re: fpgui support full theming ?!!
« Reply #6 on: November 25, 2013, 11:50:32 pm »
Thank you friends Graeme, Fred vS, avra, Dibo  for the availability  :)

@Graeme
At this moment, I only use fpGUI v1.0 release from the download page, tomorrow I'll take a look at 'develop' branch  ;)
these are some problems I encountered :
-I can not draw a button disabled juste the caption is disabled.
-I would like to draw a customised checkbox or radiobutton
...

this is small program to test a theme I vien to create not finished yet when I finish I share the code, look good vertical scrollbar ..

I do not speak English well and I have not much temp now tomorrow I'll write you, thank you again  Graeme..

« Last Edit: November 25, 2013, 11:52:05 pm by ROCABDEL »
Processor:IntelCore 2 2.19GHz - RAM 2GB
(Lazarus1.0.4 / fpc2.6.0 / qt4.7.3 at4pas2.5 / Xcode4.0)
-Windows 7/8-Intel Mac OS X 10.6.8-Haiku-Openidiana,Solaris11-PC-BSD,GhostBSD-openSUSE,Ubuntu,Fedora,mageia,Sabayon,Chakra..

ROCABDEL

  • New Member
  • *
  • Posts: 41
Re: fpgui support full theming ?!!
« Reply #7 on: November 29, 2013, 11:18:30 pm »
Hi All.

In Attachments fpg_style_carbon inspired from Carbon delphi style,  with a test programme and compiled exe, you can switch between styles.
 
Processor:IntelCore 2 2.19GHz - RAM 2GB
(Lazarus1.0.4 / fpc2.6.0 / qt4.7.3 at4pas2.5 / Xcode4.0)
-Windows 7/8-Intel Mac OS X 10.6.8-Haiku-Openidiana,Solaris11-PC-BSD,GhostBSD-openSUSE,Ubuntu,Fedora,mageia,Sabayon,Chakra..

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: fpgui support full theming ?!!
« Reply #8 on: November 30, 2013, 07:23:58 pm »
In Attachments fpg_style_carbon inspired from Carbon delphi style,  with a test programme and compiled exe, you can switch between styles.
Very nice!  I'll fix the theming issue in fpGUI with the select items for ComboBox and Memo (they have hard-coded BlueCurve selection theme). Then also take a look at some minor issues with your theme.. eg: some widgets have a single rectangle (part of widget border) that aren't painted at all - thus they contain random paint garbage. Easy to fix.

Once done, would you mind if I add this theme as a standard "dark theme" to fpGUI? You'll get credit of course.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
Re: fpgui support full theming ?!!
« Reply #9 on: November 30, 2013, 08:32:50 pm »
@ ROCABDEL

Superbissimo.  ;)
I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

ROCABDEL

  • New Member
  • *
  • Posts: 41
Re: fpgui support full theming ?!!
« Reply #10 on: November 30, 2013, 11:41:14 pm »
Hi Graeme.
I'm glad you like it, and you want to add it to your great library  :)  :)
you can rename/edit it like you want...


It would be cool if you add to fpgStyle support to draw a custom CheckBox and RadioButton something like :
Code: [Select]
    function    CanDrawCheckBox: boolean; virtual;
    function    CanDrawRadioButton: boolean; virtual;
    procedure   DrawCheckBox(ACanvas: TfpgCanvas; r: TfpgRect; AFlags: TfpgButtonFlags); virtual; abstract;
    procedure   DrawRadioButton(ACanvas: TfpgCanvas; r: TfpgRect; AFlags: TfpgButtonFlags); virtual; abstract;

and in procedure TfpgRadioButton.HandlePaint; and TfpgBaseCheckBox.HandlePaint; something like :
Code: [Select]
  if fpgStyle.CanDrawCheckBox then
    fpgStyle.DrawCheckBox(Canvas, r, lFlags)
  else begin
  img := fpgImages.GetImage('sys.checkboxes');
  Canvas.DrawImagePart(r.Left, r.Top, img, ix*FBoxSize, 0, FBoxSize, FBoxSize);
  end;

...

  if fpgStyle.CanDrawRadioButton then
    fpgStyle.DrawRadioButton(Canvas, r, lFlags)
  else begin
    img := fpgImages.GetImage('sys.radiobuttons');
    Canvas.DrawImagePart(r.Left, r.Top, img, ix*FBoxSize, 0, FBoxSize, FBoxSize);
  end;




Thank you again Graeme, thanks Fred vS  :)
Processor:IntelCore 2 2.19GHz - RAM 2GB
(Lazarus1.0.4 / fpc2.6.0 / qt4.7.3 at4pas2.5 / Xcode4.0)
-Windows 7/8-Intel Mac OS X 10.6.8-Haiku-Openidiana,Solaris11-PC-BSD,GhostBSD-openSUSE,Ubuntu,Fedora,mageia,Sabayon,Chakra..

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: fpgui support full theming ?!!
« Reply #11 on: December 01, 2013, 11:52:57 am »
Then also take a look at some minor issues with your theme.. eg: some widgets have a single rectangle (part of widget border) that aren't painted at all - thus they contain random paint garbage. Easy to fix.

@ROCABDEL
  Fixed in the latest "develop" branch of fpGUI.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

ROCABDEL

  • New Member
  • *
  • Posts: 41
Re: fpgui support full theming ?!!
« Reply #12 on: December 01, 2013, 10:54:42 pm »
Great job Graeme  :D thank you..
Processor:IntelCore 2 2.19GHz - RAM 2GB
(Lazarus1.0.4 / fpc2.6.0 / qt4.7.3 at4pas2.5 / Xcode4.0)
-Windows 7/8-Intel Mac OS X 10.6.8-Haiku-Openidiana,Solaris11-PC-BSD,GhostBSD-openSUSE,Ubuntu,Fedora,mageia,Sabayon,Chakra..

vfclists

  • Hero Member
  • *****
  • Posts: 825
    • HowTos Considered Harmful?
Re: fpgui support full theming ?!!
« Reply #13 on: December 03, 2013, 04:28:57 pm »
I just downloaded the stable version from sourcefourge and it is compiling fine in Lazarus. But I think fpGUI also as a GUI creator. Does that have to be downloaded separately, or is it somewhere among the files downloaded

You also mention a develop branch in this thread where can it be downloaded - DOH -  that must be Github

Anyway I have see the UIDesigner folder so I will give it a try and see how it goes.

Then also take a look at some minor issues with your theme.. eg: some widgets have a single rectangle (part of widget border) that aren't painted at all - thus they contain random paint garbage. Easy to fix.

@ROCABDEL
  Fixed in the latest "develop" branch of fpGUI.
Windows - Lazarus 1.0.8/FPC 2.6.0
Linux - Lazarus 1.4.4 /FPC 2.6.4

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: fpgui support full theming ?!!
« Reply #14 on: December 06, 2013, 03:03:43 pm »
I just downloaded the stable version from sourcefourge and it is compiling fine in Lazarus. But I think fpGUI also as a GUI creator. Does that have to be downloaded separately, or is it somewhere among the files downloaded

The GUI designer in fpGUI is known as UI Designer, and is part of the official fpGUI repository in the 'uidesigner' directory.

Please use the 'develop' branch instead of 'master' - it has many critical fixes, and a new v1.2 release is around the corner, so 'develop' is pretty stable. fpGUI code is hosted in a Git repository. There are two official locations: SourceForge and Github, and they are always in sync. If you did a clone from either, you have all branches already ('master' and 'develop'), but git defaults you to the 'master' branch.

So simply switch to the 'develop' branch by doing the following:

 > git branch develop origin/develop
 > git checkout develop

Hope this helps.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/