unit win_rose; {écrit par Denis stéphane Bertin le 27-28 août 2012 (c) Bertin Soft}
{Un module de déplacement selon une rose des vents écrit par denis stéphane Bertin}
{le curseur se déplace proportionellement à la distance
{et à l'angle formée par le centre et la souris - écrit par denis bertin}
{Améliorer par denis stéphane Bertin pour que la rose des déplacements indique la direction du curseur}
interface
uses u_object,windows,wbase,messages,whelp,col_plan,wformes1,font_ob1;
type
trose_des_deplacements = class(wbase.twindow)
constructor create(un_parent:wbase.TWinbase);
function GetClassName: PChar; override;
function Getstyle:DWORD; override;
function Getexstyle:DWORD; override;
procedure Deplacement_radial;
procedure Mesurer_le_deplacement(var msg:TMessage);
procedure Paint(PaintDC: HDC; var PaintInfo: TPaintStruct); override; {Recouvrement en fr}
procedure WMMousemove(var msg:TMessage); override; {Recouvrement en fr}
procedure WMLButtonDown(var msg:TMessage); override; {Recouvrement en fr}
procedure WMLButtonUp(var msg:TMessage); override; {Recouvrement en fr}
procedure WMTIMER(var msg: TMessage); override; {Recouvrement en fr}
private posi:integer;
private down:boolean;
private point_du_curseur:tpoint;
private delta:tpoint;
private longeur:real;
private angle:real;
private move_deja:boolean;
private reviens:boolean;
end;
TCadre_Ajustement_des_couleurs = class(wbase.Tbutton)
constructor Create(un_parent:TWinbase);
procedure SetUpWindow; override;
Destructor Destroy; override;
procedure Sous_classement; override;
procedure Creer_Nombre_point(nb_point:integer);
procedure WMPaint(var Msg: TMessage); override;
procedure WMMousemove(var Msg: TMessage); override;
procedure WMLButtonDown(var Msg: TMessage); override;
procedure WMLButtonUp(var Msg: TMessage); override;
private
forme_ajustement:wformes1.Tforme_dessin;
bouton_down:boolean;
plot_selected:font_ob1.testnode;
index_selected:integer;
end; {TCadre_Ajustement_des_couleurs}
TPreview_les_couleurs = class(wbase.Tbutton)
constructor Create(un_parent:TWinbase);
procedure Sous_classement; override;
procedure WMPaint(var Msg: TMessage); override;
end; {Denis}
TPlume_de_lune_a_l_autre_Dialog = class(Whelp.ThelpDialog)
constructor Create(AParent:WBase.TWindow; acalque:col_plan.TCalque);
procedure Setupwindow; override;
procedure Set_Depart_Text(aforme:u_object.tforme_color);
procedure Set_arriver_Text(aforme:u_object.tforme_color);
procedure WmHscroll(var Msg: TMessage); override;
procedure Actualiser_la_previsualisation;
private
depart,arriver:WBase.TScrollbar;
static_depart,static_arriver:wbase.Tstatic;
un_calque:col_plan.TCalque;
un_Cadre_Ajustement_des_couleurs:win_rose.TCadre_Ajustement_des_couleurs;
une_previsualisation:win_rose.TPreview_les_couleurs;
end;
var une_fenetre_rose_des_deplacements:win_rose.trose_des_deplacements;
implementation
uses wutil,hls_rvb,utile,my_math,wmain,sysutils,g_base,u_tablis,
z_open_file,wmenuk,haide,relation,c_color,deformat;
const un_name_win_rose : pchar = 'Rose des déplacements';
k_offset = 22;
id_timer_reviens = 1;
k_mm = ' mm';
constructor trose_des_deplacements.create(un_parent:wbase.TWinbase);
begin
inherited create(un_parent,win_rose.un_name_win_rose,100,100,256,256+12+k_offset,true,false,0);
self.posi:=0;
self.move_deja:=false;
self.reviens:=false;
end; {trose_des_deplacements.create}
function trose_des_deplacements.GetClassName:PChar;
begin GetClassName:=win_rose.un_name_win_rose; end;
function trose_des_deplacements.Getstyle:DWORD;
begin
Getstyle:=ws_Popup or ws_visible or ws_border or ws_caption or ws_sysmenu or ws_sizebox;
end;
function trose_des_deplacements.Getexstyle:DWORD;
begin
Getexstyle:=WS_EX_PALETTEWINDOW;
end;
procedure trose_des_deplacements.Paint(PaintDC: HDC; var PaintInfo: TPaintStruct);
var i,k,l:integer;
arect:trect;
pt,centre,ligne:my_math.Point2D;
apencilvani:hpen;
abrushici:hbrush;
old_bitmap:hbitmap;
memdc:hdc;
rayon,la_distance:real;
double:real;
apc,xpc,ypc,aapc:pc100;
afont,afont_grec:hfont;
premier_et_unique:boolean;
begin
memdc:=createcompatibledc(paintdc);
getclientrect(hwindow,arect);
with arect do old_bitmap:=selectobject(memdc,createcompatiblebitmap(paintdc,right,bottom));
with arect do
begin
rectangle(memdc,-1,-1,right,bottom);
centre.x:=arect.right div 2;
centre.y:=(arect.bottom-k_offset) div 2;
end;
rayon:=centre.x-8;
for i:=round(rayon) downto 1 do
begin
apencilvani:=selectobject(memdc,Getstockobject(NULL_PEN));
abrushici:=selectobject(memdc,createsolidbrush(Get_HLS_RGB(self.posi,1-i/rayon/2,0.5)));
ellipse(memdc,round(centre.x-i),round(centre.y-i),round(centre.x+i),round(centre.y+i));
deleteobject(selectobject(memdc,abrushici));
selectobject(memdc,apencilvani);
end;
premier_et_unique:=true;
for k:=0 to pred(arect.right) do
for l:=0 to pred(arect.Bottom) do
for i:=0 to 8 do
begin
if i mod 2=0 then
rayon:=centre.x-8
else
rayon:=centre.x*2/3-8;
la_distance:=single_distance(centre.x,centre.y,k,l);
if la_distance<rayon then
begin
pt.x:=k;
pt.y:=l;
double:=rayon*rayon;
if self.reviens then
begin
if premier_et_unique then
begin
if self.angle>=pi then
begin
self.angle:=self.angle+0.1;
if self.angle>=2*pi then
begin
self.angle:=0;
reviens:=false;
KillTimer(self.hwindow,id_timer_reviens);
end
end
else
begin
self.angle:=self.angle-0.1;
if self.angle<=0 then
begin
self.angle:=0;
reviens:=false;
KillTimer(self.hwindow,id_timer_reviens);
end;
end;
premier_et_unique:=false;
end;
ligne.x:=centre.x+cos(self.angle+i/8*utile.deuxpi)*rayon;
ligne.y:=centre.y-sin(self.angle+i/8*utile.deuxpi)*rayon;
end
else if self.down then
begin
ligne.x:=centre.x+cos(self.angle+i/8*utile.deuxpi)*rayon;
ligne.y:=centre.y-sin(self.angle+i/8*utile.deuxpi)*rayon;
end
else
begin
ligne.x:=centre.x+cos(i/8*utile.deuxpi)*rayon;
ligne.y:=centre.y-sin(i/8*utile.deuxpi)*rayon;
end;
if abs(my_math.DistDroite(pt,centre,ligne))<=6*(sqrt(double+double)-la_distance)/rayon then
Setpixel(memdc,k,l,Get_HLS_RGB(360*i div 8,0.5+(la_distance/rayon)/2,1)); {denis B}
end;
end;
if move_deja then
begin
afont:=selectobject(memdc,wutil.Get_MakeDefaultFont(14));
rectangle(memdc,-1,arect.bottom-20,arect.right,arect.bottom+1);
setbkmode(memdc,transparent);
afont_grec:=SelectObject(memdc,CreateFont(18,0,0,0,0,0,0,0,0,0,0,0,0,'Symbol'));
textout(memdc,2,arect.Bottom-18,'D',1);
DeleteObject(SelectObject(memdc,afont_grec));
inttopchar(delta.x,xpc);
strcat(strcopy(apc,'x='),xpc);
textout(memdc,12,arect.Bottom-18,apc,strlen(apc));
inttopchar(delta.y,ypc);
afont_grec:=SelectObject(memdc,CreateFont(18,0,0,0,0,0,0,0,0,0,0,0,0,'Symbol'));
textout(memdc,50,arect.Bottom-18,'D',1);
DeleteObject(SelectObject(memdc,afont_grec));
strcat(strcopy(apc,'y='),ypc);
textout(memdc,60,arect.Bottom-18,apc,strlen(apc));
inttopchar(round(angle*180/pi),aapc);
strcat(aapc,'°');
strcat(strcat(strcopy(apc,z_open_file.string_angle),'='),aapc);
textout(memdc,100,arect.Bottom-18,apc,strlen(apc));
inttopchar(utile.idistance(0,0,delta.x,delta.y),aapc);
strcat(strcat(strcopy(apc,z_open_file.string_distance),'='),aapc);
textout(memdc,170,arect.Bottom-18,apc,strlen(apc));
deleteobject(selectobject(memdc,afont));
end;
with arect do bitblt(paintdc,0,0,right,bottom,memdc,0,0,SRCCOPY);
deleteobject(selectobject(memdc,old_bitmap));
deleteDC(memdc);
end; {trose_des_deplacements.Paint}
procedure trose_des_deplacements.WMMousemove(var msg:TMessage);
var arect:trect; apoint:tpoint; milieu:tpoint;
begin
if self.reviens then exit;
if (wmain.MainWindow<>nil) and (wmain.MainWindow.Aide) then
setcursor(haide.G_Cursor.HelpCursor)
else
begin
Getclientrect(self.hwindow,arect);
apoint.x:=Smallint(loword(msg.lparam));
apoint.y:=Smallint(hiword(msg.lparam));
milieu.x:=arect.right div 2;
milieu.y:=arect.bottom div 2;
if ptinrect(arect,apoint) then
begin
self.posi:=utile.int_angle_degree(milieu.x,milieu.y,apoint.x,apoint.y); {en degrée}
self.Mesurer_le_deplacement(msg);
if self.down then self.Deplacement_radial;
invalidaterect(self.hwindow,nil,false);
end;
end;
end; {trose_des_deplacements.WMMousemove}
procedure trose_des_deplacements.WMLButtonDown(var msg:TMessage);
begin
if (wmain.MainWindow<>nil) and (wmain.MainWindow.Aide) then
wmain.MainWindow.is_aide_context(HELPID_Afficher_la_rose_des_deplacements)
else
begin
setcapture(hwindow);
self.down:=True;
self.Mesurer_le_deplacement(msg);
self.Deplacement_radial;
end;
end;
procedure trose_des_deplacements.Mesurer_le_deplacement(var msg:TMessage);
var arect:trect;
centre:tpoint;
begin
Getclientrect(self.hwindow,arect);
point_du_curseur.x:=Smallint(loword(msg.lparam));
point_du_curseur.y:=Smallint(hiword(msg.lparam));
centre.x:=arect.right div 2;
centre.y:=(arect.bottom-k_offset) div 2;
longeur:=utile.distance_2pt(centre,point_du_curseur);
angle:=utile.angle_radian_2pt(centre,point_du_curseur);
delta.x:=round(cos(angle)*longeur);
delta.y:=round(sin(angle)*longeur);
self.move_deja:=True;
end; {trose_des_deplacements.Mesurer_le_deplacement}
procedure trose_des_deplacements.Deplacement_radial;
var i:integer;
arect:trect;
un_index:u_object.tindex;
une_forme:u_object.tforme_color;
modif:boolean;
un_calque_actif:col_plan.TCalque;
begin
modif:=false;
if wmain.MainWindow<>nil then
begin
un_calque_actif:=col_plan.TCalque(wmain.MainWindow.wmsg.col_dessin.Get_calque_actif);
for i:=0 to pred(un_calque_actif.col_select.count) do
begin
un_index:=u_object.tindex(un_calque_actif.col_select.at(i));
if un_index<>nil then
begin
une_forme:=u_object.tforme_color(un_calque_actif.formindex(un_index));
if une_forme<>nil then
begin
modif:=true;
une_forme.deplace(delta.x,-delta.y,0);
invalidaterect(self.hwindow,nil,false);
updatewindow(self.hwindow);
end;
end;
end;
end;
if modif then
begin
postmessage(wmain.MainWindow.hwindow,wmenuk.wm_selection_changer,0,0);
invalidaterect(wmain.MainWindow.hwindow,nil,false);
updatewindow(wmain.MainWindow.hwindow);
if wmain.wregle_hori<>nil then invalidaterect(wmain.wregle_hori.hwindow,nil,false);
if wmain.wregle_verti<>nil then invalidaterect(wmain.wregle_verti.hwindow,nil,false);
end;
end; {trose_des_deplacements.Deplacement_radial}
procedure trose_des_deplacements.WMLButtonUp(var msg:TMessage);
begin
releasecapture;
self.down:=False;
self.reviens:=true;
setTimer(self.hwindow,id_timer_reviens,66,0);
end;
procedure trose_des_deplacements.WMTIMER(var msg: TMessage);
begin
invalidaterect(self.hwindow,nil,false);
updatewindow(self.hwindow);
end;
{------------------------------------------------------------------------------}
constructor TPlume_de_lune_a_l_autre_Dialog.Create(AParent:WBase.TWindow; acalque:col_plan.TCalque);
const HELPIDREG_Plume_de_lune_a_l_autre_Dialog = 1804;
id_scroll_depart = 1000;
id_scroll_arriver = 1001;
id_static_depart = 100;
id_static_arriver = 101;
begin
inherited Create(AParent,HELPIDREG_Plume_de_lune_a_l_autre_Dialog,haide.HELPID_Afficher_epaisseur_de_l_une_a_l_autre); {denis}
self.un_calque:=acalque;
self.depart:=WBase.TScrollbar.Create(self,id_scroll_depart,0);
self.arriver:=WBase.TScrollbar.Create(self,id_scroll_arriver,0);
self.static_depart:=wbase.Tstatic.Create(self,id_static_depart,0);
self.static_arriver:=wbase.Tstatic.Create(self,id_static_arriver,0);
self.un_Cadre_Ajustement_des_couleurs:=win_rose.TCadre_Ajustement_des_couleurs.Create(self);
self.une_previsualisation:=win_rose.TPreview_les_couleurs.Create(self);
end; {TPlume_de_lune_a_l_autre_Dialog.Create}
procedure TPlume_de_lune_a_l_autre_Dialog.setupwindow;
var aforme:u_object.tforme_color;
begin
inherited setupwindow;
self.depart.SetPosition(1);
self.depart.SetRange(0,500);
self.arriver.SetPosition(1);
self.arriver.SetRange(0,500);
self.static_depart.settext('');
self.static_arriver.settext('');
if self.un_calque.col_select.count=1 then
begin
aforme:=u_object.tforme_color(un_calque.last_selection);
if aforme<>nil then
begin
self.Set_Depart_Text(aforme);
self.depart.SetPosition(relation.log_pouce_to_10mm(aforme.epaisseur));
self.Set_arriver_Text(aforme);
self.arriver.SetPosition(relation.log_pouce_to_10mm(aforme.epaisseur_went));
end;
end;
end;
procedure TPlume_de_lune_a_l_autre_Dialog.Set_Depart_Text(aforme:u_object.tforme_color);
var apc:pc100;
begin
wutil.real_to_pchar_format(relation.log_pouce_to_10mm(aforme.epaisseur)/10,apc,2,2);
strcat(apc,win_rose.k_mm);
self.static_depart.settext(apc);
end; {TPlume_de_lune_a_l_autre_Dialog.Set_Depart_Text}
procedure TPlume_de_lune_a_l_autre_Dialog.Set_arriver_Text(aforme:u_object.tforme_color);
var apc:pc100;
begin
wutil.real_to_pchar_format(relation.log_pouce_to_10mm(aforme.epaisseur_went)/10,apc,2,2);
strcat(apc,win_rose.k_mm);
self.static_arriver.settext(apc);
end; {TPlume_de_lune_a_l_autre_Dialog.Set_arriver_Text}
procedure TPlume_de_lune_a_l_autre_Dialog.WMHSCROLL(var Msg: TMessage);
var hwndScrollBar:hwnd;
i,posit:integer;
un_index:u_object.tindex;
aforme:u_object.tforme_color;
Begin
inherited WMHSCROLL(Msg);
hwndScrollBar:=msg.LParam;
if self.depart.hwindow=hwndScrollBar then
begin
posit:=relation._10mm_to_log_pouce(self.depart.GetPosition);
for i:=0 to pred(self.un_calque.col_select.Count) do
begin
un_index:=self.un_calque.col_select.at(i);
if un_index<>nil then
begin
aforme:=u_object.tforme_color(self.un_calque.formindex(un_index));
if aforme<>nil then
begin
Set_Depart_Text(aforme);
aforme.epaisseur:=posit; {écrit par denis Bertin}
end;
end;
end;
invalidaterect(wmain.MainWindow.hwindow,nil,false);
end
else if self.arriver.hwindow=hwndScrollBar then
begin
posit:=relation._10mm_to_log_pouce(self.arriver.GetPosition);
for i:=0 to pred(self.un_calque.col_select.Count) do
begin
un_index:=self.un_calque.col_select.at(i);
if un_index<>nil then
begin
aforme:=u_object.tforme_color(self.un_calque.formindex(un_index));
if aforme<>nil then
begin
Set_arriver_Text(aforme);
aforme.epaisseur_went:=posit; {écrit par denis Bertin}
end;
end;
end;
invalidaterect(wmain.MainWindow.hwindow,nil,false);
end;
end; {TPlume_de_lune_a_l_autre_Dialog.WMHSCROLL}
procedure TPlume_de_lune_a_l_autre_Dialog.Actualiser_la_previsualisation;
begin
invalidaterect(une_previsualisation.hwindow,nil,false);
updatewindow(une_previsualisation.hwindow);
end;
{==============================================================================}
constructor TCadre_Ajustement_des_couleurs.create(un_parent:TWinbase);
const kid_Ajustement_des_couleurs = 1002;
begin
inherited create(un_parent,kid_Ajustement_des_couleurs,0);
self.forme_ajustement:=wformes1.Tforme_dessin.create(0,0,0);
self.forme_ajustement.epaisseur:=1;
self.forme_ajustement.epaisseur_went:=1;
self.bouton_down:=false;
self.plot_selected:=nil;
self.index_selected:=-1;
end;
Destructor TCadre_Ajustement_des_couleurs.Destroy;
begin
if self.forme_ajustement<>nil then
forme_ajustement.free;
inherited Destroy;
end;
procedure TCadre_Ajustement_des_couleurs.SetUpWindow;
begin
inherited SetUpWindow;
self.Creer_Nombre_point(4);
TPlume_de_lune_a_l_autre_Dialog(parent).Actualiser_la_previsualisation;
end;
procedure TCadre_Ajustement_des_couleurs.Creer_Nombre_point(nb_point:integer);
var i:integer;
arect:trect;
begin
getclientrect(self.hwindow,arect);
for i:=1 to pred(nb_point) do
begin
forme_ajustement.elements.add(font_ob1.splinenode.Create(
arect.Right*i div pred(nb_point),
arect.bottom*i div pred(nb_point),0));
end;
forme_ajustement.calcul;
end;
procedure TCadre_Ajustement_des_couleurs.sous_classement;
begin
SetWindowLong(self.hwindow,GWL_WNDPROC,longint(@c_color.PROC_COLOR_REDIB));
end; {TVisu_Spline.sous_classement}
procedure TCadre_Ajustement_des_couleurs.WMPaint(var Msg: TMessage);
var i:integer;
arect,brect:trect;
paintdc,memdc:hdc;
paintStruct:TpaintStruct;
old_bitmap:hbitmap;
posit:integer;
apencil:hpen;
anode:font_ob1.testnode;
abrush:hbrush;
begin
brect:=g_base.grand_plan;
getclientrect(self.hwindow,arect);
paintdc:=beginpaint(hwindow,paintStruct);
memdc:=CreateCompatibleDc(paintdc);
old_bitmap:=Selectobject(memdc,CreateCompatibleBitmap(paintdc,arect.Right,arect.bottom));
rectangle(memdc,0,0,succ(arect.Right),succ(arect.bottom));
for i:=1 to 4 do
begin
apencil:=selectobject(memdc,Createpen(PS_DOT,1,g_base.rgb_bleu));
posit:=arect.bottom*i div 5;
moveto(memdc,0,posit);
lineto(memdc,arect.right,posit);
DeleteObject(selectobject(memdc,apencil));
end;
forme_ajustement.paint(memdc,brect);
for i:=0 to pred(forme_ajustement.elements.count) do
begin
anode:=font_ob1.testnode(forme_ajustement.elements.at(i));
if anode<>nil then
begin
abrush:=selectobject(memdc,CreateSolidbrush(
hls_rvb.Get_HLS_RGB(360*i div forme_ajustement.elements.count,0.5,1)));
Ellipse(memdc,anode.x-8,anode.y-8,anode.x+8,anode.y+8);
DeleteObject(Selectobject(memdc,abrush));
end;
end;
bitblt(paintdc,0,0,arect.right,arect.bottom,memdc,0,0,SRCCOPY);
DeleteObject(SelectObject(Memdc,old_bitmap));
DeleteDC(memdc);
endpaint(hwindow,paintStruct);
end;
procedure TCadre_Ajustement_des_couleurs.wmmousemove(var Msg: TMessage);
var i:integer;
mouse:tpoint;
anode:font_ob1.testnode;
mouse_plot_rect:trect;
arect:trect;
begin
GetClientRect(self.hwindow,arect);
mouse.x:=Smallint(loword(msg.lparam));
mouse.y:=Smallint(hiword(msg.lparam));
if bouton_down and (self.plot_selected<>nil) then
begin
if index_selected<>-1 then
begin
if (index_selected>0)
and (index_selected<pred(self.forme_ajustement.elements.count)) then
begin
if (mouse.x>=arect.left) and (mouse.y<arect.right) then
self.plot_selected.x:=mouse.x;
if (mouse.y>arect.top) and (mouse.y<arect.bottom) then
self.plot_selected.y:=mouse.y;
end
else
begin
if (mouse.y>=arect.top) and (mouse.y<arect.bottom) then
self.plot_selected.y:=mouse.y; {écrit par denis bertin}
end;
setcursor(haide.G_Cursor.Move_fine_cursor);
forme_ajustement.calcul;
invalidaterect(self.hwindow,nil,false);
updatewindow(self.hwindow);
TPlume_de_lune_a_l_autre_Dialog(parent).Actualiser_la_previsualisation;
end;
end
else
begin
for i:=0 to pred(forme_ajustement.elements.count) do
begin
anode:=font_ob1.testnode(self.forme_ajustement.elements.at(i));
if anode<>nil then
begin
setrect(mouse_plot_rect,anode.x-8,anode.y-8,anode.x+8,anode.y+8);
if PtInRect(mouse_plot_rect,mouse) then setcursor(haide.G_Cursor.Move_fine_cursor);
end;
end;
end;
end;
procedure TCadre_Ajustement_des_couleurs.WMLButtonDown(var Msg: TMessage);
var i:integer;
mouse:tpoint;
mouse_plot_rect:trect;
anode:font_ob1.testnode;
begin
mouse.x:=Smallint(loword(msg.lparam));
mouse.y:=Smallint(hiword(msg.lparam));
for i:=0 to pred(forme_ajustement.elements.count) do
begin
anode:=font_ob1.testnode(self.forme_ajustement.elements.at(i));
if anode<>nil then
begin
setrect(mouse_plot_rect,anode.x-8,anode.y-8,anode.x+8,anode.y+8);
if PtInRect(mouse_plot_rect,mouse) then
begin
self.index_selected:=i;
self.plot_selected:=anode;
setcursor(haide.G_Cursor.Move_fine_cursor);
end;
end;
end;
setcapture(self.hwindow);
bouton_down:=true;
end;
procedure TCadre_Ajustement_des_couleurs.WMLButtonUp(var Msg: TMessage);
begin
self.index_selected:=-1;
self.bouton_down:=false;
self.plot_selected:=nil;
releasecapture;
end; {TCadre_Ajustement_des_couleurs}
{==============================================================================}
constructor TPreview_les_couleurs.Create(un_parent:TWinbase);
const id_TPreview_les_couleurs = 1003;
begin
inherited Create(un_parent,id_TPreview_les_couleurs,0);
end;
procedure TPreview_les_couleurs.Sous_classement;
begin
SetWindowLong(self.hwindow,GWL_WNDPROC,longint(@c_color.PROC_COLOR_REDIB));
end;
procedure TPreview_les_couleurs.WMPaint(var Msg: TMessage);
var i,j,position,posit_suivante:integer;
arect,arect_cadre:trect;
paintdc,memdc:hdc;
paintStruct:TpaintStruct;
old_bitmap:hbitmap;
apencil_navi:hpen;
un_tableau:u_tablis.o_tabpt;
vertical,vertical_suivante:integer;
begin
getclientrect(self.hwindow,arect);
getclientrect(TPlume_de_lune_a_l_autre_Dialog(parent).un_Cadre_Ajustement_des_couleurs.hwindow,arect_cadre);
paintdc:=beginpaint(hwindow,paintStruct);
memdc:=CreateCompatibleDc(paintdc);
old_bitmap:=Selectobject(memdc,CreateCompatibleBitmap(paintdc,arect.Right,arect.bottom));
rectangle(memdc,0,0,succ(arect.Right),succ(arect.bottom));
un_tableau:=u_tablis.o_tabpt(TPlume_de_lune_a_l_autre_Dialog(parent).
un_Cadre_Ajustement_des_couleurs.forme_ajustement.listtabpt.at(0));
if un_tableau<>nil then
begin
for i:=1 to pred(un_tableau.Npt) do
begin
position:=pred(i)*arect.right div pred(un_tableau.Npt); {écrit par denis}
posit_suivante:=i*arect.right div pred(un_tableau.Npt);
vertical:=un_tableau.tab[i].y*arect.Bottom div arect_cadre.bottom;
vertical_suivante:=un_tableau.tab[succ(i)].y*arect.Bottom div arect_cadre.bottom;
for j:=position to posit_suivante do
begin
apencil_navi:=selectObject(memdc,CreatePen(PS_Solid,1,hls_rvb.Get_HLS_RGB(
deformat.IN_Between(0,720,vertical+
deformat.IN_Between(0,vertical_suivante-vertical,j-position,posit_suivante-position),arect_cadre.bottom),0.5,1)));
moveto(memdc,j,arect.Bottom);
lineto(memdc,j,vertical+deformat.IN_Between(0,vertical_suivante-vertical,j-position,posit_suivante-position));
DeleteObject(SelectObject(memdc,apencil_navi));
end;
end;
end;
bitblt(paintdc,0,0,arect.right,arect.bottom,memdc,0,0,SRCCOPY);
DeleteObject(SelectObject(Memdc,old_bitmap));
DeleteDC(memdc);
endpaint(hwindow,paintStruct);
end;
end.