have all (one's) buttons
To be mentally sound or stable. Now that I've gotten a good night's sleep, I'm starting to feel like I have all my buttons again. Grandma still has all her buttons in spite of her other health problems.
have all one's buttons
Also, have all one's marbles. Be completely sane and rational. For example, Grandma may be in a wheelchair, but she still has all her buttons, or I'm not sure he has all his marbles. These slangy expressions date from the mid-1800s, as do the antonyms lose or be missing some of one's buttons or marbles , meaning "become (or be) mentally deficient."