Recent

Author Topic: Custom style for Windows and Mac  (Read 2995 times)

MISV

  • Hero Member
  • *****
  • Posts: 783
Custom style for Windows and Mac
« on: May 20, 2017, 10:56:04 pm »
Suppose I would like to use a nonstandard styling of an app on Windows and Mac - how would I go about that?


Solution one:
Keep all existing controls and code, but switch to customdraw?

Problem:

Not sure how to instruct my Lazarus project to use any non-default-gui-controls solution:
* GTK2
* QT
* DefaultNative
* CustomDraw-KDEPlastic
* CustomDraw-Win2k
etc.

I have installed the customdraw package



Solution two:
There appears to be another set of "BGRA" controls developed - however, I rather not have to replace content in my forms. I have huge forms, so it is almost a no-go - in particular since I would prefer to continue to have Delphi compability although that strictly speaking may not necessarily be a requirement in the future.

https://bgrabitmap.github.io/
https://bgrabitmap.github.io/bgracontrols/

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Custom style for Windows and Mac
« Reply #1 on: May 23, 2017, 10:55:17 am »
It appears I may also have

LCLWidgetType:=customdrawn
LCLWidgetType:=fpGUI

It really needs o be documented how to use the above.

Through much searching I found I could use
IDEMacro - LCLWidgetType:=customdrawn
in "project settings" and "application overrides and defines"

However, I can't see anywhere on how I select which subtype to draw. Preferably I would like to have my apps look somewhat similar on two platforms - and custom styled. But seeing this may not be possible I would like to test my options - maybe e.g. KDE.


The most important thing for me is that all standard controls work on Windows and Mac
« Last Edit: May 23, 2017, 01:19:39 pm by MISV »

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Custom style for Windows and Mac
« Reply #2 on: May 23, 2017, 01:18:06 pm »
I think I am supposed to use it like this after defining custom draw:

Code: Pascal  [Select][+][-]
  1. initialization
  2.   {$IFDEF mymsFPCDevTool}
  3.   // http://wiki.freepascal.org/Lazarus_Custom_Drawn_Controls#Custom_Drawn_Packages
  4.   customdrawndrawers.DefaultStyle := dsWin2000;
  5.   {$ENDIF}
  6.  


However, when compiling I get error

Quote
customdrawnobject_win.inc(590,78) Error: Incompatible type for arg no. 4: Got "<address of procedure(QWord;QWord;QWord;LongWord);StdCall>", expected "<procedure variable type of procedure(QWord;LongWord;QWord;LongWord);StdCall>"

at
Code: Pascal  [Select][+][-]
  1. TimerInfo^.TimerID := Windows.SetTimer(0, 0, Interval, @TimerCallBackProc);

which is line 590 in unit customdrawnobject_win.inc

MISV

  • Hero Member
  • *****
  • Posts: 783

 

TinyPortal © 2005-2018