reduced version of program using 30% of the code

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

reduced version of program using 30% of the code

Post by mael15 »

Hello everyone!
I have to create a reduced version of my program that uses only ~30% of the code. What is the best practice to do that? I am thinking about defining a preprocessor symbol and using it extensively in my code to exclude certain parts. But I am hesitating because this feels a little outdated.
Is there a more elegant/modern way to do this?
Thanx you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: reduced version of program using 30% of the code

Post by ONEEYEMAN »

Hi,
Do you mean like a licensed vs non-licensed vrsion?

Thank you.
mael15
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 539
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

Re: reduced version of program using 30% of the code

Post by mael15 »

No, what I mean is: The full version has some creating, editing and viewing features of custom files, the reduced version should only be a viewer.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: reduced version of program using 30% of the code

Post by doublemax »

I can't think of any better way. If it's ok, that the actual code parts remain in the executable, it might be less effort if you use conditional compilation to only remove the GUI elements for the things the user should not have access to.
Use the source, Luke!
alys666
Super wx Problem Solver
Super wx Problem Solver
Posts: 329
Joined: Tue Oct 18, 2016 2:31 pm

Re: reduced version of program using 30% of the code

Post by alys666 »

1.preprocessor
2. void interfaces implementaions.
if you have interfaces and their implementations, then you could define void implementations(which do nothing) and use them in restricted version.
ubuntu 20.04, wxWidgets 3.2.1
Post Reply