fix: submenu option items unresponsive to clicks
When the user opens a submenu containing items with the style `menu::checks::option` and clicks an option, the radio button logic doesn't work. This bug was discovered and fixed by nanapro.org forum user "huycan" (I'm just submitting the PR). See this forum post: http://nanapro.org/en-us/forum/index.php?u=/topic/1256/ggleave-a-menu-open As mentioned in more detail in the forum post linked above, my understanding of why this happens is that `menu_builder::checked` fails because the `menu_window` of the submenu is created with the `menu_builder` object used by the parent menu.
This commit is contained in:
		
							parent
							
								
									6c547276ec
								
							
						
					
					
						commit
						ff7fca9311
					
				@ -921,7 +921,25 @@ namespace nana
 | 
			
		||||
					}
 | 
			
		||||
					else if (checks::option == item.style)
 | 
			
		||||
					{
 | 
			
		||||
						get_drawer_trigger().mbuilder().checked(active, true);
 | 
			
		||||
						if(active > 0)
 | 
			
		||||
						{
 | 
			
		||||
							do {
 | 
			
		||||
								if(menu->items[--active]->flags.splitter)
 | 
			
		||||
								{
 | 
			
		||||
									++active;
 | 
			
		||||
									break;
 | 
			
		||||
								}
 | 
			
		||||
							} while(active > 0);
 | 
			
		||||
						}
 | 
			
		||||
						while(active < menu->items.size())
 | 
			
		||||
						{
 | 
			
		||||
							menu_item_type &el = *(menu->items[active++]);
 | 
			
		||||
							if(el.flags.splitter)
 | 
			
		||||
								break;
 | 
			
		||||
							if(checks::option == el.style)
 | 
			
		||||
								el.flags.checked = false;
 | 
			
		||||
						}
 | 
			
		||||
						item.flags.checked = true;
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
					this->_m_close_all();	//means deleting this;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user