Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set font size/color/style of upper menu in QM dialog
#1
Is it possible to set the font size of the upper menu: File, Edit,Help (and it's submenu items)
And maybe even the font type, color and style (bold,...)?
For now it's the font-size of the upper menu bar that matters to me. If font-type and style could also be changed, that would be a great bonus.

In the below code I left the  [$controls]  parameter empty so the full dialog would be rendered, but it doesn't work on the upper menu.

The buttons don't get color rendered.
I think a long time ago I read somewhere this was/is a limitation with a possible solution but it is time-consuming. So it's not really important that the buttons get their color changed. But if there is a solution for it, then that would be very welcome. For now it's the font size (and type, if possible) for the upper menu.

Function menu_sizefont_dlg
Code:
Copy      Help
str md=
;BEGIN MENU
;>&File
;,&Open :501 0x0 0x0 Co
;,&Save :502 0x0 0x0 Cs
;,>Submenu
;,,Item1 :551
;,,Item2 :552
;,,<
;,-
;,E&xit :2
;,<
;>&Edit
;,Cu&t :601
;,&Copy :602
;,&Paste :603
;,<
;>&Help
;,&About :901
;,<
;END MENU

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Static 0x54000000 0x0 71 40 48 12 "Text"
;4 Edit 0x54020080 0x200 71 56 96 12 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""

str controls = "4"
str e4="test"
if(!ShowDialog(dd &sub.DlgProc &controls 0 0 0 0 0 0 0 0 md)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,,__Font-- fnt
,,int- red;red=ColorFromRGB(255 0 0)
,,fnt.Create("Courier" 12 1) ;; 0=normal 1=bold
,,fnt.SetDialogFont(hDlg "") ;; font style, ALL controls
,,DT_SetTextColor hDlg red "" ;; set color, ALL controls
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#2
Font and color of standard menus cannot be changed, or it is difficult and I don't know how. Button colors too.
The alternative would be to use toolbar instead. And owner-draw submenus. Much work.
#3
Ok, no problem. Had a feeling this would time consuming!


Forum Jump:


Users browsing this thread: 1 Guest(s)