// toolbar.cpp : implementation file
//

#include "stdafx.h"
#include "ep196.h"
#include "flttool.h"
#include "toolbar.h"


#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// arrays of IDs used to initialize control bars
/*
UINT BASED_CODE mainButtons[] =
{
    ID_FILE_LOAD,
    	ID_SEPARATOR,
    ID_OPTIONS_MAP,
        ID_SEPARATOR,
    ID_RUN_RESET,
    ID_RUN_BREAKPOINT,
    ID_RUN_GO,
    ID_RUN_HALT,
	    ID_SEPARATOR,
    ID_RUN_STEPINTO,
    ID_RUN_STEPOVER,
    ID_RUN_STEPOUT,
    	ID_SEPARATOR,
    ID_HELP_INDEX,
};
*/

/////////////////////////////////////////////////////////////////////////////
// CSuperToolBar

CSuperToolBar::CSuperToolBar()
{
}

CSuperToolBar::~CSuperToolBar()
{
}

BOOL CSuperToolBar::CreateBar(CWnd* pParentWnd, const int nWhichWnd)
{           
	if (!Create(pParentWnd) || !LoadBitmap(nWhichWnd) ) {
		return FALSE;
	}
/*	
	if ( !SetButtons(mainButtons, sizeof(mainButtons)/sizeof(UINT)) ) {
		return FALSE;
	}
*/
	NewMain();	
//	UpdateMainToolBar();
	
	return TRUE;
}                                        

BEGIN_MESSAGE_MAP(CSuperToolBar, CFloatToolBar)
	//{{AFX_MSG_MAP(CSuperToolBar)
	ON_WM_LBUTTONUP()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSuperToolBar common routine

void CSuperToolBar::UpdateMainToolBar(void)
{
    // Update the tool bar buttons.
    if ( SetButtons(NULL, 14) ) {
        SetButtonInfo(0, ID_FILE_LOAD, TBBS_BUTTON, BTN_LOAD);
        SetButtonInfo(1, ID_SEPARATOR, TBBS_SEPARATOR, 6);

        SetButtonInfo(2, ID_OPTIONS_MAP, TBBS_BUTTON, BTN_MAP);
        SetButtonInfo(3, ID_SEPARATOR, TBBS_SEPARATOR, 6);

        SetButtonInfo(4, ID_RUN_RESET, TBBS_BUTTON, BTN_RESET);
        SetButtonInfo(5, ID_RUN_BREAKPOINT, TBBS_BUTTON, BTN_BP);
        SetButtonInfo(6, ID_RUN_GO, TBBS_BUTTON, BTN_GO);
        SetButtonInfo(7, ID_RUN_HALT, TBBS_BUTTON, BTN_HALT);
        SetButtonInfo(8, ID_SEPARATOR, TBBS_SEPARATOR, 6);

        SetButtonInfo(9, ID_RUN_STEPINTO, TBBS_BUTTON, BTN_STEPINTO);
        SetButtonInfo(10, ID_RUN_STEPOVER, TBBS_BUTTON, BTN_STEPOVER);
        SetButtonInfo(11, ID_RUN_STEPOUT, TBBS_BUTTON, BTN_STEPOUT);
        SetButtonInfo(12, ID_SEPARATOR, TBBS_SEPARATOR, 6);

        SetButtonInfo(13, ID_HELP_INDEX, TBBS_BUTTON, BTN_HELP);
    }
}


/////////////////////////////////////////////////////////////////////////////
// CSuperToolBar message handlers


void CSuperToolBar::OnLButtonUp(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	
	CFloatToolBar::OnLButtonUp(nFlags, point);
}

void CSuperToolBar::OnDestroy()
{
	CFloatToolBar::OnDestroy();
	
	// TODO: Add your message handler code here
	
}
