Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) How might one maximise/minimise/restore a floating DockItem ? (Read 4176 times)
MarkAGr
YaBB Newbies
*
Offline


New to it all, really
frustrating at the moment.

Posts: 29
Location: Europe
Joined: Nov 18th, 2017
How might one maximise/minimise/restore a floating DockItem ?
Aug 2nd, 2018 at 8:31pm
Print Post  
I was hoping to add a button to the frame ... ( can't )
or catch a double click on the title bar ... ( can't )
then call a maximise/maximise/restore method ... ( can't )

but alas ... none of those appear possible ...

8^(
Mark
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 2160
Joined: Oct 19th, 2005
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #1 - Aug 6th, 2018 at 5:05pm
Print Post  
You can get a reference to a DockItem's container like this -

Code
Select All
item.Content.ParentChanged += ContentParentChanged;

void ContentParentChanged(object sender, EventArgs e)
{
	var control = sender as Control;
	var parent = control.Parent as Control;
	if (parent != null)
	{
		var btn = new System.Windows.Forms.Button { Text = "+" };
		parent.Controls.Add(btn);
		btn.BringToFront();
		// how do we move this to titlebar?
	}
} 



Problem is when DockItem is in floating state, its container is a standard Form object and the added child control goes in form's client area below title bar, and not inside the bar. We'll look for some way to allow customizing it in next few days.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
MarkAGr
YaBB Newbies
*
Offline


New to it all, really
frustrating at the moment.

Posts: 29
Location: Europe
Joined: Nov 18th, 2017
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #2 - Aug 11th, 2018 at 2:23pm
Print Post  
Thank You ... much appreciated Smiley
  
Back to top
 
IP Logged
 
MarkAGr
YaBB Newbies
*
Offline


New to it all, really
frustrating at the moment.

Posts: 29
Location: Europe
Joined: Nov 18th, 2017
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #3 - Aug 21st, 2018 at 4:39pm
Print Post  
Any advances?
  
Back to top
 
IP Logged
 
MarkAGr
YaBB Newbies
*
Offline


New to it all, really
frustrating at the moment.

Posts: 29
Location: Europe
Joined: Nov 18th, 2017
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #4 - Aug 31st, 2018 at 8:15pm
Print Post  
Any Luck Yet?
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 2160
Joined: Oct 19th, 2005
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #5 - Sep 4th, 2018 at 8:18am
Print Post  
Our developer is working on it.
  
Back to top
 
IP Logged
 
MarkAGr
YaBB Newbies
*
Offline


New to it all, really
frustrating at the moment.

Posts: 29
Location: Europe
Joined: Nov 18th, 2017
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #6 - Sep 4th, 2018 at 4:49pm
Print Post  
(y) (y) Thanks Guys!
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 2160
Joined: Oct 19th, 2005
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #7 - Sep 10th, 2018 at 9:59am
Print Post  
Try this build -
https://mindfusion.eu/_beta/dock_tbar_buttons.zip

It adds a TitleBarButton class and three list properties used as titlebar templates,  where you can add buttons depending on the dock-item state: DockedTitleBarButtons, UndockedTitleBarButtons, TabbedTitleBarButtons. You can add a custom button like this -

Code
Select All
var myTitleButton = new TitleBarButton();
myTitleButton.ButtonPen = new Pen(Color.Red);
myTitleButton.ButtonImage = Image.FromFile(...);
//myTitleButton.Draw += MyTitleButton_Draw;
myTitleButton.OnClick += MyTitleButton_OnClick;
dockControl1.DockedTitleBarButtons.Add(myTitleButton);

private void MyTitleButton_OnClick(object sender, MouseEventArgs e)
{
  MessageBox.Show("Custom button clicked", "Custom", MessageBoxButtons.OK);
}

private void MyTitleButton_Draw(object source, DrawEventArgs e)
{
  var tbb = source as TitleBarButton;
  if (tbb == null)
    return;
  e.Graphics.DrawArc(tbb.ButtonPen, new Rectangle(tbb.X, tbb.Y, tbb.Width, tbb.Height), 0, 360);
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
MarkAGr
YaBB Newbies
*
Offline


New to it all, really
frustrating at the moment.

Posts: 29
Location: Europe
Joined: Nov 18th, 2017
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #8 - Sep 10th, 2018 at 1:40pm
Print Post  
Ooooh nice!
I'm going to need some time to mull over these.

Thank You Smiley
  
Back to top
 
IP Logged
 
MarkAGr
YaBB Newbies
*
Offline


New to it all, really
frustrating at the moment.

Posts: 29
Location: Europe
Joined: Nov 18th, 2017
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #9 - Sep 11th, 2018 at 8:52am
Print Post  
Hi ...

There appears to be just one or two minor problems ...

1) an exception is caused if there's nothing attached to the click event

There should be an event attached to the button - so that's not really a hardship -

2) the click event triggers whether the mouse is over the button or not when the button is released.

On checking, this might be the mindfusion standard way of doing it ... I was under the impression that a click event isn't activated if the cursor is no longer over the button when the mouse button is lifted. - I could be wrong.

8^)
Mark
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 2160
Joined: Oct 19th, 2005
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #10 - Sep 12th, 2018 at 10:11am
Print Post  
Hi,

New build here should fix that -
https://mindfusion.eu/_beta/dock_tbar_buttons.zip

Regards,
Slavcho
  
Back to top
 
IP Logged
 
MarkAGr
YaBB Newbies
*
Offline


New to it all, really
frustrating at the moment.

Posts: 29
Location: Europe
Joined: Nov 18th, 2017
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #11 - Sep 13th, 2018 at 12:10pm
Print Post  
Wey hey! This works gr8!

Thanks!!!

8^)
Mark
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint