Menu checkmarks...how?
BlitzMax Forums/BlitzMax Beginners Area/Menu checkmarks...how?| 
 | ||
| In one of my menus I'd like to be able to put a checkmark next to an item.  I tried using CheckMenu() to no avail.  Here's a pic of what I'm trying to do:   | 
| 
 | ||
| Use CheckMenu()? | 
| 
 | ||
| Degac can you give me an example.  Far as I can see, Checkmenu() only let's you put in a Menu not a menu index.  Don't see how it will know to check MENU_BLAH on the menu list. Anywho here's another question.  How do we make these neat and nifty toolbar dividers? God I wish the docs were more complete. :( | 
| 
 | ||
| From the docs...  A ToolBar is created from a source pixmap that contains a row of equally shaped images. Any images in the row left blank are treated as ToolBar separators.  The menu... Strict
Const MENU_TEST = 300
Const MENU_CHECKITEM = 301
Local window:TGadget = CreateWindow("A Window", 100, 100, 320, 240)
Local testMenu:TGadget = CreateMenu("Test", MENU_TEST, window)
Local checkItem:TGadget = CreateMenu("Check Me", MENU_CHECKITEM, testMenu)
UpdateWindowMenu(window)
Repeat
	Select WaitEvent()
		Case EVENT_MENUACTION
			Select EventData()
				Case MENU_CHECKITEM
					If MenuChecked(checkItem)
						UncheckMenu(checkItem)
					Else
						CheckMenu(checkItem)
					EndIf
			End Select
			
			UpdateWindowMenu(window)
			
		Case EVENT_WINDOWCLOSE
			End
	
	End Select
Forever | 
| 
 | ||
| I'm at work at the moment so I can't read the documentation but it's something like this menu:tgadget=AddMenu() or what is the comand :P CheckMenu(menu) UpdateMenu(win:tgadget) 'or something liket this... to enable the check sign For the vertical bar in toolbar maybe a blank image? I don't know because documentation is very *exaustive* (ironic) | 
| 
 | ||
| Thanks YouCanCode.   Thanks for you efforts also Degac.  All problems solved here atm. Would be nice if this stuff (save the toolbar separator info) was in the docs. Means I could stop asking stupid questions... | 
| 
 | ||
| It is in the docs.  Hard to find maybe, but it's there. | 
| 
 | ||
| ! Only now I see the post of YanCanCode...so I delete my too-late-answer!!!! For the ToolBar gadget I can say that in the MaxIde source code there is the following command InsertToolBarSeparator that seems to be not implemented... 
		toolbar=CreateToolBar("incbin::icons.PNG",0,0,0,0,window )
		SetToolBarTips toolbar,["Nuovo","Apri","Chiudi","Salva","","Taglia","Copia","Incolla","Trova","","Compila","Compila & Parti","Passo","Passo IN","Passo Out","Stop"		,"","Home","Back","Forward"		]
'		InsertToolBarSeparator toolbar,5
but I'm experimenting... | 
| 
 | ||
| Found the solution for the separator in the toolbar (PS: I'm not english but how I understand that 'blank' for you is 'white'? Blank for me means 'not filled'... :( ) From the docs: A ToolBar is created from a source pixmap that contains a row of equally shaped images. Any images in the row left blank are treated as ToolBar separators. Left blank=fill with white color 255,255,255!! And so you have the separator! |