QB64 Team Software > InForm-based programs

IQ test developed using Inform 1.2

(1/2) > >>

TempodiBasic:
Hi
here is a simple IQtest that I have built to use and test Inform 1.2
For now I post these because I have NOT more complex or/and bigger program to show.
this is the code

--- Code: QB64: ---': This program uses': InForm - GUI library for QB64 - v1.2': Fellippe Heitor, 2016-2020 - fellippe@qb64.org - [member=2]FellippeHeitor[/member]': https://github.com/FellippeHeitor/InForm'----------------------------------------------------------- ': Controls' IDs: ------------------------------------------------------------------DIM SHARED IQTest AS LONGDIM SHARED ClickOnTheSTOPButtonBeforeTimeILB AS LONGDIM SHARED STOPClickMeBT AS LONGDIM SHARED ProgressBar1 AS LONGDIM SHARED ProgressBar2 AS LONGDIM SHARED PartialTimeLB AS LONGDIM SHARED TotalTimeLB AS LONGDIM SHARED tStatus AS INTEGER': External modules: ---------------------------------------------------------------'$INCLUDE:'InForm\InForm.ui''$INCLUDE:'InForm\xp.uitheme''$INCLUDE:'IQTest.frm' ': Event procedures: ---------------------------------------------------------------SUB tt    BEEP    IF Control(ProgressBar2).Value >= 10 THEN        BEEP        Control(ProgressBar1).Value = Control(ProgressBar1).Value + 10        Control(ProgressBar2).Value = 0    ELSE        Control(ProgressBar2).Value = Control(ProgressBar2).Value + 1    END IF    IF Control(ProgressBar1).Value >= 100 THEN        _TITLE "BOOM!"        Caption(STOPClickMeBT) = "TOO LATE!"        TIMER OFF        tStatus = False    END IFEND SUB SUB MoveButton    Control(STOPClickMeBT).Left = __UI_MouseLeft + (RND * 100) + 50    IF Control(STOPClickMeBT).Left > Control(IQTest).Width - Control(STOPClickMeBT).Width THEN Control(STOPClickMeBT).Left = 10    Control(STOPClickMeBT).Top = __UI_MouseTop + (RND * 100) + 50    IF Control(STOPClickMeBT).Top >= Control(IQTest).Height - Control(STOPClickMeBT).Height - 60 THEN Control(STOPClickMeBT).Top = 10END SUB SUB __UI_BeforeInit END SUB SUB __UI_OnLoad    ON TIMER(1) tt    TIMER ON    tStatus = TrueEND SUB SUB __UI_BeforeUpdateDisplay    'This event occurs at approximately 30 frames per second.    'You can change the update frequency by calling SetFrameRate DesiredRate%    IF tStatus THEN        IF _MOUSEINPUT THEN            IF (__UI_MouseLeft < (Control(STOPClickMeBT).Left - 50)) OR (__UI_MouseLeft > (Control(STOPClickMeBT).Left + Control(STOPClickMeBT).Width + 50)) THEN                IF (__UI_MouseTop > (Control(STOPClickMeBT).Top - 50)) OR (__UI_MouseTop < (Control(STOPClickMeBT).Top + Control(stopmeclickbt).Height + 50)) THEN                    __UI_MouseEnter STOPClickMeBT 'MoveButton                END IF            END IF        END IF    END IFEND SUB SUB __UI_BeforeUnload    'If you set __UI_UnloadSignal = False here you can    'cancel the user's request to close. END SUB SUB __UI_Click (id AS LONG)    SELECT CASE id        CASE IQTest         CASE ClickOnTheSTOPButtonBeforeTimeILB         CASE STOPClickMeBT            IF Caption(STOPClickMeBT) = "TOO LATE!" THEN EXIT SUB            ' the user wins            _TITLE "YOU WIN!"            TIMER OFF            Caption(STOPClickMeBT) = "You GOT IT"            tStatus = False        CASE ProgressBar1         CASE ProgressBar2         CASE PartialTimeLB         CASE TotalTimeLB     END SELECTEND SUB SUB __UI_MouseEnter (id AS LONG)    SELECT CASE id        CASE IQTest         CASE ClickOnTheSTOPButtonBeforeTimeILB         CASE STOPClickMeBT            IF tStatus THEN MoveButton        CASE ProgressBar1         CASE ProgressBar2         CASE PartialTimeLB         CASE TotalTimeLB     END SELECTEND SUB SUB __UI_MouseLeave (id AS LONG)    SELECT CASE id        CASE IQTest         CASE ClickOnTheSTOPButtonBeforeTimeILB         CASE STOPClickMeBT         CASE ProgressBar1         CASE ProgressBar2         CASE PartialTimeLB         CASE TotalTimeLB     END SELECTEND SUB SUB __UI_FocusIn (id AS LONG)    SELECT CASE id        CASE STOPClickMeBT     END SELECTEND SUB SUB __UI_FocusOut (id AS LONG)    'This event occurs right before a control loses focus.    'To prevent a control from losing focus, set __UI_KeepFocus = True below.    SELECT CASE id        CASE STOPClickMeBT     END SELECTEND SUB SUB __UI_MouseDown (id AS LONG)    SELECT CASE id        CASE IQTest         CASE ClickOnTheSTOPButtonBeforeTimeILB         CASE STOPClickMeBT         CASE ProgressBar1         CASE ProgressBar2         CASE PartialTimeLB         CASE TotalTimeLB     END SELECTEND SUB SUB __UI_MouseUp (id AS LONG)    SELECT CASE id        CASE IQTest         CASE ClickOnTheSTOPButtonBeforeTimeILB         CASE STOPClickMeBT         CASE ProgressBar1         CASE ProgressBar2         CASE PartialTimeLB         CASE TotalTimeLB     END SELECTEND SUB SUB __UI_KeyPress (id AS LONG)    'When this event is fired, __UI_KeyHit will contain the code of the key hit.    'You can change it and even cancel it by making it = 0    SELECT CASE id        CASE STOPClickMeBT     END SELECTEND SUB SUB __UI_TextChanged (id AS LONG)    SELECT CASE id    END SELECTEND SUB SUB __UI_ValueChanged (id AS LONG)    SELECT CASE id    END SELECTEND SUB SUB __UI_FormResized END SUB  I'll attach the files .BAS  .FRM and you must remember that to compile it you must install InForm 1.2 or at least include falcon.h in the same folder of QB64.
Thanks to try

SMcNeill:
I just scored a -126.

Now I just need to decide if that’s an overflow error, or if I’m really as dumb as my family thinks I am...

FellippeHeitor:
LOL, thanks for sharing, Tempo!

TempodiBasic:
@FellippeHeitor Glad to see you take a look at. I hope to find time to test for news Inform 1.2.

@Steve but QB64 stops at _INTEGER64...it's clear that container is too small!

segura:

--- Quote from: SMcNeill on November 04, 2020, 07:52:42 pm ---I just scored a -126.

Now I just need to decide if that’s an overflow error, or if I’m really as dumb as my family thinks I am...

--- End quote ---
Seems like I'm even dumber because I couldn't even reach the test level and failed in starting it... Could anyone explain to me how to run the code? I'm a beginner at it. I know Python and C, decided to learn QB64 to survive the quarantine in my flat in Greece but frankly it's not going very well...

Navigation

[0] Message Index

[#] Next page

Go to full version