Inheritance

N

nilavya

Hi,

A question regarding inheritance.
I hope i am asking in the right group :)

I have an eVC++ application. In that I have a class for GUI, which does
the changes related to GUI. Now due to specific requirement, I want to
seperate out the functions and code which are exclusive for GUI display
only so that in future if I want to go with different GUI display then
I can easily change. In this class I also have two state machines, but
I dont want to include the state machine in the GUI specific Class. So
I have changed my design which is as follows:

I have made a class which is CommonGUI, from this I have derived a
class named CGUIOne, which is exclusive for GUI display only.

class CommonGUI
{
function1();
function2();
variable 1;
variable 2;
}

Class CGUIOne: public CommonGUI
{
function3();
};

Now I have inherited from CommonGUI.
So when the function3() of CGUIOne gets called due to user action, I
want to update the state machine and then display proper contents on
the GUI. So I have shifted the logic to change state machine, in
CommonGUI. The function3() also sets some display on GUI.

The problem is that I am able to call the parent class function1/2()
from child class. But my function3() and function1() are too big. So it
causes to freeze the GUI. So what am i doing wrong over here..

Any help ,??? please


Thanks
With Best Regards,
Bhagat Nirav K
 
C

Colander

I'd say you are doing nothing wrong,
if your GUI freezes because of lengthy
calculations, most of the time I add a
life/progression indicator somewhere
and update that indicator from the
lengthy calculation.

This way the user will be comfortable with
the waiting....

Good luck!
 
E

EventHelix.com

The problem is that I am able to call the parent class function1/2()
from child class. But my function3() and function1() are too big. So it
causes to freeze the GUI. So what am i doing wrong over here..

You might want to run computationally intensive functions in a separate
worker thread, thus freeing up the GUI thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top