| 971 | |
| 972 | |
| 973 | void UserMenu::SetColor(ExprTokenType &aColor, bool aApplyToSubmenus) |
| 974 | { |
| 975 | // AssignColor() takes care of deleting old brush, etc. |
| 976 | if (TokenIsPureNumeric(aColor)) // Integer or float; float is invalid, so just truncate it to integer. |
| 977 | AssignColor(rgb_to_bgr((COLORREF)TokenToInt64(aColor)), mColor, mBrush); |
| 978 | else |
| 979 | AssignColor(TokenToString(aColor), mColor, mBrush); |
| 980 | // To avoid complications, such as a submenu being detached from its parent and then its parent |
| 981 | // later being deleted (which causes the HBRUSH to get deleted too), give each submenu it's |
| 982 | // own HBRUSH handle by calling SetColor() for each: |
| 983 | if (aApplyToSubmenus) |
| 984 | for (UserMenuItem *mi = mFirstMenuItem; mi; mi = mi->mNextMenuItem) |
| 985 | if (mi->mSubmenu) |
| 986 | mi->mSubmenu->SetColor(aColor, aApplyToSubmenus); |
| 987 | if (mMenu) |
| 988 | { |
| 989 | ApplyColor(aApplyToSubmenus); |
| 990 | UPDATE_GUI_MENU_BARS(mMenuType, mMenu) // Verified as being necessary. |
| 991 | } |
| 992 | } |
| 993 | |
| 994 | |
| 995 |
nothing calls this directly
no test coverage detected