Archived

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

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

This topic is 5116 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
Panels?

--------
"Hey, what about those baggy pants you kids are wearin'' these days? Aren''t they hip and cool and poppin'' fresh?"-Peter Griffin
"Everytime I see an M followed by a dollar sign I just say "oh god" and go to the next post."-Neurokaotix
the D programming language|google|msdn|XLib reference manual

Share this post


Link to post
Share on other sites
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
You could use Panels, PictureBoxes, ANY CONTROL, but I would certainly advoid using forms because they are intended to be root level controls (I do not even know if they would work properly).

Personally I would recommend deriving a class called Viewport or something from a panel or picture box so that you can generalize your code for manipulating stuff in the seperate sections.

The appearance of the sliders is defined by what appears on either side of the slider, or the code you place in the sliders draw code. You will see that if you put a picture box on either side of the slider that it looks much like the MFC sliders.

I think you just need a more GUI experiance, because beyond the BuddySplitter these are really simple problems. I have already said too much.

-SniperBoB-

Share this post


Link to post
Share on other sites