home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhfile / mhgfil.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1995-11-28  |  13.8 KB  |  436 lines

  1. VERSION 4.00
  2. Begin VB.Form MhgFil 
  3.    Caption         =   "Mh3dFile Example"
  4.    ClientHeight    =   4080
  5.    ClientLeft      =   1308
  6.    ClientTop       =   1872
  7.    ClientWidth     =   7368
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   0
  11.       weight          =   700
  12.       size            =   7.8
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    ForeColor       =   &H80000008&
  18.    Height          =   4680
  19.    Left            =   1260
  20.    LinkTopic       =   "Form1"
  21.    ScaleHeight     =   4080
  22.    ScaleWidth      =   7368
  23.    Top             =   1320
  24.    Width           =   7464
  25.    Begin VB.PictureBox picStatus 
  26.       Align           =   2  'Align Bottom
  27.       Height          =   360
  28.       Left            =   0
  29.       ScaleHeight     =   312
  30.       ScaleWidth      =   7320
  31.       TabIndex        =   0
  32.       Top             =   3720
  33.       Width           =   7365
  34.    End
  35.    Begin MhgfilLib.Mh3dFile Mh3dFile1 
  36.       Height          =   3144
  37.       Left            =   180
  38.       TabIndex        =   1
  39.       Top             =   216
  40.       Width           =   3936
  41.       _Version        =   65536
  42.       _ExtentX        =   6943
  43.       _ExtentY        =   5546
  44.       _StockProps     =   79
  45.       TintColor       =   16711935
  46.       BevelStyleInner =   0
  47.       BevelSizeInner  =   0
  48.       BorderType      =   1
  49.       BorderColor     =   -2147483642
  50.       Case            =   0
  51.       DividerStyle    =   0
  52.       FillColor       =   -2147483633
  53.       FontStyle       =   0
  54.       LightColor      =   -2147483643
  55.       MultiSelect     =   0
  56.       PictureHeight   =   16
  57.       PictureWidth    =   16
  58.       ScrollBars      =   1
  59.       ShadowColor     =   -2147483632
  60.       WallPaper       =   0
  61.       Sorted          =   0   'False
  62.       TextColor       =   -2147483640
  63.       WrapList        =   0   'False
  64.       WrapWidth       =   0
  65.       Archive         =   -1  'True
  66.       DefaultPics     =   1
  67.       Hidden          =   -1  'True
  68.       Normal          =   -1  'True
  69.       Path            =   "C:\PROJECTS"
  70.       Pattern         =   "*.*"
  71.       ReadOnly        =   -1  'True
  72.       System          =   -1  'True
  73.       FocusColor      =   0
  74.       HighColor       =   -2147483634
  75.    End
  76.    Begin VB.Menu mnuBevel 
  77.       Caption         =   "Bevel"
  78.       Begin VB.Menu mnuBevelSizeInner 
  79.          Caption         =   "BevelSizeInner"
  80.       End
  81.       Begin VB.Menu mnuBevelStyleInner 
  82.          Caption         =   "BevelStyleInner"
  83.       End
  84.    End
  85.    Begin VB.Menu mnuBorder 
  86.       Caption         =   "Border"
  87.       Begin VB.Menu mnuBorderColor 
  88.          Caption         =   "BorderColor"
  89.       End
  90.       Begin VB.Menu mnuBorderType 
  91.          Caption         =   "BorderType"
  92.       End
  93.    End
  94.    Begin VB.Menu mnuColor 
  95.       Caption         =   "Color"
  96.       Begin VB.Menu mnuFillColor 
  97.          Caption         =   "FillColor"
  98.       End
  99.       Begin VB.Menu mnuFocusColor 
  100.          Caption         =   "FocusColor"
  101.       End
  102.       Begin VB.Menu mnuHighColor 
  103.          Caption         =   "HighColor"
  104.       End
  105.       Begin VB.Menu mnuLightColor 
  106.          Caption         =   "LightColor"
  107.       End
  108.       Begin VB.Menu mnuShadowColor 
  109.          Caption         =   "ShadowColor"
  110.       End
  111.       Begin VB.Menu mnuTextColor 
  112.          Caption         =   "TextColor"
  113.       End
  114.    End
  115.    Begin VB.Menu mnuFind 
  116.       Caption         =   "Find"
  117.       Begin VB.Menu mnuFindInstr 
  118.          Caption         =   "FindInstr"
  119.       End
  120.       Begin VB.Menu mnuFindString 
  121.          Caption         =   "FindString"
  122.       End
  123.       Begin VB.Menu mnuFoundIndex 
  124.          Caption         =   "FoundIndex"
  125.       End
  126.    End
  127.    Begin VB.Menu mnuList 
  128.       Caption         =   "List"
  129.       Begin VB.Menu mnuListData 
  130.          Caption         =   "ListData"
  131.       End
  132.       Begin VB.Menu mnuListPicture 
  133.          Caption         =   "ListPicture"
  134.       End
  135.       Begin VB.Menu mnuListPictureSel 
  136.          Caption         =   "ListPictureSel"
  137.       End
  138.    End
  139.    Begin VB.Menu mnuMiscellaneous 
  140.       Caption         =   "Miscellaneous"
  141.       Begin VB.Menu mnuCase 
  142.          Caption         =   "Case"
  143.       End
  144.       Begin VB.Menu mnuClearBox 
  145.          Caption         =   "ClearBox"
  146.       End
  147.       Begin VB.Menu mnuDividerStyle 
  148.          Caption         =   "DividerStyle"
  149.       End
  150.       Begin VB.Menu mnuFontStyle 
  151.          Caption         =   "FontStyle"
  152.       End
  153.       Begin VB.Menu mnuScreenUpdate 
  154.          Caption         =   "ScreenUpdate"
  155.       End
  156.       Begin VB.Menu mnuScrollbars 
  157.          Caption         =   "Scrollbars"
  158.       End
  159.       Begin VB.Menu mnuWallPaper 
  160.          Caption         =   "WallPaper"
  161.       End
  162.       Begin VB.Menu mnuWrapList 
  163.          Caption         =   "WrapList"
  164.       End
  165.       Begin VB.Menu mnuWrapWidth 
  166.          Caption         =   "WrapWidth"
  167.       End
  168.    End
  169.    Begin VB.Menu mnuPicture 
  170.       Caption         =   "Picture"
  171.       Begin VB.Menu mnuDefaultPics 
  172.          Caption         =   "DefaultPics"
  173.       End
  174.       Begin VB.Menu mnuPictureHeight 
  175.          Caption         =   "PictureHeight"
  176.       End
  177.       Begin VB.Menu mnuPictureWidth 
  178.          Caption         =   "PictureWidth"
  179.       End
  180.    End
  181.    Begin VB.Menu mnuSelect 
  182.       Caption         =   "Select"
  183.       Begin VB.Menu mnuLastAdded 
  184.          Caption         =   "LastAdded"
  185.       End
  186.       Begin VB.Menu mnuLastReplaced 
  187.          Caption         =   "LastReplaced"
  188.       End
  189.       Begin VB.Menu mnuMultiSelect 
  190.          Caption         =   "MultiSelect"
  191.       End
  192.       Begin VB.Menu mnuSelectedCount 
  193.          Caption         =   "SelectedCount"
  194.       End
  195.       Begin VB.Menu mnuTagged 
  196.          Caption         =   "Tagged"
  197.       End
  198.       Begin VB.Menu mnuTopIndex 
  199.          Caption         =   "TopIndex"
  200.       End
  201.    End
  202. Attribute VB_Name = "MhgFil"
  203. Attribute VB_Creatable = False
  204. Attribute VB_Exposed = False
  205. Private Sub Form_Load()
  206.     Me.Top = (Screen.Height - Me.Height) / 2
  207.     Me.Left = (Screen.Width - Me.Width) / 2
  208.     ' this is to set path of control so that files appear in the list
  209.     Mh3dFile1.Path = App.Path
  210. End Sub
  211. Private Sub Mh3dFile1_PathChange()
  212.     picStatus.Cls
  213.     picStatus.Print "Custom Event - Mh3dFile1_PathChange"
  214.     If picStatus.ForeColor = &H800000 Then
  215.         picStatus.ForeColor = &H0&
  216.     Else
  217.         picStatus.ForeColor = &H800000
  218.     End If
  219. End Sub
  220. Private Sub Mh3dFile1_TopIndexChange()
  221.     picStatus.Cls
  222.     picStatus.Print "Custom Event - Mh3dFile1_TopIndexChange"
  223.     If picStatus.ForeColor = &H800000 Then
  224.         picStatus.ForeColor = &H0&
  225.     Else
  226.         picStatus.ForeColor = &H800000
  227.     End If
  228. End Sub
  229. Private Sub mnuBevelSizeInner_Click()
  230.     igRangeArray(0) = 0
  231.     igRangeArray(1) = Mh3dFile1.BevelSizeInner
  232.     igRangeArray(2) = 10
  233.     Mh3dFile1.BevelSizeInner = GetRange("BevelSizeInner")
  234. End Sub
  235. Private Sub mnuBevelStyleInner_Click()
  236.     ReDim sgOptionArray(0 To 2)
  237.     sgOptionArray(0) = "Lowered"
  238.     sgOptionArray(1) = "Raised"
  239.     sgOptionArray(2) = "Chiseled"
  240.     igOptionState = Mh3dFile1.BevelStyleInner
  241.     Mh3dFile1.BevelStyleInner = GetOption("BevelStyleInner")
  242. End Sub
  243. Private Sub mnuBorderColor_Click()
  244.     ColorSelect.Show 1
  245.     Mh3dFile1.BorderColor = lgCurrentColor
  246. End Sub
  247. Private Sub mnuBorderType_Click()
  248.     ReDim sgOptionArray(0 To 4)
  249.     sgOptionArray(0) = "None"
  250.     sgOptionArray(1) = "Thin"
  251.     sgOptionArray(2) = "Sizeable"
  252.     sgOptionArray(3) = "Thin with caption"
  253.     sgOptionArray(4) = "Sizeable with caption"
  254.     igOptionState = Mh3dFile1.BorderType
  255.     Mh3dFile1.BorderType = GetOption("BorderType")
  256. End Sub
  257. Private Sub mnuCase_Click()
  258.     ReDim sgOptionArray(0 To 2)
  259.     sgOptionArray(0) = "Mixed"
  260.     sgOptionArray(1) = "Lower"
  261.     sgOptionArray(2) = "Upper"
  262.     igOptionState = Mh3dFile1.Case
  263.     Mh3dFile1.Case = GetOption("Case")
  264. End Sub
  265. Private Sub mnuClearBox_Click()
  266.     Mh3dFile1.ClearBox = 1
  267.     End Sub
  268. Private Sub mnuDefaultPics_Click()
  269.     ReDim sgOptionArray(0 To 1)
  270.     sgOptionArray(0) = "False"
  271.     sgOptionArray(1) = "True"
  272.     igOptionState = Mh3dFile1.DefaultPics
  273.     Mh3dFile1.DefaultPics = GetOption("DefaultPics")
  274. End Sub
  275. Private Sub mnuDividerStyle_Click()
  276.     ReDim sgOptionArray(0 To 4)
  277.     sgOptionArray(0) = "None"
  278.     sgOptionArray(1) = "Singe Border Color"
  279.     sgOptionArray(2) = "Single Shadow Color"
  280.     sgOptionArray(3) = "Lowered"
  281.     sgOptionArray(4) = "Raised"
  282.     igOptionState = Mh3dFile1.DividerStyle
  283.     Mh3dFile1.DividerStyle = GetOption("DividerStyle")
  284. End Sub
  285. Private Sub mnuFillColor_Click()
  286.     ColorSelect.Show 1
  287.     Mh3dFile1.FillColor = lgCurrentColor
  288. End Sub
  289. Private Sub mnuFindInstr_Click()
  290.     Dim spResp As String
  291.     spResp = InputBox$("Enter the string to search for", "FindInstr", "", Me.Left + 120, Me.Top + 120)
  292.     If Len(spResp) Then
  293.         Mh3dFile1.FindInstr = spResp
  294.     Else
  295.         MsgBox "Action canceled", , "Error"
  296.     End If
  297. End Sub
  298. Private Sub mnuFindString_Click()
  299.     Dim spResp As String
  300.     spResp = InputBox$("Enter the string to search for", "FindString", "", Me.Left + 120, Me.Top + 120)
  301.     If Len(spResp) Then
  302.         Mh3dFile1.FindString = spResp
  303.     Else
  304.         MsgBox "Action canceled", , "Error"
  305.     End If
  306. End Sub
  307. Private Sub mnuFocusColor_Click()
  308.     ColorSelect.Show 1
  309.     Mh3dFile1.FocusColor = lgCurrentColor
  310. End Sub
  311. Private Sub mnuFontStyle_Click()
  312.     ReDim sgOptionArray(0 To 4)
  313.     sgOptionArray(0) = "None"
  314.     sgOptionArray(1) = "Raised"
  315.     sgOptionArray(2) = "Raised with more shading"
  316.     sgOptionArray(3) = "Lowered"
  317.     sgOptionArray(4) = "Lowered with more shading"
  318.     igOptionState = Mh3dFile1.FontStyle
  319.     Mh3dFile1.FontStyle = GetOption("FontStyle")
  320. End Sub
  321. Private Sub mnuFoundIndex_Click()
  322.     MsgBox Str(Mh3dFile1.FoundIndex), , "FoundIndex"
  323. End Sub
  324. Private Sub mnuHighColor_Click()
  325.     ColorSelect.Show 1
  326.     Mh3dFile1.HighColor = lgCurrentColor
  327. End Sub
  328. Private Sub mnuLastAdded_Click()
  329.     MsgBox Mh3dFile1.LastAdded, , "LastAdded"
  330. End Sub
  331. Private Sub mnuLastReplaced_Click()
  332.     MsgBox Mh3dFile1.LastReplaced, , "LastReplaced"
  333. End Sub
  334. Private Sub mnuLightColor_Click()
  335.     ColorSelect.Show 1
  336.     Mh3dFile1.LightColor = lgCurrentColor
  337. End Sub
  338. Private Sub mnuListData_Click()
  339.     MsgBox "Used like .ItemData in the standard VB listbox to associate data to an index", , ""
  340. End Sub
  341. Private Sub mnuListPicture_Click()
  342.     Dim spResp As String
  343.     spResp = InputBox$("Enter the picture to show.", "ListPicture", "", Me.Left + 120, Me.Top + 120)
  344.     If Len(spResp) And Dir$(spResp) <> "" Then
  345.         Mh3dFile1.ListPicture(0) = LoadPicture(spResp)
  346.     Else
  347.         MsgBox "Action canceled", , "Error"
  348.     End If
  349. End Sub
  350. Private Sub mnuListPictureSel_Click()
  351.     Dim spResp As String
  352.     spResp = InputBox$("Enter the picture to show.", "ListPictureSel", "", Me.Left + 120, Me.Top + 120)
  353.     If Len(spResp) And Dir$(spResp) <> "" Then
  354.         Mh3dFile1.ListPictureSel(0) = LoadPicture(spResp)
  355.     Else
  356.         MsgBox "Action canceled", , "Error"
  357.     End If
  358. End Sub
  359. Private Sub mnuMultiSelect_Click()
  360.     ReDim sgOptionArray(0 To 1)
  361.     sgOptionArray(0) = "False"
  362.     sgOptionArray(1) = "True"
  363.     igOptionState = Mh3dFile1.MultiSelect
  364.     Mh3dFile1.MultiSelect = GetOption("Multiselect")
  365. End Sub
  366. Private Sub mnuPictureHeight_Click()
  367.     igRangeArray(0) = 0
  368.     igRangeArray(1) = Mh3dFile1.PictureHeight
  369.     igRangeArray(2) = 20
  370.     Mh3dFile1.PictureHeight = GetRange("PictureHeight")
  371. End Sub
  372. Private Sub mnuPictureWidth_Click()
  373.     igRangeArray(0) = 0
  374.     igRangeArray(1) = Mh3dFile1.PictureWidth
  375.     igRangeArray(2) = 20
  376.     Mh3dFile1.PictureWidth = GetRange("PictureWidth")
  377. End Sub
  378. Private Sub mnuScreenUpdate_Click()
  379.     ReDim sgOptionArray(0 To 1)
  380.     sgOptionArray(0) = "No automatic refresh on data change"
  381.     sgOptionArray(1) = "Automatic refresh"
  382.     igOptionState = Mh3dFile1.Screenupdate
  383.     Mh3dFile1.Screenupdate = GetOption("ScreenUpdate")
  384. End Sub
  385. Private Sub mnuScrollbars_Click()
  386.     ReDim sgOptionArray(0 To 1)
  387.     sgOptionArray(0) = "None"
  388.     sgOptionArray(1) = "Verticle only"
  389.     igOptionState = Mh3dFile1.ScrollBars
  390.     Mh3dFile1.ScrollBars = GetOption("Scrollbars")
  391. End Sub
  392. Private Sub mnuSelectedCount_Click()
  393.     MsgBox Mh3dFile1.SelectedCount, , "SelectedCount"
  394. End Sub
  395. Private Sub mnuShadowColor_Click()
  396.     ColorSelect.Show 1
  397.     Mh3dFile1.ShadowColor = lgCurrentColor
  398. End Sub
  399. Private Sub mnuTagged_Click()
  400.     Dim pMsg As String
  401.     Dim i As Integer
  402.     pMsg = ""
  403.     For i = 0 To Mh3dFile1.ListCount - 1
  404.         pMsg = pMsg & Str(i) & Chr$(9) & Mh3dFile1.Tagged(i) & Chr$(13) & Chr$(10)
  405.     Next i
  406.     MsgBox pMsg, , "Tagged"
  407. End Sub
  408. Private Sub mnuTextColor_Click()
  409.     ColorSelect.Show 1
  410.     Mh3dFile1.TextColor = lgCurrentColor
  411. End Sub
  412. Private Sub mnuTopIndex_Click()
  413.     MsgBox Mh3dFile1.TopIndex, , "TopIndex"
  414. End Sub
  415. Private Sub mnuWallPaper_Click()
  416.     ReDim sgOptionArray(0 To 2)
  417.     sgOptionArray(0) = "StrBlt"
  418.     sgOptionArray(1) = "BitBlt"
  419.     sgOptionArray(2) = "Replicate"
  420.     igOptionState = Mh3dFile1.WallPaper
  421.     Mh3dFile1.WallPaper = GetOption("WallPaper")
  422. End Sub
  423. Private Sub mnuWrapList_Click()
  424.     ReDim sgOptionArray(0 To 1)
  425.     sgOptionArray(0) = "False"
  426.     sgOptionArray(1) = "True"
  427.     igOptionState = Mh3dFile1.WrapList
  428.     Mh3dFile1.WrapList = GetOption("WrapList")
  429. End Sub
  430. Private Sub mnuWrapWidth_Click()
  431.     igRangeArray(0) = 0
  432.     igRangeArray(1) = Mh3dFile1.WrapWidth
  433.     igRangeArray(2) = 10
  434.     Mh3dFile1.WrapWidth = GetRange("WrapWidth")
  435. End Sub
  436.