Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Ctrl Transparency, backpaint, ...
Ctrl Transparency, backpaint, ... [message #56553] Wed, 24 March 2021 23:49 Go to next message
Didier is currently offline  Didier
Messages: 681
Registered: November 2008
Location: France
Contributor
Hello,

I am struggling with some painting issues for some time now.
All I want to do is to have some transparent widgets or widgets dislaying a background image with aplha in order to see the Topwindow background

Everything is drawn well on start and when resizing but when I hover over a widget THAT IS DISPLAYED over an alpha image, then some glitches appear.
The same happens when I refresh the layout
It looks like the Topwindow background is not redrawn as it should be.

I uploaded a test case:
* just hover over the option in the tab ==> option glitch appears
* Change selected row inside Grid : call Refresh() of the tab ==> whole background is glitch !
* Once glitch is present, just change tab or resize window and everything comes back to normal

How can I correct this ?

[Edit] removed 7z file

[Updated on: Thu, 25 March 2021 19:29]

Report message to a moderator

Re: Ctrl Transparency, backpaint, ... [message #56554 is a reply to message #56553] Wed, 24 March 2021 23:54 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 681
Registered: November 2008
Location: France
Contributor
Here are three images of the test case
* left : is what it should look like
* middle : glitch on option widget
* right : glitch on whole tab background
index.php?t=getfile&id=6402&private=0

[Updated on: Thu, 25 March 2021 19:28]

Report message to a moderator

Re: Ctrl Transparency, backpaint, ... [message #56559 is a reply to message #56554] Thu, 25 March 2021 11:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
There is missing TestTransaprency.upp in the package? why?
Re: Ctrl Transparency, backpaint, ... [message #56560 is a reply to message #56559] Thu, 25 March 2021 11:52 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 681
Registered: November 2008
Location: France
Contributor
Oups, made the zip using the export code function
I will send .upp file
Re: Ctrl Transparency, backpaint, ... [message #56563 is a reply to message #56560] Thu, 25 March 2021 19:27 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 681
Registered: November 2008
Location: France
Contributor
Here is the correct package

I tried everything I found : backpaint,transparent, Parent->Refresh(), ...
I am missing something Crying or Very Sad

[Updated on: Thu, 25 March 2021 19:30]

Report message to a moderator

Re: Ctrl Transparency, backpaint, ... [message #56566 is a reply to message #56563] Thu, 25 March 2021 20:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Should be now fixed. There was a problem in TabCtrl.
Re: Ctrl Transparency, backpaint, ... [message #56577 is a reply to message #56566] Fri, 26 March 2021 10:41 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 681
Registered: November 2008
Location: France
Contributor
Great !!!
i will look into this tonight Smile
Thanks

What is the general stratégy to deal with these matters in widgets ?
There are some methods existting in Ctrl:
* Transparent() ==> set a bool that can be used in other places
* Backpaint() : not sure what this is intended for (although I expected using TransparentBackpaint() would have fixed my problem ... but it didn't)

So I am lost on how/when/why use these methods

I would like my widgets to be fully compatible with Upp, so I have to manage transparency correctly (and maybe I could then propose some corrections : Ex I found out that frame doesn't manage transparency at all while Splitter does
Re: Ctrl Transparency, backpaint, ... [message #56578 is a reply to message #56577] Fri, 26 March 2021 11:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Didier wrote on Fri, 26 March 2021 10:41
Great !!!
i will look into this tonight Smile
Thanks

What is the general stratégy to deal with these matters in widgets ?
There are some methods existting in Ctrl:
* Transparent() ==> set a bool that can be used in other places


Transparent was the flag that was originally intended as a way for widget to say to CtrlCore painting code that it should be treated as transparent. Over time, it evolved to be the flag for the widget as well - widget sets its default state in contructor and user code can change that. Widget however needs to honor the flag in its painting code (most of them do now, TabCtrl did not, that is what lead to the problem).

Note that from the CtrlCore perspective Transparent flag is mainly the optimization - it reduces the number of widgets that have to be repainted.

Quote:

* Backpaint() : not sure what this is intended for (although I expected using TransparentBackpaint() would have fixed my problem ... but it didn't)


You can safely forget about these. These were in the past methods to optimize things, today everything is set by default to backpaint.

Mirek
Re: Ctrl Transparency, backpaint, ... [message #56579 is a reply to message #56577] Fri, 26 March 2021 12:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
BTW, while working on it, I did not like how these WithXXXLayout<ParentCtrl> (interesting usage BTW) looked in the layout designer, so I spent a couple of hours fixing that. I would appreciate if you looked at it....

Mirek
Re: Ctrl Transparency, backpaint, ... [message #56582 is a reply to message #56579] Fri, 26 March 2021 14:11 Go to previous message
Didier is currently offline  Didier
Messages: 681
Registered: November 2008
Location: France
Contributor
Hello Mirek,

1 - Ide doesn't compile du to some pen related code (I looks like accidently pasted code) i GtkEvent.cpp L428 so I commented it out and it compiled and morked after
void Ctrl::Proc()
{
#ifdef LOG_EVENTS
	String ev = "?";
	Tuple2<int, const char *> *f = FindTuple(xEvent, __countof(xEvent), CurrentEvent.type);
	if(f)
		ev = f->b;
	LOG("> PROCESS EVENT " << Upp::Name(this) << " " << ev);
	ProcStop tm;
	tm.ev = ev;
#endif
	if(!IsOpen())
		return;
	Ptr<Ctrl> _this = this;
	bool pressed = false;
	int  kv, hw;
	static int clicktime = msecs() - 100000;
/*   ------------------------------
	pen = CurrentEvent.pen;
	pen_barrel = CurrentEvent.pen_barrel;
	pen_inverted = CurrentEvent.pen_inverted;
	pen_eraser = CurrentEvent.pen_eraser;
	pen_pressure = CurrentEvent.pen_pressure;
	pen_rotation = CurrentEvent.pen_rotation;
	pen_tilt = CurrentEvent.pen_tilt;
-----------------------------------
*/
	switch(CurrentEvent.type) {
	case GDK_MOTION_NOTIFY:
		GtkMouseEvent(MOUSEMOVE, MOUSEMOVE, 0);
		break;


For the rest, transparency works fine now and layout designer also works fine now
Thanks Thumbs Up

Quote:
interesting usage BTW)

I don't like to code my GUIs so I use layout everytime I can

[Updated on: Fri, 26 March 2021 14:12]

Report message to a moderator

Previous Topic: K_CTRL_SEMICOLON and K_CTRL_PERIOD keys share the same constant value on Win32
Next Topic: *Hold() mouse events only work for widgets at top-left corner
Goto Forum:
  


Current Time: Fri Jun 21 23:00:21 CEST 2024

Total time taken to generate the page: 0.01743 seconds