Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) There a way to have a tablenode handle its events? (Read 9795 times)
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: There a way to have a tablenode handle its eve
Reply #15 - Mar 19th, 2008 at 11:38pm
Print Post  
Stoyo wrote on Mar 19th, 2008 at 2:57pm:
You'll just need to change two templates instead of one. This guide shows how to do that using Blend:
http://www.designerwpf.com/2008/02/07/the-wpf-designers-guide-to-styling-the-com...

I hope that helps,
Stoyan


I tried working on the textbox and combobox using the Blend app, but man oh man, is it me or is that thing the most convoluted thing ever made? I have no idea how it works and I am fairly savvy and have used complex authoring tools such as Maya and Softimage for years.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: There a way to have a tablenode handle its eve
Reply #16 - Mar 20th, 2008 at 9:04am
Print Post  
8) You can always define the template in plain XAML. You can find a sample template here:
http://www.codeproject.com/KB/WPF/WPFBusinessAppsPartTwo.aspx

Stoyan
  
Back to top
 
IP Logged
 
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: There a way to have a tablenode handle its eve
Reply #17 - Mar 20th, 2008 at 1:02pm
Print Post  
Stoyo wrote on Mar 20th, 2008 at 9:04am:
8) You can always define the template in plain XAML. You can find a sample template here:
http://www.codeproject.com/KB/WPF/WPFBusinessAppsPartTwo.aspx

Stoyan


I am trying it out using XAMLPad. I think that Blend was just so overhwelmingly confusing and poorly designed that it's quite a put off. You can tell that whomever designed Blend really thought they were clever, it uses so many UI constructs that are almost nice, and borrowed heavily from apps like Houdini, Maya, Softimage and many other 3D Modelling suites that came out a decade ago. Yet somehow MS managed to butcher these things and throw them all into one giant and muddled interface without providing a clean and obvious way to use them.

Oh well, XAMLPad will have to do for now.
  
Back to top
 
IP Logged
 
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: There a way to have a tablenode handle its eve
Reply #18 - Mar 20th, 2008 at 7:49pm
Print Post  
Stoyo wrote on Mar 19th, 2008 at 9:22am:
https://mindfusion.eu/_beta/fcnet503.zip

We have added CreateEditControl and DestroyEditControl events to the DiagramView class. With them, the InteractiveTable sample looks like this

Code
Select All
private void diagram_CellClicked(object sender, CellEventArgs e)
{

_comboBox.SelectedIndex = 0;

_row = e.Row;

_col = e.Column;

_table = e.Table;

diagramView.BeginEdit(e.Cell);
}

private void diagramView_CreateEditControl(object sender, InPlaceEditEventArgs e)
{

TableNode.Cell cell = e.Item as TableNode.Cell;

if (cell != null)

{


RectangleF docRect = e.Item.GetEditRect(PointF.Empty);


_comboBox.Bounds = diagramView.DocToClient(docRect);


_comboBox.Visible = true;


e.EditControl = _comboBox;



for (int i = 0; i < _comboBox.Items.Count; i++)


{



if (_comboBox.Items[i].ToString() == cell.Text)



{




_comboBox.SelectedIndex = i;




break;



}


}

}
}

private void diagramView_DestroyEditControl(object sender, InPlaceEditEventArgs e)
{

if (_col != -1 && _row != -1 && _table != null)

{


_table[_col, _row].Text =



_comboBox.Items[_comboBox.SelectedIndex].ToString();

}

_comboBox.Visible = false;
}
 



The events let you use any Windows Forms control as an editor for nodes, links and table cells. I'm afraid we don't have plans to develop combo and edit controls ourselves, so you still need to find some 3rd party controls to use as editors.

Stoyan


This has worked out quite well. The only problem i am having is that once you're in edit mode, TAB no longer takes you out of edit mode. It seems to take focus off the control but the edit mode remains and the Destroy event doesn't get fired until you click outside the cell area.
  
Back to top
 
IP Logged
 
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: There a way to have a tablenode handle its eve
Reply #19 - Mar 20th, 2008 at 8:06pm
Print Post  
Well I handled it by handling the lostfocus event and calling EndEdit on the diagram View. Works, but requires some extra code for every control being used. not a biggy, just something I wanted to mention. Thanks again!!!!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: There a way to have a tablenode handle its eve
Reply #20 - Mar 21st, 2008 at 10:44am
Print Post  
We can enable this as the default behavior. But then the user might want to copy/paste some text from a different control on the form without closing the editor, or you might use a composite control as an editor and let TAB move between the child controls there.
  
Back to top
 
IP Logged
 
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: There a way to have a tablenode handle its eve
Reply #21 - Mar 21st, 2008 at 6:42pm
Print Post  
Stoyo wrote on Mar 21st, 2008 at 10:44am:
We can enable this as the default behavior. But then the user might want to copy/paste some text from a different control on the form without closing the editor, or you might use a composite control as an editor and let TAB move between the child controls there.


Great point! You thought through it more than I did. It's fine as is then.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint