Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Overriding Display methods too complicated due to high amount of arguments (Making Display class easier to use)
Re: Overriding Display methods too complicated due to high amount of arguments [message #55205 is a reply to message #55204] |
Sun, 18 October 2020 19:16   |
Oblivion
Messages: 1206 Registered: August 2007
|
Senior Contributor |
|
|
As a user, my opinion:
I personally don't find Display paint methods confusing at all.
If the existing methods are going to be deprecated, however, I would suggest passing the reference of Draw and Value in DisplayDrawContext:
struct DisplayDrawContext
{
Draw& draw;
const Value& value;
Rect rect;
Color ink = SColorText;
Color paper = SColorPaper;
dword style = 0;
DisplayDrawContext(Drww& w, const Value& q, const Rect& r) : draw(w), value(q), rect(r) {}
};
MyDisplay().Paint(DisplayDrawContext(w, q, r));
Copying the value is not always a good idea as it can contain large stuff.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Sun, 18 October 2020 19:35] Report message to a moderator
|
|
|
 |
|
Overriding Display methods too complicated due to high amount of arguments
By: Klugier on Sun, 18 October 2020 00:01
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: Oblivion on Sun, 18 October 2020 19:16
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: mirek on Mon, 19 October 2020 15:59
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: Oblivion on Mon, 19 October 2020 16:53
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: mirek on Sat, 14 November 2020 10:02
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: Oblivion on Sat, 14 November 2020 10:14
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: Klugier on Sat, 14 November 2020 14:23
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: mirek on Sat, 14 November 2020 14:33
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: mirek on Sat, 14 November 2020 14:38
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: Klugier on Sat, 14 November 2020 20:29
|
 |
|
Re: Overriding Display methods too complicated due to high amount of arguments
By: mirek on Sun, 15 November 2020 00:03
|
Goto Forum:
Current Time: Tue May 13 23:46:03 CEST 2025
Total time taken to generate the page: 0.02316 seconds
|