home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Samples / BMPVWS / BMPVWS.ZIP / OPENBMP.FRM (.txt) < prev   
Encoding:
Visual Basic Form  |  1993-09-21  |  10.3 KB  |  344 lines

  1. VERSION 2.00
  2. Begin Form OpenBitmap 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Bitmap Viewer Control"
  5.    ClientHeight    =   3108
  6.    ClientLeft      =   3108
  7.    ClientTop       =   3852
  8.    ClientWidth     =   5688
  9.    ClipControls    =   0   'False
  10.    Height          =   3480
  11.    Left            =   3084
  12.    LinkTopic       =   "Form2"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3108
  16.    ScaleWidth      =   5688
  17.    Top             =   3504
  18.    Width           =   5736
  19.    Begin SSCheck SaveSettings 
  20.       Caption         =   "&Save settings on exit"
  21.       Font3D          =   0  'None
  22.       FontBold        =   -1  'True
  23.       FontItalic      =   0   'False
  24.       FontName        =   "MS Sans Serif"
  25.       FontSize        =   6.6
  26.       FontStrikethru  =   0   'False
  27.       FontUnderline   =   0   'False
  28.       ForeColor       =   &H00000000&
  29.       Height          =   252
  30.       Left            =   240
  31.       TabIndex        =   8
  32.       Top             =   2160
  33.       Width           =   2292
  34.    End
  35.    Begin SSCommand AboutBitmap 
  36.       Caption         =   "&About Viewer"
  37.       Font3D          =   3  'Inset w/light shading
  38.       FontBold        =   -1  'True
  39.       FontItalic      =   0   'False
  40.       FontName        =   "MS Sans Serif"
  41.       FontSize        =   6.6
  42.       FontStrikethru  =   0   'False
  43.       FontUnderline   =   0   'False
  44.       ForeColor       =   &H00000000&
  45.       Height          =   372
  46.       Left            =   240
  47.       TabIndex        =   7
  48.       Top             =   600
  49.       Width           =   1812
  50.    End
  51.    Begin SSCommand ExitViewer 
  52.       Caption         =   "E&xit Viewer"
  53.       Font3D          =   3  'Inset w/light shading
  54.       FontBold        =   -1  'True
  55.       FontItalic      =   0   'False
  56.       FontName        =   "MS Sans Serif"
  57.       FontSize        =   6.6
  58.       FontStrikethru  =   0   'False
  59.       FontUnderline   =   0   'False
  60.       ForeColor       =   &H00000000&
  61.       Height          =   372
  62.       Left            =   240
  63.       TabIndex        =   6
  64.       Top             =   1680
  65.       Width           =   1812
  66.    End
  67.    Begin SSCommand Close 
  68.       Caption         =   "&Close"
  69.       Font3D          =   3  'Inset w/light shading
  70.       FontBold        =   -1  'True
  71.       FontItalic      =   0   'False
  72.       FontName        =   "MS Sans Serif"
  73.       FontSize        =   6.6
  74.       FontStrikethru  =   0   'False
  75.       FontUnderline   =   0   'False
  76.       ForeColor       =   &H00000000&
  77.       Height          =   372
  78.       Left            =   240
  79.       TabIndex        =   5
  80.       Top             =   1320
  81.       Width           =   1812
  82.    End
  83.    Begin SSCommand LoadBMP 
  84.       Caption         =   "&Load BMP"
  85.       Font3D          =   3  'Inset w/light shading
  86.       FontBold        =   -1  'True
  87.       FontItalic      =   0   'False
  88.       FontName        =   "MS Sans Serif"
  89.       FontSize        =   6.6
  90.       FontStrikethru  =   0   'False
  91.       FontUnderline   =   0   'False
  92.       ForeColor       =   &H00000000&
  93.       Height          =   372
  94.       Left            =   240
  95.       TabIndex        =   4
  96.       Top             =   960
  97.       Width           =   1812
  98.    End
  99.    Begin SSPanel Panel3D1 
  100.       Align           =   2  'Align Bottom
  101.       Alignment       =   0  'Left Justify - TOP
  102.       BackColor       =   &H00C0C0C0&
  103.       BevelInner      =   2  'Raised
  104.       BevelWidth      =   3
  105.       Caption         =   "Panel3D1"
  106.       FloodShowPct    =   0   'False
  107.       FloodType       =   4  'Bottom To Top
  108.       Font3D          =   0  'None
  109.       ForeColor       =   &H00000000&
  110.       Height          =   3108
  111.       Left            =   0
  112.       RoundedCorners  =   0   'False
  113.       ShadowColor     =   1  'Black
  114.       TabIndex        =   0
  115.       Top             =   0
  116.       Width           =   5688
  117.       Begin SSCheck Aspect 
  118.          Caption         =   "&Maintain aspect ratio"
  119.          Font3D          =   0  'None
  120.          FontBold        =   -1  'True
  121.          FontItalic      =   0   'False
  122.          FontName        =   "MS Sans Serif"
  123.          FontSize        =   6.6
  124.          FontStrikethru  =   0   'False
  125.          FontUnderline   =   0   'False
  126.          ForeColor       =   &H00000000&
  127.          Height          =   252
  128.          Left            =   240
  129.          TabIndex        =   10
  130.          Top             =   2640
  131.          Width           =   2292
  132.       End
  133.       Begin SSCheck OnTop 
  134.          Caption         =   "&Always on top"
  135.          Font3D          =   0  'None
  136.          FontBold        =   -1  'True
  137.          FontItalic      =   0   'False
  138.          FontName        =   "MS Sans Serif"
  139.          FontSize        =   6.6
  140.          FontStrikethru  =   0   'False
  141.          FontUnderline   =   0   'False
  142.          ForeColor       =   &H00000000&
  143.          Height          =   252
  144.          Left            =   240
  145.          TabIndex        =   9
  146.          Top             =   2400
  147.          Width           =   2292
  148.       End
  149.       Begin FileListBox File1 
  150.          BackColor       =   &H00C0C0C0&
  151.          FontBold        =   -1  'True
  152.          FontItalic      =   0   'False
  153.          FontName        =   "MS Sans Serif"
  154.          FontSize        =   6.6
  155.          FontStrikethru  =   0   'False
  156.          FontUnderline   =   0   'False
  157.          ForeColor       =   &H00000000&
  158.          Height          =   2520
  159.          Left            =   3960
  160.          Pattern         =   "*.BMP"
  161.          TabIndex        =   3
  162.          Top             =   240
  163.          Width           =   1452
  164.       End
  165.       Begin DirListBox Dir1 
  166.          BackColor       =   &H00C0C0C0&
  167.          FontBold        =   -1  'True
  168.          FontItalic      =   0   'False
  169.          FontName        =   "MS Sans Serif"
  170.          FontSize        =   6.6
  171.          FontStrikethru  =   0   'False
  172.          FontUnderline   =   0   'False
  173.          ForeColor       =   &H00000000&
  174.          Height          =   1824
  175.          Left            =   2160
  176.          TabIndex        =   2
  177.          Top             =   240
  178.          Width           =   1692
  179.       End
  180.       Begin DriveListBox Drive1 
  181.          BackColor       =   &H00C0C0C0&
  182.          FontBold        =   -1  'True
  183.          FontItalic      =   0   'False
  184.          FontName        =   "MS Sans Serif"
  185.          FontSize        =   6.6
  186.          FontStrikethru  =   0   'False
  187.          FontUnderline   =   0   'False
  188.          ForeColor       =   &H00000000&
  189.          Height          =   252
  190.          Left            =   240
  191.          TabIndex        =   1
  192.          Top             =   240
  193.          Width           =   1812
  194.       End
  195.    End
  196. Sub AboutBitmap_Click ()
  197.     BmpABout.Show 1
  198. End Sub
  199. Sub Close_Click ()
  200.     OpenBitmap.Hide
  201.     If (OnTop = True) Then
  202.         Topmost
  203.     Else
  204.         NotTopMost
  205.     End If
  206. End Sub
  207. Sub Dir1_Change ()
  208.     File1.Path = Dir1.Path
  209.     File1.SetFocus
  210.     If File1.ListCount Then
  211.         File1.ListIndex = 0
  212.         If LoadBMP.Enabled = False Then
  213.             LoadBMP.Enabled = True
  214.         End If
  215.     Else
  216.         LoadBMP.Enabled = False
  217.     End If
  218. End Sub
  219. Sub Dir1_Click ()
  220.     LastChange = DIRSBOXCLICK
  221. End Sub
  222. Sub Drive1_Change ()
  223.     On Error Resume Next
  224.     Dir1.Path = Drive1.Drive
  225.     If Err Then
  226.         MsgBox Error$
  227.         Drive1.Drive = Dir1.Path
  228.     End If
  229. End Sub
  230. Sub ExitViewer_Click ()
  231.     If (SaveSettings = True) Then
  232.         SaveINI
  233.     End If
  234.     BmpView.Image1.Picture = LoadPicture("")
  235.     Unload OpenBitmap
  236.     Unload BmpABout
  237.     Unload BmpView
  238.     End
  239. End Sub
  240. Sub File1_Click ()
  241.     LastChange = FileFormCLICK
  242.     If File1.ListCount Then
  243.         If LoadBMP.Enabled = False Then
  244.             LoadBMP.Enabled = True
  245.         End If
  246.     Else
  247.         LoadBMP.Enabled = False
  248.     End If
  249. End Sub
  250. Sub File1_DblClick ()
  251.     LoadBMP_Click
  252. End Sub
  253. Sub Form_Load ()
  254. '    Dim tmp As Integer
  255. '    Dim Slash As Integer
  256.     LoadBMP.Enabled = False
  257. '   If (BMPFileName <> "") Then
  258. '       tmp = InStr(BMPFileName, "\")
  259. '       While (tmp)
  260. '           Slash = tmp
  261. '           tmp = InStr(Slash + 1, BMPFileName, "\")
  262. '       Wend
  263. '       Dir1.Path = Left$(BMPFileName, Slash - 1)
  264. '   End If
  265. End Sub
  266. Sub Form_Unload (Cancel As Integer)
  267. End Sub
  268. Sub LoadBMP_Click ()
  269.     TheNewPath = Dir1.Path
  270.     If Right$(TheNewPath, 1) <> "\" Then
  271.         TheNewPath = TheNewPath + "\"
  272.     End If
  273.     BMPFileName = TheNewPath + OpenBitmap.File1.FileName
  274.     ViewAllowResize = False
  275.     ImageLoad
  276.     ViewAllowResize = True
  277.     OpenBitmap.Hide
  278.     If (OnTop = True) Then
  279.         Topmost
  280.     Else
  281.         NotTopMost
  282.     End If
  283. End Sub
  284. Sub SaveINI ()
  285.     Dim LIN As String
  286.     Dim NoTitle As String
  287.     Dim SaveSet As String
  288.     Dim Always As String
  289.     Dim AspectRatio As String
  290.     Dim INIChan As Integer
  291.     On Error GoTo INIERROR
  292.     INIChan% = 1
  293.     If (BmpView.Caption = "") Then
  294.         NoTitle = "Yes"
  295.     Else
  296.         NoTitle = "No"
  297.     End If
  298.     If (SaveSettings = True) Then
  299.         SaveSet = "Yes"
  300.     Else
  301.         SaveSet = "No"
  302.     End If
  303.     If (OnTop = True) Then
  304.         Always = "Yes"
  305.     Else
  306.         Always = "No"
  307.     End If
  308.     If (Aspect = True) Then
  309.         AspectRatio = "Yes"
  310.     Else
  311.         AspectRatio = "No"
  312.     End If
  313.     Open "C:\WINDOWS\BMPVIEW.INI" For Output As #INIChan%
  314.     Print #INIChan%, "[Current Bitmap]"
  315.     Print #INIChan%, BMPFileName
  316.     Print #INIChan%, "[Top]"
  317.     Print #INIChan%, Str$(BmpView.Top)
  318.     Print #INIChan%, "[Left]"
  319.     Print #INIChan%, Str$(BmpView.Left)
  320.     Print #INIChan%, "[Height]"
  321.     Print #INIChan%, Str$(BmpView.Height)
  322.     Print #INIChan%, "[Width]"
  323.     Print #INIChan%, Str$(BmpView.Width)
  324.     Print #INIChan%, "[No Title]"
  325.     Print #INIChan%, NoTitle
  326.     Print #INIChan%, "[Save Settings]"
  327.     Print #INIChan%, SaveSet
  328.     Print #INIChan%, "[Always on top]"
  329.     Print #INIChan%, Always
  330.     Print #INIChan%, "[Aspect Ratio]"
  331.     Print #INIChan%, AspectRatio
  332.     Close #INIChan%
  333.     Exit Sub
  334. INIERROR:
  335.         
  336.     If (Err) Then
  337.         MsgBox "Error saving BMPVIEW.INI in C:\WINDOWS"
  338.         Resume CarryOn
  339.     End If
  340. CarryOn:
  341.     Form_Unload 0
  342.     End
  343. End Sub
  344.