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++ Library : Other (not classified elsewhere) » how can I draw on the top of a dockwindow?
how can I draw on the top of a dockwindow? [message #50831] Sun, 06 January 2019 15:18 Go to next message
aftershock is currently offline  aftershock
Messages: 134
Registered: May 2008
Experienced Member
Hi,

I have tried to draw on the top of a dockwindow
I have something like this.
class main : public DockWindow
{


and
void main::Paint(Draw& w)
{
w.DrawEllipse(dot_x,dot_y,12,12,Black());
DockWindow::Paint(w);

}
but this does not work unless there is empty space between the docked windows..
the size of the Window tends to be zero....if everything is docked.
I would like to draw on the top of them.

A.
Re: how can I draw on the top of a dockwindow? [message #50839 is a reply to message #50831] Tue, 08 January 2019 09:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11963
Registered: November 2005
Ultimate Member
aftershock wrote on Sun, 06 January 2019 15:18
Hi,

I have tried to draw on the top of a dockwindow
I have something like this.
class main : public DockWindow
{


and
void main::Paint(Draw& w)
{
w.DrawEllipse(dot_x,dot_y,12,12,Black());
DockWindow::Paint(w);

}
but this does not work unless there is empty space between the docked windows..
the size of the Window tends to be zero....if everything is docked.
I would like to draw on the top of them.

A.


Hi,

not exactly sure if that is supported at the moment, BUT the obvious quirk in above code is that DockWindo::Paint overpaints your ellipse. Try to swap those lines.

Mirek
Re: how can I draw on the top of a dockwindow? [message #50842 is a reply to message #50839] Tue, 08 January 2019 15:38 Go to previous messageGo to next message
aftershock is currently offline  aftershock
Messages: 134
Registered: May 2008
Experienced Member
That does not work.
Re: how can I draw on the top of a dockwindow? [message #50843 is a reply to message #50842] Tue, 08 January 2019 15:49 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 567
Registered: August 2007
Location: Turkey
Contributor
Hello aftershock,

DockWindow acts as a container. The way to go is adding a ctrl to dockwindow (not as DockableCtrl but using a plain ctrl. E.g. Ctrl::Add(myctrl.SizePos())), and overriding its Paint method. Have you tried that?

Best regards,
Oblivion

[Updated on: Tue, 08 January 2019 15:51]

Report message to a moderator

Re: how can I draw on the top of a dockwindow? [message #50844 is a reply to message #50843] Tue, 08 January 2019 17:06 Go to previous messageGo to next message
aftershock is currently offline  aftershock
Messages: 134
Registered: May 2008
Experienced Member
Oblivion wrote on Tue, 08 January 2019 15:49
Hello aftershock,

DockWindow acts as a container. The way to go is adding a ctrl to dockwindow (not as DockableCtrl but using a plain ctrl. E.g. Ctrl::Add(myctrl.SizePos())), and overriding its Paint method. Have you tried that?

Best regards,
Oblivion


No...but I have just done so... Same result..
The window size is the remaining part of the full window where there are no docked windows...
Re: how can I draw on the top of a dockwindow? [message #50845 is a reply to message #50844] Tue, 08 January 2019 17:13 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 567
Registered: August 2007
Location: Turkey
Contributor
Ok, did you use SizeHint() for dockable windows. You can specify min and max sizes for dockable windows so that they cannot cover the whole area.


And if you can post a basic example (prefeably zipped) I can examine it.

Best regards,
Oblivion
Re: how can I draw on the top of a dockwindow? [message #50846 is a reply to message #50845] Tue, 08 January 2019 17:18 Go to previous messageGo to next message
aftershock is currently offline  aftershock
Messages: 134
Registered: May 2008
Experienced Member
I would like to draw something on the top of the whole window...
treating the whole window as one canvas..
I would draw on the docked window as well
Re: how can I draw on the top of a dockwindow? [message #50847 is a reply to message #50846] Tue, 08 January 2019 17:28 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 567
Registered: August 2007
Location: Turkey
Contributor
Ok,
Something like this?

index.php?t=getfile&id=5732&private=0


This is a modified version of upp/reference/DockingExample: ( https://www.ultimatepp.org/reference$DockingExample1$en-us.h tml)

Add the below code (no any other alterations needed):

	virtual void Paint(Draw& w)
	{
		DockWindow::Paint(w);
		w.DrawRect(GetSize(), Gray());
		w.DrawImage(GetSize() / 2, CtrlImg::reporticon());

	}



Is this what you need?

Best regards,
Oblivion

[Updated on: Tue, 08 January 2019 17:31]

Report message to a moderator

Re: how can I draw on the top of a dockwindow? [message #50848 is a reply to message #50847] Tue, 08 January 2019 22:47 Go to previous messageGo to next message
aftershock is currently offline  aftershock
Messages: 134
Registered: May 2008
Experienced Member
This is what happens, yes.. but this is not what I would like to achieve
but I would like to draw on the top of the docked windows as well
your code should grey the whole window....it does not do that.
R sign should dominate the whole window


You just drew on the remaining area as far as I can see,

Can you do it so...that the whole window is treated as one...
E,g, your roman image would appear on the top of roman number table?

[Updated on: Tue, 08 January 2019 22:51]

Report message to a moderator

Re: how can I draw on the top of a dockwindow? [message #50883 is a reply to message #50848] Fri, 11 January 2019 16:43 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 478
Registered: November 2008
Location: France
Senior Member
Hi,

Have you tried adding simply adding a static ctrl (which doesn't catch mouse events) over the dockwindow.
I think this should work.
Re: how can I draw on the top of a dockwindow? [message #50889 is a reply to message #50883] Sat, 12 January 2019 13:46 Go to previous messageGo to next message
aftershock is currently offline  aftershock
Messages: 134
Registered: May 2008
Experienced Member
I think that was recommended earlier.
Re: how can I draw on the top of a dockwindow? [message #50900 is a reply to message #50889] Sun, 13 January 2019 13:43 Go to previous message
Didier is currently offline  Didier
Messages: 478
Registered: November 2008
Location: France
Senior Member
Hello aftershock,

rather than a long discussion, I think the following example, which illustrates my proposition, is what you need

Previous Topic: BUG dialog does not close
Next Topic: Using VisualStudio as a main IDE
Goto Forum:
  


Current Time: Tue Jul 23 03:47:07 CEST 2019

Total time taken to generate the page: 0.00864 seconds