Change Size Menuitem im hmg.4
Moderator: Rathinagiri
Change Size Menuitem im hmg.4
Hello,
Is possible change the size of "menuitem" ? See this image ?
Best Regards,
Rossine.
Is possible change the size of "menuitem" ? See this image ?
Best Regards,
Rossine.
Re: Change Size Menuitem im hmg.4
Hi Rossine.
With my compiled library, MainMenu, MenuPop and MenuItem have the same size.... this is the code
And these are two picture, one without "FontSize" (default system size)
If I understand your request or problem.
It's not possible (I have tried some times ago...) to have different size between MainMenu, MenuPopUp or MenuItem... In other words
Cheers
With my compiled library, MainMenu, MenuPop and MenuItem have the same size.... this is the code
Code: Select all
WITH OBJECT MainMenu():New( "MainMenu" )
:FontSize := 16
WITH OBJECT MenuPopup():New( 'File',, 'File' )
WITH OBJECT MenuItem():New( 'ItemOpen' ,, 'Open' , { || MsgInfo( 'Open' ) } ); END WITH
WITH OBJECT MenuItem():New( 'ItemClose',, 'Close' , { || MsgInfo( 'Close' ) } ); END WITH
WITH OBJECT MenuPopup():New( 'PopUp',, 'PopUp' )
WITH OBJECT MenuItem():New( 'Item1' ,, 'Open' , { || MsgInfo( 'Open' ) } ); END WITH
WITH OBJECT MenuItem():New( 'Item2',, 'Close' , { || MsgInfo( 'Close' ) } ); END WITH
END WITH
END WITH
END WITH
It's not possible (I have tried some times ago...) to have different size between MainMenu, MenuPopUp or MenuItem... In other words
Code: Select all
WITH OBJECT MainMenu():New( "MainMenu" )
:FontSize := 16
WITH OBJECT MenuPopup():New( 'File',, 'File' )
:FontSize := 10
WITH OBJECT MenuItem():New( 'ItemOpen' ,, 'Open' , { || MsgInfo( 'Open' ) } )
:FontSize := 8
END WITH
END WITH
END WITH
Last edited by l3whmg on Thu Dec 22, 2011 10:30 am, edited 1 time in total.
Luigi from Italy
www.L3W.it
www.L3W.it
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Change Size Menuitem im hmg.4
Wow! Thanks Luigi.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Change Size Menuitem im hmg.4
Wow ! It´s wonderful !
Taking this chance to ask:
In HMG 3 is this possible to do ?
Taking this chance to ask:
In HMG 3 is this possible to do ?
Last edited by Pablo César on Thu Dec 22, 2011 1:17 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Change Size Menuitem im hmg.4
Luigi :
Gracias por compartir tus conocimientos.
Gracias por compartir tus conocimientos.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Re: Change Size Menuitem im hmg.4
Hi DanielMaximiliano
"De nada", but I stop here my knowledge about hispanic language
Cheers
"De nada", but I stop here my knowledge about hispanic language
Cheers
Luigi from Italy
www.L3W.it
www.L3W.it
Re: Change Size Menuitem im hmg.4
Hello Luigi,
This would be a request
Wonderful to see it all working. Thank you for sharing your knowledge with us all and also all over your precious time dedicated to this great project.
Thanks Master Luigi
Rossine.
>> If I understand your request or problem.l3whmg wrote:Hi Rossine.
With my compiled library, MainMenu, MenuPop and MenuItem have the same size.... this is the codeAnd these are two picture, one without "FontSize" (default system size) If I understand your request or problem.Code: Select all
WITH OBJECT MainMenu():New( "MainMenu" ) :FontSize := 16 WITH OBJECT MenuPopup():New( 'File',, 'File' ) WITH OBJECT MenuItem():New( 'ItemOpen' ,, 'Open' , { || MsgInfo( 'Open' ) } ); END WITH WITH OBJECT MenuItem():New( 'ItemClose',, 'Close' , { || MsgInfo( 'Close' ) } ); END WITH WITH OBJECT MenuPopup():New( 'PopUp',, 'PopUp' ) WITH OBJECT MenuItem():New( 'Item1' ,, 'Open' , { || MsgInfo( 'Open' ) } ); END WITH WITH OBJECT MenuItem():New( 'Item2',, 'Close' , { || MsgInfo( 'Close' ) } ); END WITH END WITH END WITH END WITH
It's not possible (I have tried some times ago...) to have different size between MainMenu, MenuPopUp or MenuItem... In other wordsCheersCode: Select all
WITH OBJECT MainMenu():New( "MainMenu" ) :FontSize := 16 WITH OBJECT MenuPopup():New( 'File',, 'File' ) :FontSize := 10 WITH OBJECT MenuItem():New( 'ItemOpen' ,, 'Open' , { || MsgInfo( 'Open' ) } ) :FontSize := 8 END WITH END WITH END WITH
This would be a request
Wonderful to see it all working. Thank you for sharing your knowledge with us all and also all over your precious time dedicated to this great project.
Thanks Master Luigi
Rossine.
Re: Change Size Menuitem im hmg.4
Hi friends.
Many thanks for your words
A little brief about Menu and related font problem/request.
In the previous code, the MainMenu object inherit font (size, name, etc.) from QT default.
In the previous code, we have changed the fontsize property for the MainMenu object.
MenuItem inherit font (size, name, etc.) from its parent. Who is its parent? MainMenu
So, with first example MenuItem inherit Qt default font, in the second one inherit a "changed" font.
There are 3 lines within MenuPopUp.prg (97-100): if I remove these lines, menuitem doesn't inherit font property from its parent, but what happens? If I set a font for the MainMenu, this font it is not propagate to the MenuItem (in other words, it has default font) and we must use :FontSize to align its fontsize.
Remember that all font* methods are used by many objects.
From one side we can use only one time :FontSize and all menu objects have the same size; on the other side, we can have different size, but we must use everywhere :FontSize to have the same size.
I think this can be an evolution and everyone can think a solution.
Cheers
Many thanks for your words
A little brief about Menu and related font problem/request.
Code: Select all
WITH OBJECT MainMenu():New( "MainMenu" )
WITH OBJECT MenuPopup():New( 'File',, 'File' )
WITH OBJECT MenuItem():New( 'ItemOpen' ,, 'Open' , { || MsgInfo( 'Open' ) } ); END WITH
END WITH
END WITH
Code: Select all
WITH OBJECT MainMenu():New( "MainMenu" )
:FontSize := 16
WITH OBJECT MenuPopup():New( 'File',, 'File' )
WITH OBJECT MenuItem():New( 'ItemOpen' ,, 'Open' , { || MsgInfo( 'Open' ) } ); END WITH
END WITH
END WITH
MenuItem inherit font (size, name, etc.) from its parent. Who is its parent? MainMenu
So, with first example MenuItem inherit Qt default font, in the second one inherit a "changed" font.
There are 3 lines within MenuPopUp.prg (97-100): if I remove these lines, menuitem doesn't inherit font property from its parent, but what happens? If I set a font for the MainMenu, this font it is not propagate to the MenuItem (in other words, it has default font) and we must use :FontSize to align its fontsize.
Remember that all font* methods are used by many objects.
From one side we can use only one time :FontSize and all menu objects have the same size; on the other side, we can have different size, but we must use everywhere :FontSize to have the same size.
I think this can be an evolution and everyone can think a solution.
Cheers
Luigi from Italy
www.L3W.it
www.L3W.it
Re: Change Size Menuitem im hmg.4
Hello Luigi,
Many thank´s for this explanation
Below an example to let the possibility of using each submenu with a different size.
Thanks for your help,
Rossine.
Many thank´s for this explanation
Below an example to let the possibility of using each submenu with a different size.
Code: Select all
#include "hmg.ch"
#include "hbqtgui.ch"
static Form_1
Function Main
HbQt_ErrorSys()
WITH OBJECT Form_1 := MAINWINDOW():New( "Form_1" )
:Row := 10
:Col := 10
:Width := 1024
:Height := 630
:Title := "HMG4 demo change font menu"
:Icon := ":HMG_ICO"
DEFINE TOOLBAR oToolBar1 BUTTONSIZE 120, 80 FONT "ms sans serif" SIZE 12 MOVEABLE .F.
TOOLBUTTON oButton1 ;
Caption 'Font Menu Main' ;
picture 'open.png' ;
ACTION { || Form_1:MainMenu:FontSize ++ }
tooltip 'Change font of <Menu Main>'
TOOLBUTTON oButton2 ;
Caption 'Font Menu File' ;
picture 'open.png' ;
ACTION { || Form_1:MainMenu:ItemFile:FontSize ++ }
tooltip 'Change font of Option <File>'
TOOLBUTTON oButton3 ;
Caption 'Font Menu Help' ;
picture 'open.png' ;
ACTION { || Form_1:MainMenu:ItemHelp:FontSize ++ }
tooltip 'Change font of Option <Help>'
END TOOLBAR
WITH OBJECT MainMenu():New( "MainMenu" )
:FontSize := 16
WITH OBJECT MenuPopup():New( 'ItemFile',, 'File' )
WITH OBJECT MenuItem():New( ,, 'Open' , { || MsgInfo( 'Open' ) } )
END WITH
WITH OBJECT MenuItem():New( ,, 'Save' , { || MsgInfo( 'Save' ) } )
END WITH
END WITH
WITH OBJECT MenuPopup():New( 'ItemHelp',, 'Help' )
WITH OBJECT MenuItem():New( ,, 'About' , { || MsgInfo( 'About' ) } )
END WITH
END WITH
END WITH
END WITH
ACTIVATE WINDOW Form_1
return NIL
Rossine.
Re: Change Size Menuitem im hmg.4
Hi Rossine.
WoW very
Many thanks
Cheers
WoW very
Many thanks
Cheers
Luigi from Italy
www.L3W.it
www.L3W.it