Now menus inherit the font from its container. This is a problem for me. Is there a way to keep the previous behaviour?
EMG
Now menus inherit the font from its container. This is a problem for me. Is there a way to keep the previous behaviour?
EMG
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oFnt, oWnd
DEFINE FONT oFnt NAME "Courier New" SIZE 0, -7
DEFINE WINDOW oWnd
oWnd:SetFont( oFnt )
ACTIVATE WINDOW oWnd;
ON CLICK TESTMENU( oWnd )
RELEASE FONT oFnt
RETURN NIL
STATIC FUNCTION TESTMENU( oWnd )
LOCAL oMen
MENU oMen POPUP
MENUITEM "Test"
ENDMENU
ACTIVATE MENU oMen AT 0, 0 OF oWnd
RETURN oMenCristobal,
previously, menus had the system font.
EMG
Enrico Maria Giordano wrote:Cristobal,
previously, menus had the system font.
EMG
Cristobal,
yes, please. All my menus now have the wrong font. ![]()
EMG
Or give me a workaround. ![]()
EMG
Enrico Maria Giordano wrote:Cristobal,
yes, please. All my menus now have the wrong font.
EMG
Thank you, Cristobal!
EMG
Enrico,
I just looked at the source for the TMenu class (ver 15.05), and it used to inherit from TControl but doesn't inherit at all anymore. Further the New() method allows you to pass a parent window, but the section that defined the font from the parent window is commented out.
However, there is a method called NewSys( oWnd ) which I expect was added just for legacy compatibility and it does take on the font of oWnd. So, try that.
I do wonder why the NewSys() method wasn't used for whatever reason the existing New() method was modified. This would have provided true legacy compatibility. But I expect there was a good reason.
Regards,
James
James
I do not understand your comment
I use google translate and my English is very poor
Sorry if I can not answer right or I misunderstood his words correctly
I will try to answer
TMenu has never inherited from TControl.
When I started the changes, and I tried to TMenu TMenuItem inherit from TControl, but this feature was only testing for various reasons.
So it is commented (//)
Newsys method is used to obtain the icon menu window has nothing to do with what he says Enrico, or the method New
It is a good time to discuss those aspects of TMenu wishing to be improved or changed as the reason to implement full support for Unicode in Fivewin, I'm checking
Thank you
Adjunto el texto tambien en castellano por si la traduccion no es correcta
No entiendo bien su comentario
He de usar google translate y mi ingles es muy pobre
Disculpe si no puedo contestarle bien o no he entendido correctamente sus palabras
Voy a tratar de contestarle
TMenu nunca ha heredado de TControl.
Cuando empez茅 las modificaciones, intent茅 que TMenu y TMenuItem heredasen de TControl, pero esta caracter铆stica s贸lo qued贸 en pruebas por diversos motivos.
Por eso aparece comentado ( // )
Method NewSys es utilizado para obtener el Menu del icono de la ventana, no tiene nada que ver con lo que comenta Enrico, ni con el method New
Es un buen momento para comentar aquellos aspectos de TMenu que desean se mejoren o modifiquen ya que con el motivo de implementar soporte total de Unicode en Fivewin, la estoy revisando
Gracias
Enrico Maria Giordano wrote:Or give me a workaround.
EMG
Cristobal,
seems to work fine, thank you!. What's now? Will you update FWH build or...?
EMG
Cristobal,
Is that a problem like mine 2 weeks ago?
Thanks.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Cristobal,
Something's still wrong: the width of the menu is not correctly calculated (too wide) in some cases.
EMG