home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD14719292001.psc / frm_mainmenu.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-02-10  |  15.1 KB  |  502 lines

  1. VERSION 5.00
  2. Object = "{B8325759-F2AB-11D2-B1E6-9246AA68EB78}#2.0#0"; "ThumbBrowseP.ocx"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  4. Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "fm20.dll"
  5. Begin VB.Form Main 
  6.    Caption         =   "Webblasters Image Viewer"
  7.    ClientHeight    =   8310
  8.    ClientLeft      =   165
  9.    ClientTop       =   450
  10.    ClientWidth     =   11880
  11.    Icon            =   "frm_mainmenu.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   8310
  15.    ScaleWidth      =   11880
  16.    StartUpPosition =   2  'CenterScreen
  17.    WindowState     =   2  'Maximized
  18.    Begin ComctlLib.StatusBar StatusBar1 
  19.       Align           =   2  'Align Bottom
  20.       Height          =   375
  21.       Left            =   0
  22.       TabIndex        =   7
  23.       Top             =   7935
  24.       Width           =   11880
  25.       _ExtentX        =   20955
  26.       _ExtentY        =   661
  27.       SimpleText      =   ""
  28.       _Version        =   327682
  29.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  30.          NumPanels       =   2
  31.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  32.             Style           =   5
  33.             Alignment       =   1
  34.             TextSave        =   "4:04 Viper1"
  35.             Object.Tag             =   ""
  36.          EndProperty
  37.          BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  38.             Style           =   6
  39.             Alignment       =   1
  40.             AutoSize        =   1
  41.             Object.Width           =   17965
  42.             TextSave        =   "2/10/00"
  43.             Object.Tag             =   ""
  44.          EndProperty
  45.       EndProperty
  46.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  47.          Name            =   "MS Serif"
  48.          Size            =   8.25
  49.          Charset         =   0
  50.          Weight          =   700
  51.          Underline       =   0   'False
  52.          Italic          =   0   'False
  53.          Strikethrough   =   0   'False
  54.       EndProperty
  55.    End
  56.    Begin VB.PictureBox picLogo 
  57.       Appearance      =   0  'Flat
  58.       AutoRedraw      =   -1  'True
  59.       AutoSize        =   -1  'True
  60.       BackColor       =   &H80000008&
  61.       BorderStyle     =   0  'None
  62.       FillColor       =   &H00808080&
  63.       BeginProperty Font 
  64.          Name            =   "MS Serif"
  65.          Size            =   12
  66.          Charset         =   0
  67.          Weight          =   700
  68.          Underline       =   0   'False
  69.          Italic          =   0   'False
  70.          Strikethrough   =   0   'False
  71.       EndProperty
  72.       ForeColor       =   &H00E0E0E0&
  73.       Height          =   8295
  74.       Left            =   0
  75.       ScaleHeight     =   8295
  76.       ScaleWidth      =   375
  77.       TabIndex        =   6
  78.       Top             =   -240
  79.       Width           =   375
  80.    End
  81.    Begin VB.ComboBox Select1 
  82.       Height          =   315
  83.       Left            =   840
  84.       TabIndex        =   5
  85.       Text            =   "*.bmp"
  86.       Top             =   7200
  87.       Visible         =   0   'False
  88.       Width           =   1215
  89.    End
  90.    Begin ThumbBrowseControl.ThumbBrowse tb 
  91.       Height          =   7800
  92.       Left            =   9960
  93.       TabIndex        =   0
  94.       Top             =   0
  95.       Width           =   1995
  96.       _ExtentX        =   3519
  97.       _ExtentY        =   13758
  98.       ThumbWidth      =   70
  99.       ThumbBorder     =   5
  100.       ColorLight      =   -2147483648
  101.       ColorDark       =   -2147483648
  102.    End
  103.    Begin VB.Timer Timer2 
  104.       Enabled         =   0   'False
  105.       Interval        =   4000
  106.       Left            =   720
  107.       Top             =   6480
  108.    End
  109.    Begin VB.PictureBox Picture1 
  110.       AutoRedraw      =   -1  'True
  111.       AutoSize        =   -1  'True
  112.       BorderStyle     =   0  'None
  113.       BeginProperty Font 
  114.          Name            =   "MS Serif"
  115.          Size            =   8.25
  116.          Charset         =   0
  117.          Weight          =   700
  118.          Underline       =   0   'False
  119.          Italic          =   0   'False
  120.          Strikethrough   =   0   'False
  121.       EndProperty
  122.       Height          =   8175
  123.       Left            =   480
  124.       ScaleHeight     =   8175
  125.       ScaleWidth      =   2055
  126.       TabIndex        =   1
  127.       Top             =   0
  128.       Width           =   2055
  129.       Begin VB.FileListBox File1 
  130.          BackColor       =   &H80000000&
  131.          BeginProperty Font 
  132.             Name            =   "MS Serif"
  133.             Size            =   8.25
  134.             Charset         =   0
  135.             Weight          =   700
  136.             Underline       =   0   'False
  137.             Italic          =   0   'False
  138.             Strikethrough   =   0   'False
  139.          EndProperty
  140.          ForeColor       =   &H00000000&
  141.          Height          =   4575
  142.          Left            =   0
  143.          Pattern         =   "*.JPG;*.BMP;*.GIF;*.DIB"
  144.          TabIndex        =   4
  145.          Top             =   3240
  146.          Width           =   1965
  147.       End
  148.       Begin VB.DirListBox Dir1 
  149.          BackColor       =   &H80000000&
  150.          BeginProperty Font 
  151.             Name            =   "MS Serif"
  152.             Size            =   8.25
  153.             Charset         =   0
  154.             Weight          =   700
  155.             Underline       =   0   'False
  156.             Italic          =   0   'False
  157.             Strikethrough   =   0   'False
  158.          EndProperty
  159.          ForeColor       =   &H00000000&
  160.          Height          =   2790
  161.          Left            =   0
  162.          TabIndex        =   3
  163.          Top             =   360
  164.          Width           =   1965
  165.       End
  166.       Begin VB.DriveListBox Drive1 
  167.          Height          =   315
  168.          Left            =   0
  169.          TabIndex        =   2
  170.          Top             =   0
  171.          Width           =   1935
  172.       End
  173.    End
  174.    Begin MSForms.Image Image1 
  175.       Height          =   7935
  176.       Left            =   2520
  177.       Top             =   0
  178.       Width           =   7335
  179.       BackColor       =   -2147483644
  180.       BorderStyle     =   0
  181.       SpecialEffect   =   1
  182.       Size            =   "12938;13996"
  183.       Picture         =   "frm_mainmenu.frx":030A
  184.    End
  185.    Begin VB.Menu File 
  186.       Caption         =   "&File"
  187.       WindowList      =   -1  'True
  188.       Begin VB.Menu mnuCut 
  189.          Caption         =   "&Cut"
  190.          Shortcut        =   {F1}
  191.       End
  192.       Begin VB.Menu mnuPaste 
  193.          Caption         =   "&Paste"
  194.          Shortcut        =   {F2}
  195.       End
  196.       Begin VB.Menu mnuPrint 
  197.          Caption         =   "&Print"
  198.          Shortcut        =   ^P
  199.       End
  200.       Begin VB.Menu mnuDelete 
  201.          Caption         =   "&Delete"
  202.          Shortcut        =   ^D
  203.       End
  204.       Begin VB.Menu ByBy 
  205.          Caption         =   "&Exit"
  206.          Shortcut        =   ^E
  207.       End
  208.    End
  209.    Begin VB.Menu Program 
  210.       Caption         =   "&Add-Ins"
  211.       Begin VB.Menu mnuSlide 
  212.          Caption         =   "SlideShow"
  213.          Enabled         =   0   'False
  214.          Shortcut        =   ^S
  215.       End
  216.       Begin VB.Menu mnuOrder 
  217.          Caption         =   "ReOrder"
  218.          Shortcut        =   ^O
  219.       End
  220.    End
  221.    Begin VB.Menu mnuBMP 
  222.       Caption         =   "&BMP"
  223.    End
  224.    Begin VB.Menu mnuGif 
  225.       Caption         =   "&GIF"
  226.    End
  227.    Begin VB.Menu mnuJPG 
  228.       Caption         =   "&JPG"
  229.    End
  230.    Begin VB.Menu mnuPlayer 
  231.       Caption         =   "&Media Player"
  232.    End
  233.    Begin VB.Menu mnuThumbs 
  234.       Caption         =   "&LoadThumbs"
  235.    End
  236.    Begin VB.Menu mnuClear 
  237.       Caption         =   "&Clear Image"
  238.    End
  239.    Begin VB.Menu mnuSlides 
  240.       Caption         =   "&SlideShow"
  241.       Begin VB.Menu mnuStart 
  242.          Caption         =   "&Start"
  243.          Shortcut        =   ^Z
  244.       End
  245.       Begin VB.Menu mnuStop 
  246.          Caption         =   "&Stop"
  247.          Shortcut        =   ^Y
  248.       End
  249.    End
  250.    Begin VB.Menu mnuHelp 
  251.       Caption         =   "&Help"
  252.       Index           =   0
  253.       Begin VB.Menu mnuAbout 
  254.          Caption         =   "&About"
  255.       End
  256.       Begin VB.Menu mnuCredits 
  257.          Caption         =   "&Contents"
  258.          Shortcut        =   ^H
  259.       End
  260.    End
  261.    Begin VB.Menu mnuPref 
  262.       Caption         =   "Preferences"
  263.    End
  264. Attribute VB_Name = "Main"
  265. Attribute VB_GlobalNameSpace = False
  266. Attribute VB_Creatable = False
  267. Attribute VB_PredeclaredId = True
  268. Attribute VB_Exposed = False
  269. Option Explicit
  270. Dim CRLF        As String
  271. Dim CRLF_CRLF   As String
  272. Dim iPic        As Byte
  273. Dim curSelect   As StdPicture
  274. Dim cL          As New cLogo
  275. Public i As Integer
  276. Private Type SHFILEOPSTRUCT
  277.     hWnd As Long
  278.     wFunc As Long
  279.     pFrom As String
  280.     pTo As String
  281.     fFlags As Integer
  282.     fAnyOperationsAborted As Long
  283.     hNameMappings As Long
  284.     lpszProgressTitle As Long '  only used if FOF_SIMPLEPROGRESS
  285. End Type
  286. Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
  287. Private Const FO_DELETE = &H3
  288. Private Const FOF_ALLOWUNDO = &H40
  289. Private Sub Form_Resize()
  290.     On Error Resume Next
  291.     picLogo.Height = Me.ScaleHeight
  292.     On Error GoTo 0
  293.     cL.Draw
  294. End Sub
  295. Private Sub Command1_Click()
  296. i = 0
  297. ' to disable drive, dir , file and combo box during slide show
  298. Drive1.Enabled = False
  299. Dir1.Enabled = False
  300. File1.Enabled = False
  301. Select1.Enabled = False
  302. Timer2.Enabled = True
  303. End Sub
  304. Private Sub Command2_Click()
  305.   Timer2.Enabled = False
  306.        ' to enable drive, dir , file and combo box after slide show
  307.   Drive1.Enabled = True
  308.   Dir1.Enabled = True
  309.   File1.Enabled = True
  310.   Select1.Enabled = True
  311. End Sub
  312. Private Sub mnuCut_Click()
  313.         Clipboard.Clear
  314.         Clipboard.SetData Image1.Picture
  315.         Image1.Picture = Nothing
  316. End Sub
  317. Private Sub mnuPaste_Click()
  318.    Image1.Picture = Clipboard.GetData
  319. End Sub
  320. Private Sub mnuPref_Click()
  321. frm_preferences.Show
  322. End Sub
  323. Private Sub mnuPrint_Click()
  324. On Error GoTo PrintErr
  325. Main.PrintForm
  326. PrintErr:
  327.     If Err.Number = 32755 Then
  328.     Exit Sub
  329.       
  330.     End If
  331. End Sub
  332. Private Sub mnuStart_Click()
  333. i = 0
  334. ' to disable drive, dir , file and combo box during slide show
  335. Drive1.Enabled = False
  336. Dir1.Enabled = False
  337. File1.Enabled = False
  338. Select1.Enabled = False
  339. Timer2.Enabled = True
  340. End Sub
  341. Private Sub mnuStop_Click()
  342.   Timer2.Enabled = False
  343.        ' to enable drive, dir , file and combo box after slide show
  344.   Drive1.Enabled = True
  345.   Dir1.Enabled = True
  346.   File1.Enabled = True
  347.   Select1.Enabled = True
  348. End Sub
  349. Private Sub select1_Click()
  350.    File1.Pattern = Trim(Select1.Text)
  351. End Sub
  352. Private Sub Form_Load()
  353.     CRLF = vbCrLf
  354.     CRLF_CRLF = CRLF & "." & CRLF
  355.     iPic = 101
  356.     cL.DrawingObject = picLogo
  357.     cL.Caption = "                       Webblasters Software Inc./  
  358.  Nick Scott"
  359.     frmMedia.Hide
  360.     'frmAbout.Hide
  361.     frmBrowser.Hide
  362.     FileRenamer.Hide
  363.     Dir1.Path = App.Path
  364.     'Image1.PictureSizeMode = fmPictureSizeModeStretch
  365.     Image1.Picture = LoadPicture(App.Path & "\images\" & "Lab.jpg")
  366. End Sub
  367. Private Sub tmr_Timer()
  368.     If iPic = 124 Then iPic = 101
  369.     Set curSelect = LoadResPicture(iPic, vbResBitmap)
  370.     iPic = iPic + 1
  371. End Sub
  372. Private Sub ByBy_Click()
  373. Unload Me
  374. End Sub
  375. Private Sub cmdExit_Click()
  376. Unload Me
  377. End Sub
  378. Private Sub mnuBMP_Click()
  379.     File1.Pattern = "*.bmp"
  380.     File1.Refresh
  381. End Sub
  382. Private Sub mnuCredits_Click()
  383. Load frmBrowser
  384. frmBrowser.WebBrowser1.Navigate App.Path & "\Help.htm"
  385. frmBrowser.Show 'End Sub
  386. End Sub
  387. Private Sub mnuDelete_Click()
  388. Dim nxtFile
  389. Dim op As SHFILEOPSTRUCT
  390.     With op
  391.         .wFunc = FO_DELETE
  392.         .pFrom = (Dir1.Path + "\" + File1.FileName)
  393.         .fFlags = FOF_ALLOWUNDO
  394.     End With
  395.     SHFileOperation op
  396.     File1.Refresh
  397. End Sub
  398. Private Sub mnuJPG_Click()
  399.     File1.Pattern = "*.jpg"
  400.     File1.Refresh
  401. End Sub
  402. Private Sub mnuGIF_Click()
  403.     File1.Pattern = "*.gif"
  404.     File1.Refresh
  405. End Sub
  406. Private Sub Dir1_Change()
  407.     File1.Path = Dir1.Path
  408. End Sub
  409. Private Sub Drive1_Change()
  410.     Dir1.Path = Drive1.Drive
  411. End Sub
  412. Private Sub mnuClear_Click()
  413.     'Image1.PictureSizeMode = fmPictureSizeModeStretch
  414.     Image1.Picture = LoadPicture(App.Path & "\images\" & "Lab.jpg")
  415.        
  416. End Sub
  417. Private Sub mnuOrder_Click()
  418.     Main.Hide
  419.     FileRenamer.Show
  420. End Sub
  421. Private Sub mnuPlayer_Click()
  422.     Main.Hide
  423.     frmMedia.Show
  424. End Sub
  425. Private Sub mnuThumbs_Click()
  426. Dim lsPath As String
  427.         
  428.     tb.Cls
  429.     For i = 1 To File1.ListCount - 1
  430.         lsPath = File1.Path & "\" & File1.List(i)
  431.         tb.AddThumb lsPath, File1.List(i), FileLen(lsPath), FileDateTime(lsPath)
  432.         DoEvents
  433.     Next
  434. End Sub
  435. Private Sub File1_Click()
  436.     Dim msg As String   ' Declare variables.
  437.     Dim FileName
  438.     FileName = File1.FileName
  439.     Image1.Picture = LoadPicture()
  440.     Image1.Picture = LoadPicture(Dir1.Path + "\" + FileName)
  441.         
  442.         If Image1.Picture.Height > Image1.Height Then
  443.             Image1.PictureSizeMode = fmPictureSizeModeZoom
  444.         Else
  445.             Image1.PictureSizeMode = fmPictureSizeModeClip
  446.         End If
  447.         
  448.         If Image1.Picture.Width > Image1.Width Then
  449.             Image1.PictureSizeMode = fmPictureSizeModeZoom
  450.         Else
  451.             Image1.PictureSizeMode = fmPictureSizeModeClip
  452.         End If
  453.         
  454.         
  455.         If Image1.Picture = LoadPicture() Then
  456.         msg = "Could not find the requested file."
  457.         MsgBox msg  ' Display error message.
  458.     End If
  459. End Sub
  460. Private Sub tb_ThumbClick(Index As Long, ThumbPath As String, ThumbCaption As String, ThumbSize As Long, ThumbDate As Date, Width As Long, Height As Long, Planes As Long, Colors As Long)
  461.     Set Image1.Picture = LoadPicture(ThumbPath)
  462.     'Dim msg As String   ' Declare variables.
  463.     'Dim FileName                                 'for file list click
  464.     'FileName = File1.FileName
  465.     'Image1.Picture = LoadPicture()
  466.     'Image1.Picture = LoadPicture(Dir1.Path + "\" + FileName)
  467.         
  468.         If Image1.Picture.Height > Image1.Height Then
  469.             Image1.PictureSizeMode = fmPictureSizeModeZoom
  470.         Else
  471.             Image1.PictureSizeMode = fmPictureSizeModeClip
  472.         End If
  473.         
  474.         If Image1.Picture.Width > Image1.Width Then
  475.             Image1.PictureSizeMode = fmPictureSizeModeZoom
  476.         Else
  477.             Image1.PictureSizeMode = fmPictureSizeModeClip
  478.         End If
  479.         
  480.         
  481. End Sub
  482. Private Sub Timer2_Timer()
  483. Image1.Picture = LoadPicture(File1.Path & "\" & File1.List(i))
  484. If Image1.Picture.Height > Image1.Height Then
  485.             Image1.PictureSizeMode = fmPictureSizeModeZoom
  486.         Else
  487.             Image1.PictureSizeMode = fmPictureSizeModeClip
  488.         End If
  489.         
  490.         If Image1.Picture.Width > Image1.Width Then
  491.             Image1.PictureSizeMode = fmPictureSizeModeZoom
  492.         Else
  493.             Image1.PictureSizeMode = fmPictureSizeModeClip
  494.         End If
  495.         
  496.         
  497. i = i + 1
  498. If i = File1.ListCount Then
  499. Timer2.Enabled = False
  500. End If
  501. End Sub
  502.