Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SlimTimmy

"Creating 3D Tools with MFC" in C#?

This topic is 5329 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I read this tutorial: http://www.gamedev.net/reference/programming/features/3dmfc/ But I don''t like this MFC-stuff. I think, that I could do something like this with the new .NET Framework and C#. But you can''t use splitters in a way you could with the MFC, isn''t it? How can I develop such an editor with .NET an C#? Which Classes do I need to create those 4 views for example?

Share this post


Link to post
Share on other sites
Advertisement
Actually you don''t have ( and you can''t ) add splitter using the dialog editor ( i''m talking for vc6 ) you have to create a splitview and assign to each one of them a view class , the process is pretty simple ( once you know ho to do )
go here http://www.codeproject.com/ you will find a lot of source code and examples


Share this post


Link to post
Share on other sites
Yes!

I have figured this out, I made a "BuddySplitter class"


using System;
using System.Windows.Forms;

namespace BDB
{
/// <summary>A splitter that moves another splitter simultaniously</summary>

public class BuddySplitter : Splitter
{
private BuddySplitter buddy;
/// <summary>A splitter to move simultaniously with this splitter</summary>

public BuddySplitter Buddy
{
get { return buddy; }
set
{
buddy = value;
value.buddy = this;
}
}

private bool called = false;

protected override void OnMouseDown(MouseEventArgs e)
{
if(!called)
{
called = true;
base.OnMouseDown(e);
if(buddy != null)
buddy.OnMouseDown(e);
called = false;
}
}

protected override void OnMouseMove(MouseEventArgs e)
{
if(!called)
{
called = true;
base.OnMouseMove(e);
if(buddy != null)
buddy.OnMouseMove(e);
called = false;
}
}

protected override void OnMouseUp(MouseEventArgs e)
{
if(!called)
{
called = true;
base.OnMouseUp(e);
if(buddy != null)
buddy.OnMouseUp(e);
called = false;
}
}
}
}


e-mail snprbob@optonline.net if u want 2 send me money ;-)

Share this post


Link to post
Share on other sites
oh, I probably should have mentioned that in order to use this:

Insert a panel or whatever control u want.
Dock it.
Dock a normal splitter to the same side as that control.
Insert a control in both halfs.
Dock them.
Insert a buddy splitter on both sides and dock them to the inner docked controls.
After your call to InitalizeComponent, set one of their buddies to be the other control.


Its that simple!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!