Is this a problem with the way the 'view' command works in the DOS version? Or is this a major flaw in my program code.
Code: Select all
' test5.bas
#include "widgets.bi"
Screen 20
color 7,1:cls 'Paints BG blue-1, FG white-7
line (0,0)-(1023,767),45,b '4 Outline the screen red border.
Dim Shared As Long mx,my,mb
Dim As String Key
Sub drawTitle()
Line (2,2)-(1022,24),8,bf
Draw String (450,5),"Test View Program",3
End Sub
Dim Shared As BUTTON btnQuit
Dim Shared As BUTTON btnApp
Dim Shared As BUTTON btnOK
' Quit button
btnQuit.x = 4 '0
btnQuit.y = 26 '0
btnQuit.w = 8 * 5
btnQuit.h = 16 * 8 '8
btnQuit.title = "Quit"
btnQuit.c2 = 0 ' ??Grey-8
btnQuit.c1 = 0 ' White
' Test application
btnApp.x = 44
btnApp.y = 26
btnApp.w = 8 * 8
btnApp.h = 16 * 8
btnApp.title = "View"
btnApp.c2 = 0
btnApp.c1 = 0
' OK button
btnOK.x = 190
btnOK.y = 95
btnOK.w = 8 * 8
btnOK.h = 16 * 8
btnOK.title = "OK"
btnOK.c2 = 0
btnOK.c1 = 0
drawTitle()
drawButton(btnQuit)
drawButton(btnApp)
Do
getmouse mx,my,,mb
If mb = 1 Then
' This is the quit button.
If mx>btnQuit.x And mx<btnQuit.x+btnQuit.w And my>btnQuit.y And my<btnQuit.y+16 Then
End
End If
' This is the view button.
If mx>btnApp.x And mx<btnApp.x+btnApp.w And my>btnApp.y And my<btnApp.y+16 Then
' Create the view area.
Line (210,125)-(600,240),44,bf ' 8 dark grey
view (210,125)-(600,240)
drawButton(btnOK)
Do
ScreenSync
' ScreenLock
getmouse mx,my,,mb
If mx>btnOK.x And mx<btnOK.x+btnOK.w And my>btnOK.y And my<btnOK.y+16 Then
Cls
Exit Do
End If
While mb = 1
getmouse mx,my,,mb
Wend
sleep 100
' ScreenUnlock
Loop
End If
' mouse event
While mb = 1
getmouse mx,my,,mb
Wend
End If
sleep 1,0
Loop until multikey(&H01)
End