Problem with menus

Problem with menus

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with menus

Postby Enrico Maria Giordano » Fri Sep 25, 2015 10:37 am

This is a sample of the problem:

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with menus

Postby cnavarro » Fri Sep 25, 2015 11:29 am

Enrico
Menus takes the font of the window
What do you need?

Image
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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with menus

Postby Enrico Maria Giordano » Fri Sep 25, 2015 12:16 pm

Cristobal,

previously, menus had the system font.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with menus

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with menus

Postby Enrico Maria Giordano » Fri Sep 25, 2015 12:31 pm

Cristobal,

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with menus

Postby Enrico Maria Giordano » Fri Sep 25, 2015 12:32 pm

Or give me a workaround. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with menus

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with menus

Postby Enrico Maria Giordano » Fri Sep 25, 2015 12:39 pm

Thank you, Cristobal!

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with menus

Postby James Bott » Fri Sep 25, 2015 2: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Problem with menus

Postby cnavarro » Fri Sep 25, 2015 4: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with menus

Postby cnavarro » Fri Sep 25, 2015 8: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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Problem with menus

Postby Enrico Maria Giordano » Fri Sep 25, 2015 9:22 pm

Cristobal,

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with menus

Postby driessen » Fri Sep 25, 2015 9: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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem with menus

Postby Enrico Maria Giordano » Fri Sep 25, 2015 9:36 pm

Cristobal,

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests

cron