2017-01-21 17:27:46 +01:00
|
|
|
|
// Button.h
|
|
|
|
|
|
2017-01-21 23:44:30 +01:00
|
|
|
|
#pragma once
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
class CButton
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CButton();
|
|
|
|
|
~CButton();
|
|
|
|
|
|
2017-02-05 09:15:08 +01:00
|
|
|
|
bool Create(CPixmap *pPixmap, CSound *pSound,
|
2017-01-22 00:10:12 +01:00
|
|
|
|
POINT pos, int type, bool bMinimizeRedraw,
|
2017-01-21 17:27:46 +01:00
|
|
|
|
int *pMenu, int nbMenu,
|
|
|
|
|
int *pTooltips, int nbToolTips,
|
|
|
|
|
int region, UINT message);
|
|
|
|
|
void Draw();
|
|
|
|
|
void Redraw();
|
|
|
|
|
|
|
|
|
|
int GetState();
|
|
|
|
|
void SetState(int state);
|
|
|
|
|
|
|
|
|
|
int GetMenu();
|
|
|
|
|
void SetMenu(int menu);
|
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool GetEnable();
|
|
|
|
|
void SetEnable(bool bEnable);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool GetHide();
|
|
|
|
|
void SetHide(bool bHide);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
2017-01-28 23:34:02 +01:00
|
|
|
|
bool TreatEvent(const SDL_Event &event);
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool MouseOnButton(POINT pos);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
int GetToolTips(POINT pos);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool Detect(POINT pos);
|
|
|
|
|
bool MouseDown(POINT pos);
|
|
|
|
|
bool MouseMove(POINT pos);
|
|
|
|
|
bool MouseUp(POINT pos);
|
2017-01-21 17:27:46 +01:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
CPixmap* m_pPixmap;
|
|
|
|
|
CDecor* m_pDecor;
|
|
|
|
|
CSound* m_pSound;
|
|
|
|
|
int m_type; // type de bouton
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool m_bEnable; // true si bouton actif
|
|
|
|
|
bool m_bHide; // true si bouton cach<63>
|
2017-01-21 17:27:46 +01:00
|
|
|
|
UINT m_message; // message envoy<6F> si bouton actionn<6E>
|
|
|
|
|
POINT m_pos; // coin sup/gauche
|
|
|
|
|
POINT m_dim; // dimensions
|
|
|
|
|
int m_state; // 0=rel<65>ch<63>, 1=press<73>, +2=survoll<6C>
|
|
|
|
|
int m_mouseState; // 0=rel<65>ch<63>, 1=press<73>, +2=survoll<6C>
|
|
|
|
|
int m_iconMenu[20]; // ic<69>nes du sous-menu
|
|
|
|
|
int m_toolTips[20]; // info-bulles
|
|
|
|
|
int m_nbMenu; // nb de case du sous-menu
|
|
|
|
|
int m_nbToolTips; // nb d'info-bulles
|
|
|
|
|
int m_selMenu; // sous-menu s<>lectionn<6E>
|
2017-01-22 00:10:12 +01:00
|
|
|
|
bool m_bMouseDown; // true -> bouton souris press<73>
|
|
|
|
|
bool m_bMinimizeRedraw;
|
|
|
|
|
bool m_bRedraw; // true -> doit <20>tre redessin<69>
|
2017-01-21 17:27:46 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|