| 
        
          | 
              
                | Author |  Topic  |  |  
                | gmitWhole Tomato Software
 
     
 
                Croatia96 Posts
 | 
                    
                      |  Posted - Sep 15 2005 :  09:34:03 AM   
 |  
                      | I've got few suggestions for your new autotext feature... 
 1. Add a toolbar icon for going into AutoText-edit dialog, because that's a rather frequent action to do.
 2. Add a possibility to specify a default value. For example, $Index=i$ or $Index="i"$.
 3. Add a $$ option that would be substituted with the type of expression from selection/clipboard/last used or defined variable. I believe that VA has those informations and such feature would be real powerful.
 
 
 |  |  
                | felineWhole Tomato Software
 
      
 
                United Kingdom19247 Posts
 | 
                    
                      |  Posted - Sep 15 2005 :  4:42:33 PM   
 |  
                      | point 1 - press the VA toolbar button "insert code template", use the bottom item on the list. 
 point 2 - a good idea
 
 case=756
 
 point 3 - have you tried the existing options:
 $selected$
 $clipboard$
 
 also you can right click when prompted for the values to select recent clipboard items in 1422.
 
 last used or defined variable is an interesting thought, but it could be confusing when mixed with $selected$.  also you have problems with things like global variables, the autotext being the first thing in a function, the autotext being outside of a function (autotext comments).
 
 what sort of thing are you picturing?
 |  
                      | zen is the art of being at one with the two'ness
 |  
                      |  |  |  
                | gmitWhole Tomato Software
 
     
 
                Croatia96 Posts
 | 
                    
                      |  Posted - Sep 16 2005 :  02:45:50 AM   
 |  
                      | We misunderstood about points one and three... 
 1. I was talking about EDIT autotext dialog, not inserting autotext, which I know it exists in toolbar already. Editing autotext is frequent action and it would be nice it could be triggered directly, not going through options dialog.
 
 3. I was talking about TYPES, not names themselves, although, that could be handy also.
 
 For example
 for
 expands to
 for($selection_typeof$::iterator $iterator=it$ = $selection$.begin(); $iterator$ != $selection$.end(); ++$iterator$) {}
 
 then you could only select container's name and you'll get iteration through it. At the point of selection, I'm sure that VA knows types of  expressions, so, this probably can be implemented...
 
 |  
                      |  |  |  
                | felineWhole Tomato Software
 
      
 
                United Kingdom19247 Posts
 | 
                    
                      |  Posted - Sep 17 2005 :  1:55:47 PM   
 |  
                      | point 1, i am using VS 2003 and VA 1422, the bottom item on the menu produced by the toolbar button "insert code template" is the option to edit autotext.  up comes the edit dialog, the languages down one side in a tree, etc.  if you are missing this option then that is a bug. 
 
 point 3, i am very taken by this, i can definitely see its usefulness in this example.  i have an autotext rule for doing just this myself, but it is done slightly differently.
 
 i am just wondering how reliable this would be, i.e. if strange special cases using typedef's, pointers, references, etc, would cause problems.
 
 on occasions i have ended up with something rather like:
 
 stl::vector<Data *> *pVector;
 
 in this case the type would turn into "stl::vector<Data *> *", which is not actually what you want.  the real question is are the problem cases worth worrying about?  in my own template using code i virtually never have pointers to containers, but it does happen.  so this would work as expected 99% of the time.
 
 also can you think of any non STL rules that would use this?  off hand i cannot think of any non template autotext rules that would care about the type, but i am sure they exist.
 |  
                      | zen is the art of being at one with the two'ness
 |  
                      |  |  |  
                |  |  Topic  |  |  |  |