layer Posted December 28, 2004 Posted December 28, 2004 (edited) hey guys... im trying to be able to "toggle" a menu_item... is there a way to put a check next to a menu item?? heres part of my editor that has the non working toggling...Func WordWrapOn () Local $edit_styles= BitOR ($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL) $edit= GUICtrlCreateEdit ("", -1, -1, 300, 400, $edit_styles) EndFunc Func WordWrapOff () GUICtrlDelete ($edit) $edit= GUICtrlCreateEdit ("", -1, -1, 300, 400, $ES_WANTRETURN) EndFunc Func ToggleWordWrap () if $menu_item5= $GUI_CHECKED Then WordWrapOn () EndIf If $menu_item5= $GUI_UNCHECKED Then WordWrapOff () EndIf EndFunc While 1 $get= GUIGetMsg () Select Case $get = $menu_item5 ToggleWordWrap () Wendnow, is it possible to put a check next to a menu_item? i have no clue, so could someone help me with that... i think that would solve it...EDIT: the help file is a charm... nevermind.... but i don't think the toggle works though.. any help? EDIT2: actually i think the help file covers it all... i will ask if i need help! thanks! also had some wrong code i think in the above script... Edited December 28, 2004 by layer FootbaG
Doxie Posted December 28, 2004 Posted December 28, 2004 Any chance we can see how you solved it? Were ever i lay my script is my home...
SlimShady Posted December 28, 2004 Posted December 28, 2004 Here's an example: expandcollapse popup#include <GUIConstants.au3> AutoItSetOption("TrayIconDebug", 1) ;Initialize variables Global $style1 Global $IniFile Global $GUIWidth Global $GUIHeight $GUIWidth = 250 $GUIHeight = 250 GUICreate("New GUI", $GUIWidth, $GUIHeight) $Main_menu = GUICtrlCreateMenu("View") $Menu_Item = GUICtrlCreateMenuItem("Test", $Main_menu) GUISetState(@SW_SHOW) While 1 Sleep(25) $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $Menu_Item If BitAND(GUICtrlRead($Menu_Item), $GUI_CHECKED) Then GUICtrlSetState($Menu_Item, $GUI_UNCHECKED) Else GUICtrlSetState($Menu_Item, $GUI_CHECKED) EndIf EndSelect WEnd
Doxie Posted December 28, 2004 Posted December 28, 2004 Thanks, but there was a small error in the script. GUICtrlRead shoud be GUIRead Right? Were ever i lay my script is my home...
MHz Posted December 28, 2004 Posted December 28, 2004 GUIRead changed to GUICtrlRead in v1.0.103.133. Released 24th Dec. Time to update.
Doxie Posted December 28, 2004 Posted December 28, 2004 I thought i was updated, hmm this starts to look more and more like Microsoft Vulnerability update Everytime you reboot, you need to update your computer. Were ever i lay my script is my home...
Nova Posted December 28, 2004 Posted December 28, 2004 Everytime you reboot, you need to update your computer.I know its graet isnt it ?, all those new functions and santax
layer Posted December 28, 2004 Author Posted December 28, 2004 (edited) slim's probably works best but heres mine... btw: im not very good with toggling anyway so Func WordWrapOn () Local $edit_styles= BitOR ($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL) $edit= GUICtrlCreateEdit ("", -1, -1, 300, 400, $edit_styles) GUICtrlSetState ($menu_item5, $GUI_CHECKED) EndFunc Func WordWrapOff () ***TRYING TO FIND SOMETHING FOR HERE*** GUICtrlSetState? I dont know! ALSO TRYING TO FIND WAY TO MAKE IT SO YOU DON'T HAVE TO DELETE IT AND SET STYLES AGAIN.. EndFunc Case $get = $menu_item5 If BitAnd(GUICtrlRead($menu_item5),$GUI_CHECKED) = $GUI_CHECKED then GUICtrlSetState($menu_item5, $GUI_UNCHECKED) WordWrapOff () Else GUICtrlSetState($menu_item5, $GUI_CHECKED) WordWrapOn () EndIf pretend all the variables are declared though...although it still seems a bit buggy but im going to fix it.. EDIT: fixed something in script.. Edited December 28, 2004 by layer FootbaG
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now