1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00
planetblupi/button.h

69 lines
1.6 KiB
C
Raw Normal View History

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
2017-02-08 22:50:19 +01:00
#include <vector>
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,
POINT pos, int type, bool bMinimizeRedraw,
2017-01-21 17:27:46 +01:00
int *pMenu, int nbMenu,
2017-02-08 22:50:19 +01:00
const char **pToolTips,
2017-02-10 00:14:28 +01:00
int region, unsigned int message);
2017-01-21 17:27:46 +01:00
void Draw();
void Redraw();
int GetState();
void SetState(int state);
int GetMenu();
void SetMenu(int menu);
bool GetEnable();
void SetEnable(bool bEnable);
2017-01-21 17:27:46 +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);
bool MouseOnButton(POINT pos);
2017-02-08 22:50:19 +01:00
const char *GetToolTips(POINT pos);
2017-01-21 17:27:46 +01:00
protected:
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
bool m_bEnable; // true si bouton actif
bool m_bHide; // true si bouton cach<63>
2017-02-10 00:14:28 +01:00
unsigned int m_message; // message envoy<6F> si bouton actionn<6E>
2017-01-21 17:27:46 +01:00
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
2017-02-08 22:50:19 +01:00
const char **m_toolTips; // info-bulles
2017-01-21 17:27:46 +01:00
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>
2017-01-21 17:27:46 +01:00
};
/////////////////////////////////////////////////////////////////////////////