Category : BASIC Source Code
Archive   : PBVL010.ZIP
Filename : TUTOR3_1.BAS

 
Output of file : TUTOR3_1.BAS contained in archive : PBVL010.ZIP
'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
'³ FILE: TUTOR3_1.BAS ³
'³ PURPOSE: PB/VISION(tm) LITE Tutorial Example Program ³
'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
'³ For instant help on any PB/VISION(tm) keyword, place the cursor on that ³
'³ keyword and press . The PB/VISION(tm) index can be accessed ³
'³ by pressing twice. The file "PBVLITE.PBH" _must_ be in the ³
'³ same directory as the PowerBASIC IDE (PB.EXE) for this feature to work ³
'³ properly. ³
'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

%ISPBU = 0

DEFINT A-Z
$DYNAMIC

$INCLUDE ".\WINDOW.BI"
$INCLUDE ".\EVENT.BI"
$INCLUDE ".\MOUSE.BI"

APP.GRAPHICSMODE = 1
APP.GRAPHICSMOUSE = 1

APPTITLE &HB0, "AN INTRODUCTION TO MULTI-THREADING"

APPINIT

GottaMouse% = MOUSEINIT(buttons%)
MOUSECURSORON

winflags = %SHADOW OR %DRAGBAR OR %CONTROL OR %RESIZE OR %MINMAX

win1% = WINPOPUP(0, 0, 10, 50, &H9F, 1, &H9F, "YourRoutine() Window", &HCF, winflags)


' Ä þ 6.1.1 - ASSIGNING CODE TO A WINDOW ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

WININSTALLCODE win1%, CODESEG(YourRoutine), CODEPTR(YourRoutine)

DO

eventNo = GETEVENT(0)

SELECT CASE eventNo

CASE 102
EXIT DO

CASE ELSE

END SELECT

LOOP

MOUSECURSOROFF
APPCLOSE

END


' Ä þ 6.1.2 - SYNTAX OF A WINDOW ROUTINE ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

FUNCTION YourRoutine% (BYVAL handle%, BYVAL eventNo%, BYVAL parm1%, BYVAL parm2%)

' Ä þ 6.1.3 - PROCESSING EVENTS IN A WINDOW ROUTINE ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

SELECT CASE eventNo

CASE 203 ' control box clicked
eventNo% = 102

CASE 217 ' window clicked while minimized
WINNORMALIZE handle

CASE ELSE

END SELECT

WINWRITELN handle%, "Event" + STR$(eventNo%) + " in YourRoutine()"

' Ä þ 6.1.4 - RETURNING THE EVENT CODE BACK TO GETEVENT() ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

YourRoutine% = eventNo% ' return this event code

END FUNCTION



  3 Responses to “Category : BASIC Source Code
Archive   : PBVL010.ZIP
Filename : TUTOR3_1.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/