// UTS 2000 - fichier 'bmp.cpp' Gére les variables et sous-programmes pour la sélection des couleurs
// V3.7a le 28/09/2016
/*****************************************************************************/
/* debut ITI                                                                 */
/*****************************************************************************/
#include  <windows.h>
#include  <string.h>
#include  <stdlib.h>
#include  <stdio.h>
#include "Train_UTS.h"

#define _CRT_SECURE_NO_WARNINGS  // Limite les messages de warning dans Visual C++

// Déclaration des fonctions externes
extern HDC       hMemDC, bmp_h_dc_mem;
extern HFONT     bmp_fonte;

extern HBRUSH    bmp_pinceau_, bmp_pinceau_noir, bmp_pinceau_bleu, bmp_pinceau_vert, bmp_pinceau_cyan, bmp_pinceau_rouge, bmp_pinceau_violet;
extern HBRUSH    bmp_pinceau_jaune, bmp_pinceau_blanc, bmp_pinceau_rougef, bmp_pinceau_vertfluo, bmp_pinceau_orange, bmp_pinceau_marron;
extern HBRUSH    bmp_pinceau_kaki, bmp_pinceau_bleuf, bmp_pinceau_grisvert, bmp_pinceau_vertfonce, bmp_pinceau_gris32,  bmp_pinceau_gris64, bmp_pinceau_gris128;
extern HBRUSH    bmp_pinceau_gris192, bmp_pinceau_griswin, bmp_pinceau_magenta, bmp_pinceau_magentaf, bmp_pinceau_cyanf, bmp_pinceau_vertdeau;
extern HBRUSH    bmp_pinceau_lilas, bmp_pinceau_bleulagon, bmp_pinceau_verttendre, bmp_pinceau_rosefluo, bmp_pinceau_saumon, bmp_pinceau_rose;
extern HBRUSH    bmp_pinceau_gris220, bmp_pinceau_gris230, bmp_pinceau_gris240;
extern HBRUSH    bmp_pinceau_bleuf2, bmp_pinceau_jauneclair, bmp_pinceau_bleuf3;

extern HPEN      bmp_stylo_, bmp_stylo_noir, bmp_stylo_bleu, bmp_stylo_vert, bmp_stylo_cyan, bmp_stylo_rouge, bmp_stylo_violet;
extern HPEN      bmp_stylo_jaune, bmp_stylo_blanc, bmp_stylo_rougef, bmp_stylo_vertfluo, bmp_stylo_orange, bmp_stylo_marron;
extern HPEN      bmp_stylo_kaki, bmp_stylo_bleuf, bmp_stylo_grisvert, bmp_stylo_vertfonce, bmp_stylo_gris32, bmp_stylo_gris64, bmp_stylo_gris128;
extern HPEN      bmp_stylo_gris192, bmp_stylo_griswin, bmp_stylo_magenta, bmp_stylo_magentaf, bmp_stylo_cyanf, bmp_stylo_vertdeau;
extern HPEN      bmp_stylo_lilas, bmp_stylo_bleulagon, bmp_stylo_verttendre, bmp_stylo_rosefluo, bmp_stylo_saumon, bmp_stylo_rose;
extern HPEN      bmp_stylo_gris220, bmp_stylo_gris230, bmp_stylo_gris240;
extern HPEN      bmp_stylo_bleuf2, bmp_stylo_jauneclair, bmp_stylo_bleuf3;

extern int cfg_relief;

//
void bmp_move(int x, int y, int xo, int yo, int l, int h)
{
	SelectObject(hMemDC,bmp_pinceau_blanc);
	BitBlt(hMemDC,x,y,l,h,bmp_h_dc_mem,xo,yo,MERGECOPY);
}

// Sélectionne la couleur de fond pour dessiner les formes.
//   bmp_select_brush(numéro de couleur)
//
void bmp_select_brush(int no_color)
{
	switch(no_color) {
		case BMP_CST_COLOR_NOIR          : SelectObject(hMemDC,bmp_pinceau_noir         ); break;
		case BMP_CST_COLOR_BLEU          : SelectObject(hMemDC,bmp_pinceau_bleu         ); break;
		case BMP_CST_COLOR_BLEUF2        : SelectObject(hMemDC,bmp_pinceau_bleuf2       ); break;
		case BMP_CST_COLOR_VERT          : SelectObject(hMemDC,bmp_pinceau_vert         ); break;
		case BMP_CST_COLOR_CYAN          : SelectObject(hMemDC,bmp_pinceau_cyan         ); break;
		case BMP_CST_COLOR_ROUGE         : SelectObject(hMemDC,bmp_pinceau_rouge        ); break;
		case BMP_CST_COLOR_VIOLET        : SelectObject(hMemDC,bmp_pinceau_violet       ); break;
		case BMP_CST_COLOR_JAUNE         : SelectObject(hMemDC,bmp_pinceau_jaune        ); break;
		case BMP_CST_COLOR_BLANC         : SelectObject(hMemDC,bmp_pinceau_blanc        ); break;
		case BMP_CST_COLOR_ROUGEF        : SelectObject(hMemDC,bmp_pinceau_rougef       ); break;
		case BMP_CST_COLOR_VERTFLUO      : SelectObject(hMemDC,bmp_pinceau_vertfluo     ); break;
		case BMP_CST_COLOR_ORANGE        : SelectObject(hMemDC,bmp_pinceau_orange       ); break;
		case BMP_CST_COLOR_MARRON        : SelectObject(hMemDC,bmp_pinceau_marron       ); break;
		case BMP_CST_COLOR_KAKI          : SelectObject(hMemDC,bmp_pinceau_kaki         ); break;
		case BMP_CST_COLOR_BLEUF         : SelectObject(hMemDC,bmp_pinceau_bleuf        ); break;
		case BMP_CST_COLOR_GRISVERT      : SelectObject(hMemDC,bmp_pinceau_grisvert     ); break;
		case BMP_CST_COLOR_VERTFONCE     : SelectObject(hMemDC,bmp_pinceau_vertfonce    ); break;
		case BMP_CST_COLOR_GRIS32        : SelectObject(hMemDC,bmp_pinceau_gris32       ); break;
		case BMP_CST_COLOR_GRIS64        : SelectObject(hMemDC,bmp_pinceau_gris64       ); break;
		case BMP_CST_COLOR_GRIS128       : SelectObject(hMemDC,bmp_pinceau_gris128      ); break;
		case BMP_CST_COLOR_GRIS192       : SelectObject(hMemDC,bmp_pinceau_gris192      ); break;
		case BMP_CST_COLOR_GRISWIN       : SelectObject(hMemDC,bmp_pinceau_griswin      ); break;
		case BMP_CST_COLOR_MAGENTA       : SelectObject(hMemDC,bmp_pinceau_magenta      ); break;
		case BMP_CST_COLOR_MAGENTAF      : SelectObject(hMemDC,bmp_pinceau_magentaf     ); break;
		case BMP_CST_COLOR_CYANF         : SelectObject(hMemDC,bmp_pinceau_cyanf        ); break;
		case BMP_CST_COLOR_VERTDEAU      : SelectObject(hMemDC,bmp_pinceau_vertdeau     ); break;
		case BMP_CST_COLOR_LILAS         : SelectObject(hMemDC,bmp_pinceau_lilas        ); break;
		case BMP_CST_COLOR_BLEULAGON     : SelectObject(hMemDC,bmp_pinceau_bleulagon    ); break;
		case BMP_CST_COLOR_VERTTENDRE    : SelectObject(hMemDC,bmp_pinceau_verttendre   ); break;
		case BMP_CST_COLOR_ROSEFLUO      : SelectObject(hMemDC,bmp_pinceau_rosefluo     ); break;
		case BMP_CST_COLOR_SAUMON        : SelectObject(hMemDC,bmp_pinceau_saumon       ); break;
		case BMP_CST_COLOR_ROSE          : SelectObject(hMemDC,bmp_pinceau_rose         ); break;
		case BMP_CST_COLOR_GRIS220       : SelectObject(hMemDC,bmp_pinceau_gris220      ); break;
		case BMP_CST_COLOR_GRIS230       : SelectObject(hMemDC,bmp_pinceau_gris230      ); break;
		case BMP_CST_COLOR_GRIS240       : SelectObject(hMemDC,bmp_pinceau_gris240      ); break;
		case BMP_CST_COLOR_BLEUF3        : SelectObject(hMemDC,bmp_pinceau_bleuf3       ); break;
		default:                           SelectObject(hMemDC,bmp_pinceau_blanc        ); break;
	}
}

// Sélectionne la couleur des traits ou du bord des formes.
//   bmp_select_pen(numéro de couleur)
//
void bmp_select_pen(int no_color)
{
	switch(no_color) {
		case BMP_CST_COLOR_NOIR          : SelectObject(hMemDC,bmp_stylo_noir         ); break;
		case BMP_CST_COLOR_BLEU          : SelectObject(hMemDC,bmp_stylo_bleu         ); break;
		case BMP_CST_COLOR_BLEUF2        : SelectObject(hMemDC,bmp_stylo_bleuf2       ); break;
		case BMP_CST_COLOR_VERT          : SelectObject(hMemDC,bmp_stylo_vert         ); break;
		case BMP_CST_COLOR_CYAN          : SelectObject(hMemDC,bmp_stylo_cyan         ); break;
		case BMP_CST_COLOR_ROUGE         : SelectObject(hMemDC,bmp_stylo_rouge        ); break;
		case BMP_CST_COLOR_VIOLET        : SelectObject(hMemDC,bmp_stylo_violet       ); break;
		case BMP_CST_COLOR_JAUNE         : SelectObject(hMemDC,bmp_stylo_jaune        ); break;
		case BMP_CST_COLOR_BLANC         : SelectObject(hMemDC,bmp_stylo_blanc        ); break;
		case BMP_CST_COLOR_ROUGEF        : SelectObject(hMemDC,bmp_stylo_rougef       ); break;
		case BMP_CST_COLOR_VERTFLUO      : SelectObject(hMemDC,bmp_stylo_vertfluo     ); break;
		case BMP_CST_COLOR_ORANGE        : SelectObject(hMemDC,bmp_stylo_orange       ); break;
		case BMP_CST_COLOR_MARRON        : SelectObject(hMemDC,bmp_stylo_marron       ); break;
		case BMP_CST_COLOR_KAKI          : SelectObject(hMemDC,bmp_stylo_kaki         ); break;
		case BMP_CST_COLOR_BLEUF         : SelectObject(hMemDC,bmp_stylo_bleuf        ); break;
		case BMP_CST_COLOR_GRISVERT      : SelectObject(hMemDC,bmp_stylo_grisvert     ); break;
		case BMP_CST_COLOR_VERTFONCE     : SelectObject(hMemDC,bmp_stylo_vertfonce    ); break;
		case BMP_CST_COLOR_GRIS32        : SelectObject(hMemDC,bmp_stylo_gris32       ); break;
		case BMP_CST_COLOR_GRIS64        : SelectObject(hMemDC,bmp_stylo_gris64       ); break;
		case BMP_CST_COLOR_GRIS128       : SelectObject(hMemDC,bmp_stylo_gris128      ); break;
		case BMP_CST_COLOR_GRIS192       : SelectObject(hMemDC,bmp_stylo_gris192      ); break;
		case BMP_CST_COLOR_GRISWIN       : SelectObject(hMemDC,bmp_stylo_griswin      ); break;
		case BMP_CST_COLOR_MAGENTA       : SelectObject(hMemDC,bmp_stylo_magenta      ); break;
		case BMP_CST_COLOR_MAGENTAF      : SelectObject(hMemDC,bmp_stylo_magentaf     ); break;
		case BMP_CST_COLOR_CYANF         : SelectObject(hMemDC,bmp_stylo_cyanf        ); break;
		case BMP_CST_COLOR_VERTDEAU      : SelectObject(hMemDC,bmp_stylo_vertdeau     ); break;
		case BMP_CST_COLOR_LILAS         : SelectObject(hMemDC,bmp_stylo_lilas        ); break;
		case BMP_CST_COLOR_BLEULAGON     : SelectObject(hMemDC,bmp_stylo_bleulagon    ); break;
		case BMP_CST_COLOR_VERTTENDRE    : SelectObject(hMemDC,bmp_stylo_verttendre   ); break;
		case BMP_CST_COLOR_ROSEFLUO      : SelectObject(hMemDC,bmp_stylo_rosefluo     ); break;
		case BMP_CST_COLOR_SAUMON        : SelectObject(hMemDC,bmp_stylo_saumon       ); break;
		case BMP_CST_COLOR_ROSE          : SelectObject(hMemDC,bmp_stylo_rose         ); break;
		case BMP_CST_COLOR_GRIS220       : SelectObject(hMemDC,bmp_stylo_gris220      ); break;
		case BMP_CST_COLOR_GRIS230       : SelectObject(hMemDC,bmp_stylo_gris230      ); break;
		case BMP_CST_COLOR_GRIS240       : SelectObject(hMemDC,bmp_stylo_gris240      ); break;	
		case BMP_CST_COLOR_BLEUF3        : SelectObject(hMemDC,bmp_stylo_bleuf3       ); break;
		default:                           SelectObject(hMemDC,bmp_stylo_noir         ); break;
	}
}


// Routine interne - Sélectionne la couleur de fond pour dessiner les formes.
// bmp_select_brush(HDC, numéro de couleur)
//

void bmp_select_brush(HDC h_dc_,int no_color)
{
	switch(no_color) {
		case BMP_CST_COLOR_NOIR          : SelectObject(h_dc_,bmp_pinceau_noir         ); break;
		case BMP_CST_COLOR_BLEU          : SelectObject(h_dc_,bmp_pinceau_bleu         ); break;
		case BMP_CST_COLOR_BLEUF2        : SelectObject(h_dc_,bmp_pinceau_bleuf2       ); break;
		case BMP_CST_COLOR_VERT          : SelectObject(h_dc_,bmp_pinceau_vert         ); break;
		case BMP_CST_COLOR_CYAN          : SelectObject(h_dc_,bmp_pinceau_cyan         ); break;
		case BMP_CST_COLOR_ROUGE         : SelectObject(h_dc_,bmp_pinceau_rouge        ); break;
		case BMP_CST_COLOR_VIOLET        : SelectObject(h_dc_,bmp_pinceau_violet       ); break;
		case BMP_CST_COLOR_JAUNE         : SelectObject(h_dc_,bmp_pinceau_jaune        ); break;
		case BMP_CST_COLOR_BLANC         : SelectObject(h_dc_,bmp_pinceau_blanc        ); break;
		case BMP_CST_COLOR_ROUGEF        : SelectObject(h_dc_,bmp_pinceau_rougef       ); break;
		case BMP_CST_COLOR_VERTFLUO      : SelectObject(h_dc_,bmp_pinceau_vertfluo     ); break;
		case BMP_CST_COLOR_ORANGE        : SelectObject(h_dc_,bmp_pinceau_orange       ); break;
		case BMP_CST_COLOR_MARRON        : SelectObject(h_dc_,bmp_pinceau_marron       ); break;
		case BMP_CST_COLOR_KAKI          : SelectObject(h_dc_,bmp_pinceau_kaki         ); break;
		case BMP_CST_COLOR_BLEUF         : SelectObject(h_dc_,bmp_pinceau_bleuf        ); break;
		case BMP_CST_COLOR_GRISVERT      : SelectObject(h_dc_,bmp_pinceau_grisvert     ); break;
		case BMP_CST_COLOR_VERTFONCE     : SelectObject(h_dc_,bmp_pinceau_vertfonce    ); break;
		case BMP_CST_COLOR_GRIS32        : SelectObject(h_dc_,bmp_pinceau_gris32       ); break;
		case BMP_CST_COLOR_GRIS64        : SelectObject(h_dc_,bmp_pinceau_gris64       ); break;
		case BMP_CST_COLOR_GRIS128       : SelectObject(h_dc_,bmp_pinceau_gris128      ); break;
		case BMP_CST_COLOR_GRIS192       : SelectObject(h_dc_,bmp_pinceau_gris192      ); break;
		case BMP_CST_COLOR_GRISWIN       : SelectObject(h_dc_,bmp_pinceau_griswin      ); break;
		case BMP_CST_COLOR_MAGENTA       : SelectObject(h_dc_,bmp_pinceau_magenta      ); break;
		case BMP_CST_COLOR_MAGENTAF      : SelectObject(h_dc_,bmp_pinceau_magentaf     ); break;
		case BMP_CST_COLOR_CYANF         : SelectObject(h_dc_,bmp_pinceau_cyanf        ); break;
		case BMP_CST_COLOR_VERTDEAU      : SelectObject(h_dc_,bmp_pinceau_vertdeau     ); break;
		case BMP_CST_COLOR_LILAS         : SelectObject(h_dc_,bmp_pinceau_lilas        ); break;
		case BMP_CST_COLOR_BLEULAGON     : SelectObject(h_dc_,bmp_pinceau_bleulagon    ); break;
		case BMP_CST_COLOR_VERTTENDRE    : SelectObject(h_dc_,bmp_pinceau_verttendre   ); break;
		case BMP_CST_COLOR_ROSEFLUO      : SelectObject(h_dc_,bmp_pinceau_rosefluo     ); break;
		case BMP_CST_COLOR_SAUMON        : SelectObject(h_dc_,bmp_pinceau_saumon       ); break;
		case BMP_CST_COLOR_ROSE          : SelectObject(h_dc_,bmp_pinceau_rose         ); break;
		case BMP_CST_COLOR_GRIS220       : SelectObject(h_dc_,bmp_pinceau_gris220      ); break;
		case BMP_CST_COLOR_GRIS230       : SelectObject(h_dc_,bmp_pinceau_gris230      ); break;
		case BMP_CST_COLOR_GRIS240       : SelectObject(h_dc_,bmp_pinceau_gris240      ); break;
		case BMP_CST_COLOR_BLEUF3        : SelectObject(h_dc_,bmp_pinceau_bleuf3       ); break;
		default:                           SelectObject(h_dc_,bmp_pinceau_blanc        ); break;
	}
}

// Routine interne à 'bmp.cpp' - Sélectionne la couleur des traits ou du bord des formes.
// bmp_select_pen(HCD, numéro de couleur)
//
void bmp_select_pen(HDC h_dc_,int no_color)
{
	switch(no_color) {
		case BMP_CST_COLOR_NOIR          : SelectObject(h_dc_,bmp_stylo_noir         ); break;
		case BMP_CST_COLOR_BLEUF2        : SelectObject(h_dc_,bmp_stylo_bleuf2       ); break;	
		case BMP_CST_COLOR_BLEU          : SelectObject(h_dc_,bmp_stylo_bleu         ); break;
		case BMP_CST_COLOR_VERT          : SelectObject(h_dc_,bmp_stylo_vert         ); break;
		case BMP_CST_COLOR_CYAN          : SelectObject(h_dc_,bmp_stylo_cyan         ); break;
		case BMP_CST_COLOR_ROUGE         : SelectObject(h_dc_,bmp_stylo_rouge        ); break;
		case BMP_CST_COLOR_VIOLET        : SelectObject(h_dc_,bmp_stylo_violet       ); break;
		case BMP_CST_COLOR_JAUNE         : SelectObject(h_dc_,bmp_stylo_jaune        ); break;
		case BMP_CST_COLOR_BLANC         : SelectObject(h_dc_,bmp_stylo_blanc        ); break;
		case BMP_CST_COLOR_ROUGEF        : SelectObject(h_dc_,bmp_stylo_rougef       ); break;
		case BMP_CST_COLOR_VERTFLUO      : SelectObject(h_dc_,bmp_stylo_vertfluo     ); break;
		case BMP_CST_COLOR_ORANGE        : SelectObject(h_dc_,bmp_stylo_orange       ); break;
		case BMP_CST_COLOR_MARRON        : SelectObject(h_dc_,bmp_stylo_marron       ); break;
		case BMP_CST_COLOR_KAKI          : SelectObject(h_dc_,bmp_stylo_kaki         ); break;
		case BMP_CST_COLOR_BLEUF         : SelectObject(h_dc_,bmp_stylo_bleuf        ); break;
		case BMP_CST_COLOR_GRISVERT      : SelectObject(h_dc_,bmp_stylo_grisvert     ); break;
		case BMP_CST_COLOR_VERTFONCE     : SelectObject(h_dc_,bmp_stylo_vertfonce    ); break;
		case BMP_CST_COLOR_GRIS32        : SelectObject(h_dc_,bmp_stylo_gris32       ); break;
		case BMP_CST_COLOR_GRIS64        : SelectObject(h_dc_,bmp_stylo_gris64       ); break;
		case BMP_CST_COLOR_GRIS128       : SelectObject(h_dc_,bmp_stylo_gris128      ); break;
		case BMP_CST_COLOR_GRIS192       : SelectObject(h_dc_,bmp_stylo_gris192      ); break;
		case BMP_CST_COLOR_GRISWIN       : SelectObject(h_dc_,bmp_stylo_griswin      ); break;
		case BMP_CST_COLOR_MAGENTA       : SelectObject(h_dc_,bmp_stylo_magenta      ); break;
		case BMP_CST_COLOR_MAGENTAF      : SelectObject(h_dc_,bmp_stylo_magentaf     ); break;
		case BMP_CST_COLOR_CYANF         : SelectObject(h_dc_,bmp_stylo_cyanf        ); break;
		case BMP_CST_COLOR_VERTDEAU      : SelectObject(h_dc_,bmp_stylo_vertdeau     ); break;
		case BMP_CST_COLOR_LILAS         : SelectObject(h_dc_,bmp_stylo_lilas        ); break;
		case BMP_CST_COLOR_BLEULAGON     : SelectObject(h_dc_,bmp_stylo_bleulagon    ); break;
		case BMP_CST_COLOR_VERTTENDRE    : SelectObject(h_dc_,bmp_stylo_verttendre   ); break;
		case BMP_CST_COLOR_ROSEFLUO      : SelectObject(h_dc_,bmp_stylo_rosefluo     ); break;
		case BMP_CST_COLOR_SAUMON        : SelectObject(h_dc_,bmp_stylo_saumon       ); break;
		case BMP_CST_COLOR_ROSE          : SelectObject(h_dc_,bmp_stylo_rose         ); break;
		case BMP_CST_COLOR_GRIS220       : SelectObject(h_dc_,bmp_stylo_gris220      ); break;
		case BMP_CST_COLOR_GRIS230       : SelectObject(h_dc_,bmp_stylo_gris230      ); break;
		case BMP_CST_COLOR_GRIS240       : SelectObject(h_dc_,bmp_stylo_gris240      ); break;
		case BMP_CST_COLOR_BLEUF3        : SelectObject(h_dc_,bmp_stylo_bleuf3       ); break;
		default:                           SelectObject(h_dc_,bmp_stylo_noir         ); break;
	}
}

// Sous programme pour définir la couleur du texte.
//   bmp_SetTextColor(numéro de couleur).  Numéro de couleur = BMP_CST_COLOR_NOIR, BMP_CST_COLOR_BLEU, BMP_CST_COLOR_VERT,...
//
// Sous programme interne à 'bmp.cpp'. Est appelé par 'bmp_SetTextColor(couleur)'.
//
void bmp_SetTextColor(HDC h_dc_,int no_color)
{
	switch(no_color) {
		case BMP_CST_COLOR_NOIR      : SetTextColor(h_dc_,RGB(  0,  0,  0)); break;	//ok 0,0,0
		case BMP_CST_COLOR_BLEUF2    : SetTextColor(h_dc_,RGB(  0,  0,128)); break;	//
		case BMP_CST_COLOR_BLEUF     : SetTextColor(h_dc_,RGB(  0,  0,255)); break;	//
		case BMP_CST_COLOR_VERTFONCE : SetTextColor(h_dc_,RGB(  0,128,  0)); break;	//ok
		case BMP_CST_COLOR_CYANF     : SetTextColor(h_dc_,RGB(  0,128,128)); break;	//ok
		case BMP_CST_COLOR_BLEU      : SetTextColor(h_dc_,RGB(  0,128,255)); break;	//
		case BMP_CST_COLOR_VERT      : SetTextColor(h_dc_,RGB(  0,220,  0)); break;	//ok
		case BMP_CST_COLOR_VERTDEAU  : SetTextColor(h_dc_,RGB(  0,255,128)); break;
		case BMP_CST_COLOR_CYAN      : SetTextColor(h_dc_,RGB(  0,255,255)); break;	//

		case BMP_CST_COLOR_GRIS32    : SetTextColor(h_dc_,RGB( 32, 32, 32)); break;
		case BMP_CST_COLOR_GRIS64    : SetTextColor(h_dc_,RGB( 64, 64, 64)); break;
		case BMP_CST_COLOR_GRISVERT  : SetTextColor(h_dc_,RGB( 80,155,155)); break;	// Fond de fenêtre d'édition

		case BMP_CST_COLOR_ROUGEF    : SetTextColor(h_dc_,RGB(128,  0,  0)); break;	//
		case BMP_CST_COLOR_MAGENTAF  : SetTextColor(h_dc_,RGB(128,  0,128)); break;
		case BMP_CST_COLOR_VIOLET    : SetTextColor(h_dc_,RGB(128,  0,255)); break;	//
		case BMP_CST_COLOR_MARRON    : SetTextColor(h_dc_,RGB(128, 64,  0)); break;	//
		case BMP_CST_COLOR_KAKI      : SetTextColor(h_dc_,RGB(128,128,  0)); break;	//
		case BMP_CST_COLOR_GRIS128   : SetTextColor(h_dc_,RGB(128,128,128)); break;
		case BMP_CST_COLOR_LILAS     : SetTextColor(h_dc_,RGB(128,128,255)); break;
		case BMP_CST_COLOR_VERTFLUO  : SetTextColor(h_dc_,RGB(128,255,  0)); break;	//
		case BMP_CST_COLOR_VERTTENDRE: SetTextColor(h_dc_,RGB(128,255,128)); break;
		case BMP_CST_COLOR_BLEULAGON : SetTextColor(h_dc_,RGB(128,255,255)); break;

		case BMP_CST_COLOR_GRIS192   : SetTextColor(h_dc_,RGB(192,192,192)); break;
		case BMP_CST_COLOR_GRISWIN   : SetTextColor(h_dc_,RGB(212,208,200)); break;
		case BMP_CST_COLOR_GRIS220   : SetTextColor(h_dc_,RGB(220,220,220)); break;
		case BMP_CST_COLOR_GRIS230   : SetTextColor(h_dc_,RGB(230,230,230)); break;
		case BMP_CST_COLOR_GRIS240   : SetTextColor(h_dc_,RGB(240,240,240)); break;

		case BMP_CST_COLOR_ROUGE     : SetTextColor(h_dc_,RGB(255,  0,  0)); break;	//ok
		case BMP_CST_COLOR_ROSEFLUO  : SetTextColor(h_dc_,RGB(255,  0,128)); break;
		case BMP_CST_COLOR_MAGENTA   : SetTextColor(h_dc_,RGB(255,  0,225)); break;
		case BMP_CST_COLOR_ORANGE    : SetTextColor(h_dc_,RGB(255,102,  0)); break;	// 255,102,0
		case BMP_CST_COLOR_SAUMON    : SetTextColor(h_dc_,RGB(255,128,128)); break;
		case BMP_CST_COLOR_ROSE      : SetTextColor(h_dc_,RGB(255,128,255)); break;
		case BMP_CST_COLOR_JAUNE     : SetTextColor(h_dc_,RGB(250,250,  0)); break;	//ok
		case BMP_CST_COLOR_JAUNECLAIR: SetTextColor(h_dc_,RGB(250,250,100)); break;	//ok
		case BMP_CST_COLOR_BLANC     : SetTextColor(h_dc_,RGB(255,255,255)); break;	//ok 255,255,255

		case BMP_CST_COLOR_BLEUF3    : SetTextColor(h_dc_,RGB( 38, 62,148)); break;

		default:                       SetTextColor(h_dc_,RGB(  0,  0,  0)); break;	//ok
	}
}


//
void bmp_SetTextColor(int no_color)
{
	bmp_SetTextColor(hMemDC,no_color);
}


//
void font_pinceau_stylo_init(void)
{
	bmp_fonte=CreateFont(15,10,0,0,400,0,0,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_MODERN,"Courier");

    bmp_pinceau_noir      = CreateSolidBrush(RGB(  0,  0,  0));
	bmp_pinceau_bleuf2    = CreateSolidBrush(RGB(  0,  0,128));
	bmp_pinceau_bleuf     = CreateSolidBrush(RGB(  0,  0,255));
	bmp_pinceau_vertfonce = CreateSolidBrush(RGB(  0,128,  0));
	bmp_pinceau_cyanf     = CreateSolidBrush(RGB(  0,128,128));
	bmp_pinceau_bleu      = CreateSolidBrush(RGB(  0,128,255));
	bmp_pinceau_vert      = CreateSolidBrush(RGB(  0,220,  0));
	bmp_pinceau_vertdeau  = CreateSolidBrush(RGB(  0,240,128));
	bmp_pinceau_cyan      = CreateSolidBrush(RGB(  0,255,255));
		
	bmp_pinceau_gris32    = CreateSolidBrush(RGB( 32, 32, 32));
	bmp_pinceau_gris64    = CreateSolidBrush(RGB( 64, 64, 64));
	bmp_pinceau_grisvert  = CreateSolidBrush(RGB( 80,155,155));
		
	bmp_pinceau_rougef    = CreateSolidBrush(RGB(150, 10, 10));
	bmp_pinceau_magentaf  = CreateSolidBrush(RGB(128,  0,128));
	bmp_pinceau_violet    = CreateSolidBrush(RGB(128,  0,255));
	bmp_pinceau_marron    = CreateSolidBrush(RGB(128, 64,  0));
	bmp_pinceau_kaki      = CreateSolidBrush(RGB(128,128,  0));
	bmp_pinceau_gris128   = CreateSolidBrush(RGB(128,128,128));
	bmp_pinceau_lilas     = CreateSolidBrush(RGB(128,128,255));
	bmp_pinceau_vertfluo  = CreateSolidBrush(RGB(128,240,  0));
	bmp_pinceau_verttendre= CreateSolidBrush(RGB(110,240,110));
	bmp_pinceau_bleulagon = CreateSolidBrush(RGB(128,240,240));

	bmp_pinceau_gris192   = CreateSolidBrush(RGB(192,192,192));
	bmp_pinceau_griswin   = CreateSolidBrush(RGB(212,208,200));
	bmp_pinceau_gris220   = CreateSolidBrush(RGB(220,220,220));
	bmp_pinceau_gris230   = CreateSolidBrush(RGB(230,230,230));
	bmp_pinceau_gris240   = CreateSolidBrush(RGB(240,240,240));
	
	bmp_pinceau_rouge     = CreateSolidBrush(RGB(255,  0,  0));
	bmp_pinceau_rosefluo  = CreateSolidBrush(RGB(250,  0,128));
	bmp_pinceau_magenta   = CreateSolidBrush(RGB(255,  0,225));
	
	bmp_pinceau_orange    = CreateSolidBrush(RGB(255,102,  0));
	bmp_pinceau_saumon    = CreateSolidBrush(RGB(250,110,110));
	bmp_pinceau_rose      = CreateSolidBrush(RGB(250,110,250));
	bmp_pinceau_jaune     = CreateSolidBrush(RGB(250,250,  0));
	bmp_pinceau_jauneclair= CreateSolidBrush(RGB(250,250,100));
	bmp_pinceau_blanc     = CreateSolidBrush(RGB(255,255,255));

	bmp_pinceau_bleuf3    = CreateSolidBrush(RGB( 38, 62,148));


	bmp_stylo_noir      = CreatePen(PS_SOLID,1,RGB(  0,  0,  0));
	bmp_stylo_bleuf2    = CreatePen(PS_SOLID,1,RGB(  0,  0,128));
	bmp_stylo_bleuf     = CreatePen(PS_SOLID,1,RGB(  0,  0,255));
	bmp_stylo_vertfonce = CreatePen(PS_SOLID,1,RGB(  0,128,  0));
	bmp_stylo_cyanf     = CreatePen(PS_SOLID,1,RGB(  0,128,128));
	bmp_stylo_bleu      = CreatePen(PS_SOLID,1,RGB(  0,128,255));
	bmp_stylo_vert      = CreatePen(PS_SOLID,1,RGB(  0,220,  0));
	bmp_stylo_vertdeau  = CreatePen(PS_SOLID,1,RGB(  0,240,128));
	bmp_stylo_cyan      = CreatePen(PS_SOLID,1,RGB(  0,255,255));
		
	bmp_stylo_gris32    = CreatePen(PS_SOLID,1,RGB( 32, 32, 32));
	bmp_stylo_gris64    = CreatePen(PS_SOLID,1,RGB( 64, 64, 64));
	bmp_stylo_grisvert  = CreatePen(PS_SOLID,1,RGB( 80,155,155));
		
	bmp_stylo_rougef    = CreatePen(PS_SOLID,1,RGB(150, 10, 10));
	bmp_stylo_magentaf  = CreatePen(PS_SOLID,1,RGB(128,  0,128));
	bmp_stylo_violet    = CreatePen(PS_SOLID,1,RGB(128,  0,255));
	bmp_stylo_marron    = CreatePen(PS_SOLID,1,RGB(128, 64,  0));
	bmp_stylo_kaki      = CreatePen(PS_SOLID,1,RGB(128,128,  0));
	bmp_stylo_gris128   = CreatePen(PS_SOLID,1,RGB(128,128,128));
	bmp_stylo_lilas     = CreatePen(PS_SOLID,1,RGB(128,128,250));
	bmp_stylo_vertfluo  = CreatePen(PS_SOLID,1,RGB(128,240,  0));
	bmp_stylo_verttendre= CreatePen(PS_SOLID,1,RGB(110,240,110));
	bmp_stylo_bleulagon = CreatePen(PS_SOLID,1,RGB(128,240,240));

	bmp_stylo_gris192   = CreatePen(PS_SOLID,1,RGB(192,192,192));
	bmp_stylo_griswin   = CreatePen(PS_SOLID,1,RGB(212,208,200));
	bmp_stylo_gris220   = CreatePen(PS_SOLID,1,RGB(220,220,220));
	bmp_stylo_gris230   = CreatePen(PS_SOLID,1,RGB(230,230,230));
	bmp_stylo_gris240   = CreatePen(PS_SOLID,1,RGB(240,240,240));
	
	bmp_stylo_rouge     = CreatePen(PS_SOLID,1,RGB(255,  0,  0));
	bmp_stylo_rosefluo  = CreatePen(PS_SOLID,1,RGB(250,  0,128));
	bmp_stylo_magenta   = CreatePen(PS_SOLID,1,RGB(255,  0,225));
	
	bmp_stylo_orange    = CreatePen(PS_SOLID,1,RGB(250,102,  0));
	bmp_stylo_saumon    = CreatePen(PS_SOLID,1,RGB(250,110,110));
	bmp_stylo_rose      = CreatePen(PS_SOLID,1,RGB(250,110,250));
	bmp_stylo_jaune     = CreatePen(PS_SOLID,1,RGB(250,250,  0));
	bmp_stylo_jauneclair= CreatePen(PS_SOLID,1,RGB(250,250,100));
	bmp_stylo_blanc     = CreatePen(PS_SOLID,1,RGB(255,255,255));
	bmp_stylo_bleuf3    = CreatePen(PS_SOLID,1,RGB( 38, 62,148));

}

// Sous programme pour afficher le fond d'écran, quand on ne sélectionne pas un TCO.
// L'écran par défaut fait 32 * 25 cases de TCO. Une marge de 10 pixels est prévue autour.
//
void bmp_fond_default(void)
{
	if (cfg_relief==1) SelectObject(hMemDC,bmp_pinceau_griswin); else SelectObject(hMemDC,bmp_pinceau_blanc);
	SelectObject(hMemDC,bmp_stylo_gris220);
	Rectangle(hMemDC,0,0, CELLS_X_NB*CELLS_SIZE, CELLS_Y_NB*CELLS_SIZE);
}
