home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / misc / prog_bar.lha / prog_bar / Assembler / prog_bar.i < prev   
Encoding:
Text File  |  1997-01-12  |  5.7 KB  |  156 lines

  1.    IFND PROG_BAR_I
  2. PROG_BAR_I  SET   1
  3.  
  4. ** $Filename: progbar.i $
  5. ** $Release: 1.01 $
  6. ** $Revision: 36.1 $
  7. ** $Date: 18/11/96 $
  8. **
  9. ** Prog_Bar definitions, a progress bar system
  10. **
  11. ** (C) Copyright 1996 by Allan Savage
  12. ** All Rights Reserved
  13.  
  14.    IFND  EXEC_TYPES_I
  15.    INCLUDE "exec/types.i"
  16.    ENDC
  17.  
  18.    IFND UTILITY_TAGITEM_I
  19.    INCLUDE "utility/tagitem.i"
  20.    ENDC
  21.  
  22.    IFND INTUITION_INTUITION_I
  23.    INCLUDE "intuition/intuition.i"
  24.    ENDC
  25.  
  26. ;------------------------------------------------------------------------------
  27.  
  28. PB_Dummy             EQU   TAG_USER+$60000
  29.  
  30. ; Tags for CreateProgBar() and SetProgBarAttrs()
  31.  
  32. PB_LeftEdge          EQU   PB_Dummy+1     ; X pos
  33. PB_TopEdge           EQU   PB_Dummy+2     ; Y pos
  34. PB_Width             EQU   PB_Dummy+3     ; Width
  35. PB_Height            EQU   PB_Dummy+4     ; Height
  36. PB_Direction         EQU   PB_Dummy+5     ; Direction of Expansion
  37. PB_BarColour         EQU   PB_Dummy+6     ; Bar colour
  38. PB_BarBackColour     EQU   PB_Dummy+7     ; Bar Background colour
  39. PB_BarSize           EQU   PB_Dummy+8     ; Value of full Bar
  40. PB_BarValue          EQU   PB_Dummy+9     ; Value of filled Bar
  41. PB_BorderType        EQU   PB_Dummy+10    ; Type of Border
  42.  
  43. PB_TextMode          EQU   PB_Dummy+11    ; Actual Value or %age
  44. PB_TextPosition      EQU   PB_Dummy+12    ; Position to display text
  45. PB_TextColour        EQU   PB_Dummy+13    ; Text Colour
  46. PB_TextBackColour    EQU   PB_Dummy+14    ; Text BackGround Colour
  47. PB_TextFont          EQU   PB_Dummy+15    ; Font for text (*TextAttr)
  48.  
  49. ; Options for PB_Direction
  50.  
  51. PBDE_RIGHT           EQU   0              ; From Left to Right  ( default )
  52. PBDE_LEFT            EQU   1              ; From Right to Left
  53. PBDE_UP              EQU   2              ; From Bottom to Top
  54. PBDE_DOWN            EQU   3              ; From Top to Bottom
  55.  
  56. ; Options for PB_BorderType
  57.  
  58. PBBT_NONE            EQU   10             ; No Border
  59. PBBT_PLAIN           EQU   11             ; Plain Black Box  ( default )
  60. PBBT_RECESSED        EQU   12             ; Recessed Box
  61. PBBT_RAISED          EQU   13             ; Raised Box
  62. PBBT_RIDGE           EQU   14             ; Raised Ridge
  63.  
  64. ; Options for Text Mode
  65.  
  66. PBTM_NONE            EQU   20             ; No Text  ( default )
  67. PBTM_PERCENT         EQU   21             ; Display Value as a %age
  68. PBTM_VALUE           EQU   22             ; Display Value as "Value/Total"
  69.  
  70. ; Options for Text Position
  71.  
  72. PBTP_BELOW           EQU   30             ; Text centred below Bar  ( default )
  73. PBTP_ABOVE           EQU   31             ; Text centred above Bar
  74. PBTP_LEFT            EQU   32             ; Text to left of Bar
  75. PBTP_RIGHT           EQU   33             ; Text to right of Bar
  76. PBTP_CENTRE          EQU   34             ; Text centred inside Bar
  77.  
  78. ; Structure Definition
  79.  
  80.    STRUCTURE P_Bar, 0
  81.  
  82.    ; The following fields are set up when the Progress Bar is created.
  83.    ; They are simply quick reference points for the information needed
  84.    ; to display the Progress Bar.  DO NOT CHANGE THE VALUES STORED HERE.
  85.  
  86.    APTR     pbr_Wnd                       ; Window to render Bar in
  87.    APTR     pbr_RPort                     ; RastPort used for rendering
  88.    APTR     pbr_Vis_Info                  ; VisualInfo for Bar
  89.    STRUCT   pbr_Bar_IText,it_SIZEOF       ; Used to display the Text
  90.    STRUCT   pbr_Bar_Text,16               ; Used to store the Text
  91.  
  92.    ; The following fields are used to store the current settings for the
  93.    ; Progress Bar.  They should not be changed directly, but can be altered
  94.    ; using SetProgBarAttrs()
  95.  
  96.    UWORD    pbr_LeftEdge                  ; Column Number for Left Edge
  97.    UWORD    pbr_TopEdge                   ; Row Number for Top Edge
  98.    UWORD    pbr_Width                     ; Total Width  ( including Border )
  99.    UWORD    pbr_Height                    ; Total Height ( including Border )
  100.  
  101.    UBYTE    pbr_Direction                 ; Direction for Bar Expansion
  102.  
  103.    UBYTE    pbr_Bar_Colour                ; Pen Number for rendering Bar
  104.    UBYTE    pbr_Bar_Background            ; Pen Number for Bar Background
  105.    UWORD    pbr_Bar_Size                  ; Value for full bar
  106.    UWORD    pbr_Bar_Value                 ; Current Value for Bar
  107.  
  108.    UBYTE    pbr_Border_Type               ; Type of Border
  109.  
  110.    UBYTE    pbr_Text_Mode                 ; Mode for text display
  111.    UBYTE    pbr_Text_Position             ; Placement for Text
  112.  
  113.    ; The following fields are working variables for the functions and
  114.    ; should not be used or altered by your program.
  115.  
  116.    UWORD    pbr_B_LeftEdge                ; LeftEdge of Bar ( No Border )
  117.    UWORD    pbr_B_RightEdge               ; RightEdge of Bar ( No Border )
  118.    UWORD    pbr_B_TopEdge                 ; TopEdge of Bar ( No Border )
  119.    UWORD    pbr_B_BottomEdge              ; BottomEdge of Bar ( No Border )
  120.    UWORD    pbr_B_Length                  ; Bar Length in pixels ( No Border )
  121.    UWORD    pbr_B_Value                   ; Number of pixels to fill
  122.    UBYTE    pbr_B_Percent                 ; Percentage of Bar filled
  123.    UWORD    pbr_T_Width                   ; Width of text in pixels
  124.    UWORD    pbr_T_Height                  ; Height of text in pixels
  125.    UWORD    pbr_MT_Width                  ; Max Text Width in Pixels
  126.    UWORD    pbr_MT_Left                   ; Left coordinate of longest test
  127.    UWORD    pbr_MT_Top                    ; Top coordinate of longest text
  128.  
  129.    LABEL PBar_SIZEOF
  130.  
  131. PBAR     MACRO                         ; P_Bar structure
  132. \1     EQU     SOFFSET
  133. SOFFSET     SET     SOFFSET+PBar_SIZEOF
  134.        ENDM
  135.  
  136.  
  137. ; Function Prototypes
  138.  
  139.    IFND  PROG_BAR_A
  140.  
  141.    XREF  _CreateProgBarA
  142.    XREF  _CreateProgBar
  143.    XREF  _SetProgBarAttrsA
  144.    XREF  _SetProgBarAttrs
  145.    XREF  _FreeProgBar
  146.    XREF  _RefreshProgBar
  147.    XREF  _UpdateProgBar
  148.    XREF  _ResetProgBar
  149.    XREF  _ClearProgBar
  150.    XREF  _ClearBar
  151.    XREF  _ClearText
  152.  
  153.    ENDC  ; PROG_BAR_A
  154.  
  155.    ENDC  ; PROG_BAR_I
  156.