Home » U++ Library support » U++ Library : Other (not classified elsewhere) » design flaw in scatterctrl?
design flaw in scatterctrl? [message #49824] |
Sat, 12 May 2018 12:56  |
aftershock
Messages: 143 Registered: May 2008
|
Experienced Member |
|
|
In Scatterctrl,
private:
bool showInfo;
Point clickPoint;
PopUpInfo popText;
String popTextX, popTextY, popTextY2;
Point popLT, popRB;
bool isZoomWindow;
const Point offset;
int copyRatio;
bool isLeftDown;
int butDownX, butDownY;
bool isScrolling, isLabelPopUp;
bool showContextMenu;
bool showPropDlg;
bool showProcessDlg;
bool showButtons;
int lastRefresh_ms;
dword lastRefresh0_ms;
int maxRefresh_ms;
bool highlighting;
Upp::Array<MouseBehavior> mouseBehavior;
Upp::Array<KeyBehavior> keyBehavior;
void ProcessPopUp(const Point & pt);
virtual void Paint(Draw& w);
virtual void LeftDown(Point, dword);
virtual void LeftDouble(Point p, dword);
virtual void LeftUp(Point, dword);
virtual void MiddleDown(Point, dword);
virtual void MouseMove(Point, dword);
virtual void MiddleUp(Point, dword);
public: // my fix
virtual void RightDown(Point, dword);
private:
virtual void RightUp(Point, dword);
virtual void MouseLeave();
virtual void MouseWheel(Point, int zdelta, dword);
virtual bool Key(dword key, int count);
virtual void GotFocus();
virtual void LostFocus();
void DoMouseAction(bool down, Point pt,
you can see a lot of the function are private when they are virtual.
I needed to use some of them.., not without modification..
Is this ok?
|
|
|
Re: design flaw in scatterctrl? [message #49825 is a reply to message #49824] |
Sat, 12 May 2018 21:18   |
 |
Klugier
Messages: 1099 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello aftershock,
When package maintainer decided to follow your change he needs to make all virtual methods public. I do not see reason to change only one specific method that you need.
So the fix should look like this:
public: /* Ctrl */
void Paint(Draw& w) override;
void LeftDown(Point, dword) override;
void LeftDouble(Point p, dword) override;
void LeftUp(Point, dword) override;
void MiddleDown(Point, dword) override;
void MouseMove(Point, dword) override;
void MiddleUp(Point, dword) override;
void RightDown(Point, dword) override;
void RightUp(Point, dword) override;
void MouseLeave() override;
void MouseWheel(Point, int zdelta, dword) override;
bool Key(dword key, int count) override;
void GotFocus() override;
void LostFocus() override;
private:
Koldo, you can start using override statement instead of adding virtual. It guarantees on the compilation level that method is overridden.
Sincerely,
Klugier
U++ - one framework to rule them all.
[Updated on: Sat, 12 May 2018 21:25] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 12:32:42 CEST 2025
Total time taken to generate the page: 0.00494 seconds
|