home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmWinGAPI
- BorderStyle = 1 'Fixed Single
- Caption = "The WinG API Program"
- ClientHeight = 4230
- ClientLeft = 945
- ClientTop = 1800
- ClientWidth = 7005
- Height = 4920
- Icon = "WINGAPI.frx":0000
- Left = 885
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 282
- ScaleMode = 3 'Pixel
- ScaleWidth = 467
- Top = 1170
- Width = 7125
- Begin VB.Label lblInstructions
- Caption = "To draw and move a red circle inside this window, drag the mouse over this window."
- Enabled = 0 'False
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 615
- Left = 1080
- TabIndex = 0
- Top = 600
- Width = 4815
- End
- Begin TegwingLibCtl.Tegwing Tegwing1
- Left = 2880
- Top = 1560
- _version = 65536
- _extentx = 1032
- _extenty = 953
- _stockprops = 0
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "&Help"
- Begin VB.Menu mnuAbout
- Caption = "&About..."
- End
- End
- Attribute VB_Name = "frmWinGAPI"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- ' All variables must be declared.
- Option Explicit
- ' Constants used for drawing.
- Const PS_SOLID = 0
- Const PS_DASH = 1
- Const PS_DOT = 2
- Const PS_DASHDOT = 3
- Const PS_DASHDOTDOT = 4
- Const PS_NULL = 5
- Const PS_INSIDEFRAME = 6
- Private Sub Form_Load()
- ' Set the scale mode to units of Pixels.
- Me.ScaleMode = 3
- ' Tell the WinG control in which window to draw.
- Tegwing1.hWndDisplay = Me.hWnd
- ' Open a WinG session
- Tegwing1.OpenWinG
- ' Disable the Instructions label.
- lblInstructions.Enabled = False
- End Sub
- Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim RectWidth, RectHeight
- Dim Dummy
- ' Draw the white rectangle inside WinG
- Tegwing1.SetPen PS_SOLID, 1, RGB(255, 255, 255)
- Tegwing1.SetSolidBrush RGB(255, 255, 255)
- RectWidth = Tegwing1.WinGWidth
- RectHeight = Tegwing1.WinGHeight
- Tegwing1.DrawRectangle 0, 0, RectWidth - 1, RectHeight - 1
- ' Draw a red circle inside WinG
- Tegwing1.SetSolidBrush RGB(255, 0, 0)
- Dummy = Ellipse(Tegwing1.WinGDC, _
- X - 50, _
- Y - 50, _
- X + 50, _
- Y + 50)
- ' Slam WinG into the screen.
- Tegwing1.SlamIt
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- ' If the mouse button is not pressed, terminate
- ' this procedure.
- If Button = 0 Then Exit Sub
- ' Call the Form_MouseDown() procedure.
- Form_MouseDown Button, Shift, X, Y
- End Sub
- Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- ' Clear the screen.
- Me.Cls
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- ' Close the WinG session
- Tegwing1.CloseWinG
- End Sub
- Private Sub mnuAbout_Click()
- Dim Title
- Dim Msg
- Dim CR
- CR = Chr(13) + Chr(10)
- ' The title of the About message box.
- Title = "About the WinG API Program"
- ' Prepare the message of the About message box.
- Msg = "This program was written with Visual "
- Msg = Msg + "Basic for Windows, using the "
- Msg = Msg + "TegoSoft WinG OCX control. "
- Msg = Msg + CR + CR
- Msg = Msg + "The TegoSoft WinG OCX control "
- Msg = Msg + "enables you to perform fast graphics "
- Msg = Msg + "operations (such as display BMP files) "
- Msg = Msg + "using WinG technology."
- Msg = Msg + CR + CR
- Msg = Msg + "The TegoSoft WinG OCX control "
- Msg = Msg + "is part of the TegoSoft OCX Control "
- Msg = Msg + "Kit - a collection of various OCX controls. "
- Msg = Msg + CR + CR
- Msg = Msg + "For more information about the "
- Msg = Msg + "TegoSoft OCX Control Kit, contact TegoSoft "
- Msg = Msg + "at:"
- Msg = Msg + CR + CR
- Msg = Msg + "TegoSoft Inc." + CR
- Msg = Msg + "P.O. Box 389" + CR
- Msg = Msg + "Bellmore, NY 11710"
- Msg = Msg + CR + CR
- Msg = Msg + "Phone: (516)783-4824"
- ' Display the About message box.
- MsgBox Msg, vbInformation, Title
- End Sub
- Private Sub mnuExit_Click()
- ' Terminate the program.
- Unload Me
- End Sub
-