// Button.cpp // #include #include #include #include #include "def.h" #include "pixmap.h" #include "sound.h" #include "decor.h" #include "button.h" #include "misc.h" ////////////////////////////////////////////////////////// // Constructor CButton::CButton() { m_type = 0; m_bEnable = TRUE; m_bHide = FALSE; m_bSomething = 0; m_state = 0; m_mouseState = 0; m_nbMenu = 0; m_nbToolTips = 0; m_selMenu = 0; m_bMouseDown = FALSE; m_bMinimizeRedraw = FALSE; m_bRedraw = FALSE; } // Destructor CButton::~CButton() { } // Create a new Button BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, POINT pos, int type, BOOL bMinimizeRedraw, int *pMenu, int nbMenu, int *pToolTips, int nbToolTips, int region, UINT message) { POINT iconDim; int i, icon; static int ttypes[] = { DIMBUTTONX,DIMBUTTONY, }; if ( type < 0 || type > 0 ) return FALSE; iconDim.x = ttypes[type*2+0]; iconDim.y = ttypes[type*2+1]; m_hWnd = hWnd; m_pPixmap = pPixmap; m_pSound = pSound; m_type = type; m_bMinimizeRedraw = bMinimizeRedraw; m_bEnable = TRUE; m_bHide = FALSE; m_bSomething = 0; m_message = message; m_pos.x = pos.x; m_pos.y = pos.y; m_dim.x = iconDim.x; m_dim.y = iconDim.y; m_nbMenu = nbMenu; m_nbToolTips = nbToolTips; m_selMenu = 0; m_state = 0; m_mouseState = 0; m_bMouseDown = FALSE; m_bRedraw = TRUE; /* Do we need this yet? /////////////////////////////////////////////////// for ( i=0 ; i