#ifndef MTIGESWIN_H #define MTIGESWIN_H #include "gesenv.h" #include "gesclib.h" #include typedef struct SGesWin{ WINDOW *w; int l,h,ofstY; //Coordonnées de la fenêtre et offset en Y }SGesWin; typedef struct SGesProgressBar{ short nb,pos; }SGesProgressBar; typedef struct SGesWinBTM{ const char *text; //Texte du bouton short lenPxt,hPxt; //Longueur et hauteur en pixels du texte int font; //Fonte }SGesWinBtm; typedef struct STab{ int t[3][2]; }STab; /* ================================== FONCTIONS GENERALES ================================= */ /* Création d'une fenêtre : - le point haut/gauche est (x,y) - la largeur : w - la hauteur : h Si x=-1 la fenêtre sera centrée horizontalement; idem pour y Si l=-1 l sera égal à la largeur de l'écran; idem pour h */ SGesWin *CGesWinCreate(int l, int h, int x, int y); void CGesWinTitle(SGesWin *win, const char *title, short font); int CGesWinInsert(SGesWin *win, int x, int y, char *buf, unsigned short lenBuf); void CGesWinDestroy(SGesWin *win); //Destruction /* ================================== Boites de dialogue ================================== */ /* Création d'une boite de dialogue l: largeur (-1 pour calcul automatique) h: hauteur (-1 pour calcul automatique) title: titre de la boîte msg: message type: type de la boîte - 0 -> Information - 1 -> Attention - 2 -> Question - 3 -> Invite de saisie buf: pour la saisie lenBuf: limite du buffer de saisie btm1: Bouton 1 btm2: Bouton 2 */ int CGesMsgBox(int l, int h, const char *title, const char *msg, short type, char *buf, short lenBuf, const SGesWinBtm *btm1, const SGesWinBtm *btm2); //Information (OK) void CGesMsgBoxInfo(const char *msg); //Attention (OK) void CGesMsgBoxWarning(const char *msg); //Question (OUI/NON) int CGesMsgBoxQuestion(const char *msg); //Entrée (Enregistrer/Annuler) : invite de saisie d'une chaine 'buf' de carractères int CGesMsgBoxInput(const char *msg, char *buf, short lenBuf); void CGesMsgBoxMem(); /* =================================== Dessins divers ===================================== */ //Dessine un V void CGesWinDrawV(SGesWin *win, short x, short y, short lastMode, short newMode); //Création d'un bouton SGesWinBtm *CGesWinBtmCreat(const char *text, int font); /* Dessine ou actionne un bouton : action -0:dessine -1:inverse */ void CGesWinBtm(SGesWin *win, const SGesWinBtm *btm, short x, short y, short action); void CGesProgressBarClr(); void CGesProgressBarSetPos(SGesProgressBar *bar, short pos); void CGesProgressBarIncr(SGesProgressBar *bar); void CGesWinPrintXY(SGesWin *win, int x, int y, const char *str, STab *tab); #endif