2024-08-01 11:48:02 -04:00
|
|
|
|
#include <minwindef.h>
|
|
|
|
|
#include <windef.h>
|
|
|
|
|
#include "decor.h"
|
|
|
|
|
#include "sound.h"
|
|
|
|
|
#include "pixmap.h"
|
2024-05-17 11:47:48 -04:00
|
|
|
|
|
2024-08-01 11:48:02 -04:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
2024-06-24 15:46:58 -04:00
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
int message;
|
|
|
|
|
int type;
|
|
|
|
|
int iconMenu[20];
|
|
|
|
|
POINT pos;
|
|
|
|
|
int toolTips[20];
|
|
|
|
|
}
|
|
|
|
|
Button;
|
2024-05-17 11:47:48 -04:00
|
|
|
|
|
|
|
|
|
class CButton
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CButton();
|
|
|
|
|
~CButton();
|
|
|
|
|
|
|
|
|
|
BOOL Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound,
|
|
|
|
|
POINT pos, int type, BOOL bMinimizeRedraw,
|
2024-06-12 22:36:20 -05:00
|
|
|
|
/*int *pMenu, int nbMenu,
|
2024-05-17 11:47:48 -04:00
|
|
|
|
int *pTooltips, int nbToolTips,
|
2024-06-12 22:36:20 -05:00
|
|
|
|
int region,*/ UINT message);
|
2024-06-06 10:54:21 -04:00
|
|
|
|
void SetSomethingMenu(int somethingMenu);
|
2024-05-17 11:47:48 -04:00
|
|
|
|
void Draw();
|
|
|
|
|
void Redraw();
|
|
|
|
|
|
|
|
|
|
int GetState();
|
|
|
|
|
void SetState(int state);
|
|
|
|
|
|
|
|
|
|
int GetMenu();
|
|
|
|
|
void SetMenu(int menu);
|
|
|
|
|
|
|
|
|
|
BOOL GetEnable();
|
|
|
|
|
void SetEnable(BOOL bEnable);
|
|
|
|
|
|
2024-06-01 20:56:16 -04:00
|
|
|
|
void SetSomething(BOOL bSomething);
|
|
|
|
|
|
2024-05-17 11:47:48 -04:00
|
|
|
|
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
|
2024-08-01 11:48:02 -04:00
|
|
|
|
int m_state;
|
|
|
|
|
int m_mouseState;
|
2024-05-17 11:47:48 -04:00
|
|
|
|
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
|
2024-05-30 21:58:09 -04:00
|
|
|
|
int m_selMenu;
|
|
|
|
|
int m_bSomething; // sous-menu s<>lectionn<6E>
|
2024-05-17 11:47:48 -04:00
|
|
|
|
BOOL m_bMouseDown; // TRUE -> bouton souris press<73>
|
|
|
|
|
BOOL m_bMinimizeRedraw;
|
2024-08-01 11:48:02 -04:00
|
|
|
|
BOOL m_bRedraw;
|
2024-05-17 11:47:48 -04:00
|
|
|
|
};
|