Violation d'accès à l'adresse...

Résolu
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 - 26 août 2010 à 17:26
 Utilisateur anonyme - 28 août 2010 à 22:49
Salut!
Au moment où je dépose mon composant sur une fiche il m'affiche cette erreur :

"violation d'accès à l'adresse 03293CEC dans le module TBTreeGraph.bpl. Ecriture à l'adresse 1758AE60".

C'est le genre d'erreur que je suis incapable d'analyser! Sauf quand il propose de voir le contenu de la mémoire, j'arrive parfois à déterminer l'instruction qui pose problème. Mais là, rien!

Ensuite, je vérifie le code et je trouve généralement l'erreur, mais je n'en vois pas!

J'ai donc désinstaller le composant et réinstallé, tout se passe bien, mais dès que je veux déposer le composant sur la Fiche, ça me ressort l'erreur.

Qu'en pensez-vous?
j'ai eu quelques plantages auparavant car j'avais affecté une propriété de Font sans avoir au préalable créé le type Font. J'ai été obligé de redémarrer D7.

Comment identifier l'erreur?
Que feriez-vous, avant que je décide à réécrire tout la composant?
Merci pour votre aide.


Jean_Jean

16 réponses

Guillemouze Messages postés 991 Date d'inscription samedi 25 octobre 2003 Statut Membre Dernière intervention 29 août 2013 6
27 août 2010 à 09:12
Dans delphi 7, tu ouvre le dpk qui contient ton composant, et dans le menu Executer->parametres, tu met le chemin complet de delphi32.exe dans "application hote". Ensuite, tu peux faire "Executer" et ca te demarrera une aurtre instance de delphi, dans laquelle tu met ton composant et tu verra ou ca plante comme dans nimporte quel exe (ou plutot dll, car un dpk/bpl n'est rien d'autre qu'une dll)
PS: c'est un peu chiant a debugger car une partie du code n'est pas accessible, donc certains "pas à pas" sont tres long a passer d'un pas à un autre, et pire avec le "pas à pas approfondi"
3
Utilisateur anonyme
26 août 2010 à 17:44
Salut,

Passe nous le code de la bète Jean_Jean, qu'on lui fasse une autopsie : Et fais pas ta chochotte hein
0
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
26 août 2010 à 18:01
Je te l'envoie comment? Il est un peu long pour le mettre ici. Sur ta boite privée?
bon on va pas chochoter 2 h. Est-ce que ta besoin du programme test?
Merci à toi

Jean_Jean
0
Utilisateur anonyme
26 août 2010 à 18:12
Oh là tu commences à chochotter toi : Tu peux mettre le tout dans un zip et l'héberger ici mais pense à nous donner le lien
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
26 août 2010 à 18:25
{==================================================}
{ COMPOSANT VISUEL DE B - ARBRE }
{==================================================}
- le composant est en conception :
1. Les étiquettes sont encore en réglage car j'ai rajouté une zone de titre, je ne sais plus si l'arbre s'affiche correctement, mais ça n'est pas le problème
2. Je n'ai pas encore intégré la solution de l'éditeur de propriété
3. Les figures géométriques ne sont pas finies...
Je n'ai rien touché au code pour le diagnostic, simplement les commentaires perso pour alléger!
Merci Francky!
===================================================}
unit CBTreeGraph;
{$R-,W-,S-}

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,Math;

Type

{==================================================

COMPOSANT TBTreeGraph

===================================================}
{Type pour Debug}
Const
MaxCteColor = 51;

kStrColor : array[1..MaxcteColor] of string[78] = (
'Blanc sur Windows 9x, noir sur NT','Couleur de la barre de défilement',
'Aqua','Couleur du fond du bureau Windows','Noir',
'Couleur de la barre de titre de la fenêtre active','Bleu',
'Couleur de la barre de titre des fenêtres inactives','Crème',
'Couleur du fond des menus','Gris foncé',
'Couleur du fond des fenêtres','Fuchsia',
'Couleur des cadres de fenêtres','Gris','Couleur du texte des menus',
'Vert','Couleur du texte dans les fenêtres','Vert citron',
'Couleur du texte de la barre de titres de la fenêtre active',
'Gris clair','Couleur de la bordure de la fenêtre active',
'Marron','Couleur de la bordure des fenêtres inactives',
'Gris moyen','Couleur de l''espace de travail de l''application',
'Vert menthe','Couleur du fond du texte sélectionné',
'Bleu marine','Couleur du texte sélectionné',
'Vert olive','Couleur de la face d''un bouton',
'Violet','Couleur de l''ombre projetée par un bouton',
'Rouge','Couleur d''un texte estompé','Argent',
'Couleur du texte sur un bouton','Bleu ciel',
'Couleur du texte de la barre de titre des fenêtres inactives',
'Sarcelle','Couleur d''un bouton sélectionné','Blanc',
'Win 95 & NT 4.0 : ombre foncée des éléments s''affichant en 3D',
'Jaune','Win 95 & NT 4.0 : couleur claire en 3D (côtés faces à la lumière)',
'Win 95 & NT 4.0 : couleur du texte des fenêtres de conseils',
'Win 95 & NT 4.0 : couleur du fond des fenêtres de conseils',
'Win 98 & 2000 : coul. à droite du dégradé barre de titre fenêtre active',
'Win 98 & 2000 : coul.à droite du dégradé barre de titre fenêtre inactive',
'Couleur par défaut pour le contrôle auquel la couleur est affectée');
Type
{ définition des types utilisés}
TTypeData = (tdChar,tdInteger,tdReal,tdString);
TTypeDataModeInput =(tdmiListByNiveau);

TDataSeparator =(tdsPoint,tdsComma,tdsPointComma,tdsReturn,tdsSlash,
tdsVertical,tdsDash,tdsSpace,tdsBottomDash,DoublePoint);
// //('.',',',';',#13,'/','|','-',' ','_',':');
TTypeEtiquet = (teCircle,teEllipse,teSquare,teRoundSquare,teRect,
teRoundRect,teTriangle,teParallelogram,teTrapezoid,
tePentagon,teHexagon,teOctagon,teNonagone,teStar,teBubble);
TTypeConnexion = (tcSolid,tcShortDodded,tcLongDotted,TcMixedDodded,tcDoubleLine);
TAlignText = (taLeftBottom,taLeftCenter,taLeftTop,
taCenterBottom,taCenterCenter,taCenterTop,
taRightBottom,taRightCenter,taRigthTop);

{===================================================
CLASSE TITLE
===================================================}
type
TBTreeGraph = class;

TBTreeGraphTitle = class(TPersistent)
private
FBTreeGraph : TBTreeGraph;
FBackGroundBrush : TBrush;
FTextBrush : TBrush;
FFont : TFont;
FHeight : Integer;
FText : String;
FAlignText : TAlignText;
procedure SetBackgroundBrush(New : TBrush);
procedure SetTextBrush(New : TBrush);
procedure SetFont(New : TFont);
procedure SetHeight(Value : Integer);
procedure SetText(Value : String);
procedure SetAlignText(Value : TAlignText);
public
constructor Create(aOwner : TBTreeGraph);
destructor Destroy; override;
procedure Assign(Source : TPersistent); override;
published
property BackGroundBrush : TBrush read FBackgroundBrush write SetBackgroundBrush;
property TextBrush : TBrush read FTextBrush write SetTextBrush;
property Font : TFont read FFont write SetFont;
property Height : Integer read FHeight write SetHeight;
property Text : String read FText write SetText;
property AlignText : TAlignText read FAlignText write SetAlignText;
end;


{===================================================
CLASSE TTREEGRAPH
===================================================}
TBTreeGraph = class(TGraphicControl)
private
Rect : TRect;
MemDC : HDC;
BmpTree : TBitmap;
NbEleMax : LongInt;
FBrush : TBrush;
FPen : TPen;
FAutosize : Boolean;
FTransparent : Boolean;
FBmpStretch : Boolean;
FDataType : TTypeData;
FDataModeInput : TTypeDataModeInput;
FDataSeparator : TDataSeparator;
FDataInteger : Integer;
FDataReal : Extended;
FDataChar : Char;
FDataString : String;
FCenterPointEtiquette : array of Tpoint;
FTabExistenceNoeuds : array of Boolean;
FBackgroundColor : TColor;
FTitle : TBTreeGraphTitle;
FShadowEtiquette : Boolean;
FFrameShadowEtiquette : Boolean;
FShadowEtiquetteOffset : Integer; // décalage de l'ombre
FShadowEtiquetteColor : TColor;
FShadowEtiquetteFramecolor : Tcolor;
FEtiquetteColor : TColor;
FEtiquetteFrameColor : TColor;
FEtiquetteTextColor : TColor;
FConnectColor : Tcolor;
FBmpTransparentColor : TColor;
FEtiquette : TTypeEtiquet;
FConnexion : TTypeConnexion;
FConnect : boolean; // visualisation des liens entre cellules
FTreeFull : boolean; // Arbre plein jusqu'au niveau spécifié
FHeightEtiq : Integer; // hauteur d'une cellule de donnée (étiquette)
FWidthEtiq : Integer; // largeur d'une étiquette
FWidthSpace : Integer; // espace entre étiquettes
FHeightSpace : integer;
FOrdreArbre : integer; // Ordre arbre = Nb de fils Max d'un Noeud (Page)
FHauteurArbre : Integer; // hauteur (Niveau) max en nbre de cellules
FNbFeuillesMax : Integer; // largeur max en nombre de feuilles de l'arbre
procedure ChangeRedraw(Sender: TObject);
procedure InitializeTableauExistenceNoeuds(NombreMaxElements : LongInt; Var FTabExistenceNoeuds : array of boolean);
procedure InitializeCentresEtiquettes(NombreElements : LongInt; var FCenterPointEtiquette : array of Tpoint);
procedure SetBrush(Value: TBrush);
procedure SetPen(Value: TPen);
procedure SetTransparent(Value: Boolean);
procedure SetAutoSize(Value: Boolean);
procedure SetBmpStretch(Value: Boolean);
procedure SetTypeData(Value : TTypeData);
procedure SetDataModeInput(Value : TTypeDataModeInput);
procedure SetDataSeparator(Value : TDataSeparator);
procedure SetDataInteger(Value : Integer);
procedure setDataReal(Value : Extended);
procedure SetDataChar(Value : Char);
procedure SetDataString(Value : String);
procedure SetBackgroundColor(const Value: TColor);
procedure SetTitle(Value : TBTreeGraphTitle);
procedure SetShadowEtiquette(Value: Boolean);
procedure SetFrameShadowEtiquette(Value: Boolean);
procedure SetShadowOffset(Value: Integer);
procedure SetShadowColor(Value: TColor);
procedure SetShadowFramecolor(Value : Tcolor);
procedure SetEtiquetteColor(Value: TColor);
procedure SetEtiquetteFrameColor(Value : TColor);
procedure SetEtiquetteTextColor(Value: TColor);
procedure SetConnectColor(Value: TColor);
procedure SetBmpTransparentColor(const Value: TColor);
procedure SetEtiquette(value: TTypeEtiquet);
procedure SetConnexion(value : TTypeConnexion);
procedure SetConnected(value : Boolean);
procedure SetTreeFull(value : Boolean);
procedure SetHeightEtiquette(Value : Integer);
procedure SetWidthEtiquette(Value : Integer);
procedure SetWidthSpace(Value : Integer);
procedure SetHeightSpace(Value : Integer);
procedure SetOrdreArbre(Value : Integer);
procedure SetHauteurarbre(Value : Integer);
procedure SetNumberFeuillesMax(Value : Integer);
procedure DrawShadowEtiqCircle(Const Centre : TPoint);
procedure DrawEtiqCircle(Const Centre : TPoint);
procedure DrawShadowEtiqEllipse(Const Centre : TPoint);
procedure DrawEtiqEllipse(Const Centre : TPoint);
procedure DrawShadowEtiqSquare(Const Centre : TPoint);
procedure DrawEtiqSquare(Const Centre : TPoint);
procedure DrawShadowEtiqRect(Const Centre : TPoint);
procedure DrawEtiqRect(Const Centre : TPoint);
procedure DrawShadowEtiqRoundSquare(Const Centre : TPoint);
procedure DrawEtiqRoundSquare(Const Centre : TPoint);
procedure DrawShadowEtiqRoundrect(Const Centre : TPoint);
procedure DrawEtiqRoundrect(Const Centre : TPoint);
procedure DrawShadowEtiqTriangle(Const Centre : TPoint);
procedure DrawEtiqTriangle(Const Centre : TPoint);
procedure DrawShadowEtiqParallelogram(Const Centre : TPoint);
procedure DrawEtiqParallelogram(Const Centre : TPoint);
procedure DrawShadowEtiqTrapezoid(Const Centre : TPoint);
procedure DrawEtiqTrapezoid(Const Centre : TPoint);
procedure DrawShadowEtiqPentagon(Const Centre : TPoint);
procedure DrawEtiqPentagon(Const Centre : TPoint);
procedure DrawShadowEtiqHexagon(Const Centre : TPoint);
procedure DrawEtiqHexagon(Const Centre : TPoint);
procedure DrawShadowEtiqOctagon(Const Centre : TPoint);
procedure DrawEtiqOctagon(Const Centre : TPoint);
procedure DrawShadowEtiqNonagon(Const Centre : TPoint);
procedure DrawEtiqNonagon(Const Centre : TPoint);
procedure DrawShadowEtiqStar(Const Centre : TPoint);
procedure DrawEtiqStar(Const Centre : TPoint);
procedure DrawShadowEtiqBuble(Const Centre : TPoint);
procedure DrawEtiqBuble(Const Centre : TPoint);
protected
procedure Paint; override;
procedure PaintTitle;
procedure PaintShadowEtiquette(Const Centre : TPoint); virtual;
procedure PaintEtiquette(Const Centre : TPoint); virtual;
function CalcPoly(var Points: Array of TPoint; Source: Array of TPoint; AWidth, AHeight: Integer): Boolean;// override;
procedure OffsetPoly(var Points: Array of TPoint; OfsX,OfsY: Integer); virtual;
Function NbMaxElements(Const OrdreArbre : Integer; Const NbNiveau : Integer) : LongInt;virtual;
Procedure TextSizeWH(Texte : string; Police : TFont; Var Wtext,Htext : Integer); virtual;
// Function SeparatorToIdent(Separator : Integer; Var Ident : String):Boolean;
// Function IdentToSeparator(const Ident : string; Var Separator : Integer):Boolean;
Function NbFreresMaxIntoNiv(Const OrdreArbre : Integer; Const Niveau : Integer) : Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Align;
property Brush: TBrush read FBrush write SetBrush;
property DragCursor;
property DragMode;
property Enabled;
property ParentShowHint;
property Pen: TPen read FPen write SetPen;
property Transparent: Boolean read FTransparent write SetTransparent;
property Autosize : Boolean read FAutosize write SetAutoSize;
property BmpStretch: Boolean read FBmpStretch write SetBmpStretch;
property DataType : TTypeData read FDataType write SetTypeData;
property DataModeInput : TTypeDataModeInput read FDataModeInput write SetDataModeInput;
property DataSeparator : TDataSeparator read FDataSeparator write SetDataSeparator;
property DataInteger : Integer read FDataInteger write SetDataInteger;
property DataReal : Extended read FDataReal write SetDataReal;
property DataChar : Char read FDataChar write SetDataChar;
property DataString : String read FDataString write SetDataString;
property BackgroundColor: Tcolor read FBackgroundColor write SetBackgroundColor default clGreen;
property Title : TBtreeGraphTitle read FTitle write SetTitle;
property ShadowEtiquette: Boolean read FShadowEtiquette write SetShadowEtiquette;
property FrameShadowEtiquette: Boolean read FFrameShadowEtiquette write SetFrameShadowEtiquette;
property ShadowEtiquetteOffset: Integer read FShadowEtiquetteOffset write SetShadowOffset;
property ShadowEtiquetteColor : TColor read FShadowEtiquetteColor write SetShadowColor;
property EtiquetteColor : TColor read FEtiquetteColor write SetEtiquetteColor;
property EtiquetteFrameColor : TColor read FEtiquetteFrameColor write SetEtiquetteFrameColor;
property ShadowEtiquetteFrameColor : TColor read FShadowEtiquetteFramecolor write SetShadowFrameColor;
property EtiquetteTextColor : TColor read FEtiquetteTextColor write SetEtiquetteTextColor;
property ConnectColor : TColor read FConnectColor write SetConnectColor;
property BmpTransparentColor: TColor read FBmpTransparentColor write SetBmpTransparentColor;
property Etiquette: TTypeEtiquet read FEtiquette write SetEtiquette;
property Connexion: TTypeConnexion read FConnexion write SetConnexion;
property Connected: Boolean read FConnect write SetConnected;
property TreeFull : Boolean read FTreeFull write SetTreeFull;
property HeightEtiquette : Integer read FHeightEtiq write SetHeightEtiquette;
property WidthEtiquette : Integer read FWidthEtiq write SetWidthEtiquette;
property WidthSpace : Integer read FWidthSpace write SetWidthSpace;
property HeightSpace : Integer read FHeightSpace write SetHeightSpace;
property OrdreArbre : Integer read FOrdreArbre write SetOrdreArbre;
property HauteurArbre : Integer read FHauteurArbre write SetHauteurarbre;
property NumberFeuilles : Integer read FNbFeuillesMax write SetNumberFeuillesMax;
property ShowHint;
property Visible;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;

Const
MaxFormesEtiquettes = 15;
MaxFormesConnect = 5;
MaxDataDef = 13;
NbDataDef = 9; // affichage de neuf donnéespar défaut : BTree(3,3)

procedure Register;

implementation

procedure Register;
begin
// RegisterPropertyEditor(TypeInfo(TSeparator),Nil,TSeparatorProperty);
RegisterComponents('Test', [TBTreeGraph]);
end;

{-------------------------------------------------------------------------------
Fonction servant au Débugage
-------------------------------------------------------------------------------}
Function ColorToString(Const aColor : TColor) : String;
begin
result := 'Couleur non typée';
Case aColor of
clNone : result := kStrColor[1];
clScrollBar : result := kStrColor[2];
clAqua : result := kStrColor[3];
clBackground : result := kStrColor[4];
clBlack : result := kStrColor[5];
clActiveCaption : result := kStrColor[6];
clBlue : result := kStrColor[7];
clInactiveCaption : result := kStrColor[8];
clCream : result := kStrColor[9];
clMenu : result := kStrColor[10];
clDkGray : result := kStrColor[11];
clWindow : result := kStrColor[12];
clFuchsia : result := kStrColor[13];
clWindowFrame : result := kStrColor[14];
// clGray : result := kStrColor[15];
clMenuText : result := kStrColor[16];
clGreen : result := kStrColor[17];
clWindowText : result := kStrColor[18];
clLime : result := kStrColor[19];
clCaptionText : result := kStrColor[20];
clLtGray : result := kStrColor[21];
clActiveBorder : result := kStrColor[22];
clMaroon : result := kStrColor[23];
clInactiveBorder : result := kStrColor[24];
clMedGray : result := kStrColor[25];
clAppWorkSpace : result := kStrColor[26];
clMoneyGreen : result := kStrColor[27];
clHighlight : result := kStrColor[28];
clNavy : result := kStrColor[29];
// clHightlightText : result := kStrColor[30];
clOlive : result := kStrColor[31];
clBtnFace : result := kStrColor[32];
clPurple : result := kStrColor[33];
clBtnShadow : result := kStrColor[34];
clRed : result := kStrColor[35];
clGrayText : result := kStrColor[36];
// clSilver : result := kStrColor[37];
clBtnText : result := kStrColor[38];
clSkyBlue : result := kStrColor[39];
clInactiveCaptionText : result := kStrColor[40];
clTeal : result := kStrColor[41];
clBtnHighlight : result := kStrColor[42];
clWhite : result := kStrColor[43];
cl3DDkShadow : result := kStrColor[44];
clYellow : result := kStrColor[45];
cl3DLight : result := kStrColor[46];
clInfoText : result := kStrColor[47];
clInfoBk : result := kStrColor[48];
clGradientActiveCaption : result := kStrColor[49];
clGradientInactiveCaption : result := kStrColor[50];
clDefault : result := kStrColor[51];
end;
end;

{Valeurs des données de l'arbre par défaut}
Const
DataCharDef : Array[1..NbDataDef] of Char =
('A','B','C','D','E','F','G','H','I');
DataIntegerDef : Array[1..NbDataDef] of Integer =
(0,1,2,3,4,5,6,7,8);
DataRealDef : Array[1..NbDataDef] of Extended =
(0.0,1.1,2.2,3.3,4.4,5.5,6.6,7.7,8.8);
DataCharString : Array[1..NbDataDef] of String =
('ABC','DEF','GHI','JKL','MNO','PQR','STU','VWX','YZ');
ListFilsDef : Array[1..MaxDataDef] of boolean =
(true, // racine = niveau 0
true,true,true, // niveau 1
true,true,true,true,true,true,true,true,true); // niveau 2;
// false,false
{Valeur des Points construisant les figures qui utilisent la fonction Polygon -}
const
Points_TRIANGLE : Array[0..3] of TPoint =
((X:50;Y:0),(X:100;Y:100),(X:0;Y:100),(X:50;Y:0));
Points_PARALLELOGRAM : Array[0..4] of TPoint =
((X:0;Y:0),(X:75;Y:0),(X:100;Y:100),(X:25;Y:100),(X:0;Y:0));
Points_TRAPEZOID : Array[0..4] of TPoint =
((X:25;Y:0),(X:75;Y:0),(X:100;Y:100),(X:0;Y:100),(X:25;Y:0));
Points_PENTAGON : Array[0..5] of TPoint =
((X:50;Y:0),(X:100;Y:50),(X:75;Y:100),(X:25;Y:100),(X:0;Y:50),(X:50;Y:0));
Points_HEXAGON : Array[0..6] of TPoint =
((X:25;Y:0),(X:75;Y:0),(X:100;Y:50),(X:75;Y:100),(X:25;Y:100),(X:0;Y:50),
(X:25;Y:0));
Points_OCTAGON : Array[0..8] of TPoint =
((X:25;Y:0),(X:75;Y:0),(X:100;Y:25),(X:100;Y:75),(X:75;Y:100),(X:25;Y:100),
(X:0;Y:75),(X:0;Y:25),(X:25;Y:0));
Points_STAR : Array[0..16] of TPoint =
((X:11;Y:0),(X:13;Y:6),(X:19;Y:3),(X:16;Y:9),(X:22;Y:11),(X:16;Y:13),
(X:19;Y:19),(X:13;Y:16),(X:11;Y:22),(X:9;Y:16),(X:3;Y:19),(X:6;Y:13),
(X:0;Y:11),(X:6;Y:9),(X:3;Y:3),(X:9;Y:6),(X:11;Y:0));
Points_BUBBLE : Array[0..11] of TPoint =
((X:10;Y:23),(X:17;Y:10),(X:20;Y:10),(X:23;Y:7),(X:23;Y:3),(X:20;Y:0),
(X:3;Y:0),(X:0;Y:3),(X:0;Y:7),(X:3;Y:10),(X:15;Y:10),(X:10;Y:23));



{===================================================

CLASSE TITLE

===================================================}

constructor TBTreeGraphTitle.Create(aOwner : TBTreeGraph);
begin
inherited Create;
FBTreeGraph := AOwner;
FBackgroundBrush := TBrush.Create;
FBackgroundBrush.Color := $00D2DD9B;
FTextBrush := TBrush.Create;
FTextBrush.Color := FBackgroundBrush.Color; // fond texte = fond titre
FFont := TFont.Create;
FFont.Name := 'Tahoma';
FFont.Size := 10;
FFont.Color := ClWhite;
FAlignText := taCenterCenter;
FHeight := 50;
FText := 'Title of Graph';
end;

destructor TBTreeGraphTitle.Destroy;
begin
FBackgroundBrush.Free;
FTextBrush.Free;
FFont.Free;
inherited Destroy;
end;

procedure TBTreeGraphTitle.Assign(Source : TPersistent);
begin
if Source is TBTreeGraphTitle then
begin
with TBTreeGraphTitle(Source) do
begin
Self.FBackgroundBrush.Assign(FBackgroundBrush);
Self.FTextBrush.Assign(FTextBrush);
Self.FFont.Assign(FFont);
end;
end else inherited;
end;

procedure TBTreeGraphTitle.SetBackgroundBrush(New : TBrush);
begin
FBackgroundBrush.Assign(New);
end;

procedure TBTreeGraphTitle.SetTextBrush(New : TBrush);
begin
FTextBrush.Assign(New);
end;

procedure TBTreeGraphTitle.SetFont(New : TFont);
begin
showmessage('Avant assign(newFont)');
FFont.Assign(New);
showmessage('Après assign(newFont)');
end;

procedure TBTreeGraphTitle.SetHeight(Value : Integer);
begin
if FHeight Value then
begin
FHeight := Value;
FBTreeGraph.PaintTitle;
end;
end;

procedure TBTreeGraphTitle.SetText(Value : String);
begin
if FText Value then
begin
FText := Value;
FBTreeGraph.PaintTitle;
end;
end;
procedure TBTreeGraphTitle.SetAlignText(Value : TAlignText);
begin
if (FAlignText Value) then
begin
FAlignText := Value;
FBTreeGraph.PaintTitle;
end;
end;



{===================================================

CLASSE TBTREEGRAPH

===================================================}



{-------------------------------------------------------------------------------
initialisation du Graphique de l'arbre TTreeShape
--------------------------------------------------------------------------------}
constructor TBTreeGraph.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
ControlStyle := ControlStyle + [csReplicatable];
FBrush := TBrush.Create;
FBrush.OnChange := ChangeRedraw;
FPen := TPen.Create;
FPen.OnChange := ChangeRedraw;
FBackGroundColor := ClBlack;
FShadowEtiquette := True;
FFrameShadowEtiquette := False;
FShadowEtiquetteOffset := 5;
FShadowEtiquetteColor := ClSilver;
FEtiquetteColor := ClYellow;
FEtiquetteFrameColor := ClRed;
FShadowEtiquetteFramecolor := ClSilver;
FEtiquetteTextColor := ClWhite;
FConnectColor := ClRed;
FBmpTransparentColor := clNone;
FEtiquette := teRect;
FConnexion := tcSolid;
FConnect := True;
FTreeFull := False;
FHeightEtiq := 25;
FWidthEtiq := 40;
FWidthSpace := 40;
FHeightSpace := 60;
FOrdreArbre := 3;
FHauteurArbre := 3; // Arbre sur 3 niveaux
FNbFeuillesMax := NbDataDef; // 9 feuilles => arbre ordre 3 => Arbre non complet
Width := FNbFeuillesMax * (FWidthEtiq + FWidthSpace);// On ajoute une marge de FWidthSpace
FTransparent := false;
FAutosize := false;
FBmpStretch := false;
FDataType := tdInteger;
FDataModeInput := tdmiListByNiveau;
// FDataSeparator := tdsComma;
FDataInteger := 0;
FDataReal := 0.0;
FDataChar := 'A';
FDataString := 'String';
FTitle := TBTreeGraphTitle.Create(self);
Height := FTitle.Height + FHauteurArbre * (FHeightEtiq + FHeightSpace); // on ajoute une marge de FHeightSpace;
BmpTree := TBitmap.Create;// Image complète de l'arbre
BmpTree.PixelFormat := pf24bit;
BmpTree.Transparent := False;
BmpTree.Width := Width;
BmpTree.Height := Height;
With BmpTree.Canvas do
begin
Pen.Width := 1;
Pen.Color := FEtiquetteFrameColor;
end;
NbEleMax := NbMaxElements(OrdreArbre,FHauteurArbre);

{Création par défaut des données de l'arbre
et des tables}
SetLength(FCenterPointEtiquette,NbEleMax);
SetLength(FTabExistenceNoeuds,NbeleMax);
InitializeTableauExistenceNoeuds(NbEleMax,FTabExistenceNoeuds);
InitializeCentresEtiquettes(NbEleMax,FCenterPointEtiquette);
end;

destructor TBTreeGraph.Destroy;
begin
BmpTree.Free;
if MemDC 0 then DeleteDC(MemDC);
FBrush.Free;
FPen.Free;
inherited Destroy;
end;

{-------------------------------------------------------------------------------
Calcul le maximum d'éléments de l'arbre en fonction de l'Ordre et du nombre
de niveaux de l'arbre. 0 1 (niveau - 1)
N = O + O + ... O
-------------------------------------------------------------------------------}
Function TBTreeGraph.NbMaxElements(Const OrdreArbre : Integer; Const NbNiveau : Integer) : LongInt;
var ii : integer;
Begin
result := 0;
for ii := 0 to NbNiveau -1 do result := result + Trunc(Power(OrdreArbre,ii));
End;

{-------------------------------------------------------------------------------
Donne le nombre de freres Maximum à un niveau déterminé de l'arbre d'ordre
Ordrearbre 2
Exemple : Arbre d'ordre 3, au 2ème niveau => Nmax = 3 = 9
-------------------------------------------------------------------------------}
Function TBTreeGraph.NbFreresMaxIntoNiv(Const OrdreArbre : Integer; Const Niveau : Integer) : Integer;
Begin
Result := Trunc(Power(OrdreArbre,Niveau));
End;

{-------------------------------------------------------------------------------
Calcul de la longueur et la hauteur d'un texte
Sert à l'ajustement des textes aux zones réservées
-------------------------------------------------------------------------------}
Procedure TBTreeGraph.TextSizeWH(Texte : string; Police : TFont; Var Wtext,Htext : Integer);
var
DC : HDC;
Rect: TRect;
Bmpt: TBitmap;
begin
Bmpt := TBitmap.create;
if police nil then Bmpt.canvas.Font := police;
Rect.Left := 0;
Rect.Top := 0;
Rect.Right := 0;
Rect.Bottom := 0;
DC := GetDC(0);
Bmpt.Canvas.Handle := DC;
DrawText(Bmpt.Canvas.Handle, PChar(Texte), Length(Texte), Rect,
(DT_EXPANDTABS or DT_CALCRECT));
Bmpt.Canvas.Handle := 0;
ReleaseDC(0, DC);
Wtext :=Rect.Right - Rect.Left;
Htext :=Rect.Bottom - Rect.Top;
Bmpt.Free;
end;

{-------------------------------------------------------------------------------
Fonction de conversion de l'ordre des ascii séparteur de données en son nom
symbolique qui apparaitra tel quel dans l'inspecteur de propriété du composant
Ord('.') => '.' visuel dans l'inspecteur
utilise pour cela un nouveau type de propriété qui n'est pas hérité naturellement
et qu'il faut définir
--------------------------------------------------------------------------------}
{Function TBTreeGraph.SeparatorToIdent(Separator : LongInt; Var Ident : String):Boolean;
begin
result := IntToIdent(Separator,Ident,Separators);
end;
Function TBTreeGraph.IdentToSeparator(const Ident : string; Var Separator : LongInt):Boolean;
begin
end;



{===============================================================================
DESSINS DES FORMES D'ETIQUETTES
===============================================================================}

{ Paint ------------------------------------------------------------------------
--------------------------------------------------------------------------------
Paint est appelée à chaque fois que l'objet TreeShape doit mettre à jour son image,
c'est à dire :
- La première fois qu'elle est dessinée
- Qu'une fenêtre au desus est enlevée
- En forçant son dessin par la méthode Invalidate, lorsque par exemple, une
propriété de la Led est modifiée par programme.
- Met à jour à la fois la couleur de l'étiquette et de son ombre
-------------------------------------------------------------------------------}
procedure TBTreeGraph.Paint;
var
ii : Integer;
O : TPoint;
WidthText,
HeightText : Integer;
oldFont : TFont;
begin
with inherited Canvas do
begin
{Création mémoire pour la sauvegarde du bitmap}
if MemDC = 0 then MemDC := CreateCompatibleDC(Canvas.Handle);

{Création image de l'arbre}
BmpTree.Canvas.FillRect(ClientRect); {Efface l'ancien arbre avec la couleur de fond}
With BmpTree.Canvas do
begin
{Sauvegarde de la police pour les caractères}
Font.Name := 'Times New Roman';
Font.Style := [fsBold];
Font.Size := 10;
Font.Color := ClRed;
Brush.Color := FBackgroundColor;
OldFont := Font;

{Fond de l'arbre composant}
Rect.top := 0;
Rect.bottom := Height;
Rect.left := 0;
Rect.Right := Width;
FloodFill(0,0, FBackgroundColor, fsBorder);
FrameRect(Rect);

{Ecriture du titre de l'arbre}
PaintTitle;

{Positionnement et Dessin des étiquettes}
{Position de la Racine}
O.X := FCenterPointEtiquette[0].X;
O.Y := FCenterPointEtiquette[0].Y;
if ShadowEtiquette then PaintShadowEtiquette(O);
PaintEtiquette(O);

{Position des autres étiquettes}
For ii := 1 to High(FCenterPointEtiquette) do
begin
O.X := FCenterPointEtiquette[ii].X;
O.Y := FCenterPointEtiquette[ii].Y;
if ShadowEtiquette then PaintShadowEtiquette(O);
PaintEtiquette(O);
end;
end;

if FBmpStretch
then StretchDraw(Rect, BmpTree)
else Draw(Rect.Left, Rect.Top, BmpTree);

end;
end;

{-------------------------------------------------------------------------------
Dessine la zone de titre : couleurs, style, texte
-------------------------------------------------------------------------------}
procedure TBTreeGraph.PaintTitle;
var
aRect : TRect;
WidthText,
HeightText : Integer;
begin
With BmpTree.Canvas do
begin
{Ecriture du titre de l'arbre}
aRect.Left := 0;
aRect.Bottom := Title.Height;
aRect.Right := BmpTree.Width;
aRect.Top := 0;
Brush.Color := Title.BackGroundBrush.Color;
Rectangle(aRect);
WidthText := 0;
HeightText := 0;
TextSizeWH(FTitle.FText,FTitle.FFont,WidthText,HeightText);
if FTitle.Height > HeightText then
begin
Font := FTitle.FFont;
Case FTitle.FAlignText of
taLeftBottom : TextOut(2,FTitle.Height - HeightText - 1,FTitle.FText);
taLeftCenter : TextOut(2,(FTitle.Height - HeightText ) div 2,FTitle.FText);
taLeftTop : TextOut(2,2,FTitle.FText);
taCenterBottom: TextOut((Width - WidthText) div 2,FTitle.Height - HeightText - 1,FTitle.FText);
taCenterCenter: TextOut((Width - WidthText) div 2,(FTitle.Height - HeightText ) div 2,FTitle.FText);
taCenterTop : TextOut((Width - WidthText) div 2,2,FTitle.FText);
taRightBottom : TextOut( Width - WidthText - 2,FTitle.Height - HeightText - 1,FTitle.FText);
taRightCenter : TextOut( Width - WidthText - 2,(FTitle.Height - HeightText ) div 2,FTitle.FText);
taRigthTop : TextOut( Width - WidthText - 2,2,FTitle.FText);
End;
end;
end;
end;

procedure TBTreeGraph.PaintShadowEtiquette(Const Centre : TPoint);
begin
With BmpTree.Canvas do
begin
Brush.Color := FShadowEtiquetteColor;
Pen.Color := FShadowEtiquetteColor;
Case FEtiquette of
teCircle : DrawShadowEtiqCircle(Centre);
teEllipse : DrawShadowEtiqEllipse(Centre);
teSquare : DrawShadowEtiqSquare(Centre);
teRect : DrawShadowEtiqRect(Centre);
teRoundSquare: DrawShadowEtiqRoundSquare(Centre);
teRoundRect : DrawShadowEtiqRoundrect(Centre);
teTriangle : DrawShadowEtiqTriangle(Centre);
teParallelogram : DrawShadowEtiqParallelogram(Centre);
teTrapezoid : DrawShadowEtiqTrapezoid(Centre);
tePentagon : DrawShadowEtiqPentagon(Centre);
teHexagon : DrawShadowEtiqHexagon(Centre);
teOctagon : DrawShadowEtiqOctagon(Centre);
teNonagone : DrawShadowEtiqNonagon(Centre);
teStar : DrawShadowEtiqStar(Centre);
teBubble : DrawShadowEtiqBuble(Centre);
end;
end;
end;

procedure TBTreeGraph.PaintEtiquette(Const Centre : TPoint);
begin
With BmpTree.Canvas do
begin
Brush.Color := FEtiquetteColor;//FBrush.Color;
Pen.Color := FEtiquetteFrameColor;//FPen.Color;
Case FEtiquette of
teCircle : DrawEtiqCircle(Centre);
teEllipse : DrawEtiqEllipse(Centre);
teSquare : DrawEtiqSquare(Centre);
teRect : DrawEtiqRect(Centre);
teRoundSquare: DrawEtiqRoundSquare(Centre);
teRoundRect : DrawEtiqRoundrect(Centre);
teTriangle : DrawEtiqTriangle(Centre);
teParallelogram : DrawEtiqParallelogram(Centre);
teTrapezoid : DrawEtiqTrapezoid(Centre);
tePentagon : DrawEtiqPentagon(Centre);
teHexagon : DrawEtiqHexagon(Centre);
teOctagon : DrawEtiqOctagon(Centre);
teNonagone : DrawEtiqNonagon(Centre);
teStar : DrawEtiqStar(Centre);
teBubble : DrawEtiqBuble(Centre);
end;
end;
end;

{-------------------------------------------------------------------------------
Centralisation des évènements OnChange de FPen et FBrush
-------------------------------------------------------------------------------}
procedure TBTreeGraph.ChangeRedraw(Sender: TObject);
begin
Invalidate;
end;

{-------------------------------------------------------------------------------
On mémorise les fils existants par défaut
-------------------------------------------------------------------------------}
procedure TBTreeGraph.InitializeTableauExistenceNoeuds(NombreMaxElements : LongInt; Var FTabExistenceNoeuds : array of boolean);
var ii : integer;
begin
For ii := 0 to High(FTabExistenceNoeuds)
do FTabExistenceNoeuds[ii]:= ListFilsDef[ii];
end;


{-------------------------------------------------------------------------------
On mémorise dans un tableau les coordonnées de chaque Centre d'étiquette
-------------------------------------------------------------------------------}
procedure TBTreeGraph.InitializeCentresEtiquettes(NombreElements : LongInt; var FCenterPointEtiquette : array of Tpoint);
var X,Y,X0,Y0 : integer;
Nel : Integer; // nb Noeud au niveau considéré
eeW : Integer; // interval entre les noeuds au niveau considéré
Niv : Integer;
nFr,nFrMax : Integer; // nb de frères sur un niveau
MemEl : Integer; // centre noeuds déjà calculés
begin
{Racine centrée en largeur}
FCenterPointEtiquette[0]:= Point(BmpTree.Width div 2,
1 + FTitle.Height + (FHeightSpace + FHeightEtiq) div 2);
Niv := 2;
MemEl := 1;
nFr := 0;
nFrMax:= NbFreresMaxIntoNiv(OrdreArbre,Niv-1);

{coordonnées du centre première étiquette à gauche}
eeW := ( BmpTree.Width - (nFrMax * FWidthEtiq) ) div nFrMax;
X0 := (FWidthEtiq + eeW) div 2;
Y0 := FTitle.Height + FHeightEtiq div 2;

{Parcours des éléments potentiels de l'arbre}
For nEl := 1 to High(FCenterPointEtiquette) do
begin
if FTabExistenceNoeuds[nEl] then
begin
if (nEl - MemEl) = nFrMax then
begin {Changement de niveau}
if Niv < FHauteurArbre + 1 then
begin

inc(niv);
nFr := 1;
MemEl := MemEl + nFrMax;
nFrMax := NbFreresMaxIntoNiv(FOrdreArbre,Niv-1);

{Coordonnées du centrepremière étiquette à gauche}
eeW := ( BmpTree.Width - (nFrMax * FWidthEtiq) ) div nFrMax;
X0 := (FWidthEtiq + eeW) div 2;
Y0 := Y0 + FHeightSpace + FHeightEtiq div 2;

end;
end else inc(nFr);

{Calcul et Stockage des coordonnées du centre}
X := X0 + (eeW + FWidthEtiq) * (nFr - 1);
Y := Y0;
FCenterPointEtiquette[nEl] := Point(X,Y);
end;
end;
end;

procedure TBTreeGraph.SetBrush(Value: TBrush);
begin
FBrush.Assign(Value);
end;

procedure TBTreeGraph.SetPen(Value: TPen);
begin
FPen.Assign(Value);
end;

procedure TBTreeGraph.SetTransparent(Value: Boolean);
begin
if value FTransparent then
begin
FTransparent := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetAutoSize(Value: Boolean);
begin
if value FAutoSize then
begin
FAutoSize := Value;
if FAutosize And (not BmpTree.Empty)then
begin
Width := BmpTree.Width;
Height := BmpTree.Height;
end;
Invalidate;
end;
end;

procedure TBTreeGraph.SetBmpStretch(Value: Boolean);
begin
if value FBmpStretch then
begin
FBmpStretch := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetTypeData(Value: TTypeData);
begin
if value FDataType then
begin
FDataType := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetDataModeInput(Value: TTypeDataModeInput);
begin
if value FDataModeInput then
begin
FDataModeInput := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetDataSeparator(Value: TDataSeparator);
begin
if value FDataSeparator then
begin
FDataSeparator := Value;
Invalidate;
end;
end;


procedure TBTreeGraph.SetDataInteger(Value: Integer);
begin
if value FDataInteger then
begin
FDataInteger := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetDataReal(Value: Extended);
begin
if value FDataReal then
begin
FDataReal := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetDataChar(Value: Char);
begin
if value FDataChar then
begin
FDataChar := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetDataString(Value: String);
begin
if value FDataString then
begin
FDataString := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetBackgroundColor(const Value: TColor);
begin
FBackgroundColor := Value;
Invalidate;
end;

procedure TBTreeGraph.SetTitle(Value: TBTreeGraphTitle);
begin
with FTitle do
begin
TextBrush := Value.TextBrush;
Font := Value.Font;
AlignText := Value.AlignText;
Height := Value.Height;
Text := Value.Text;
end;
end;

procedure TBTreeGraph.SetShadowEtiquette(Value: Boolean);
begin
if FShadowEtiquette Value then
begin
FShadowEtiquette := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetFrameShadowEtiquette(Value: Boolean);
begin
if FFrameShadowEtiquette Value then
begin
FFrameShadowEtiquette := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetShadowOffset(Value: Integer);
begin
if FShadowEtiquetteOffset Value then
begin
FShadowEtiquetteOffset := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetShadowColor(Value: TColor);
begin
if FShadowEtiquetteColor Value then
begin
FShadowEtiquetteColor := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetShadowFrameColor(Value: TColor);
begin
if FShadowEtiquetteColor Value then
begin
FShadowEtiquetteColor := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetEtiquetteColor(Value: TColor);
begin
Showmessage('Value dans SetEtiquetteColor : '+ColorToString(Value)+#13+
'FEtiquetteColor dans SetEtiquetteColor : '+ColorToString(FEtiquetteColor));
if FEtiquetteColor Value then
begin
FEtiquetteColor := Value;
Showmessage('SetEtiquetteColor : '+ColorToString(FEtiquetteColor));
Invalidate;
end;
end;

procedure TBTreeGraph.SetEtiquetteFrameColor(Value: TColor);
begin
if FEtiquetteFrameColor Value then
begin
FEtiquetteFrameColor := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetEtiquetteTextColor(Value: TColor);
begin
if FEtiquetteTextColor Value then
begin
FEtiquetteTextColor := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetConnectColor(Value: TColor);
begin
if FConnectColor Value then
begin
FConnectColor := Value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetBmpTransparentColor(const Value: TColor);
begin
FBmpTransparentColor := Value;
Invalidate;
end;

procedure TBTreeGraph.SetEtiquette(value: TTypeEtiquet);
begin
if value FEtiquette then
begin
FEtiquette := value;
Paint;
Invalidate;
end;
end;

procedure TBTreeGraph.SetConnexion(value : TTypeConnexion);
begin
if value FConnexion then
begin
FConnexion := value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetConnected(value : Boolean);
begin
if value FConnect then
begin
FConnect := value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetTreeFull(value : Boolean);
begin
if value FTreeFull then
begin
FTreeFull := value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetHeightEtiquette(Value : Integer);
begin
if value FHeightEtiq then
begin
If FEtiquette In [TeCircle,TeSquare,TeRoundSquare] then
begin
FHeightEtiq := value;
FWidthEtiq := value;
Invalidate;
end;
end;
end;

procedure TBTreeGraph.SetWidthEtiquette(Value : Integer);
begin
if value FWidthEtiq then
begin
If FEtiquette In [TeCircle,TeSquare,TeRoundSquare] then
begin
FWidthEtiq := value;
FHeightEtiq := value;
Invalidate;
end;
end;
end;

procedure TBTreeGraph.SetWidthSpace(Value : Integer);
begin
if value FWidthSpace then
begin
FWidthSpace := value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetHeightSpace(Value : Integer);
begin
if value FHeightSpace then
begin
FHeightSpace := value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetOrdreArbre(Value : Integer);
begin
if value FOrdreArbre then
begin
FOrdreArbre := value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetHauteurarbre(Value : Integer);
begin
if value FHauteurArbre then
begin
FHauteurArbre := value;
Invalidate;
end;
end;

procedure TBTreeGraph.SetNumberFeuillesMax(Value : Integer);
begin
if value FNbFeuillesMax then
begin
FNbFeuillesMax := value;
Invalidate;
end;
end;

function TBTreeGraph.CalcPoly(var Points: Array of TPoint; Source: Array of TPoint; AWidth, AHeight: Integer): Boolean;
var i : Integer;
lx,ly : LongInt;
begin
Result := True;
try
for i := Low(Points) to High(Points) do begin
lx := MulDiv(Source[i].x,AWidth,100);
ly := MulDiv(Source[i].y,AHeight,100);
Points[i].x := lx;
Points[i].y := ly;
end;
except
Result := False;
end;
end;

procedure TBTreeGraph.OffsetPoly(var Points: Array of TPoint; OfsX,OfsY: Integer);
var i: Integer;
begin
for i := Low(Points) to High(Points) do begin
Points[i].x := Points[i].x+OfsX;
Points[i].y := Points[i].y+OfsY;
end;
end;

{-------------------------------------------------------------------------------
Dessin Etiquette circulaire et son ombre projetée
-------------------------------------------------------------------------------}
procedure TBTreeGraph.DrawShadowEtiqCircle(Const Centre : TPoint);
var x,y,xx,yy : Integer;
begin
if ShadowEtiquette then
begin
{ Calcul dimensions width et height de l'ombre}
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
BmpTree.Canvas.Ellipse(x,y,xx,yy);
end;
end;
procedure TBTreeGraph.DrawEtiqCircle(Const Centre : TPoint);
var x,y,xx,yy: Integer;
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1;
BmpTree.Canvas.Ellipse(x,y,xx,yy);
end;

{-------------------------------------------------------------------------------
Dessin Etiquette elliptique et son ombre projetée
-------------------------------------------------------------------------------}
procedure TBTreeGraph.DrawShadowEtiqEllipse(Const Centre : TPoint);
var x,y,xx,yy : Integer;
begin
if ShadowEtiquette then
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
BmpTree.Canvas.Ellipse(x,y,xx,yy);
end;
end;
procedure TBTreeGraph.DrawEtiqEllipse(Const Centre : TPoint);
var x,y,xx,yy : Integer;
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
BmpTree.Canvas.Ellipse(x,y,xx,yy);
end;

{-------------------------------------------------------------------------------
Dessin Etiquette carrée et son ombre projetée
-------------------------------------------------------------------------------}
procedure TBTreeGraph.DrawShadowEtiqSquare(Const Centre : TPoint);
var x,y,xx,yy : Integer;
begin
if ShadowEtiquette then
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
BmpTree.Canvas.Rectangle(x,y,xx,yy);
end;
end;

procedure TBTreeGraph.DrawEtiqSquare(Const Centre : TPoint);
var x,y,xx,yy : Integer;
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
xx := Centre.X + FWidthEtiq div 2 + ShadowEtiquetteOffset + BmpTree.Canvas.Pen.Width + 1;
yy := Centre.Y + FHeightEtiq div 2 + ShadowEtiquetteOffset + BmpTree.Canvas.Pen.Width + 1;
BmpTree.Canvas.Rectangle(x,y,x+xx,y+yy);
end;

{-------------------------------------------------------------------------------
Dessin Etiquette rectangulaire et son ombre projetée
-------------------------------------------------------------------------------}
{procedure TBTreeGraph.DrawBackEtiqRect(Const Centre : TPoint);
var x,y,xx,yy : Integer;
begin
if ShadowEtiquette then
begin
x := Centre.X - FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width div 2 - ShadowEtiquetteOffset;
y := Centre.Y - FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width div 2 - ShadowEtiquetteOffset;
xx := Centre.X + FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2- BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
if BmpTree.Canvas.Pen.Width = 0 then
begin
Dec(xx);
Dec(yy);
end;
BmpTree.Canvas.Rectangle(x,y,xx,yy);
end;
end;
}procedure TBTreeGraph.DrawShadowEtiqRect(Const Centre : TPoint);
var x,y,xx,yy : Integer;
begin
if ShadowEtiquette then
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
BmpTree.Canvas.Rectangle(x,y,xx,yy);
end;
end;

procedure TBTreeGraph.DrawEtiqRect(Const Centre : TPoint);
var x,y,xx,yy : Integer;
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width div 2;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width div 2;
BmpTree.Canvas.Rectangle(x,y,xx,yy);
end;

procedure TBTreeGraph.DrawShadowEtiqRoundSquare(Const Centre : TPoint);
var x,y,xx,yy,r : Integer;
begin
if ShadowEtiquette then
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 + ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 - ShadowEtiquetteOffset;
r := xx - x;
BmpTree.Canvas.RoundRect(x,y,x+xx,y+yy,r div 4,r div 4);
end;
end;

procedure TBTreeGraph.DrawEtiqRoundSquare(Const Centre : TPoint);
var x,y,xx,yy,r : Integer;
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 - ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 - ShadowEtiquetteOffset;
r := xx - x;
BmpTree.Canvas.RoundRect(x,y,x+xx,y+yy,r div 4,r div 4);
end;

procedure TBTreeGraph.DrawShadowEtiqRoundrect(Const Centre : TPoint);
var x,y,xx,yy,r : Integer;
begin
if ShadowEtiquette then
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2 + ShadowEtiquetteOffset;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 - ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 - ShadowEtiquetteOffset;
r := xx - x;
BmpTree.Canvas.RoundRect(x,y,xx,yy,r div 4,r div 4);
end;
end;

procedure TBTreeGraph.DrawEtiqRoundrect(Const Centre : TPoint);
var x,y,xx,yy,r : Integer;
begin
x := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
y := Centre.Y - FHeightEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
xx := Centre.X + FWidthEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 - ShadowEtiquetteOffset;
yy := Centre.Y + FHeightEtiq div 2 + BmpTree.Canvas.Pen.Width + 1 - ShadowEtiquetteOffset;
r := xx - x;
BmpTree.Canvas.RoundRect(x,y,xx,yy,r div 4,r div 4);
end;

procedure TBTreeGraph.DrawShadowEtiqTriangle(Const Centre : TPoint);
var Points : Array[0..3] of TPoint;
l,t,w,h : Integer;
begin
l := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
t := l;
w := Width-Pen.Width-ShadowEtiquetteOffset-1;
h := Height-Pen.Width-ShadowEtiquetteOffset-1;
if CalcPoly(Points,Points_TRIANGLE,w,h) then
begin
OffsetPoly(Points,l+ShadowEtiquetteOffset,t+ShadowEtiquetteOffset);
BmpTree.Canvas.Polygon(Points);
end;
end;
procedure TBTreeGraph.DrawEtiqTriangle(Const Centre : TPoint);
var Points : Array[0..3] of TPoint;
l,t,w,h : Integer;
begin
l := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
t := l;
w := Width-Pen.Width-ShadowEtiquetteOffset-1;
h := Height-Pen.Width-ShadowEtiquetteOffset-1;
if CalcPoly(Points,Points_TRIANGLE,w,h) then
begin
OffsetPoly(Points,l,t);
BmpTree.Canvas.Polygon(Points);
end;
end;

procedure TBTreeGraph.DrawShadowEtiqParallelogram(Const Centre : TPoint);
var Points : Array[0..4] of TPoint;
l,t,w,h : Integer;
begin
l := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
t := l;
w := Width-Pen.Width-ShadowEtiquetteOffset-1;
h := Height-Pen.Width-ShadowEtiquetteOffset-1;
if CalcPoly(Points,Points_PARALLELOGRAM,w,h) then
begin
OffsetPoly(Points,l+ShadowEtiquetteOffset,t+ShadowEtiquetteOffset);
BmpTree.Canvas.Polygon(Points);
end;
end;
procedure TBTreeGraph.DrawEtiqParallelogram(Const Centre : TPoint);
var Points : Array[0..4] of TPoint;
l,t,w,h : Integer;
begin
l := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
t := l;
w := Width-Pen.Width-ShadowEtiquetteOffset-1;
h := Height-Pen.Width-ShadowEtiquetteOffset-1;
if CalcPoly(Points,Points_PARALLELOGRAM,w,h) then
begin
OffsetPoly(Points,l,t);
BmpTree.Canvas.Polygon(Points);
end;
end;

procedure TBTreeGraph.DrawShadowEtiqTrapezoid(Const Centre : TPoint);
var Points : Array[0..4] of TPoint;
l,t,w,h : Integer;
begin
l := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
t := l;
w := Width-Pen.Width-ShadowEtiquetteOffset-1;
h := Height-Pen.Width-ShadowEtiquetteOffset-1;
if CalcPoly(Points,Points_TRAPEZOID,w,h) then
begin
OffsetPoly(Points,l+ShadowEtiquetteOffset,t+ShadowEtiquetteOffset);
BmpTree.Canvas.Polygon(Points);
end;
end;
procedure TBTreeGraph.DrawEtiqTrapezoid(Const Centre : TPoint);
var Points : Array[0..4] of TPoint;
l,t,w,h : Integer;
begin
l := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
t := l;
w := Width-Pen.Width-ShadowEtiquetteOffset-1;
h := Height-Pen.Width-ShadowEtiquetteOffset-1;
if CalcPoly(Points,Points_TRAPEZOID,w,h) then
begin
OffsetPoly(Points,l,t);
BmpTree.Canvas.Polygon(Points);
end;
end;

procedure TBTreeGraph.DrawShadowEtiqPentagon(Const Centre : TPoint);
var Points : Array[0..5] of TPoint;
l,t,w,h : Integer;
begin
l := Centre.X - FWidthEtiq div 2 - BmpTree.Canvas.Pen.Width div 2;
t := l;
w := Width-Pen.Width-ShadowEtiquetteOffset-1;
h := Height-Pen.Width-ShadowEtiquetteOffset-1;
if CalcPoly(Points,Points_PENTAGON,w,h) then
begin
OffsetPoly(Points,l+ShadowEtiquetteOffset,t+ShadowEtiquetteOffset);
BmpTree.Canvas.Polygon(Points);
end;
end;
procedure TBTreeGraph.DrawEtiqPentagon(Const Centre : TPoint);
var Points : Array[0..5] of TPoint;
l,t,w,h : Integer;
0
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
26 août 2010 à 18:27
Trop tard!
ça serait pratique que l'on puisse mettre des pièces jointes aux messages!
ça y est on chochotte!


Jean_Jean
0
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
26 août 2010 à 18:29
Dis moi si tu préfères que je zippe zippe!
Jean_Jean
0
Utilisateur anonyme
26 août 2010 à 18:54
Oui zippe zippe parce que là ca fait mal au zip ton truc.

Psss :Jean Jean pense à la balise zip quand tu zip un zip. C'est plus facile pour zipper après
0
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
26 août 2010 à 22:13
Francky,

j'ai zippé mes fichiers mais je n'ai trouvé aucune aide sur MegaUpload pour dire comment on stocke le dossier. Je me suis inscrit, mais même dans la FAQ, je n'ai pas trouver de mode d'emploi.
Bizarre comme Site. Pourtant utile!!!
je devrais peut-être aller me coucher.

Jean_Jean
0
Guillemouze Messages postés 991 Date d'inscription samedi 25 octobre 2003 Statut Membre Dernière intervention 29 août 2013 6
26 août 2010 à 23:34
au passage, sais-tu que tu peux debugger un package en mettant delphi comme application hote ?
Ca fait que tu as 2 instances de delphi demarrées, ce qui peut etre perturbant pour savoir si tu es dans celle de debug ou celle d'execution, mais c'est bien pratique pour debugger les composants
0
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
27 août 2010 à 09:00
Salut Guillemouze!
je ne connais pas cette méthode. Comment fais-tu pour mettre Delphi en application hote?
Bien à toi
Jean_Jean
0
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
27 août 2010 à 10:09
Merci Guillemouze,
C'est pas de la chochotte! J'essaie ça dans la journée et vous tient au courant.
A+
Jean_Jean
0
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
27 août 2010 à 17:32
Guillemouze
J'ai fait ce que tu as dit, j'ai rien compris, n'ait touché à rien, n'ait rien débuggué....puis j'ai ouvert mon appli pour déposer mon compo sur la fiche. Nickel.
Francky va dire que je chochotte, mais quand même j'aimerai bien comprendre ce qui s'est passé.

Jean_Jean
0
Guillemouze Messages postés 991 Date d'inscription samedi 25 octobre 2003 Statut Membre Dernière intervention 29 août 2013 6
27 août 2010 à 17:44
tu chochotte
peut etre que tu n'avais pas recompilé ton compo, et le fait d'executer le package l'a recompilé ;)
0
cs_Jean_Jean Messages postés 615 Date d'inscription dimanche 13 août 2006 Statut Membre Dernière intervention 13 décembre 2018 3
27 août 2010 à 18:27
Guillemouze, tu me prends pour une chochotte?
je l'ai recompilé dans tous les sens.
J'ai même supprimé le composant de la palette et détruit e quelque chosele bpl et remplacé le dpk.
Bah! t'as peut-être raison, j'ai du faire quelque chose de pas chochotte du tout.
Jean_Jean
0
Utilisateur anonyme
28 août 2010 à 22:49
Ben woui tu as du chochotter de travers : tu chochottes pas assez tu vois

Une femme c'est comme un prout, une fois que tu l'as largué ca pue
0
Rejoignez-nous