home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / WTJ9403.ZIP / FOLEY / METER.PAS < prev   
Pascal/Delphi Source File  |  1993-04-07  |  2KB  |  77 lines

  1. {$S-,R-,V-,I-,B-,F-,W-,A-,G+,X+}
  2. {$C MOVEABLE,DEMANDLOAD,DISCARDABLE}
  3.  
  4. {*********************************************************}
  5. {*                    METER.PAS 1.00                     *}
  6. {*           Copyright (c) Brian Foley 1993.             *}
  7. {*                 All rights reserved.                  *}
  8. {*********************************************************}
  9.  
  10. unit Meter;
  11.   {-OWL interface to the meter control in DLLMETER}
  12.  
  13. interface
  14.  
  15. uses
  16.   WinTypes, WinProcs,
  17.   {$IFDEF Ver15}
  18.   wObjects;
  19.   {$ELSE}
  20.   OWindows, ODialogs;
  21.   {$ENDIF}
  22.  
  23. const
  24.   {special messages for meter controls}
  25.   mm_SetMeterValue = wm_User+0;
  26.   mm_SetLeftColor  = wm_User+1;
  27.   mm_SetRightColor = wm_User+2;
  28. type
  29.   PMeterControl = ^TMeterControl;
  30.   TMeterControl = object(TControl)
  31.     procedure SetMeterValue(N : Byte);
  32.       {-Set the value represented by the meter control}
  33.     procedure SetLeftColor(Color : LongInt);
  34.       {-Set the color used on the left side of the meter control}
  35.     procedure SetRightColor(Color : LongInt);
  36.       {-Set the color used on the right side of the meter control}
  37.     function GetClassName : PChar; virtual;
  38.       {-Return the class name of the meter control}
  39.   end;
  40.  
  41.   {========================================================================}
  42.  
  43. implementation
  44.  
  45.   procedure ForceLoad; far; forward;
  46.     {-Dummy routine called to force DLLMETER to be loaded}
  47.   procedure ForceLoad; external 'DLLMETER' index 1;
  48.  
  49.   procedure TMeterControl.SetMeterValue(N : Byte);
  50.     {-Set the value represented by the meter control}
  51.   begin
  52.     SendMessage(hWindow, mm_SetMeterValue, N, 0);
  53.   end;
  54.  
  55.   procedure TMeterControl.SetLeftColor(Color : LongInt);
  56.     {-Set the color used on the left side of the meter control}
  57.   begin
  58.     SendMessage(hWindow, mm_SetLeftColor, 0, Color);
  59.   end;
  60.  
  61.   procedure TMeterControl.SetRightColor(Color : LongInt);
  62.     {-Set the color used on the right side of the meter control}
  63.   begin
  64.     SendMessage(hWindow, mm_SetRightColor, 0, Color);
  65.   end;
  66.  
  67.   function TMeterControl.GetClassName : PChar;
  68.     {-Return the class name of the meter control}
  69.   begin
  70.     GetClassName := 'dllMeterControl';
  71.  
  72.     {force DLLMETER to be loaded}
  73.     ForceLoad;
  74.   end;
  75.  
  76. end.
  77.