[fpc-pascal] if you really want to know who write a really good code read-it

denis Bertin d_bertin at hotmail.com
Wed Feb 2 16:25:25 CET 2011


unit D_fleche; {written by denis bertin in  a day for www.denisdraw.com with delphi-7}
interface
uses windows,whelp,wbase,col_plan,dialbase,messages;
type
Tdial_position_fleche = class(whelp.ThelpDialog)  constructor create (un_parent:wbase.twindow; un_plan_param:col_plan.TCalque);  procedure   setupwindow; override;  procedure   wmnum_edit_change(var msg:messages.TMessage); override;  procedure 	wmcommand(var Msg: TMessage); override;  private    un_calque_actif:col_plan.TCalque;    Position_de_la_fleche:dialbase.TNumEdit_plus_moins;    Epaisseur_de_la_fleche:dialbase.TNumEdit_plus_moins;    Distance_de_la_fleche:dialbase.TNumEdit_plus_moins;  public    bool_modifier:boolean;    count_before:integer;  end; {Tdial_position_fleche}
implementation
uses wmain;
Type
  TRec_Position_fleche = record    Position,    Epaisseur,    Distance:integer;    end;
var Rec_Position_fleche : TRec_Position_fleche;
const id_appliquer = 1000;
constructor Tdial_position_fleche.create(un_parent:wbase.twindow; un_plan_param:col_plan.TCalque);  const kid_position_fleche = 1681;  const id_Position_de_la_fleche = 101;  const id_Epaisseur_de_la_fleche = 102;  const id_Distance_de_la_fleche = 103;  begin  inherited create(un_parent,kid_position_fleche,0);  TransferBuffer := @Rec_Position_fleche;  Self.un_calque_actif:=un_plan_param;  Self.Position_de_la_fleche:=dialbase.TNumEdit_plus_moins.create(self,id_Position_de_la_fleche,3,0,100,0);  Self.Position_de_la_fleche.Enable_Previent_ton_Parent(true);  Self.Epaisseur_de_la_fleche:=dialbase.TNumEdit_plus_moins.create(self,id_Epaisseur_de_la_fleche,3,0,100,0);  Self.Epaisseur_de_la_fleche.Enable_Previent_ton_Parent(true);  Self.Distance_de_la_fleche:=dialbase.TNumEdit_plus_moins.create(self,id_Distance_de_la_fleche,3,0,100,0);  Self.Distance_de_la_fleche.Enable_Previent_ton_Parent(true);  Self.bool_modifier:=false;  count_before:=Self.un_calque_actif.count;  end;
procedure Tdial_position_fleche.setupwindow;  begin  inherited setupwindow;  postmessage(self.hwindow,wm_command,id_appliquer,0);  end; {Tdial_position_fleche.setupwindow}
procedure Tdial_position_fleche.wmnum_edit_change(var msg:TMessage);  begin  postmessage(self.hwindow,wm_command,id_appliquer,0);  end; {Tdial_position_fleche.wmnum_edit_change}
procedure Tdial_position_fleche.wmcommand(var Msg: TMessage);  var i:integer;  begin  inherited wmcommand(Msg);  case Msg.Wparam of    id_cancel:      begin      if bool_modifier then        begin        for i:=count_before to pred(Self.un_calque_actif.count) do          begin Self.un_calque_actif.atdelete(i); end;        end;      end;    id_appliquer:      begin      if bool_modifier then        begin        for i:=count_before to pred(Self.un_calque_actif.count) do          begin Self.un_calque_actif.atdelete(i); end;        end;      Self.TransferData(TDirT_GetData);      with Rec_Position_fleche do        un_calque_actif.Dessiner_une_fleche_rigide(bool_modifier,Epaisseur,Position,Distance); {->formecom}      invalidaterect(wmain.MainWindow.hwindow,nil,false);      end;    end; {case}  end; {Tdial_position_fleche.wmcommand}
beginRec_Position_fleche.Position:=80;  {%}Rec_Position_fleche.Epaisseur:=20; {%}Rec_Position_fleche.Distance:=25; {%}end.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110202/7c035b60/attachment.html>


More information about the fpc-pascal mailing list