home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / walpeep / wallpap.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  5.2 KB  |  155 lines

  1. VERSION 2.00
  2. Begin Form Form2 
  3.    AutoRedraw      =   -1  'True
  4.    Caption         =   "Preview"
  5.    ClientHeight    =   1470
  6.    ClientLeft      =   120
  7.    ClientTop       =   5160
  8.    ClientWidth     =   4485
  9.    ControlBox      =   0   'False
  10.    DrawStyle       =   3  'Dash-Dot
  11.    FillStyle       =   0  'Solid
  12.    Height          =   1875
  13.    Icon            =   WALLPAP.FRX:0000
  14.    Left            =   60
  15.    LinkMode        =   1  'Source
  16.    LinkTopic       =   "Form2"
  17.    ScaleHeight     =   98
  18.    ScaleMode       =   3  'Pixel
  19.    ScaleWidth      =   299
  20.    Top             =   4815
  21.    Width           =   4605
  22.    Begin PictureBox Picture1 
  23.       BackColor       =   &H00C0C0C0&
  24.       Height          =   120
  25.       Left            =   0
  26.       ScaleHeight     =   6
  27.       ScaleMode       =   3  'Pixel
  28.       ScaleWidth      =   6
  29.       TabIndex        =   1
  30.       Top             =   30
  31.       Width           =   120
  32.    End
  33.    Begin PictureBox DestinationPic 
  34.       AutoSize        =   -1  'True
  35.       DrawMode        =   1  'Blackness
  36.       DrawStyle       =   3  'Dash-Dot
  37.       Height          =   195
  38.       Left            =   -30
  39.       ScaleHeight     =   11
  40.       ScaleMode       =   3  'Pixel
  41.       ScaleWidth      =   13
  42.       TabIndex        =   0
  43.       Top             =   -15
  44.       Width           =   225
  45.    End
  46. Sub DestinationPic_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  47. If Not InPic1 Then Exit Sub
  48. Form1.Timer1.Enabled = False
  49. Dragging = True
  50. DestinationPic.AutoRedraw = False
  51. If Not Metafile Then
  52.    Call DragPictureTo(Int(X), Int(Y), Shift)
  53. End If
  54. End Sub
  55. Sub DestinationPic_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  56. If Dragging Then
  57.    MousePointer = 8
  58.    If DestinationPic.Left + X > ScaleWidth Then X = ScaleWidth - DestinationPic.Left
  59.    'If Y > ScaleHeight + 2 Then Y = ScaleHeight + 2
  60.    If DestinationPic.Top + Y > ScaleHeight Then Y = ScaleHeight - DestinationPic.Top
  61.    'Carole Rogers roooooolzzzzz!
  62.    If X * Y > 180000 Then
  63.       newY = Sqr(180000 * Y / X)
  64.       newX = 180000 / newY
  65.       X = newX
  66.       Y = newY
  67.    End If
  68.    Call DragPictureTo(Int(X), Int(Y), Shift)
  69.    MousePointer = 0
  70.    'Beep
  71. End If
  72. End Sub
  73. Sub DestinationPic_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  74. If Not InPic1 Then Exit Sub
  75. Moving = False
  76. gDrawing = False
  77. DoEvents
  78. If Not Metafile Then Call DestinationPic_MouseMove(Button, Shift, X, Y)
  79. Dragging = False   'stop moving this up!!!!
  80.                    'it belongs after the mouse_move call
  81. 'Call DestinationPic_MouseMove(Button, Shift, X, Y)
  82. 'Call DestinationPic_MouseMove(Button, Shift, X, Y)
  83. 'Call DestinationPic_MouseMove(Button, Shift, X, Y)
  84. DestinationPic.AutoRedraw = False
  85. NonPersistentHDC = DestinationPic.hDC
  86. DestinationPic.AutoRedraw = True
  87. PersistentHDC = DestinationPic.hDC
  88. dwRop& = &HCC0020
  89. DoEvents
  90. T% = BitBlt%(PersistentHDC, 0, 0, DestinationPic.Width, DestinationPic.Height, NonPersistentHDC, 0, 0, dwRop&)
  91. DoEvents
  92. Call WallPaper
  93. Form1.Timer1.Enabled = True
  94. End Sub
  95. Sub Form_DblClick ()
  96. If Form1.ShowAllFiles.Value = 0 Then
  97.    Call File1DClick
  98.    Call List1DClick
  99. End If
  100. End Sub
  101. Sub Form_Load ()
  102. 'Top = Form1.Top
  103. Top = Form1.Top + Form1.Height - 15
  104. Left = Form1.Left
  105. Width = Form1.Width
  106. End Sub
  107. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  108. MousePointer = 0
  109. End Sub
  110. Sub Form_Resize ()
  111. 'Command1.Width = ScaleWidth
  112. 'Form2.Visible = True
  113. If Form2.WindowState = 1 Then ' minimized
  114.       Form2.Visible = False
  115.       Form2.WindowState = 0
  116.       Form1.WindowState = 1
  117.    Else
  118.       Form2.Visible = True
  119. End If
  120. If Not Loading% Then
  121.    Call DragPictureTo((Form2.DestinationPic.Width), (Form2.DestinationPic.Height), False)
  122.    Call WallPaper
  123.    Call PositionOutline
  124.    Call DottedLine
  125. End If
  126. End Sub
  127. Sub Form_Unload (Cancel As Integer)
  128. End Sub
  129. Sub Picture1_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  130. InPic1 = True
  131. MousePointer = 8
  132. Picture1.Visible = False
  133. Picture1.Left = Picture1.Left + X
  134. Picture1.Top = Picture1.Top + Y
  135. Call DestinationPic_MouseDown(Button, Shift, (Picture1.Left - DestinationPic.Left), (Picture1.Top - DestinationPic.Top))
  136. End Sub
  137. Sub Picture1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  138. MousePointer = 8
  139. If Not InPic1 Then Exit Sub
  140. Call DestinationPic_MouseMove(Button, Shift, (Picture1.Left - DestinationPic.Left) + X, (Picture1.Top - DestinationPic.Top) + Y)
  141. 'Call DestinationPic_MouseMove(Button, Shift, (Picture1.Left) + X, (Picture1.Top) + Y)
  142. End Sub
  143. Sub Picture1_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  144. Call DestinationPic_MouseUp(Button, Shift, (Picture1.Left - DestinationPic.Left) + X, (Picture1.Top - DestinationPic.Top) + Y)
  145. 'Call DestinationPic_MouseUp(Button, Shift, Picture1.Left + X, Picture1.Top + Y)
  146. Picture1.Left = DestinationPic.Left + DestinationPic.Width - Picture1.Width - 1
  147. Picture1.Top = DestinationPic.Top + DestinationPic.Height - Picture1.Height - 1
  148. Form2.DestinationPic.Line (0, 0)-(Form2.DestinationPic.Width, 0)
  149. Picture1.Visible = True
  150. InPic1 = False
  151. MousePointer = 0
  152. Call DottedLine
  153. 'Beep
  154. End Sub
  155.