home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / tool_wnd / toolwnd.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-05-25  |  7.1 KB  |  235 lines

  1. VERSION 2.00
  2. Begin Form ToolWnd 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00C0C0C0&
  5.    BorderStyle     =   0  'None
  6.    Caption         =   "ToolWnd"
  7.    ClientHeight    =   1185
  8.    ClientLeft      =   1515
  9.    ClientTop       =   3885
  10.    ClientWidth     =   1875
  11.    Height          =   1590
  12.    Left            =   1455
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   79
  15.    ScaleMode       =   3  'Pixel
  16.    ScaleWidth      =   125
  17.    Top             =   3540
  18.    Width           =   1995
  19.    Begin PictureBox Tool 
  20.       AutoRedraw      =   -1  'True
  21.       AutoSize        =   -1  'True
  22.       BorderStyle     =   0  'None
  23.       Height          =   330
  24.       Index           =   6
  25.       Left            =   0
  26.       Picture         =   TOOLWND.FRX:0000
  27.       ScaleHeight     =   330
  28.       ScaleWidth      =   360
  29.       TabIndex        =   6
  30.       TabStop         =   0   'False
  31.       Tag             =   "59,2,24,22"
  32.       Top             =   435
  33.       Width           =   360
  34.    End
  35.    Begin PictureBox Tool 
  36.       AutoRedraw      =   -1  'True
  37.       AutoSize        =   -1  'True
  38.       BorderStyle     =   0  'None
  39.       Height          =   330
  40.       Index           =   0
  41.       Left            =   345
  42.       Picture         =   TOOLWND.FRX:0182
  43.       ScaleHeight     =   330
  44.       ScaleWidth      =   360
  45.       TabIndex        =   5
  46.       TabStop         =   0   'False
  47.       Tag             =   "29,2,24,22"
  48.       Top             =   120
  49.       Width           =   360
  50.    End
  51.    Begin PictureBox Tool 
  52.       AutoRedraw      =   -1  'True
  53.       AutoSize        =   -1  'True
  54.       BorderStyle     =   0  'None
  55.       Height          =   330
  56.       Index           =   5
  57.       Left            =   345
  58.       Picture         =   TOOLWND.FRX:0304
  59.       ScaleHeight     =   330
  60.       ScaleWidth      =   360
  61.       TabIndex        =   4
  62.       TabStop         =   0   'False
  63.       Tag             =   "172,2,24,22"
  64.       Top             =   750
  65.       Width           =   360
  66.    End
  67.    Begin PictureBox Tool 
  68.       AutoRedraw      =   -1  'True
  69.       AutoSize        =   -1  'True
  70.       BorderStyle     =   0  'None
  71.       Height          =   330
  72.       Index           =   4
  73.       Left            =   0
  74.       Picture         =   TOOLWND.FRX:0486
  75.       ScaleHeight     =   330
  76.       ScaleWidth      =   360
  77.       TabIndex        =   3
  78.       TabStop         =   0   'False
  79.       Tag             =   "6,2,24,22"
  80.       Top             =   120
  81.       Width           =   360
  82.    End
  83.    Begin PictureBox Tool 
  84.       AutoRedraw      =   -1  'True
  85.       AutoSize        =   -1  'True
  86.       BorderStyle     =   0  'None
  87.       Height          =   330
  88.       Index           =   3
  89.       Left            =   0
  90.       Picture         =   TOOLWND.FRX:0608
  91.       ScaleHeight     =   330
  92.       ScaleWidth      =   360
  93.       TabIndex        =   2
  94.       TabStop         =   0   'False
  95.       Tag             =   "112,2,24,22"
  96.       Top             =   750
  97.       Width           =   360
  98.    End
  99.    Begin PictureBox Tool 
  100.       AutoRedraw      =   -1  'True
  101.       AutoSize        =   -1  'True
  102.       BorderStyle     =   0  'None
  103.       Height          =   330
  104.       Index           =   2
  105.       Left            =   345
  106.       Picture         =   TOOLWND.FRX:078A
  107.       ScaleHeight     =   330
  108.       ScaleWidth      =   360
  109.       TabIndex        =   1
  110.       TabStop         =   0   'False
  111.       Tag             =   "89,2,24,22"
  112.       Top             =   435
  113.       Width           =   360
  114.    End
  115.    Begin PictureBox Tool 
  116.       AutoRedraw      =   -1  'True
  117.       AutoSize        =   -1  'True
  118.       BorderStyle     =   0  'None
  119.       Height          =   330
  120.       Index           =   1
  121.       Left            =   1020
  122.       Picture         =   TOOLWND.FRX:090C
  123.       ScaleHeight     =   330
  124.       ScaleWidth      =   360
  125.       TabIndex        =   0
  126.       TabStop         =   0   'False
  127.       Tag             =   "142,2,24,22"
  128.       Top             =   360
  129.       Visible         =   0   'False
  130.       Width           =   360
  131.    End
  132. Option Explicit
  133. Dim StartExit               As Integer
  134. Dim w                       As Integer
  135. Dim a                       As Integer
  136. Sub Form_Activate ()
  137. Dim rc As Integer
  138.     Me.FillStyle = 0
  139.     Me.FillColor = GetSysColor(2)
  140.     rc = ExtFloodFill(Me.hDC, 13, 2, 0, 0)
  141.     Me.FillStyle = 1
  142.     a = True
  143. End Sub
  144. Sub Form_DblClick ()
  145.     StartExit = -StartExit
  146. End Sub
  147. Sub Form_Deactivate ()
  148. Dim rc As Integer
  149.     a = False
  150.     Me.FillStyle = 0
  151.     Me.FillColor = GetSysColor(3)
  152.     rc = ExtFloodFill(Me.hDC, 13, 2, 0, 0)
  153.     Me.FillStyle = 1
  154. End Sub
  155. Sub Form_Load ()
  156. Dim h As Integer
  157. Dim col As Long
  158.     Me.AutoRedraw = True
  159.     ToolhWnd = True
  160.     w = (2 * Tool(0).Width - 1)
  161.     Me.Width = w * stppx
  162.     h = (3 * Tool(0).Height + 6)
  163.     Me.Height = h * stppy
  164.     Me.Line (0, 0)-(w - 1, h - 1), 0, B         ' Rand um Fenster
  165.     col = GetSysColor(2)
  166.     Me.Line (12, 1)-(w - 2, 7), col, BF         ' Titelleiste
  167.     Me.Line (1, 8)-(w, 8), 0                    ' Linie unter Titel
  168.     Me.Line (11, 1)-(11, 8), 0                  ' Linie links von Titel
  169.     Me.Line (3, 3)-(8, 5), 0, B                 ' Schwarzes Rechteck
  170.     Me.Line (4, 4)-(8, 4), RGB(255, 255, 255)   ' Weiss f
  171.     Me.Line (4, 6)-(9, 6), RGB(128, 128, 128)   ' Schatten unten
  172.     Me.Line (9, 4)-(9, 7), RGB(128, 128, 128)   ' Schatten rechts
  173.     Me.Picture = Me.Image
  174.     Me.AutoRedraw = False
  175.     Me.Refresh
  176. End Sub
  177. Sub Form_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
  178. Dim dc As Integer
  179. Dim dx As Integer, dy As Integer
  180. Dim mPos As apiPoint
  181. Dim oldpos As apiPoint
  182. Dim mRect As apiRect
  183.     StartExit = False
  184.     If Y < 9 Then
  185.         If x > 10 Then
  186.             FakeMove Me
  187.             Screen.MousePointer = 0
  188.         Else
  189.             Me.DrawMode = 6
  190.             Me.Line (1, 1)-(10, 7), 0, BF
  191.             StartExit = True
  192.         End If
  193.     End If
  194. End Sub
  195. Sub Form_MouseUp (Button As Integer, Shift As Integer, x As Single, Y As Single)
  196.     Me.DrawMode = 13
  197.     Me.Cls
  198.     If StartExit = 1 Then Unload Me
  199. End Sub
  200. Sub Form_Paint ()
  201. Dim rc As Integer
  202.     If a Then
  203.         Me.FillStyle = 0
  204.         Me.FillColor = GetSysColor(2)
  205.         rc = ExtFloodFill(Me.hDC, 13, 2, 0, 0)
  206.         Me.FillStyle = 1
  207.     Else
  208.         Me.FillStyle = 0
  209.         Me.FillColor = GetSysColor(3)
  210.         rc = ExtFloodFill(Me.hDC, 13, 2, 0, 0)
  211.         Me.FillStyle = 1
  212.     End If
  213. End Sub
  214. Sub Form_Unload (Cancel As Integer)
  215. Dim h As Integer
  216.     h = 15 * (GetSystemMetrics(15) + GetSystemMetrics(4) + 2 * GetSystemMetrics(33) - GetSystemMetrics(6)) + MainWnd.ToolBar.Height
  217.     On Error Resume Next
  218.     MainWnd.Height = h
  219.     ToolhWnd = False
  220. End Sub
  221. Sub Tool_MouseDown (Index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single)
  222.     If ButtonDown(Tool(Index)) Then
  223.         Select Case Index
  224.             Case 0
  225.             Case 1
  226.             Case 2
  227.             Case 3
  228.             Case 4
  229.             Case 5
  230.             Case 6
  231.             Case Else
  232.         End Select
  233.     End If
  234. End Sub
  235.