Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Enum completion
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Aug 15 2008 :  09:17:49 AM  Show Profile  Reply with Quote
I believe this feature would yield another "WOW" experience, and I have a feeling it might be quite easy to implement.
I hope you like the idea as much as I do :)

In C++ you often use enum types. Consider this example:
enum PeriodType
{
    periodAlways,
    periodLastWeek,
    periodPastMonth,
    periodPastYear,
    periodSpecifyDates
};

void SetPeriod(PeriodType periodType);
void SetPeriodEx(PeriodType periodType, bool update);
It would be nice if VAX could show a list of available constants (similar to the variable completion), when declaring a function call:

SetPeriod(|
SetPeriodEx(|, false)

...or initiating a variable:
PeriodType p = |
PeriodType p2(|
p2 = |

...or in a class initialization:
CMyClass::CMyClass()
: m_periodType(|

Taking care of all relevant operators, such as "+", "OR" and "AND", is also desirable:
p2 = p | |
p2 = p | (periodMask & |)
p2 &= ~|;

Basically, whereever the enum type is expected you would show a list of available constants!

Also, <Ctrl+Space> should explicitly show this list (in case you press <Esc>).

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 15 2008 :  10:30:40 AM  Show Profile  Reply with Quote
The idea is interesting, but there are two problems here.

Firstly the assignment statements. You are assuming that the programmer wants to assign the variable to an enum item. But why not assign the variable to another variable, the return type of a function, a constant, or something else?

Having a listbox appear that only lists the enum members is going to get in the way.

The same effect applies to calling a function, but there is a further complication. When dealing with overloaded functions VA is not going to know which overload you are calling, so it will not know what type the parameters are.

This is where suggestions should help, since if you have recently used one of the enum members VA should be offering it as you start typing its name.

zen is the art of being at one with the two'ness
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Aug 15 2008 :  4:24:16 PM  Show Profile  Reply with Quote
Ok, here's my backup approach:

Show this list when you press <ctrl+space> at a valid place.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 16 2008 :  08:51:08 AM  Show Profile  Reply with Quote
So CTRL-SPACE no longer lists the variables and functions? Surely that is going to cause more problems than it fixes.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000