I wanted to create a class deriving from the Scrollbar to add functionality: a method and some data members to occasionally (on change message) load and store data to be visualized in the background of the scrollbar by a custom LookAndFeel.
So two quick questions,
Would it be possible to have a virtual destructor on the Scrollbar class to make it extensible?
Would it be possible to have a method to use a custom scrollbar class in viewport?
Sigh… I see this misunderstanding so often. When any method overrides a virtual method, it becomes virtual by default. You don’t need to keep adding the word ‘virtual’ in every derived class.
Not sure, I don’t like bloating classes with custom stuff like that. But I’m soon going to need to add support for more modern scrollbars (i.e. minimalist ones like on OSX) so may be making some changes that will help you.
juce::Scrollbar’s destructor is not virtual. Derivatives of a juce::Scrollbar would not be castable to the Scrollbar base-class, nor would a juce::Scrollbar* to a derived class.