//
//	Copyright © 2006 Nemetschek North America 
//	All Rights Reserved.
//
// Created by Vladislav Stanev

#include "StdHeaders.h"

#include "SwapCtrl.h"

#include "Dialog.h"
#include "SwapPaneCtrl.h"

using namespace VectorWorks::VWUI;

VWSwapCtrl::VWSwapCtrl(TControlID id)
: VWControl( id )
{
}

VWSwapCtrl::~VWSwapCtrl()
{
}

bool VWSwapCtrl::CreateControl(VWDialog* pDlg)
{
	::GS_CreateSwapControl( gCBP, pDlg->GetControlID(), fControlID );
	return VWControl::CreateControl( pDlg );;
}

void VWSwapCtrl::AddPane(VWSwapPaneCtrl* pPane)
{
	::GS_CreateSwapPane( gCBP, fpParentDlg->GetControlID(), fControlID, pPane->GetControlID() );
}

size_t VWSwapCtrl::GetActivePaneIndex() const
{
	return ::GS_GetActivePane( gCBP, fpParentDlg->GetControlID(), fControlID );
}

void VWSwapCtrl::SetActivePaneIndex(size_t paneIndex)
{
	::GS_DisplaySwapPane( gCBP, fpParentDlg->GetControlID(), fControlID, paneIndex );
}
