- Welcome, Guest. Please Login or Register
MindFusion  
  We have released initial version of MindFusion.Scheduling library for HTML5 & JavaScript.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
How might one maximise/minimise/restore a floating DockItem ?
Read 790 times

MarkAGr   Offline
YaBB Newbies
*
Posts: 29
Gender: male
Europe
New to it all, really
frustrating at the moment.


   
     
 
How might one maximise/minimise/restore a floating DockItem ?
Aug 2nd, 2018 at 9:31pm
 
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
 
 
 
IP Logged    
 
     

Slavcho   Offline
YaBB Moderator
*****
Posts: 1566
Gender: male
tech.support


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #1 - Aug 6th, 2018 at 6:05pm
 
You can get a reference to a DockItem's container like this -

Code:
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
 
 
 
IP Logged    
 
     

MarkAGr   Offline
YaBB Newbies
*
Posts: 29
Gender: male
Europe
New to it all, really
frustrating at the moment.


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #2 - Aug 11th, 2018 at 3:23pm
 
Thank You ... much appreciated Smiley
 
 
 
IP Logged    
 
     

MarkAGr   Offline
YaBB Newbies
*
Posts: 29
Gender: male
Europe
New to it all, really
frustrating at the moment.


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #3 - Aug 21st, 2018 at 5:39pm
 
Any advances?
 
 
 
IP Logged    
 
     

MarkAGr   Offline
YaBB Newbies
*
Posts: 29
Gender: male
Europe
New to it all, really
frustrating at the moment.


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #4 - Aug 31st, 2018 at 9:15pm
 
Any Luck Yet?
 
 
 
IP Logged    
 
     

Slavcho   Offline
YaBB Moderator
*****
Posts: 1566
Gender: male
tech.support


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #5 - Sep 4th, 2018 at 9:18am
 
Our developer is working on it.
 
 
 
IP Logged    
 
     

MarkAGr   Offline
YaBB Newbies
*
Posts: 29
Gender: male
Europe
New to it all, really
frustrating at the moment.


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #6 - Sep 4th, 2018 at 5:49pm
 
(y) (y) Thanks Guys!
 
 
 
IP Logged    
 
     

Slavcho   Offline
YaBB Moderator
*****
Posts: 1566
Gender: male
tech.support


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #7 - Sep 10th, 2018 at 10:59am
 
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:
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
 
 
 
IP Logged    
 
     

MarkAGr   Offline
YaBB Newbies
*
Posts: 29
Gender: male
Europe
New to it all, really
frustrating at the moment.


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #8 - Sep 10th, 2018 at 2:40pm
 
Ooooh nice!
I'm going to need some time to mull over these.

Thank You Smiley
 
 
 
IP Logged    
 
     

MarkAGr   Offline
YaBB Newbies
*
Posts: 29
Gender: male
Europe
New to it all, really
frustrating at the moment.


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #9 - Sep 11th, 2018 at 9:52am
 
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
 
 
 
IP Logged    
 
     

Slavcho   Offline
YaBB Moderator
*****
Posts: 1566
Gender: male
tech.support


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #10 - Sep 12th, 2018 at 11:11am
 
Hi,

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

Regards,
Slavcho
 
 
 
IP Logged    
 
     

MarkAGr   Offline
YaBB Newbies
*
Posts: 29
Gender: male
Europe
New to it all, really
frustrating at the moment.


   
     
 
Re: How might one maximise/minimise/restore a floating DockItem ?
Reply #11 - Sep 13th, 2018 at 1:10pm
 
Wey hey! This works gr8!

Thanks!!!

8^)
Mark
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print