home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhanim / clrsel32.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-11-08  |  6.8 KB  |  236 lines

  1. VERSION 4.00
  2. Begin VB.Form ColorSelect 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00C0C0C0&
  5.    BorderStyle     =   1  'Fixed Single
  6.    ClientHeight    =   930
  7.    ClientLeft      =   2505
  8.    ClientTop       =   6030
  9.    ClientWidth     =   3795
  10.    ControlBox      =   0   'False
  11.    BeginProperty Font 
  12.       name            =   "MS Sans Serif"
  13.       charset         =   0
  14.       weight          =   700
  15.       size            =   8.25
  16.       underline       =   0   'False
  17.       italic          =   0   'False
  18.       strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H80000008&
  21.    Height          =   1335
  22.    KeyPreview      =   -1  'True
  23.    Left            =   2445
  24.    LinkTopic       =   "Form2"
  25.    MaxButton       =   0   'False
  26.    MinButton       =   0   'False
  27.    ScaleHeight     =   930
  28.    ScaleWidth      =   3795
  29.    Top             =   5685
  30.    Width           =   3915
  31.    Begin MhgmulLib.Mh3dMulLabel ColorSel 
  32.       Height          =   495
  33.       Left            =   1320
  34.       TabIndex        =   1
  35.       Top             =   240
  36.       Width           =   1215
  37.       _Version        =   65536
  38.       _ExtentX        =   2143
  39.       _ExtentY        =   873
  40.       _StockProps     =   77
  41.       ForeColor       =   0
  42.       AutoSize        =   -1  'True
  43.       BevelSize       =   0
  44.       BevelStyle      =   0
  45.       BorderColor     =   0
  46.       BorderStyle     =   0
  47.       FillColor       =   12632256
  48.       FontStyle       =   0
  49.       FontTransparent =   0   'False
  50.       LightColor      =   16777215
  51.       ShadowColor     =   8421504
  52.       WallPaper       =   0
  53.       Picture         =   "Clrsel32.frx":0000
  54.       Scalemode       =   0
  55.       SegmentStyle    =   0
  56.       Segment         =   0
  57.       Segments        =   1
  58.       SegmentVarsize  =   0
  59.       DataField       =   ""
  60.       DataFieldCount  =   0
  61.       DataFieldData   =   "Clrsel32.frx":001C
  62.       SegBevelStyle0  =   0
  63.       SegBevelSize0   =   2
  64.       SegFontStyle0   =   0
  65.       SegPicLeft0     =   0
  66.       SegPicTop0      =   0
  67.       SegPicWidth0    =   0
  68.       SegPicHeight0   =   0
  69.       SegWallpaper0   =   0
  70.       SegBorderStyle0 =   0
  71.       SegMax0         =   100
  72.       SegMin0         =   0
  73.       SegValue0       =   0
  74.       SegFillStyle0   =   0
  75.       SegAlignment0   =   0
  76.       SegRectTop0     =   4
  77.       SegRectLeft0    =   4
  78.       SegRectBottom0  =   27
  79.       SegRectRight0   =   75
  80.       SegLightColor0  =   -2147483643
  81.       SegShadowColor0 =   -2147483632
  82.       SegBackColor0   =   -2147483633
  83.       SegFillColor0   =   -2147483643
  84.       SegTextColor0   =   -2147483640
  85.       SegTwipLeft0    =   0
  86.       SegTwipTop0     =   0
  87.       SegTwipWidth0   =   0
  88.       SegTwipHeight0  =   0
  89.       SegAutosize0    =   0   'False
  90.       SegMultiline0   =   0   'False
  91.       SegFontStrike0  =   0   'False
  92.       SegFontTransparent0=   0   'False
  93.       SegFontUnder0   =   0   'False
  94.       SegFontBold0    =   0   'False
  95.       SegFontItalic0  =   0   'False
  96.       SegFontSize0    =   0
  97.       SegPicture0     =   "Clrsel32.frx":0034
  98.       SegCaption0     =   ""
  99.       SegFontName0    =   ""
  100.       SegDataField0   =   ""
  101.       SegFormat0      =   ""
  102.    End
  103.    Begin VB.CommandButton Command1 
  104.       Appearance      =   0  'Flat
  105.       BackColor       =   &H80000005&
  106.       Cancel          =   -1  'True
  107.       Caption         =   "Command1"
  108.       Height          =   375
  109.       Left            =   5160
  110.       TabIndex        =   0
  111.       Top             =   2040
  112.       Width           =   615
  113.    End
  114. Attribute VB_Name = "ColorSelect"
  115. Attribute VB_Creatable = False
  116. Attribute VB_Exposed = False
  117. Option Explicit
  118. Dim colors&(64)
  119. Dim cColorselhit
  120. Private Sub ColorSel_Click()
  121. lgColorValue = colors&(cColorselhit)
  122. lgCurrentColor = colors&(cColorselhit)
  123. Unload ColorSelect
  124. End Sub
  125. Private Sub colorsel_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  126.     Dim xcolorsel As Integer
  127.     Dim ycolorsel As Integer
  128.     xcolorsel = Int(X / (ColorSel.Width / 16))
  129.     ycolorsel = Int(Y / (ColorSel.Height / 4))
  130.     cColorselhit = ycolorsel * 16 + xcolorsel
  131. End Sub
  132. Private Sub Command1_Click()
  133.     lgColorValue = -1
  134.     ColorSelect.Hide
  135. End Sub
  136. Private Sub Form_Load()
  137.     Dim swidth%
  138.     Dim sheight%
  139.     Dim i%
  140.     Screen.MousePointer = 11
  141.     DoEvents
  142.     ColorSel.ScaleMode = 1
  143.     ColorSel.Segments = 64
  144.     swidth% = ColorSelect.ScaleWidth / 16
  145.     sheight% = ColorSelect.ScaleHeight / 4
  146.     setcolors colors&()
  147.     ColorSelect.Top = (Screen.Height - ColorSelect.Height) / 2
  148.     ColorSelect.Left = (Screen.Width - ColorSelect.Width) / 2
  149.     ColorSel.Width = ColorSelect.ScaleWidth
  150.     ColorSel.Height = ColorSelect.ScaleHeight
  151.     ColorSel.Top = 0
  152.     ColorSel.Left = 0
  153.     ColorSel.BorderColor = ColorSel.ShadowColor
  154.     For i% = 0 To 63
  155.         ColorSel.Segment = i%
  156.         ColorSel.SegBackColor = colors&(i%)
  157.         ColorSel.SegWidth = swidth%
  158.         ColorSel.SegHeight = sheight%
  159.         ColorSel.SegLeft = swidth% * (i% Mod 16)
  160.         ColorSel.SegTop = sheight% * Int(i% / 16)
  161.         ColorSel.SegBevelSize = 1
  162.         ColorSel.SegBorderStyle = 1
  163.         ColorSel.SegShadowColor = 0
  164.         ColorSel.SegLightColor = ColorSel.SegShadowColor
  165.     Next
  166.     Screen.MousePointer = 0
  167. End Sub
  168. Private Sub setcolors(colors&())
  169.  colors&(0) = 16777215
  170.  colors&(1) = 14737632
  171.  colors&(2) = 12632319
  172.  colors&(3) = 12640511
  173.  colors&(4) = 14745599
  174.  colors&(5) = 12648384
  175.  colors&(6) = 16777152
  176.  colors&(7) = 16761024
  177.  colors&(8) = 16761087
  178.  colors&(9) = 192
  179. colors&(10) = 16576
  180. colors&(11) = 49344
  181. colors&(12) = 49152
  182. colors&(13) = 12632064
  183. colors&(14) = 12582912
  184. colors&(15) = 12583104
  185. colors&(16) = 12632256
  186. colors&(17) = 4210752
  187. colors&(18) = 8421631
  188. colors&(19) = 8438015
  189. colors&(20) = 8454143
  190. colors&(21) = 8454016
  191. colors&(22) = 16777088
  192. colors&(23) = 16744576
  193. colors&(24) = 16744703
  194. colors&(25) = 128
  195. colors&(26) = 16512
  196. colors&(27) = 32896
  197. colors&(28) = 32768
  198. colors&(29) = 8421376
  199. colors&(30) = 8388608
  200. colors&(31) = 8388736
  201. colors&(32) = 8421504
  202. colors&(33) = 0
  203. colors&(34) = 255
  204. colors&(35) = 33023
  205. colors&(36) = 65535
  206. colors&(37) = 65280
  207. colors&(38) = 16776960
  208. colors&(39) = 16711680
  209. colors&(40) = 16711935
  210. colors&(41) = 64
  211. colors&(42) = 4210816
  212. colors&(43) = 16448
  213. colors&(44) = 16384
  214. colors&(45) = 4210688
  215. colors&(46) = 4194304
  216. colors&(47) = 4194368
  217. colors&(48) = 16777215
  218. colors&(49) = 16777215
  219. colors&(50) = 16777215
  220. colors&(51) = 16777215
  221. colors&(52) = 16777215
  222. colors&(53) = 16777215
  223. colors&(54) = 16777215
  224. colors&(55) = 16777215
  225. colors&(56) = 16777215
  226. colors&(57) = 16777215
  227. colors&(58) = 16777215
  228. colors&(59) = 16777215
  229. colors&(60) = 16777215
  230. colors&(61) = 16777215
  231. colors&(62) = 16777215
  232. colors&(63) = 16777215
  233. End Sub
  234. Private Sub MHGMUL1_Click()
  235. End Sub
  236.