//
//	VWUI Dialogs SampleMenuComamnd.cpp
//
//	Main entry point for VectorWorks Plug-in Menu Command code.
//
//	Copyright © Nemetschek North America, Inc  2005.
//	All Rights Reserved.


#include "StdAfx.h"

#include "UI/SampleDlg1.h"
#include "UI/SampleDlg2.h"
#include "UI/SampleDlg3.h"
#include "UI/SampleDlg4.h"

// Because we include MenuMain.cpp in the project, the low level setup operations
// are performed on our behalf by SDK code. The CallBackPtr is already stored in gCBP
// and can be used throughout this external

// See MiniCADHookIntf.h for a description


long MenuMain(long action, long message1, long& userData)
{
	::GS_InitializeVCOM( gCBP );

	switch (action) {
		case kMenuInitGlobals: {
				/*
					This action is called when an overlay is activated and serves the
					primary purpose of allowing the external function to define any
					defaults and global information and to initialize data space that
					may be stored in userData.
 				*/


				break;
			}
		case kMenuDisposeGlobals: {
				/*
					This action is called when a workspace is deactivated and serves
					the primary purpose of allowing the external function to dispose
					data space that may be stored in userData.
 				*/


				break;
			}
		case kMenuDoInterface: {
				MenuChunkInfo*	pChunkInfo		= (MenuChunkInfo*) message1;
				switch( pChunkInfo->chunkIndex ) {
					case 1:	{
						UI::CSampleDlg1		dlg;
						dlg.RunDialogLayout();
					} break;
					case 2:	{
						UI::CSampleDlg2		dlg;
						dlg.RunDialogLayout();
					} break;
					case 3:	{
						UI::CSampleDlg3		dlg;
						dlg.RunDialogLayout();
					} break;
					case 4:	{
						UI::CSampleDlg4		dlg;
						dlg.RunDialogLayout();
					} break;
				}
			}
	}
 	return 0L;
}

long DangerousMenuMain(long /*action*/, long /*message1*/, long & /*userData*/)
{
	// This entry point gets kMenuCheckHilite & kMenuNotify messages, which must be handled very carefully
	return 0L;
}
