About Store Forum Documentation Contact



Post Reply 
ComboBox inherits from Button
Author Message
fatcoder Offline
Member

Post: #1
ComboBox inherits from Button
Hi Greg, I was just browsing through the update notes in November and found this line, which prompted me to download the latest version and investigate the code.

Quote:ComboBox no longer has a member 'button', instead it now directly inherits from the Button class

I discovered that ComboBox and Tab both inherit from Button. Last year we had a chat (scroll to the bottom of the thread) about this issue. After our chat Greg you changed the ComboBox button member to be a FixedElm<Button> like we have for the button and slidebars in Region and the buttons in SlideBar for example. This allowed the internal button of these gui objects to be overridden for custom behaviour and it works really well.

Unfortunately, this change in November has broken this functionality for the ComboBox. There no longer appears to be anyway to override the button used by the ComboBox (or the Tab for that matter too).

Is it possible to revert this back to the way it worked before, like all the other controls?
12-06-2014 04:22 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: ComboBox inherits from Button
Hi,

Aren't you using an older version of the engine (2.0)?

Yes you can override the class smile
The methods are virtual. You override the combobox and the button at the same time.
12-06-2014 05:31 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #3
RE: ComboBox inherits from Button
Esenthel Wrote:Aren't you using an older version of the engine (2.0)?
Actually, I am using 1.0, 2.0 and the latest <no version number> version of the engine as I have several projects spread across different versions. My aim is to gradually upgrade projects on to the latest EE code, so that I can eventually do away with the older versions. So to do that I have to keep a close eye on the update changes and investigate anything that may cause an issue, such as this.

For example, I have built a GUI system on top of the EE GUI that uses dynamic (and procedural) styling done in code and with custom shaders. Unfortunately, the new skin system in EE just isn't sophisticated enough to handle what I'm doing, so I will have to disable that and override most things.

Esenthel Wrote:Yes you can override the class smile
The methods are virtual. You override the combobox and the button at the same time.
Hmm... this just leads to duplicate code. Under the old system, I have all the code for the button in one place and I just tell the combobox to use that type of button. This new system would force code to be duplicated in two places, to override both the normal button and the combobox button. It is that reason why I built my own tabs too, as I couldn't use the Tab control in EE as I couldn't replace the button the tabs use. lol

Oh and while we're on the subject, why is the Menu in Combobox not a FixedElm<Menu> so it can be replaced?
12-06-2014 06:05 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: ComboBox inherits from Button
Quote:Oh and while we're on the subject, why is the Menu in Combobox not a FixedElm<Menu> so it can be replaced?
Please subscribe and I'll be happy to add this feature for you wink
I recommend getting the source license while the 15% discount still lasts.

Quote:Hmm... this just leads to duplicate code
I'm sure you can workaround it somehow, either this:
Code:
class ButtonShared
{
  virtual..
}
class Button2 : Button, ButtonShared
{
}
class ComboBox2 : ComboBox, ButtonShared
{
}

if that's not enough, then, add:
Code:
class Button2 : Button, ButtonShared
{
   virtual void update(..) {ButtonShared::newUpdate(..);}
}
class ComboBox2 : ComboBox, ButtonShared
{
   virtual void update(..) {ButtonShared::newUpdate(..);}
}
12-08-2014 12:13 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #5
RE: ComboBox inherits from Button
Yes I too thought of a similar solution as you described, if I ever upgrade. Unfortunately, upgrading doesn't really offer a lot of value to me over my current licenses at the moment (don't really use the tools). I wouldn't mind fiddling with and contributing a bit to the source some day, but not in any rush to start paying every year for the privilege. lol
12-09-2014 12:58 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: ComboBox inherits from Button
That's too bad as subscriptions support further engine development.
Please keep in mind that not having an active subscription may affect my ability to provide replies to support related questions.
Looking forward to having you as a subscriber in the future smile
12-09-2014 02:42 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #7
RE: ComboBox inherits from Button
What I meant by my previous post was I don't work much with EE these days. Just haven't had the time like I used to (a weekend or so every now and then), so it isn't really worth upgrading right now. A 15% discount isn't that great if it sits largely unused for 6 months. lol

Totally understand about the support. I like to keep in touch with the community here though and talk about EE as I really enjoy working with this engine. Look forward to one day (hopefully soon) getting back into my EE work again. smile
12-09-2014 06:15 AM
Find all posts by this user Quote this message in a reply
Post Reply