Problem with menus
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Problem with menus
Now menus inherit the font from its container. This is a problem for me. Is there a way to keep the previous behaviour?
EMG
EMG
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Problem with menus
This is a sample of the problem:
EMG
Code: Select all | Expand
#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 oMen
EMG
Re: Problem with menus
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Problem with menus
Enrico Maria Giordano wrote:Cristobal,
previously, menus had the system font.
EMG
You think that's better?
I can also configure it so
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Problem with menus
Enrico Maria Giordano wrote:Cristobal,
yes, please. All my menus now have the wrong font.
EMG
Enrico
I'll see if I can find a simple solution
I'll informed
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Problem with menus
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
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
Re: Problem with menus
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
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
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Re: Problem with menus
Enrico Maria Giordano wrote:Or give me a workaround.
EMG
Look your mail
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Problem with menus
Cristobal,
seems to work fine, thank you!. What's now? Will you update FWH build or...?
EMG
seems to work fine, thank you!. What's now? Will you update FWH build or...?
EMG
Re: Problem with menus
Cristobal,
Is that a problem like mine 2 weeks ago?
Thanks.
Is that a problem like mine 2 weeks ago?
Thanks.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.09 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.09 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
Re: Problem with menus
Cristobal,
Something's still wrong: the width of the menu is not correctly calculated (too wide) in some cases.
EMG
Something's still wrong: the width of the menu is not correctly calculated (too wide) in some cases.
EMG