mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
68 lines
1.6 KiB
C
68 lines
1.6 KiB
C
|
// Button.h
|
|||
|
|
|||
|
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
|
|||
|
class CButton
|
|||
|
{
|
|||
|
public:
|
|||
|
CButton();
|
|||
|
~CButton();
|
|||
|
|
|||
|
BOOL 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);
|
|||
|
void Draw();
|
|||
|
void Redraw();
|
|||
|
|
|||
|
int GetState();
|
|||
|
void SetState(int state);
|
|||
|
|
|||
|
int GetMenu();
|
|||
|
void SetMenu(int menu);
|
|||
|
|
|||
|
BOOL GetEnable();
|
|||
|
void SetEnable(BOOL bEnable);
|
|||
|
|
|||
|
BOOL GetHide();
|
|||
|
void SetHide(BOOL bHide);
|
|||
|
|
|||
|
BOOL TreatEvent(UINT message, WPARAM wParam, LPARAM lParam);
|
|||
|
BOOL MouseOnButton(POINT pos);
|
|||
|
int GetToolTips(POINT pos);
|
|||
|
|
|||
|
|
|||
|
protected:
|
|||
|
BOOL Detect(POINT pos);
|
|||
|
BOOL MouseDown(POINT pos);
|
|||
|
BOOL MouseMove(POINT pos);
|
|||
|
BOOL MouseUp(POINT pos);
|
|||
|
|
|||
|
protected:
|
|||
|
HWND m_hWnd;
|
|||
|
CPixmap* m_pPixmap;
|
|||
|
CDecor* m_pDecor;
|
|||
|
CSound* m_pSound;
|
|||
|
int m_type; // type de bouton
|
|||
|
BOOL m_bEnable; // TRUE si bouton actif
|
|||
|
BOOL m_bHide; // TRUE si bouton cach<63>
|
|||
|
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>
|
|||
|
BOOL m_bMouseDown; // TRUE -> bouton souris press<73>
|
|||
|
BOOL m_bMinimizeRedraw;
|
|||
|
BOOL m_bRedraw; // TRUE -> doit <20>tre redessin<69>
|
|||
|
};
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|