Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Wrapper Control Example (Read 4216 times)
alfadata
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 7th, 2006
Wrapper Control Example
Jun 12th, 2006 at 1:41pm
Print Post  
Does anyone have an example wrapper control that works with JavaScript / Client-Side events? We wish to use the BosDeleting event however are not having great success.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Wrapper Control Example
Reply #1 - Jun 12th, 2006 at 1:54pm
Print Post  
It might be easier to set KbdActive = false and process the KeyDown event yourself instead of creating a wrapper control.

Stoyan
  
Back to top
 
IP Logged
 
alfadata
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 7th, 2006
Re: Wrapper Control Example
Reply #2 - Jun 12th, 2006 at 2:11pm
Print Post  
This would only capture the fact the keyboard was used. We are looking to have control of the actual FlowChart events and elements on the client-side prior to the postback.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Wrapper Control Example
Reply #3 - Jun 12th, 2006 at 2:38pm
Print Post  
Are you talking about the ActiveX version ? You can handle most of the FlowChartX events from JavaScript; only the validation events that have output parameters cannot be handled.
  
Back to top
 
IP Logged
 
alfadata
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jun 7th, 2006
Re: Wrapper Control Example
Reply #4 - Jun 12th, 2006 at 3:23pm
Print Post  
We are using the .NET control. We are trying to control what boxes the user has the ability to delete and potentially control what boxes can be connected to each other.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Wrapper Control Example
Reply #5 - Jun 12th, 2006 at 6:08pm
Print Post  
Ok, I've played a bit with this and created the following wrapper ontrol:

[code]
namespace FcnetWrap
{
/// <summary>
/// Summary description for FcnetHandler.
/// </summary>
public class FcnetHandler : System.Windows.Forms.UserControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public FcnetHandler()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();

// TODO: Add any initialization after the InitializeComponent call
flowChart1.BoxCreating += new BoxConfirmation(flowChart_BoxCreating);
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Component Designer generated code
#endregion

private MindFusion.FlowChartX.FlowChart flowChart1;

private void flowChart_BoxCreating(object sender, BoxConfirmArgs e)
{
MessageBox.Show("BoxCreating raised");
}
}
}
[/code]
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Wrapper Control Example
Reply #6 - Jun 12th, 2006 at 6:20pm
Print Post  
Now adding this

<OBJECT id=fch height=100 width=100 classid=FcnetWrap.dll#FcnetWrap.FcnetHandler VIEWASTEXT>
</OBJECT>

to the ClientSvr example and removing the original OBJECt tag referring to FlowChart.NET.dll seems to work fine. It seems the .NET loader manages to find and download FlowChart.NET dll when the FcnetWrap.dll requests it. I had deleted all files from the "Temporary internet files" folder, and used

gacutil /cdl

to remove everything from the GAC download cache before trying this. The wrapper control loads fine and displays the message box when the CreatingBox event is raised.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Wrapper Control Example
Reply #7 - Jun 12th, 2006 at 6:26pm
Print Post  
As for handling events from JavaScript, you might have to declare a COM interface describing the events you are interested in and implementing it in the wrapper control. Then when a FlowChart.NET event is raised, the wrapper control should fire the corresponding COM event. An example is available here:

http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint