Add an enabled_ field to MenuItem::Impl and initialize it true; have SetEnabled update the stored flag and the native menu via EnableMenuItem. Change IsEnabled to return the stored enabled_ value instead of querying GetMenuState. When adding/inserting items, set MF_CHECKED/MF_UNCHECKED based on the item state for checkboxes and radio items, apply MF_GRAYED for disabled items, and fix InsertMenuW to pass the correct menu_id (handling submenus) for insertion. These changes ensure item enabled/checked state is tracked consistently and reflected in native menu flags.
Description
Fixes two issues where MenuItem.state and MenuItem.enabled properties are silently ignored on Windows when set before the item is added to a Menu via addItem() or insertItem().
Root Cause
MenuItem::Impl had no enabled_ field — SetEnabled() only called EnableMenuItem() if parent_menu_ was set (null before addItem), and IsEnabled() fell back to returning true when parent_menu_ was null. Additionally, Menu::AddItem() and Menu::InsertItem() hardcoded MF_UNCHECKED instead of reading the item's current state_.
Changes
Resolves