Recent

Author Topic: MainMenu font  (Read 11493 times)

mtournay

  • Jr. Member
  • **
  • Posts: 63
MainMenu font
« on: March 24, 2016, 11:48:13 am »
Hi all

Delphi has the ability to change default font of a mainmenu, because it's possible in windows default widgetset. It seems that it's not possible in other widgetset.

Is it possible to add and enable this fonctionnality only in win32/64 widgetset ?

Thanks in advance
laz 2.06 32b - fpc 3.04 32b - win10 64b

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: MainMenu font
« Reply #1 on: March 24, 2016, 01:57:11 pm »
Delphi has the ability to change default font of a mainmenu, because it's possible in windows default widgetset. It seems that it's not possible in other widgetset.

Is it possible to add and enable this fonctionnality only in win32/64 widgetset ?

You can use WinAPI for it. Enclose the code in an IFDEF and your application remains cross-platform.
Adding Windows-only features to a cross-platform library goes against the fundamental idea and gives false hopes for a programmer.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: MainMenu font
« Reply #2 on: March 24, 2016, 04:08:50 pm »
Afair, it's possible on qt too on all platforms supported by qt except osx

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: MainMenu font
« Reply #3 on: March 24, 2016, 05:44:24 pm »
Afair, it's possible on qt too on all platforms supported by qt except osx

Having a feature in 2 or 3 widgetsets could justify it already. Then it must be marked as restricted for other widgetsets.
Like always, somebody must implement it then.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

mtournay

  • Jr. Member
  • **
  • Posts: 63
Re: MainMenu font
« Reply #4 on: March 24, 2016, 09:04:52 pm »
Like always, somebody must implement it then.

I think I can handle it for windows, but it may take several weeks.
I don't know anything about qt or other widgetset, so can someone else do the job ?

when I got it working on my system, I will propose a patch througt bugtracker.

best regards
laz 2.06 32b - fpc 3.04 32b - win10 64b

mtournay

  • Jr. Member
  • **
  • Posts: 63
Re: MainMenu font
« Reply #5 on: March 25, 2016, 09:05:13 am »
Hi again

Ok Win32 widgetset is already ownerdrawn, I just have to add font to mainmenu.

Work goes fast, but now i'm stuck : is there a func to change TFont class into TLogFont struct ?
tfont can be assigned by logfont (tfont.assign()), but i can't find the reverse

I think I can have something working sunday or monday

regards
laz 2.06 32b - fpc 3.04 32b - win10 64b

mtournay

  • Jr. Member
  • **
  • Posts: 63
Re: MainMenu font
« Reply #6 on: March 27, 2016, 09:01:22 pm »
Hello all

In win32wsmenus.pp, how can I test if the font is set to 'default' font ?
Actually I test
Code: Pascal  [Select][+][-]
  1. uppercase(font.name) = 'DEFAULT'
but I'm not sure it's the best way.

regards
laz 2.06 32b - fpc 3.04 32b - win10 64b

mtournay

  • Jr. Member
  • **
  • Posts: 63
Re: MainMenu font
« Reply #7 on: March 29, 2016, 10:19:15 pm »
Hi there

I'm almost done but I found something very strange in win menu API : the main menu bar height is not impacted by the height of the font  >:(. Everything else works, but not this...

I made research on google, it's seems this is a limitation in the win API.

until I found this limitation I was not sure the team accept this work, now I'm quit sure you won't take it  ;)
I will understand this and if you don't take it
1. I learned a lot digging in the widgetset like this
2. I can now make a new component that will be a descendant a TMEnu with things I want into !

best regards
laz 2.06 32b - fpc 3.04 32b - win10 64b

mtournay

  • Jr. Member
  • **
  • Posts: 63
Re: MainMenu font
« Reply #8 on: March 31, 2016, 11:30:34 pm »
LOL ROFL cry

I just discover throught SVN and bugtracker that Ondrej Pokorny have add onmeasureitem and ondrawitem to lazarus ...
http://mantis.freepascal.org/view.php?id=26969

do I continue my work ?
laz 2.06 32b - fpc 3.04 32b - win10 64b

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: MainMenu font
« Reply #9 on: April 01, 2016, 08:48:47 pm »
Continue, if you want. But use trunk sources for developing new features to Lazarus.

 

TinyPortal © 2005-2018