Author Topic: How to hide inactive function definition in c/c++  (Read 4557 times)

lusu2004

  • Community Member
  • Posts: 39
  • Hero Points: 1
How to hide inactive function definition in c/c++
« on: August 26, 2013, 03:32:49 PM »
Hi Experts,

    I see in slickedit, the inactive functions be shown in auto preview (symbol list), any one know how to hide them?

e.g. there are two files, one is a.h, another is a.cpp.
//a.h
extern int hello();
//a.cpp
#include "a.h"
#ifdef TEST
int hello() { return 0; }
#else
int hello() { return 1; }
#endif


Thanks,
Lu Su

Dennis

  • Senior Community Member
  • Posts: 3999
  • Hero Points: 522
Re: How to hide inactive function definition in c/c++
« Reply #1 on: August 26, 2013, 04:00:10 PM »
Go to Document > C/C++ Options > C/C++ Preprocessing.
Then define (or create a #undef) for the symbol used in the #if
The inactive code regions will be displayed as grayed out code.

Option #2 is to use View > Selective Display... and select "Preprocessor Directives" and specify the defines there.

lusu2004

  • Community Member
  • Posts: 39
  • Hero Points: 1
Re: How to hide inactive function definition in c/c++
« Reply #2 on: August 27, 2013, 01:55:06 PM »
Hi Dennis,
   
    thanks very much, but your two suggestion are global setting, isn't it? is there any setting to specific project (or workspace)?

Thanks & Best Regards
Lu Su

Dennis

  • Senior Community Member
  • Posts: 3999
  • Hero Points: 522
Re: How to hide inactive function definition in c/c++
« Reply #3 on: October 25, 2013, 09:22:08 PM »
We are adding a dialog for editing preprocessing on a per-workspace basis in the next release.  It will be accessed from the Project > Workspace Properties... dialog.

hs2

  • Senior Community Member
  • Posts: 2763
  • Hero Points: 292
Re: How to hide inactive function definition in c/c++
« Reply #4 on: October 25, 2013, 09:40:36 PM »
Quote
preprocessing on a per-workspace
++HP :)
HS2