//
// Button BN 11-Juni-98
//
//
//
//
#include <stdlib.h>
#include <malloc.h>
#include <string.h>

#include "WinMain.h"
#include "GlobalData.h"
#include "Button.h"


// *****************************************************************
Button::Init (void)
{
int nRet=TRUE;


memset(&pButton, 0, sizeof(Button));
nAutoWert++; // dient als eindeutiger Schlüssel
pButton.pBitmap.Init();
return(nRet);
}

// *****************************************************************
Button::DeInit (void)
{
int nRet=TRUE;


pButton.pBitmap.DeInit();
return(nRet);
}

// *****************************************************************
Button::DoLoadButton (char *acBefehl_ID, char *acFilename)
{
int nRet=FALSE;


pButton.pBitmap.SetName(acFilename);
nRet = pButton.pBitmap.DoLoadBitmap("DoDisplayBitmap");
return(nRet);
}

// *****************************************************************
Button::DoDisplayButton (char *acBefehl_ID, HDC PaintDC, int nX, int nY, HDC ButtonDC)
{
int nRet=FALSE;


nRet = pButton.pBitmap.DoDisplayBitmap("DoDisplayBitmap", PaintDC, nX, nY, ButtonDC);
return(nRet);
}

// *****************************************************************
Button::GetName (char *GetName)
{
int nRet=TRUE;


memcpy(GetName, pButton.acName, sizeof(pButton.acName));
return(nRet);
}

// *****************************************************************
Button::GetX (int *GetX)
{
int nRet=TRUE;


*GetX = pButton.nX;
return(nRet);
}

// *****************************************************************
Button::GetY (int *GetY)
{
int nRet=TRUE;


*GetY = pButton.nY;
return(nRet);
}

// *****************************************************************
Button::GetBreite (int *GetBreite)
{
int nRet=TRUE;


*GetBreite = pButton.nBreite;
return(nRet);
}

// *****************************************************************
Button::GetHoehe (int *GetHoehe)
{
int nRet=TRUE;


*GetHoehe = pButton.nHoehe;
return(nRet);
}

// *****************************************************************
Button::GetLink (void *GetLink)
{
int nRet=TRUE;


GetLink = pButton.pLink;
return(nRet);
}

// *****************************************************************
Button::SetName (char *SetName)
{
int nRet=TRUE;


memset(pButton.acName, 0, sizeof(pButton.acName));
memcpy(pButton.acName, SetName, strlen(SetName));
return(nRet);
}

// *****************************************************************
Button::SetX (int *SetX)
{
int nRet=TRUE;


pButton.nX = *SetX;
return(nRet);
}

// *****************************************************************
Button::SetY (int *SetY)
{
int nRet=TRUE;


pButton.nY = *SetY;
return(nRet);
}

// *****************************************************************
Button::SetBreite (int *SetBreite)
{
int nRet=TRUE;


pButton.nBreite = *SetBreite;
return(nRet);
}

// *****************************************************************
Button::SetHoehe (int *SetHoehe)
{
int nRet=TRUE;


pButton.nHoehe = *SetHoehe;
return(nRet);
}

// *****************************************************************
Button::SetLink (void *SetLink)
{
int nRet=TRUE;


pButton.pLink = (int (__cdecl *)(void))(SetLink);
return(nRet);
}