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

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: InForm Beta 7 is out now
« Reply #15 on: June 03, 2018, 11:50:19 am »
  • Best Answer
  • 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
    Crypting.jpg
    * Crypting.jpg (Filesize: 277.37 KB, Dimensions: 1366x768, Views: 645)
    inform7betaQB64ide.jpg
    * inform7betaQB64ide.jpg (Filesize: 362.81 KB, Dimensions: 1366x768, Views: 680)
    Programming isn't difficult, only it's  consuming time and coffee

    FellippeHeitor

    • Guest
    Re: InForm Beta 7 is out now
    « Reply #16 on: June 03, 2018, 12:45:35 pm »
  • Best Answer
  • @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, 12:47:45 pm by FellippeHeitor »

    Offline bplus

    • Global Moderator
    • Forum Resident
    • Posts: 8053
    • b = b + ...
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #17 on: June 03, 2018, 01:21:03 pm »
  • Best Answer
  • 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, 02:55:02 pm by bplus »

    Offline TempodiBasic

    • Forum Resident
    • Posts: 1792
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #18 on: June 03, 2018, 05:30:14 pm »
  • Best Answer
  • 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: QB64: [Select]
    1. ': This program uses
    2. ': InForm - GUI library for QB64 - Beta version 7
    3. ': Fellippe Heitor, 2016-2018 - fellippe@qb64.org - @fellippeheitor
    4. ': https://github.com/FellippeHeitor/InForm
    5. '-----------------------------------------------------------
    6.  
    7. ': Controls' IDs: ------------------------------------------------------------------
    8. DIM SHARED coccoprova AS LONG
    9. DIM SHARED DropdownList1 AS LONG
    10. DIM SHARED DropdownList2 AS LONG
    11.  
    12. ': External modules: ---------------------------------------------------------------
    13. '$INCLUDE:'InForm\InForm.ui'
    14. '$INCLUDE:'InForm\xp.uitheme'
    15. '$INCLUDE:'coccoprova.frm'
    16.  
    17. ': Event procedures: ---------------------------------------------------------------
    18. SUB __UI_BeforeInit
    19.  
    20.  
    21. SUB __UI_OnLoad
    22.     '
    23.     AddItem DropdownList1, "Traslation simple fixed" 'a->d = a+3, b->e = b+3, c->f = c+3...z->c z+3-(maxletters=26)
    24.     AddItem DropdownList1, "Traslation simple progressive" 'a->d = a+3, b->f = b+4, c->h = c+5...z->c z+29-(maxletters=26)
    25.     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)
    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)
    27.     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
    28.  
    29.     '
    30.     AddItem DropdownList2, "Traslation simple fixed" 'a->d = a+3, b->e = b+3, c->f = c+3...z->c z+3-(maxletters=26)
    31.     AddItem DropdownList2, "Traslation simple progressive" 'a->d = a+3, b->f = b+4, c->h = c+5...z->c z+29-(maxletters=26)
    32.     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)
    33.     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)
    34.     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
    35.  
    36.  
    37. SUB __UI_BeforeUpdateDisplay
    38.     'This event occurs at approximately 30 frames per second.
    39.     'You can change the update frequency by calling SetFrameRate DesiredRate%
    40.  
    41.  
    42. SUB __UI_BeforeUnload
    43.     'If you set __UI_UnloadSignal = False here you can
    44.     'cancel the user's request to close.
    45.  
    46.  
    47. SUB __UI_Click (id AS LONG)
    48.     SELECT CASE id
    49.         CASE coccoprova
    50.  
    51.         CASE DropdownList1
    52.             Caption(coccoprova) = STR$(value(DropdownList1)) + "-1"
    53.         CASE DropdownList2
    54.             Caption(coccoprova) = STR$(value(DropdownList2)) + " -2"
    55.     END SELECT
    56.  
    57. SUB __UI_MouseEnter (id AS LONG)
    58.     SELECT CASE id
    59.         CASE coccoprova
    60.  
    61.         CASE DropdownList1
    62.  
    63.         CASE DropdownList2
    64.  
    65.     END SELECT
    66.  
    67. SUB __UI_MouseLeave (id AS LONG)
    68.     SELECT CASE id
    69.         CASE coccoprova
    70.  
    71.         CASE DropdownList1
    72.  
    73.         CASE DropdownList2
    74.  
    75.     END SELECT
    76.  
    77. SUB __UI_FocusIn (id AS LONG)
    78.     SELECT CASE id
    79.         CASE DropdownList1
    80.  
    81.         CASE DropdownList2
    82.  
    83.     END SELECT
    84.  
    85. SUB __UI_FocusOut (id AS LONG)
    86.     'This event occurs right before a control loses focus.
    87.     'To prevent a control from losing focus, set __UI_KeepFocus = True below.
    88.     SELECT CASE id
    89.         CASE DropdownList1
    90.  
    91.         CASE DropdownList2
    92.  
    93.     END SELECT
    94.  
    95. SUB __UI_MouseDown (id AS LONG)
    96.     SELECT CASE id
    97.         CASE coccoprova
    98.  
    99.         CASE DropdownList1
    100.  
    101.         CASE DropdownList2
    102.  
    103.     END SELECT
    104.  
    105. SUB __UI_MouseUp (id AS LONG)
    106.     SELECT CASE id
    107.         CASE coccoprova
    108.  
    109.         CASE DropdownList1
    110.  
    111.         CASE DropdownList2
    112.  
    113.     END SELECT
    114.  
    115. SUB __UI_KeyPress (id AS LONG)
    116.     'When this event is fired, __UI_KeyHit will contain the code of the key hit.
    117.     'You can change it and even cancel it by making it = 0
    118.     SELECT CASE id
    119.         CASE DropdownList1
    120.  
    121.         CASE DropdownList2
    122.  
    123.     END SELECT
    124.  
    125. SUB __UI_TextChanged (id AS LONG)
    126.     SELECT CASE id
    127.     END SELECT
    128.  
    129. SUB __UI_ValueChanged (id AS LONG)
    130.     SELECT CASE id
    131.         CASE DropdownList1
    132.  
    133.         CASE DropdownList2
    134.  
    135.     END SELECT
    136.  
    137. SUB __UI_FormResized
    138.  
    139.  

    and .FRM file
    Code: QB64: [Select]
    1. ': This form was generated by
    2. ': InForm - GUI library for QB64 - Beta version 7
    3. ': Fellippe Heitor, 2016-2018 - fellippe@qb64.org - @fellippeheitor
    4. ': https://github.com/FellippeHeitor/InForm
    5. '-----------------------------------------------------------
    6. SUB __UI_LoadForm
    7.  
    8.     DIM __UI_NewID AS LONG
    9.  
    10.     __UI_NewID = __UI_NewControl(__UI_Type_Form, "coccoprova", 300, 300, 0, 0, 0)
    11.     SetCaption __UI_NewID, "coccoprova"
    12.     Control(__UI_NewID).Stretch = False
    13.     Control(__UI_NewID).Font = SetFont("segoeui.ttf", 12)
    14.  
    15.     __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "DropdownList1", 200, 23, 50, 138, 0)
    16.     AddItem __UI_NewID, "coccobello"
    17.     Control(__UI_NewID).Stretch = False
    18.     Control(__UI_NewID).HasBorder = True
    19.     Control(__UI_NewID).CanHaveFocus = True
    20.  
    21.     __UI_NewID = __UI_NewControl(__UI_Type_DropdownList, "DropdownList2", 200, 23, 50, 191, 0)
    22.     Control(__UI_NewID).Stretch = False
    23.     Control(__UI_NewID).HasBorder = True
    24.     Control(__UI_NewID).CanHaveFocus = True
    25.  
    26.  
    27. SUB __UI_AssignIDs
    28.     coccoprova = __UI_GetID("coccoprova")
    29.     DropdownList1 = __UI_GetID("DropdownList1")
    30.     DropdownList2 = __UI_GetID("DropdownList2")
    31.  

    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

    Programming isn't difficult, only it's  consuming time and coffee

    FellippeHeitor

    • Guest
    Re: InForm Beta 7 is out now
    « Reply #19 on: June 03, 2018, 06:12:52 pm »
  • Best Answer
  • @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.

    Offline bplus

    • Global Moderator
    • Forum Resident
    • Posts: 8053
    • b = b + ...
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #20 on: June 03, 2018, 07:20:21 pm »
  • Best Answer
  • 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.

    FellippeHeitor

    • Guest
    Re: InForm Beta 7 is out now
    « Reply #21 on: June 03, 2018, 07:25:52 pm »
  • Best Answer
  • In the View menu -> untick "Keep preview window attached".

    Offline bplus

    • Global Moderator
    • Forum Resident
    • Posts: 8053
    • b = b + ...
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #22 on: June 04, 2018, 02:30:00 am »
  • Best Answer
  • Thanks, I have program worked out where everything should go.

    Offline bplus

    • Global Moderator
    • Forum Resident
    • Posts: 8053
    • b = b + ...
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #23 on: June 07, 2018, 01:00:15 pm »
  • Best Answer
  • 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: QB64: [Select]
    1. 'Key_Message.bas for QB64 v1.1(last before number change to 1.2) B+ 2018-06-07
    2.  
    3. 'testing:
    4. ' 1. Message box - and how to get a really long title to show completely?
    5. '    answer: a really long string in message string that word wrap can't split!
    6. ' 2. SETFOCUS demo how it works and allows key presses to be acknowldeged (only my left hand is dyslexic!)
    7. '    maybe it is better used in repaint er ah,  BeforeUpdateDisplay event
    8. '    by setting focus on a control once on OnLoad event
    9. ' 3. What are the __UI_KeyHit values  being returned?
    10. '    Are they the same as code found under _KEYHIT at Wiki?
    11.  

    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: QB64: [Select]
    1. SUB __UI_OnLoad
    2.     SetFocus Button1
    3.  

    And this is main event, so to speak:
    Code: QB64: [Select]
    1. SUB __UI_KeyPress (id AS LONG)
    2.     'When this event is fired, __UI_KeyHit will contain the code of the key hit.
    3.     'You can change it and even cancel it by making it = 0
    4.  
    5.  
    6.     'test the not yet documented messageBox&
    7.     ' FUNCTION MessageBox& (Message$, Title$, Setup AS LONG)
    8.     'You can change it and even cancel it by making it = 0 <<<<<<<<<< oops ignore this repeated line from above
    9.  
    10.     'Setup is a combination (button + icon) of:
    11.     'Buttons, which can be MsgBox_OkOnly, MsgBox_OkCancel, MsgBox_AbortRetryIgnore, MsgBox_YesNoCancel,
    12.     'MsgBox_YesNo, MsgBox_RetryCancel, MsgBox_CancelTryagainContinue, MsgBox_CancelTryagainContinue.
    13.  
    14.     'Icons, which can be MsgBox_Critical, MsgBox_Question, MsgBox_Exclamation, MsgBox_Information
    15.  
    16.     'The possible return values are: MsgBox_Ok, MsgBox_Cancel, MsgBox_Abort, MsgBox_Retry, MsgBox_Ignore,
    17.     ' MsgBox_Yes, MsgBox_No, MsgBox_Tryagain, MsgBox_Continue.
    18.     DIM x AS LONG
    19.     x = __UI_KeyHit
    20.     m$ = STR$(x) + " = __UI_KeyHit Value," + CHR$(10) + "_KEYHIT Code from wiki came up with this:" + CHR$(10)
    21.  
    22.     '====   reference: https://www.qb64.org/wiki/KEYHIT
    23.     IF x < 0 THEN 'negative value means key released
    24.         m$ = m$ + "Released "
    25.         x = -x
    26.     ELSE
    27.         m$ = m$ + "Pressed " 'positive value means key pressed
    28.     END IF
    29.     IF x < 256 THEN 'ASCII code values
    30.         m$ = m$ + "ASCII" + STR$(x) + " "
    31.         IF x >= 32 AND x <= 255 THEN m$ = m$ + " [" + CHR$(x) + "] "
    32.     END IF
    33.     IF x >= 256 AND x < 65536 THEN '2 byte key codes
    34.         m$ = m$ + "2-BYTE-COMBO" + STR$(x AND 255) + " " + STR$(x \ 256) + " "
    35.         x2 = x \ 256
    36.         IF x2 >= 32 AND x2 <= 255 THEN m$ = m$ + " [" + CHR$(x2) + "] "
    37.     END IF
    38.  
    39.     'this helpful?  I can't get a small b difference with a B
    40.     IF x >= 100000 AND x < 200000 THEN 'QB84 Virtual Key codes
    41.         m$ = m$ + "SDL VK" + STR$(x - 100000) + " "
    42.     END IF
    43.     IF x >= 200000 AND x < &H40000000 THEN
    44.         m$ = m$ + "QB64 VK" + STR$(x - 200000) + " "
    45.     END IF
    46.     IF x >= &H40000000 THEN 'Unicode values (IME Input mode)
    47.         m$ = m$ + "UNICODE" + STR$(x - &H40000000) + " 0x" + HEX$(x - &H40000000) + " ..."
    48.     END IF
    49.  
    50.     'OK simple message box, also testing how to display a really long title in message box
    51.     ans& = MessageBox&(m$ + CHR$(10) + STRING$(150, "+"), "Testing __UI_KeyHit and message box and Wiki code for _KEYHIT.", MsgBox_OkCancel)
    52.     IF ans& = MsgBox_Ok THEN
    53.         'OK then
    54.     ELSE
    55.         END
    56.     END IF
    57.  
    58.     SELECT CASE id
    59.         CASE Button1
    60.  
    61.     END SELECT
    62.  

    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.
    * Key Message.zip (Filesize: 78.9 KB, Downloads: 365)
    « Last Edit: June 07, 2018, 01:12:31 pm by bplus »

    Offline TempodiBasic

    • Forum Resident
    • Posts: 1792
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #24 on: June 09, 2018, 10:08:41 am »
  • Best Answer
  • 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
    Programming isn't difficult, only it's  consuming time and coffee

    FellippeHeitor

    • Guest
    Re: InForm Beta 7 is out now
    « Reply #25 on: June 10, 2018, 11:04:45 am »
  • Best Answer
  • 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.

    Offline TempodiBasic

    • Forum Resident
    • Posts: 1792
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #26 on: June 14, 2018, 05:42:35 pm »
  • Best Answer
  • 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
    Programming isn't difficult, only it's  consuming time and coffee

    Offline TempodiBasic

    • Forum Resident
    • Posts: 1792
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #27 on: June 17, 2018, 09:35:50 am »
  • Best Answer
  • 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
    Programming isn't difficult, only it's  consuming time and coffee

    FellippeHeitor

    • Guest
    Re: InForm Beta 7 is out now
    « Reply #28 on: June 17, 2018, 09:44:16 am »
  • Best Answer
  • 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, 09:45:55 am by FellippeHeitor »

    Offline TempodiBasic

    • Forum Resident
    • Posts: 1792
      • View Profile
    Re: InForm Beta 7 is out now
    « Reply #29 on: June 17, 2018, 09:57:06 am »
  • Best Answer
  • Hi Fellippe
    Thank's for answers...
    I have tried also to setting to true the property WordWrap, Multiline and CanResize....
    Code: QB64: [Select]
    1.     ' enlarging label of results
    2.     Control(MessageAtStartAsWrittenByUserLB).WordWrap = True
    3.     Control(MessageAtStartAsWrittenByUserLB).Multiline = True
    4.     Control(MessageAtStartAsWrittenByUserLB).CanResize = True
    5.  
    6.     Control(EncryptedMessageLB).WordWrap = True
    7.     Control(EncryptedMessageLB).CanResize = True
    8.     Control(EncryptedMessageLB).Multiline = True
    9.  
    10.     Control(DecryptedMessageLB).WordWrap = True
    11.     Control(DecryptedMessageLB).Multiline = True
    12.     Control(DecryptedMessageLB).CanResize = True
    13.  
    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, 07:24:06 pm by TempodiBasic »
    Programming isn't difficult, only it's  consuming time and coffee