Book a Demo

Author Topic: Editing Operations and Attributes of a class  (Read 4141 times)

Lode

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Editing Operations and Attributes of a class
« on: October 09, 2007, 10:10:01 pm »
Say I'm manually representing a C++ class in EA, I right click on the class and choose "Operations..." to add the functions. There are for example member functions with the following definition:

void SetFilePath(const wchar_t* ip_file_path, const wchar_t* ip_extension)

bool IsFilenameDefined() const

For the first function, in EA, the only way to get it in EA is to type the name, the return type, and each of the parameter, separatly, pressing a lot of little "new" and "save" buttons along the way.

It would be really cool, if there was a field "enter definition", where I would in one go, copypaste "void SetFilePath(const wchar_t* ip_file_path, const wchar_t* ip_extension)" in one editbox, and that EA will then parse it and fill in all the fields like name, all the parameters, the fact that is is or isn't a const member function, and so on itself.
That could greatly enhance the productivity, when entering classes manually!

Same for attributes to type for example "int m_name" in one go instead of typing the "int" and the "m_name" in separate fields.

The reason why it could increase the productivity is that typing 1 function definition is easier than clicking lots of buttons and typing in separate fields, and that when the code already exists, you can simply copypaste it.

Please consider it :) Thanks.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Editing Operations and Attributes of a class
« Reply #1 on: October 10, 2007, 01:10:33 pm »
It's already there.

You can enter the parameter list in one go onto the main page of the options dialog, by extracting the parameter string from either of my two examples below.  Or, select the class on the diagram and select Element | Inline Features | Add Operation (or Ctrl+Shift+F10).  In that editor enter either of the following lines.

Code: [Select]
+ SetFilePath (fixed ip_file_path: wchar_t*, fixed ip_extension: wchar_t*): void
+ SetFilePath (fixed wchar_t* ip_file_path, fixed wchar_t* ip_extension): void


For your attribute example, the same menu (or Ctrl+Shift+F9) will allow you to enter

Code: [Select]
m_Name: int

I also recommend you see the help for more ways this can be used.  http://www.sparxsystems.com/EAUserGuide/index.html?elementeditingoptions.htm