Author Topic: InForm Beta 7 is out now  (Read 1294 times)

Re: InForm Beta 7 is out now
« Reply #15 on: June 03, 2018, 12:50:19 PM »
Hi Friends

@Fellippe
sorry I must post this error, an old issue that was present in previous version...(many other issues  are been fixed)
see image Inform7.jpeg


@Bplus
Yes I agree that the great mind is your, mine is just medium...but I can increase it by coding and talking wiht great coders like you, Fellippe, Steve, Pete,   CodeGuy, SkyCharger,.... (oh damn I fall in the error of the list that is always uncomplete...)...
I apologize for all those other QB64 coders, very strong that for my poor memory and lazyness I have put out of this list

Online FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: InForm Beta 7 is out now
« Reply #16 on: June 03, 2018, 01:45:35 PM »
@Tempo:
It is an old known issue but it's a QB64 issue, not InForm's. I understand that chances of it happening are higher with InForm generated programs because of the minimum of 3 mandatory includes, but it's still an issue of QB64 that we are yet to be able to track down.

@bplus:
I understand you had the feeling that Text() was a function but it's clearly stated to be an array in the wiki, with even a link to a dedicated page explaining its use (https://github.com/FellippeHeitor/InForm/wiki/Text). I hope it's all clear now.
« Last Edit: June 03, 2018, 01:47:45 PM by FellippeHeitor »

Re: InForm Beta 7 is out now
« Reply #17 on: June 03, 2018, 02:21:03 PM »
Yes, Fellippe, I guess I missed Text() as an array thing in my first readings...

I do think I over compensated by imaging control.property was gone... too early in morning...

So as far as being clear, ha! but practice does make more perfect... I am glad for your help!

Append: err, ah, control(controlID).property, man half the battle is getting that understood. That, and then realizing Text() is not a property.
« Last Edit: June 03, 2018, 03:55:02 PM by bplus »
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Re: InForm Beta 7 is out now
« Reply #18 on: June 03, 2018, 06:30:14 PM »
Hi Fellippe
sorry but I think to need help about DropDownlist....
as in wiki  https://github.com/FellippeHeitor/InForm/wiki/Value value brings the index of the item selected....but
when I click on a Dropdownlist I am NOT able to get the value (index) of the item leftclicked on...
here my code_example
Code: [Select]
': This program uses
': InForm - GUI library for QB64 - Beta version 7
': Fellippe Heitor, 2016-2018 - fellippe@qb64.org - @fellippeheitor
': https://github.com/FellippeHeitor/InForm
'-----------------------------------------------------------

': Controls' IDs: ------------------------------------------------------------------
DIM SHARED coccoprova AS LONG
DIM SHARED DropdownList1 AS LONG
DIM SHARED DropdownList2 AS LONG

': External modules: ---------------------------------------------------------------
'$INCLUDE:'InForm\InForm.ui'
'$INCLUDE:'InForm\xp.uitheme'
'$INCLUDE:'coccoprova.frm'

': Event procedures: ---------------------------------------------------------------
SUB __UI_BeforeInit

END SUB

SUB __UI_OnLoad
    '
    AddItem DropdownList1, "Traslation simple fixed" 'a->d = a+3, b->e = b+3, c->f = c+3...z->c z+3-(maxletters=26)
    AddItem DropdownList1, "Traslation simple progressive" 'a->d = a+3, b->f = b+4, c->h = c+5...z->c z+29-(maxletters=26)
    AddItem DropdownList1, "Traslation alternate fixed" 'a->d = a+3, b->f = b+4, c->f = c+3,d->h= d+4...z->d z+4-(maxletters=26)
    AddItem DropdownList1, "Traslation alternate progressive" 'a->d = a+3, b->f = b+4, c->f = c+3, d->i = i+5...z->d z+13-(maxletters=26)
    AddItem DropdownList1, "Traslation bidirectional fixed" ' a->d = a+3, b->y = b-3+26, c->f = c+3,d->a= d-3....z->w= z-3

    '
    AddItem DropdownList2, "Traslation simple fixed" 'a->d = a+3, b->e = b+3, c->f = c+3...z->c z+3-(maxletters=26)
    AddItem DropdownList2, "Traslation simple progressive" 'a->d = a+3, b->f = b+4, c->h = c+5...z->c z+29-(maxletters=26)
    AddItem DropdownList2, "Traslation alternate fixed" 'a->d = a+3, b->f = b+4, c->f = c+3,d->h= d+4...z->d z+4-(maxletters=26)
    AddItem DropdownList2, "Traslation alternate progressive" 'a->d = a+3, b->f = b+4, c->f = c+3, d->i = i+5...z->d z+13-(maxletters=26)
    AddItem DropdownList2, "Traslation bidirectional fixed" ' a->d = a+3, b->y = b-3+26, c->f = c+3,d->a= d-3....z->w= z-3

END SUB

SUB __UI_BeforeUpdateDisplay
    'This event occurs at approximately 30 frames per second.
    'You can change the update frequency by calling SetFrameRate DesiredRate%

END 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 coccoprova

        CASE DropdownList1
            Caption(coccoprova) = STR$(value(DropdownList1)) + "-1"
        CASE DropdownList2
            Caption(coccoprova) = STR$(value(DropdownList2)) + " -2"
    END SELECT
END SUB

SUB __UI_MouseEnter (id AS LONG)
    SELECT CASE id
        CASE coccoprova

        CASE DropdownList1

        CASE DropdownList2

    END SELECT
END SUB

SUB __UI_MouseLeave (id AS LONG)
    SELECT CASE id
        CASE coccoprova

        CASE DropdownList1

        CASE DropdownList2

    END SELECT
END SUB

SUB __UI_FocusIn (id AS LONG)
    SELECT CASE id
        CASE DropdownList1

        CASE DropdownList2

    END SELECT
END 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 DropdownList1

        CASE DropdownList2

    END SELECT
END SUB

SUB __UI_MouseDown (id AS LONG)
    SELECT CASE id
        CASE coccoprova

        CASE DropdownList1

        CASE DropdownList2

    END SELECT
END SUB

SUB __UI_MouseUp (id AS LONG)
    SELECT CASE id
        CASE coccoprova

        CASE DropdownList1

        CASE DropdownList2

    END SELECT
END 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 DropdownList1

        CASE DropdownList2

    END SELECT
END SUB

SUB __UI_TextChanged (id AS LONG)
    SELECT CASE id
    END SELECT
END SUB

SUB __UI_ValueChanged (id AS LONG)
    SELECT CASE id
        CASE DropdownList1

        CASE DropdownList2

    END SELECT
END SUB

SUB __UI_FormResized

END SUB

and .FRM file
Code: [Select]
': This form was generated by
': InForm - GUI library for QB64 - Beta version 7
': Fellippe Heitor, 2016-2018 - fellippe@qb64.org - @fellippeheitor
': https://github.com/FellippeHeitor/InForm
'-----------------------------------------------------------
SUB __UI_LoadForm

    DIM __UI_NewID AS LONG

    __UI_NewID = __UI_NewControl(__UI_Type_Form, "coccoprova", 300, 300, 0, 0, 0)
    SetCaption __UI_NewID, "coccoprova"
    Control(__UI_NewID).Stretch = False
    Control(__UI_NewID).Font = SetFont("segoeui.ttf", 12)

    __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "DropdownList1", 200, 23, 50, 138, 0)
    AddItem __UI_NewID, "coccobello"
    Control(__UI_NewID).Stretch = False
    Control(__UI_NewID).HasBorder = True
    Control(__UI_NewID).CanHaveFocus = True

    __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "DropdownList2", 200, 23, 50, 191, 0)
    Control(__UI_NewID).Stretch = False
    Control(__UI_NewID).HasBorder = True
    Control(__UI_NewID).CanHaveFocus = True

END SUB

SUB __UI_AssignIDs
    coccoprova = __UI_GetID("coccoprova")
    DropdownList1 = __UI_GetID("DropdownList1")
    DropdownList2 = __UI_GetID("DropdownList2")
END SUB

I think you needn't  the other two files:
'$INCLUDE:'InForm\InForm.ui'
'$INCLUDE:'InForm\xp.uitheme'.

Thank's for Inform and for your help


Online FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: InForm Beta 7 is out now
« Reply #19 on: June 03, 2018, 07:12:52 PM »
@Tempo:

If you want to know which item index was selected by the user:

    theItem% = Control(DropdownList1).Value

It you want to know the contents/text of the item selected:

    theItem$ = GetItem(DropdownList1, thisItem%)

Also, the best place for that would be the ValueChanged event instead of the Click event, but that's up to you.

Let me know how it goes.

Re: InForm Beta 7 is out now
« Reply #20 on: June 03, 2018, 08:20:21 PM »
Hi Fellippe,

I started planning a less trivial app that requires one giant picture box 1200 x 700 and a number of controls: buttons, frames with radio buttons... on the right side of the screen. Is there a way to access the right side of the form to drag and drop controls and move them around? It seems the Frm window is stuck always to the right of the properties window.
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Online FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: InForm Beta 7 is out now
« Reply #21 on: June 03, 2018, 08:25:52 PM »
In the View menu -> untick "Keep preview window attached".

Re: InForm Beta 7 is out now
« Reply #22 on: June 04, 2018, 03:30:00 AM »
Thanks, I have program worked out where everything should go.
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Re: InForm Beta 7 is out now
« Reply #23 on: June 07, 2018, 02:00:15 PM »
Here is some more testing / experimenting / demonstrating with InForm:

+ My first interest was to test the new undocumented MessageBox&() function, so I have notes included with code for copy/paste or reference later on in convenient place. While testing this function, I became curious how to get a really long title to display. I found an answer!

+ I also wanted to do more testing with the __UI_KEYHIT values being returned and make a handy utility for those numbers. So in this code I used code I found in Wiki under _KEYHIT and added modification of that to message box messages when you hit a key or key combination.

+ I also want to help Fellippe promote this marvelous effort, because I think it is an important step forward with QB and I think it should be supported with interest and questions and practice using.

Snips of important parts:
Code: [Select]
'Key_Message.bas for QB64 v1.1(last before number change to 1.2) B+ 2018-06-07

'testing:
' 1. Message box - and how to get a really long title to show completely?
'    answer: a really long string in message string that word wrap can't split!
' 2. SETFOCUS demo how it works and allows key presses to be acknowldeged (only my left hand is dyslexic!)
'    maybe it is better used in repaint er ah,  BeforeUpdateDisplay event
'    by setting focus on a control once on OnLoad event
' 3. What are the __UI_KeyHit values  being returned?
'    Are they the same as code found under _KEYHIT at Wiki?

This starts key press messages from get go but, if you take focus off button, you need to click it again (or just mouse over it).
Code: [Select]
SUB __UI_OnLoad
    SetFocus Button1
END SUB

And this is main event, so to speak:
Code: [Select]
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


    'test the not yet documented messageBox&
    ' FUNCTION MessageBox& (Message$, Title$, Setup AS LONG)
    'You can change it and even cancel it by making it = 0 <<<<<<<<<< oops ignore this repeated line from above

    'Setup is a combination (button + icon) of:
    'Buttons, which can be MsgBox_OkOnly, MsgBox_OkCancel, MsgBox_AbortRetryIgnore, MsgBox_YesNoCancel,
    'MsgBox_YesNo, MsgBox_RetryCancel, MsgBox_CancelTryagainContinue, MsgBox_CancelTryagainContinue.

    'Icons, which can be MsgBox_Critical, MsgBox_Question, MsgBox_Exclamation, MsgBox_Information

    'The possible return values are: MsgBox_Ok, MsgBox_Cancel, MsgBox_Abort, MsgBox_Retry, MsgBox_Ignore,
    ' MsgBox_Yes, MsgBox_No, MsgBox_Tryagain, MsgBox_Continue.
    DIM x AS LONG
    x = __UI_KeyHit
    m$ = STR$(x) + " = __UI_KeyHit Value," + CHR$(10) + "_KEYHIT Code from wiki came up with this:" + CHR$(10)

    '====   reference: https://www.qb64.org/wiki/KEYHIT
    IF x < 0 THEN 'negative value means key released
        m$ = m$ + "Released "
        x = -x
    ELSE
        m$ = m$ + "Pressed " 'positive value means key pressed
    END IF
    IF x < 256 THEN 'ASCII code values
        m$ = m$ + "ASCII" + STR$(x) + " "
        IF x >= 32 AND x <= 255 THEN m$ = m$ + " [" + CHR$(x) + "] "
    END IF
    IF x >= 256 AND x < 65536 THEN '2 byte key codes
        m$ = m$ + "2-BYTE-COMBO" + STR$(x AND 255) + " " + STR$(x \ 256) + " "
        x2 = x \ 256
        IF x2 >= 32 AND x2 <= 255 THEN m$ = m$ + " [" + CHR$(x2) + "] "
    END IF

    'this helpful?  I can't get a small b difference with a B
    IF x >= 100000 AND x < 200000 THEN 'QB84 Virtual Key codes
        m$ = m$ + "SDL VK" + STR$(x - 100000) + " "
    END IF
    IF x >= 200000 AND x < &H40000000 THEN
        m$ = m$ + "QB64 VK" + STR$(x - 200000) + " "
    END IF
    IF x >= &H40000000 THEN 'Unicode values (IME Input mode)
        m$ = m$ + "UNICODE" + STR$(x - &H40000000) + " 0x" + HEX$(x - &H40000000) + " ..."
    END IF

    'OK simple message box, also testing how to display a really long title in message box
    ans& = MessageBox&(m$ + CHR$(10) + STRING$(150, "+"), "Testing __UI_KeyHit and message box and Wiki code for _KEYHIT.", MsgBox_OkCancel)
    IF ans& = MsgBox_Ok THEN
        'OK then
    ELSE
        END
    END IF

    SELECT CASE id
        CASE Button1

    END SELECT
END SUB

I was not expecting so many responses from one key press or key combo.

I am concerned about getting a capital B distinguished from a little b and similar combinations of keys eg Ctrl, Alt as well as Shift.

BTW, in this test program, if you click Cancel in the MessageBox, you will end the program.
« Last Edit: June 07, 2018, 02:12:31 PM by bplus »
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Re: InForm Beta 7 is out now
« Reply #24 on: June 09, 2018, 11:08:41 AM »
Hi Fellippe
you are always very gentle...

yes I must miss the wikipage where I can get this manner to access to index value....

"  theItem% = Control(DropdownList1).Value"  while I have been able to capture the second formula that you have posted....

Following your suggestions about DropDownlList .... how can I get the value of this object in ValueChanged event?
The code example, posted by me, uses the click event only to get a fast feedback on caption of the form.
As you can see in code I have missed the way to access to value because I have imaged that it (property value) was like property text() and I am able to access to it directly as an array.
But that thought is wrong! Now, thank's to you I know how access to value of DropDownList.

As soon as I'll post the Inform version of a simple CryptoProgram

Thank's for help and for Inform

Online FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: InForm Beta 7 is out now
« Reply #25 on: June 10, 2018, 12:04:45 PM »
Just move the code you wrote in the Click event to the ValueChanged event. Because a user may click a list box but not change its contents, the ValueChanged event is more suitable as it will only be triggered when a new item is actually selected, so that makes more sense in your case.

Re: InForm Beta 7 is out now
« Reply #26 on: June 14, 2018, 06:42:35 PM »
Thank's Fellippe

I agree  and as soon as I'll post the new educational program that I have coded in Inform version....
for now in another thread I post the ASCII version

Thank's

Re: InForm Beta 7 is out now
« Reply #27 on: June 17, 2018, 10:35:50 AM »
Hi Fellippe

1. I need help:
label has an autosize property?
On run, changing the caption of a label
both directly using Caption(MyLabelLB)= "MyString"
both using SetCaption MyLabelLB, "MyString"
the label doesn't contain all the new string.

It is possible to do this in InForm?

2. Feedback on WIKI of Inform....
the link to WordWrap in this page https://github.com/FellippeHeitor/InForm/wiki/Label bring me to the main page of wiki of Inform and not to the page "https://github.com/FellippeHeitor/InForm/wiki/WordWrap" that is pointed by the link

Thank's

Online FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: InForm Beta 7 is out now
« Reply #28 on: June 17, 2018, 10:44:16 AM »
1. Labels will only autosize at design time (a feature I added after your request), but not at run time. I recommend that you make them big enough so that no text will be clipped. Or even better, make it not only long, but also tall, and set the .WordWrap feature to True.

2. You'll notice that the link to the WordWrap page is colored red for now, which means I didn't write that page yet. Thanks for reporting. I will be updating the wiki soon after your feedback (and also bplus's feedback).

Is this the text encoder you're writing?
« Last Edit: June 17, 2018, 10:45:55 AM by FellippeHeitor »

Re: InForm Beta 7 is out now
« Reply #29 on: June 17, 2018, 10:57:06 AM »
Hi Fellippe
Thank's for answers...
I have tried also to setting to true the property WordWrap, Multiline and CanResize....
Code: [Select]
    ' enlarging label of results
    Control(MessageAtStartAsWrittenByUserLB).WordWrap = True
    Control(MessageAtStartAsWrittenByUserLB).Multiline = True
    Control(MessageAtStartAsWrittenByUserLB).CanResize = True

    Control(EncryptedMessageLB).WordWrap = True
    Control(EncryptedMessageLB).CanResize = True
    Control(EncryptedMessageLB).Multiline = True

    Control(DecryptedMessageLB).WordWrap = True
    Control(DecryptedMessageLB).Multiline = True
    Control(DecryptedMessageLB).CanResize = True
but as you already knows it is unuseful.... OK I must program a good space/size of Label that I use for output at design time....
Thank's again

Yes I'm porting in  Inform the core of encrypt/decrypt ver 0.2 but I'm still learning to use with most efficacy Inform!
Thank's for this wonderful tool
« Last Edit: June 17, 2018, 08:24:06 PM by TempodiBasic »