You must be registered to post a reply. Click here to register.
T O P I C R E V I E W
Posted - Sep 19 2016 : 11:27:47 AM Currently - the context sensitive aspect of VS or VA (not sure who's providing this service) when I go to add an override function to a subclass initially displays the default arguments for the superclass's declaration.
e.g. I start typing `void OnContextMen` and by this time I see a "tooltip" showing "afx_msg void OnContextMenu(..." showing the correct args for that message handler (inherited from the superclass).
However, it disappears in another heart-beat, and I see no way to recover it. :'(
I want a way to say "Insert Override" and have it offer all methods that are inherited - whether virtual or not - so I can choose one and have it supply the correct return type and args (and name). And if it is a virtual, then of course it needs to add the 'override' keyword (I prefer NOT to see virtual keyword, since it's more than redundant: it's misleading at that point in modern C++).
I start typing OnContex
and I either get a persistent and easy-to-use way to expand that to afx_msg void OnContextMenu... blah blah, OR, I simply right click inside the class declaration and choose "insert inherited method" [or whatever you end up calling it] and choose from a fly-out of all possible inherited members.
HUGE time saver over having to now lookup the inheritance tree and find a declaration for that and copy/paste and fix the override and etc. :D
You need to click on the class name, not inside the class. Just trigger the refactoring context menu over the classname (alt+shift+Q for quick menu) and select Implement Virtual Methods from there. You can find other useful commands there based on the context you're triggering in, such as Adding the Missing Case statements to a switch after you add new enum items or Adding a missing include statement for a symbol.