MMGAUGE.INT 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {========================================================================}
  2. {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
  3. {========================================================================}
  4. {= All Rights Reserved =}
  5. {========================================================================}
  6. {= D 01099 Dresden = Tel.: +0351-8012255 =}
  7. {= Loewenstr.7a = info@swiftsoft.de =}
  8. {========================================================================}
  9. {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
  10. {========================================================================}
  11. {= This code is for reference purposes only and may not be copied or =}
  12. {= distributed in any format electronic or otherwise except one copy =}
  13. {= for backup purposes. =}
  14. {= =}
  15. {= No Delphi Component Kit or Component individually or in a collection=}
  16. {= subclassed or otherwise from the code in this unit, or associated =}
  17. {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
  18. {= without express permission from SwiftSoft. =}
  19. {= =}
  20. {= For more licence informations please refer to the associated =}
  21. {= HelpFile. =}
  22. {========================================================================}
  23. {= $Date: 20.01.1998 - 18:00:00 $ =}
  24. {========================================================================}
  25. unit MMGauge;
  26. {$I COMPILER.INC}
  27. interface
  28. uses
  29. {$IFDEF WIN32}
  30. Windows,
  31. {$ELSE}
  32. WinTypes,
  33. WinProcs,
  34. {$ENDIF}
  35. Classes,
  36. Controls,
  37. Graphics,
  38. Menus,
  39. MMObj;
  40. type
  41. TMMGaugeKind = (gkText,gkHorizontalBar,gkVerticalBar,gkPie,gkNeedle);
  42. const
  43. defWidth = 150;
  44. defHeight = 18;
  45. defKind = gkHorizontalBar;
  46. defShowText = True;
  47. defForeColor = clActiveCaption;
  48. defBackColor = clWhite;
  49. defMinValue = 0;
  50. defMaxValue = 100;
  51. defProgress = 0;
  52. defBWText = False;
  53. type
  54. {-- TMMCustomGauge --------------------------------------------------}
  55. TMMCustomGauge = class(TMMGraphicControl)
  56. public
  57. constructor Create(AOwner: TComponent); override;
  58. procedure AddProgress(Value: Longint);
  59. property PercentDone: Longint read GetPercentDone;
  60. protected
  61. property Width default defWidth;
  62. property Height default defHeight;
  63. property Kind: TMMGaugeKind read FKind write SetGaugeKind default defKind;
  64. property ShowText: Boolean read FShowText write SetShowText default defShowText;
  65. property ForeColor: TColor read FForeColor write SetForeColor default defForeColor;
  66. property BackColor: TColor read FBackColor write SetBackColor default defBackColor;
  67. property MinValue: Longint read FMinValue write SetMinValue default defMinValue;
  68. property MaxValue: Longint read FMaxValue write SetMaxValue default defMaxValue;
  69. property Progress: Longint read FCurValue write SetProgress default defProgress;
  70. property Caption: string read FCaption write SetCaption;
  71. property BWText: Boolean read FBWText write SetBWText default defBWText;
  72. end;
  73. {-- TMMGauge --------------------------------------------------------}
  74. TMMGauge = class(TMMCustomGauge)
  75. published
  76. property Kind;
  77. property ShowText;
  78. property ForeColor;
  79. property BackColor;
  80. property MinValue;
  81. property MaxValue;
  82. property Progress;
  83. property Caption;
  84. property BWText;
  85. property Align;
  86. property Enabled;
  87. property Font;
  88. property Bevel;
  89. property ParentFont;
  90. property ParentShowHint;
  91. property PopupMenu;
  92. property ShowHint;
  93. property Visible;
  94. end;
  95. implementation