FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with menus
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Problem with menus
Posted: Fri Sep 25, 2015 10:00 AM

Now menus inherit the font from its container. This is a problem for me. Is there a way to keep the previous behaviour?

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 10:37 AM
This is a sample of the problem:

Code (fw): Select all Collapse
#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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 11:29 AM
Enrico
Menus takes the font of the window
What do you need?

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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 12:16 PM

Cristobal,

previously, menus had the system font.

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 12:19 PM
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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 12:31 PM

Cristobal,

yes, please. All my menus now have the wrong font. :-(

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 12:32 PM

Or give me a workaround. :-)

EMG

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 12:34 PM
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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 12:39 PM

Thank you, Cristobal!

EMG

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 02:40 PM

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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 04:47 PM

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

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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 08:44 PM
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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 09:22 PM

Cristobal,

seems to work fine, thank you!. What's now? Will you update FWH build or...?

EMG

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Problem with menus
Posted: Fri Sep 25, 2015 09:25 PM

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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with menus
Posted: Fri Sep 25, 2015 09:36 PM

Cristobal,

Something's still wrong: the width of the menu is not correctly calculated (too wide) in some cases.

EMG