frmabout.pp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2003 by the Free Pascal development team
  4. About form for debug server
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$mode objfpc}
  12. {$h+}
  13. unit frmabout;
  14. interface
  15. uses fpgtk,gtk,classes,sysutils;
  16. Type
  17. TAboutForm = Class (TFPGtkWindow)
  18. FAboutText : TFPGtkLabel;
  19. FSeparator : TFPGtkHSeparator;
  20. FVBox : TFPgtkVBox;
  21. FOK,
  22. FCancel : TFPGtkButton;
  23. FButtonBox: TFPgtkHBox;
  24. Constructor Create;
  25. Procedure CreateWindow;
  26. end;
  27. Implementation
  28. Resourcestring
  29. SAbout1 = 'Free Pascal message compiler - GTK version.';
  30. SAbout2 = '(c) 2003, Michael Van Canneyt';
  31. SOK = 'OK';
  32. SCancel = 'Cancel';
  33. Constructor TAboutForm.Create;
  34. begin
  35. Inherited Create(GTK_WINDOW_DIALOG);
  36. CreateWindow;
  37. end;
  38. Procedure TAboutForm.CreateWindow;
  39. Var
  40. S : String;
  41. begin
  42. FVBox:=TFPGtkVBox.Create;
  43. FVBox.Spacing:=4;
  44. FVBox.Border:=8;
  45. Add(FVBox);
  46. // About text
  47. S:=SAbout1+LineEnding+SAbout2;
  48. FAboutText:=TFPgtkLabel.Create(S);
  49. // button area
  50. FOK:=TFpGtkButton.CreateWithLabel(SOK);
  51. FOK.ConnectClicked(@CloseWithResult,IntToPointer(drOK));
  52. FCancel:=TFPgtkButton.CreateWithLabel(SCancel);
  53. FCancel.ConnectCLicked(@CloseWithResult,IntToPointer(drCancel));
  54. FSeparator:=TFPgtkHSeparator.Create;
  55. FButtonBox:=TfpGtkHBox.Create;
  56. FButtonBox.Spacing:=4;
  57. FButtonBox.PackEnd(FOK,false,false,4);
  58. FButtonBox.PackEnd(FCancel,false,false,4);
  59. // Add to window
  60. FVBox.PackStart(FAboutText,True,True,0);
  61. FVBox.PackStart(FSeparator,False,False,4);
  62. FVBox.PackStart(FButtonBox,false,false,0);
  63. end;
  64. end.