/////////////////////////////////////////////////////////////////////////////
// Name:        No names yet.
// Purpose:     Contrib. demo
// Author:      Aleksandras Gluchovas
// Modified by:
// Created:     3/01/99
// RCS-ID:      $Id: gedthandler.cpp,v 1.6 2001/04/11 15:42:06 aleksandras Exp $
// Copyright:   (c) Aleksandras Gluchovas
// Licence:   	wxWindows license
/////////////////////////////////////////////////////////////////////////////
 
#ifdef __GNUG__
#pragma implementation "objstore.h"
// #pragma interface
#endif

// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "gedthandler.h"
#include "XRectEditor.h"
#include "XSelectionEditor.h"
#include "XCellBackground.h"

#include "wx/fl/dyntbar.h"
#include "wx/fl/dyntbarhnd.h"

/***** Implementation for class XGenericEditorHandler *****/

static wxCommandInfo _gEditMenuCommands[] = {

	wxCommandInfo( XGenericEditorHandler::EDIT_UNDO, "&Undo", "", "Ctrl+Z|Alt+BACK" ), 
	wxCommandInfo( XGenericEditorHandler::EDIT_REDO, "&Redo", "", "Ctrl+A|Ctrl+BACK" ), 
	wxCommandInfo( -1, "SEPARATOR" ), 

	wxCommandInfo( XGenericEditorHandler::EDIT_CUT,			"Cu&t",			"", "Ctrl+X" ), 
	wxCommandInfo( XGenericEditorHandler::EDIT_COPY,		"&Copy",		"", "Ctrl+C" ), 
	wxCommandInfo( XGenericEditorHandler::EDIT_PASTE,		"&Paste",		"", "Ctrl+V" ), 
	wxCommandInfo( XGenericEditorHandler::EDIT_DELETE,		"&Delete",		"", "" ), 
	wxCommandInfo( XGenericEditorHandler::EDIT_SELECT_ALL,	"Select a&ll",	"", "" ), 

	wxCommandInfo( 0, "" ) // terminator
};

static wxCommandInfo _gAlignSubMenuCommands[] = {

	wxCommandInfo( XGenericEditorHandler::LAYOUT_ALIGN_LEFT,   "&Left",   "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_ALIGN_RIGHT,  "&Right",  "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_ALIGN_TOP,    "&Top",    "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_ALIGN_BOTTOM, "&Bottom", "", "" ), 

	wxCommandInfo( 0, "" ) // terminator
};

static wxCommandInfo _gCenterSubMenuCommands[] = {

	wxCommandInfo( XGenericEditorHandler::LAYOUT_CENTER_VERTICAL,   "&Vertically",   "", "" ),
	wxCommandInfo( XGenericEditorHandler::LAYOUT_CENTER_HORIZONTAL, "&Horizontally", "", "" ),

	wxCommandInfo( 0, "" ) // terminator
};

static wxCommandInfo _gArrangeSubMenuCommands[] = {

	wxCommandInfo( XGenericEditorHandler::LAYOUT_ARRANGE_RIGHT,  "&Right", "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_ARRANGE_BOTTOM, "&Bottom", "", "" ), 

	wxCommandInfo( 0, "" ) // terminator
};

static wxCommandInfo _gSameSubMenuCommands[] = {

	wxCommandInfo( XGenericEditorHandler::LAYOUT_SAME_WIDTH,  "&Width", "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_SAME_HEIGHT, "&Height", "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_SAME_BOTH,   "Width &and &height", "", "" ), 

	wxCommandInfo( 0, "" ) // terminator
};


static wxCommandInfo _gSpaceSubMenuCommands[] = {

	wxCommandInfo( XGenericEditorHandler::LAYOUT_SPACE_ACROSS, "&Across", "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_SPACE_DOWN,   "&Down", "", "" ), 

	wxCommandInfo( 0, "" ) // terminator
};

static wxCommandInfo _gFlipSubMenuCommands[] = {

	wxCommandInfo( XGenericEditorHandler::LAYOUT_FLIP_HORIZONTAL, "&Horizontal", "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_FLIP_VERTICAL,   "&Vertical", "", "" ), 

	wxCommandInfo( 0, "" ) // terminator
};

static wxCommandInfo _gLayoutMenuCommands[] = {

//	wxCommandInfo( XGenericEditorHandler::LAYOUT_BRING_FRONT, "Bring to &front", "", "Ctrl+F" ), 
//	wxCommandInfo( XGenericEditorHandler::LAYOUT_SEND_BACK, "Send &back", "", "Ctrl+B" ), 
//	wxCommandInfo( XGenericEditorHandler::LAYOUT_GRID_SETTINGS, "Grid &settings...", "", "" ), 
//	wxCommandInfo( XGenericEditorHandler::EDIT_PROPERTIES, "Pr&operties", "", "" ), 

	wxCommandInfo( XGenericEditorHandler::LAYOUT_ALIGN,   "&Align",   "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_CENTER,  "&Center",  "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_ARRANGE,    "&Arrange",    "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_SAME, "&Make same size", "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_SPACE, "&Space", "", "" ), 
	wxCommandInfo( XGenericEditorHandler::LAYOUT_FLIP, "&Flip", "", "" ), 

//	wxCommandInfo( XGenericEditorHandler::LAYOUT_BRING_FRONT, "Bring to &front", "", "Ctrl+F" ), 

	wxCommandInfo( 0, "" ) // terminator
};

static wxPMMergableMenuChain _gEditorMenuChains[] = {

	wxPMMergableMenuChain( "/&Edit/Dummy",	_gEditMenuCommands ),
	wxPMMergableMenuChain( "/&Layout/", _gLayoutMenuCommands ),

	wxPMMergableMenuChain( "/&Layout/&Align/",			_gAlignSubMenuCommands ),
	wxPMMergableMenuChain( "/&Layout/&Center/",			_gCenterSubMenuCommands ),
	wxPMMergableMenuChain( "/&Layout/&Arrange/",			_gArrangeSubMenuCommands ),
	wxPMMergableMenuChain( "/&Layout/&Make same size/", _gSameSubMenuCommands ),
	wxPMMergableMenuChain( "/&Layout/&Space/",			_gSpaceSubMenuCommands ),
	wxPMMergableMenuChain( "/&Layout/&Flip/",			_gFlipSubMenuCommands ),

	wxPMMergableMenuChain( "", NULL ) // terminator
};

BEGIN_EVENT_TABLE( XGenericEditorHandler, wxEvtHandler )

	EVT_MENU( EDIT_UNDO,       XGenericEditorHandler::EditUndo )
	EVT_MENU( EDIT_REDO,       XGenericEditorHandler::EditRedo )
	EVT_MENU( EDIT_CUT,        XGenericEditorHandler::EditCut )
	EVT_MENU( EDIT_COPY,       XGenericEditorHandler::EditCopy )
	EVT_MENU( EDIT_PASTE,      XGenericEditorHandler::EditPaste )
	EVT_MENU( EDIT_DELETE,     XGenericEditorHandler::EditDelete )
	EVT_MENU( EDIT_SELECT_ALL, XGenericEditorHandler::EditSelectAll )
	EVT_MENU( EDIT_PROPERTIES, XGenericEditorHandler::EditProperties )

	EVT_UPDATE_UI( EDIT_UNDO,       XGenericEditorHandler::EditUndoUI )
	EVT_UPDATE_UI( EDIT_REDO,       XGenericEditorHandler::EditRedoUI )
	EVT_UPDATE_UI( EDIT_CUT,        XGenericEditorHandler::EditCutUI )
	EVT_UPDATE_UI( EDIT_COPY,       XGenericEditorHandler::EditCopyUI )
	EVT_UPDATE_UI( EDIT_PASTE,      XGenericEditorHandler::EditPasteUI )
	EVT_UPDATE_UI( EDIT_DELETE,     XGenericEditorHandler::EditDeleteUI )
	EVT_UPDATE_UI( EDIT_SELECT_ALL, XGenericEditorHandler::EditSelectAllUI )
	EVT_UPDATE_UI( EDIT_PROPERTIES, XGenericEditorHandler::EditPropertiesUI )

	EVT_MENU( LAYOUT_ALIGN_LEFT,   XGenericEditorHandler::LayoutAlignLeft )
	EVT_MENU( LAYOUT_ALIGN_RIGHT,  XGenericEditorHandler::LayoutAlignRight )
	EVT_MENU( LAYOUT_ALIGN_TOP,    XGenericEditorHandler::LayoutAlignTop )
	EVT_MENU( LAYOUT_ALIGN_BOTTOM, XGenericEditorHandler::LayoutAlignBottom )

	EVT_MENU( LAYOUT_CENTER_VERTICAL,   XGenericEditorHandler::LayoutCenterVertical )
	EVT_MENU( LAYOUT_CENTER_HORIZONTAL, XGenericEditorHandler::LayoutCenterHorizontal )

	EVT_MENU( LAYOUT_ARRANGE_RIGHT,  XGenericEditorHandler::LayoutArrangeRight )
	EVT_MENU( LAYOUT_ARRANGE_BOTTOM, XGenericEditorHandler::LayoutArrangeBottom )

	EVT_MENU( LAYOUT_SAME_WIDTH,  XGenericEditorHandler::LayoutSameWidth )
	EVT_MENU( LAYOUT_SAME_HEIGHT, XGenericEditorHandler::LayoutSameHeight )
	EVT_MENU( LAYOUT_SAME_BOTH,   XGenericEditorHandler::LayoutSameBoth )

	EVT_MENU( LAYOUT_BRING_FRONT, XGenericEditorHandler::LayoutBringFront )
	EVT_MENU( LAYOUT_SEND_BACK,   XGenericEditorHandler::LayoutSendBack )

	EVT_MENU( LAYOUT_TEST,        XGenericEditorHandler::LayoutTest )

	EVT_UPDATE_UI( LAYOUT_ALIGN,       XGenericEditorHandler::LayoutAlignUI )
	EVT_UPDATE_UI( LAYOUT_CENTER,      XGenericEditorHandler::LayoutCenterUI )
	EVT_UPDATE_UI( LAYOUT_ARRANGE,     XGenericEditorHandler::LayoutArrangeUI )
	EVT_UPDATE_UI( LAYOUT_SAME,        XGenericEditorHandler::LayoutSameUI )
	EVT_UPDATE_UI( LAYOUT_BRING_FRONT, XGenericEditorHandler::LayoutBringFrontUI )
	EVT_UPDATE_UI( LAYOUT_SEND_BACK,   XGenericEditorHandler::LayoutSendBackUI )
	EVT_UPDATE_UI( LAYOUT_FLIP,        XGenericEditorHandler::LayoutCenterUI )
	EVT_UPDATE_UI( LAYOUT_TEST,        XGenericEditorHandler::LayoutTestUI )

	EVT_MENU( LAYOUT_SPACE_ACROSS,    XGenericEditorHandler::LayoutSpaceAcross )
	EVT_MENU( LAYOUT_SPACE_DOWN,      XGenericEditorHandler::LayoutSpaceDown )
	EVT_MENU( LAYOUT_FLIP_VERTICAL,   XGenericEditorHandler::LayoutFlipVertical )
	EVT_MENU( LAYOUT_FLIP_HORIZONTAL, XGenericEditorHandler::LayoutFlipHorizontal )

	//  EVT_MENU( LAYOUT_SHOW_GRID,     XGenericEditorHandler::LayoutShowGrid )
	EVT_MENU( LAYOUT_GRID_SETTINGS, XGenericEditorHandler::LayoutGridSettings )

	EVT_UPDATE_UI( LAYOUT_SPACE, XGenericEditorHandler::LayoutAlignUI  )
	EVT_UPDATE_UI( LAYOUT_FLIP,  XGenericEditorHandler::LayoutCenterUI )

	//  EVT_UPDATE_UI( LAYOUT_GRID_SETTINGS, XGenericEditorHandler::LayoutGridSettingsUI )

END_EVENT_TABLE()

XGenericEditorHandler::XGenericEditorHandler( bool useFrameLayout )
{}

XGenericEditorHandler::~XGenericEditorHandler()
{
}

void XGenericEditorHandler::SetCurrentScene( XCollection& scene )
{
	mpScene = &scene;

	if ( mpLUtil )

		mpLUtil->SetScene( mpScene );
}

void XGenericEditorHandler::SetCurrentCmdManager( XCommandManager& cmdMgr )
{
	mpCmdMgr = &cmdMgr;
}

void XGenericEditorHandler::SetLayoutUtility( XLayoutUtility* pUtil )
{
	mpLUtil = pUtil;
}

XCollection* XGenericEditorHandler::GetCurrentScene()
{
	return mpScene;
}

XCommandManager* XGenericEditorHandler::GetCurrentCmdManager()
{
	return mpCmdMgr;
}

wxPMMergableMenuChain* XGenericEditorHandler::GetMergableMenuChain()
{
	return _gEditorMenuChains;
}

void XGenericEditorHandler::AddToolbars( wxDynamicToolBar* pEditTBar, 
										 wxDynamicToolBar* pLayoutTBar,
										 wxFrameLayout* pFl )
{
	wxPMBitmapManager& mgr = wxGetPMBitmapManager();

	pEditTBar->AddTool( FILE_OPEN,  mgr.FindBitmap("layoutedit/open"), "" );
	pEditTBar->AddTool( FILE_SAVE,  mgr.FindBitmap("layoutedit/save"), "" );
	//pEditTBar->AddSeparator();
	pEditTBar->AddTool( EDIT_CUT,   mgr.FindBitmap("layoutedit/cut"), "" );
	pEditTBar->AddTool( EDIT_COPY,  mgr.FindBitmap("layoutedit/copy"), "" );
	pEditTBar->AddTool( EDIT_PASTE, mgr.FindBitmap("layoutedit/paste"), "" );
	//pEditTBar->AddSeparator();
	pEditTBar->AddTool( EDIT_UNDO, mgr.FindBitmap("layoutedit/undo"), "" );
	pEditTBar->AddTool( EDIT_REDO, mgr.FindBitmap("layoutedit/redo"), "" );

	//pTBar1->EnableTool( FILE_OPEN, FALSE );
	//pTBar1->EnableTool( FILE_SAVE, FALSE );

    cbDimInfo sizes1( 210,35, // when docked horizontally      
                      200,40, // when docked vertically        
                      220,35, // when floated                  
                      TRUE, // the bar is fixed-size
                      4,     // vertical gap (bar border)
                      4,     // horizontal gap (bar border)
					  new cbDynToolBarDimHandler()
                    ); 

    cbDimInfo sizes2( 484,38,
                      450,35,
                      484,35, 
                      TRUE,  
                      4,     
                      4,
					  new cbDynToolBarDimHandler()
                    ); 

    int cbWidth  = 200;
    int cbHeight = 150;

    cbDimInfo sizes4( cbWidth,cbHeight,
                      cbWidth,cbHeight,
                      cbWidth,cbHeight, FALSE ); // -/-

    pFl->AddBar( pEditTBar,          // bar window
                 sizes1, wxTOP,   // alignment ( 0-top,1-bottom, etc)
                 0,               // insert into 0th row (vert. position)
                 0,               // offset from the start of row (in pixels)
                 "Edit",          // name to refer in customization pop-ups
		 	     TRUE
               );

	pLayoutTBar->AddTool( LAYOUT_ALIGN_LEFT,   mgr.FindBitmap("layoutedit/align_left"), "" );
	pLayoutTBar->AddTool( LAYOUT_ALIGN_RIGHT,  mgr.FindBitmap("layoutedit/align_right"), "" );
	pLayoutTBar->AddTool( LAYOUT_ALIGN_TOP,    mgr.FindBitmap("layoutedit/align_top"), "" );
	pLayoutTBar->AddTool( LAYOUT_ALIGN_BOTTOM, mgr.FindBitmap("layoutedit/align_bottom"), "" );
	//pLayoutTBar->AddSeparator();

	pLayoutTBar->AddTool( LAYOUT_CENTER_VERTICAL,   mgr.FindBitmap("layoutedit/center_vert"), "" );
	pLayoutTBar->AddTool( LAYOUT_CENTER_HORIZONTAL, mgr.FindBitmap("layoutedit/center_horiz"), "" );

	pLayoutTBar->AddTool( LAYOUT_ARRANGE_RIGHT,  mgr.FindBitmap("layoutedit/arrange_right"), "" );
	pLayoutTBar->AddTool( LAYOUT_ARRANGE_BOTTOM, mgr.FindBitmap("layoutedit/arrange_bottom"), "" );
	//pLayoutTBar->AddSeparator();

	pLayoutTBar->AddTool( LAYOUT_SAME_WIDTH,  mgr.FindBitmap("layoutedit/same_width"), "" );
	pLayoutTBar->AddTool( LAYOUT_SAME_HEIGHT, mgr.FindBitmap("layoutedit/same_height"), "" );
	pLayoutTBar->AddTool( LAYOUT_SAME_BOTH,   mgr.FindBitmap("layoutedit/same_both"), "" );
	//pLayoutTBar->AddSeparator();

	pLayoutTBar->AddTool( LAYOUT_SPACE_ACROSS, mgr.FindBitmap("layoutedit/space_across"), "" );
	pLayoutTBar->AddTool( LAYOUT_SPACE_DOWN,   mgr.FindBitmap("layoutedit/space_down"), "" );
	//pLayoutTBar->AddSeparator();

	pLayoutTBar->AddTool( LAYOUT_BRING_FRONT, mgr.FindBitmap("layoutedit/bring_to_front"), "" );
	pLayoutTBar->AddTool( LAYOUT_SEND_BACK,   mgr.FindBitmap("layoutedit/send_back"), "" );
	//pLayoutTBar->AddSeparator();

	// FIXME:: kludge : useing LAYOUT_GRID_SETTINGS instead of LAYOUT_SHOW_GRID
	//         because of "weirddness" of checkable menus on wxWin2.0...

	pLayoutTBar->AddTool( LAYOUT_GRID_SETTINGS, mgr.FindBitmap("layoutedit/toggle_grid"), "" );
	pLayoutTBar->AddTool( LAYOUT_TEST,		   mgr.FindBitmap("layoutedit/test_dialog"), "" );

    pFl->AddBar( pLayoutTBar,          
                 sizes2, wxLEFT,
                 0,               
                 0,               
                 "Layout",          
	    		 TRUE
               );
}

/*** menu handlers ***/

void XGenericEditorHandler::EditUndo( wxCommandEvent& event )
{
	if ( !mpCmdMgr->CanUndo() ) return;

	mpCmdMgr->Undo();
}

void XGenericEditorHandler::EditRedo(wxCommandEvent& event)
{
	if ( !mpCmdMgr->CanRedo() ) return;

	mpCmdMgr->Redo();
}

void XGenericEditorHandler::EditCut(wxCommandEvent& event)
{
	mpCmdMgr->Copy( mpScene );

	mpCmdMgr->Delete();
}

void XGenericEditorHandler::EditCopy(wxCommandEvent& event)
{
	mpCmdMgr->Copy( mpScene );
}

void XGenericEditorHandler::EditPaste(wxCommandEvent& event)
{
	mpCmdMgr->Paste( mpScene );
}

void XGenericEditorHandler::EditDelete(wxCommandEvent& event)
{
	mpCmdMgr->Delete();
}

void XGenericEditorHandler::EditSelectAll(wxCommandEvent& event)
{
	mpLUtil->SelectAllItems();
}

void XGenericEditorHandler::EditProperties(wxCommandEvent& event)
{
	wxMessageBox( "Properties... (TBD)");
}

//////////////// layouting handlers ////////////

void XGenericEditorHandler::LayoutAlignLeft( wxCommandEvent& event )
{
	mpLUtil->AlignItems( wxLeft );
}

void XGenericEditorHandler::LayoutAlignRight( wxCommandEvent& event )
{
	mpLUtil->AlignItems( wxRight );
}

void XGenericEditorHandler::LayoutAlignTop( wxCommandEvent& event )
{
	mpLUtil->AlignItems( wxTop );
}

void XGenericEditorHandler::LayoutAlignBottom( wxCommandEvent& event )
{
	mpLUtil->AlignItems( wxBottom );
}

void XGenericEditorHandler::LayoutCenterVertical( wxCommandEvent& event )
{
	mpLUtil->Center( TRUE );
}

void XGenericEditorHandler::LayoutCenterHorizontal( wxCommandEvent& event )
{
	mpLUtil->Center( FALSE );
}

void XGenericEditorHandler::LayoutArrangeRight( wxCommandEvent& event )
{
	mpLUtil->Arrange( TRUE );
}

void XGenericEditorHandler::LayoutArrangeBottom( wxCommandEvent& event )
{
	mpLUtil->Arrange( FALSE );
}

void XGenericEditorHandler::LayoutSameWidth( wxCommandEvent& event )
{
	mpLUtil->MakeSameSize( TRUE, FALSE, FALSE );
}

void XGenericEditorHandler::LayoutSameHeight( wxCommandEvent& event )
{
	mpLUtil->MakeSameSize( FALSE, TRUE, FALSE );
}

void XGenericEditorHandler::LayoutSameBoth( wxCommandEvent& event )
{
	mpLUtil->MakeSameSize( TRUE, TRUE, TRUE );
}

void XGenericEditorHandler::LayoutBringFront( wxCommandEvent& event )
{
	mpScene->BringSelectionToFront();
}

void XGenericEditorHandler::LayoutSendBack( wxCommandEvent& event )
{
	mpLUtil->SendItemsBack();
}

void XGenericEditorHandler::LayoutTest( wxCommandEvent& event )
{
	wxMessageBox( "Test layout...(TBD)" );
}

////////////// Update-UI handlers /////////

void XGenericEditorHandler::EditUndoUI(wxUpdateUIEvent& event)
{
	event.Enable( mpScene && mpScene->GetCommandManager()->CanUndo() );
}

void XGenericEditorHandler::EditRedoUI(wxUpdateUIEvent& event)
{
	event.Enable( mpScene && mpScene->GetCommandManager()->CanRedo() );
}

void XGenericEditorHandler::EditCutUI(wxUpdateUIEvent& event)
{
	event.Enable( mpScene && mpScene->HasSelection() );
}

void XGenericEditorHandler::EditCopyUI(wxUpdateUIEvent& event)
{
	event.Enable( mpScene && mpScene->HasSelection() );
}

void XGenericEditorHandler::EditPasteUI(wxUpdateUIEvent& event)
{
	event.Enable( mpScene && mpScene->GetCommandManager()->CanPaste() );
}

void XGenericEditorHandler::EditDeleteUI(wxUpdateUIEvent& event)
{
	event.Enable( mpScene && mpScene->HasSelection() );
}

void XGenericEditorHandler::EditSelectAllUI(wxUpdateUIEvent& event)
{
	event.Enable( mpScene && mpScene->GetContents().Count() > 1 );
}

void XGenericEditorHandler::EditPropertiesUI(wxUpdateUIEvent& event)
{
	event.Enable( mpScene && mpScene->HasSingleSelection() );
}

void XGenericEditorHandler::LayoutAlignUI(wxUpdateUIEvent& event)
{
	event.Enable( mpLUtil->CanAlign() );
}

void XGenericEditorHandler::LayoutCenterUI(wxUpdateUIEvent& event)
{
	event.Enable( mpLUtil->CanLayout() );
}

void XGenericEditorHandler::LayoutArrangeUI(wxUpdateUIEvent& event)
{
	event.Enable( mpLUtil->CanAlign() );
}

void XGenericEditorHandler::LayoutSameUI(wxUpdateUIEvent& event)
{
	event.Enable( mpLUtil->CanAlign() );
}

void XGenericEditorHandler::LayoutBringFrontUI(wxUpdateUIEvent& event)
{
	event.Enable( (mpScene->GetSelection().Count() != 0) );
}

void XGenericEditorHandler::LayoutSendBackUI(wxUpdateUIEvent& event)
{
	event.Enable( (mpScene->GetSelection().Count() != 0) );
}

void XGenericEditorHandler::LayoutTestUI(wxUpdateUIEvent& event)
{
	event.Enable( TRUE );
}

void XGenericEditorHandler::LayoutSpaceAcross( wxCommandEvent& event )
{
	// TBD::
}

void XGenericEditorHandler::LayoutSpaceDown( wxCommandEvent& event )
{
	// TBD::
}

void XGenericEditorHandler::LayoutFlipVertical( wxCommandEvent& event )
{
	mpLUtil->Flip( TRUE );
}

void XGenericEditorHandler::LayoutFlipHorizontal( wxCommandEvent& event )
{
	mpLUtil->Flip( FALSE );
}

void XGenericEditorHandler::LayoutGridShow( wxCommandEvent& event )
{
	// TBD::
}

void XGenericEditorHandler::LayoutGridSettings( wxCommandEvent& event )
{
	// TBD::
}

void XGenericEditorHandler::LayoutGridSettingsUI( wxUpdateUIEvent& event )
{
	// TBD::
}

