Sign in to follow this  
Followers 0
Sunaj

Can the font be changed in Context Menu?

7 posts in this topic

Share this post


Link to post
Share on other sites



Tried a variety of ideas but nothing seems to work :/

Here's the latest code bit:

$gaGUIMenu=GUICtrlCreateMenuItem($gaMem,$ghMTFMenu)
GUICtrlSetFont(gaGUIMenu,9,"","","Courier New")

Also tried setting the gui font (GUISetFont) with no luck: the context menu opens with exact same standard font anyway. Any help is appreciated, searched the forum high and low to no avail.

The only way I've found to change the menu font is with Desktop Properties|Appearance|Advanced|Item - menu. This changes all menus of course, and it looks to me like there is only one setting windows uses for all menus. (I now expect the next post to prove me wrong.)


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

@martin, cheers for the feedback, guess it's a bit unfortunate to change all menu's on the whole system.. still thanks, I never noticed that sub-sub-sub setting before :) @Holger, thanks for the MSDN link,that settles it. I already use your menu lib for this purpose but wanted a light weight alternative for a new application I'm developing.

Fonts for menu/items can only be 'changed' by creating 'ownerdrawn' menu items (as I use them in my GUI/Tray-menus):

http://msdn2.microsoft.com/en-us/library/ms647558.aspx

The only way I've found to change the menu font is with Desktop Properties|Appearance|Advanced|Item - menu. This changes all menus of course, and it looks to me like there is only one setting windows uses for all menus. (I now expect the next post to prove me wrong.)

Share this post


Link to post
Share on other sites

But you can open OWN window with lines as context menu.

Right click ($GUI_EVENT_SECONDARYDOWN) will open second window by call ContextMenu()

#include <GuiConstants.au3>
$NewStyle = False
$hWnd = GuiCreate("Gui Style", 260, 100)
$Style = GUICtrlCreateButton("Set Style",45, 50, 150, 20 )
GUISetState()

While 1
 $Msg = GUIGetMsg()
 Switch $Msg
  Case -3
   Exit
  Case $GUI_EVENT_SECONDARYDOWN
    ContextMenu()
  Case Else
   EndSwitch
WEnd

func ContextMenu()
;Opt('MouseCoordMode',0)
local $MPos = MouseGetPos()
GUICreate("", 100, 100, $MPos[0],$MPos[1],$WS_POPUPWINDOW+$WS_THICKFRAME)
GUISetState ()
While 1
 $Msg = GUIGetMsg()
 Switch $Msg
  Case -3
   Exit
  Case $GUI_EVENT_SECONDARYDOWN
  Case Else
   EndSwitch
WEnd
endfunc

This secondary window (context menu) can have text lines (any fonts), icons, pictures, animation and other controls for selection...

Valery


The point of world view

Share this post


Link to post
Share on other sites

delete or comment waste line

$Style = GUICtrlCreateButton("Set Style",45, 50, 150, 20 )

The point of world view

Share this post


Link to post
Share on other sites

Great point Valery! But damn, it's gonna take some smoothass GUI engineering to get a completely custom, updateable, context meny to draw, question is whether the resource use at the end of the day would be much different from using the custom drawn GUI menu by Holger?!

Sunaj

But you can open OWN window with lines as context menu.

Right click ($GUI_EVENT_SECONDARYDOWN) will open second window by call ContextMenu()

[.........]

This secondary window (context menu) can have text lines (any fonts), icons, pictures, animation and other controls for selection...

Valery

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0