Page 21 of 24 FirstFirst ... 111920212223 ... LastLast
Results 201 to 210 of 236

Thread: thinBasic 1.11.x.x

  1. #201
    Thanks for the explanations !
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  2. #202

    Lightbulb

    f.png

    Maybe tooltip for types can show :
    User defined type : instead of "Parameters :"
    variables with variables types (as ...)
    and not show "return value :" ?
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  3. #203

    Hide a Control

    thinBasic 1.11.6.0 BETA TESTING

    the hiding of a control may be broken, does not work
    txtBox.Hide ' to hide
    txtBox.Normalize ' to unHide
    also
    txtBox.ForeColor = rgb(255,0,0)
    txtBox.backColor = rgb(0,255,0)
    does not work as expected if they are used in this order or in this order
    txtBox.backColor = rgb(0,255,0)
    txtBox.ForeColor = rgb(255,0,0)
    USES "UI"
    '---Define a button and textBox ID
    begin ControlID
      %txtBox
      %btnPush
    end ControlID
     
    dialog Font "Courier New", 14
    DIALOG New Pixels   , Name Form, 0, "tests",-1,-1, 640, 400,
                          %WS_DLGFRAME | %DS_CENTER | %WS_CAPTION  | %WS_SYSMENU | %WS_OVERLAPPEDWINDOW
    CONTROL ADD Textbox , Name txtBox  , Form.Handle, %txtBox   , "",  10,  30, 350,  350, %ES_AUTOHSCROLL | %WS_VSCROLL | %ES_AUTOVSCROLL | %ES_WANTRETURN | %ES_MULTILINE |  %WS_TABSTOP ' | %ES_NUMBER
    CONTROL ADD BUTTON  , Name btnPush , Form.Handle, %btnPush  , "Okay"     , 400, 340, 200,  35, %BS_NOTIFY | %BS_CENTER | %BS_VCENTER | %WS_TABSTOP
    control set Color Form.Handle , %txtBox, rgb(255,0,0), rgb(0,255,0)
    DIALOG SHOW MODAL Form.Handle
    '------------------------------------------------
    CallBack Function Form_OnLoad() As Long
    '------------------------------------------------
      txtBox.ForeColor = rgb(255,0,0)
      txtBox.backColor = rgb(0,255,0)
      txtBox.Text  = "OK" + $CRLF
      '---Change name to Run me
      btnPush.Text = "Hide the TextBox"
     
    End Function
    '------------------------------------------------
    ' Function fired when button is clicked
    '------------------------------------------------
    CallBack Function btnPush_OnClick() As Long
    txtBox.Hide
    'Control Hide Form.Handle, %txtBox  ' output error
    'txtBox.Normalize  ' to UnHide the control
    End Function
    

  4. #204
    As developpment is focused on thinAir, i would like to highlight that this issue is still relevant for v1.11.60 : https://www.thinbasic.com/community/...hp?issueid=613 and add to the info that now with freebasic bundled, it is doubled.
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  5. #205
    Hi Primo,

    where did you find the hide method for the textbox ?
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  6. #206
    Hi DirectuX
    it pops up when we write txtBox.hi like this
    hide.PNG
    i remember using this feature in VB6 in which we can hide any control, it is a fun feature
    it is also in powerbasic functions
    https://forum.powerbasic.com/forum/a...hide-statement
    CONTROL HIDE HDlg, ID&
    Normalize is not yet added to the tips in thinbasic but it is accepted

    the "Hide" is available for any control including Buttons.

  7. #207
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170

    Post

    just for a Trackbar- maybe add in support-section, using any style causes the trackbar to stay invisible

    for all dialogs & controls if added:

    i think itis still possible to create indexed dialogs & controls but : same name must be same type of dialog or same type of control. I dont know but i think if you make "INDEX" a keyword it will break thousands of old scripts that use "Index" as a variable- but maybe there is another expression that could be used maybe "Indicator" that means its an Index-Expression of a Dialog or Control. Or you could call it "UI_Index"

    If such an index is used alike
    Control Add Button Name Superbutton(20), hDlg, %IDSuper20, "Click me",...
    means to create this superbutton number 20 only.

    it can not be to create this after creating another control named "superbutton" without an index and no other control with that same name can be created without an index. Also all named as "Superbutton" must be identical controls except the position, caption, image , check-state etc. and all must be 1-dimensional indexed.
    It should be possible as well to create grids so to say 2D-Indexed

    Control Add Textbox Name myCell(1,1), hDlg, %ID_Cell_1_1,...

    I dont know where you will store "Indicators" but if you would find a few bytes to store this "indicators" then for the callback. The user has to write a cb-Function for an indexed control alike

    Callback Function Superbutton.OnClick(ByVal Index As Long) As Long

    so if used "Index" by the User here its just a local variable only he could write whatever he likes, mainly the callback needs a slot to put that value for the user to be available.
    for 2D-indication , means

    Callback Function myCell.OnClick(Byval Column As Long, Byval Row As Long) as Long
    is the same as
    Callback Function myCell.OnClick(Byval X As Long, Byval Y As Long) as Long
    - if a controls name with 2D-Index has been created , the user must provide the correct number to receive them in callback and their order must be same as between parenthesis

    If its just more than 2 dimensions will need more than the space of a quad to store the indexes except the range would get cut down to
    1 dimension = range of 16 bytes (quad- but i think long is ok since the callbacks should use these as a parameter uniform)
    2 dimensions = 2 * range of 8 bytes(long)

    3 + 4 dimensions 4 * range of 4 bytes (integer)
    but imo the User could make it from 2D to 4D himself using HI and LO- functions. UI mostly is a 2d-environment so its ok if provides 1D- & 2D-indications only

    The content of the Index does not matter. Its not required to be in a continous row. Its up to the user. Only for the same name every index is available once. There can not be more than 1 object with same name and same indication.
    He should be able to assign any numeric value in range of Long as an index to enable using the index instantly in a callback-

    For example if the user creates a mediaplayer, he might have a play-button, a record-button and 4 (or more) position-buttons to select the position within the current song. LikeForward, FastForward,Backward and FastBackward and he can declare
    %FWD = 1
    %FFWD = 10
    %BWD = -1
    %FBWD = -10
    Control Add Button Name ChangePos(%FWD)...
    Control Add Button Name ChangePos(%FFWD)...
    Control Add Button Name ChangePos(%BWD)...
    Control Add Button Name ChangePos(%FBWD)...
    then use the callback
    Callback Function ChangePos.OnClick(Byval Amount As Long) As Long
    ' to make it short:
    mySong.PositionChange(Amount)

    Thats all. The rules, 16 Bytes (a Quad) for indicators per control or dialog, another internal bit or byte somewhere to know how many dimensions the quad contains and the callback must call_ifExist as currently, but pass the indicators additionally.

    Alternative way
    You could as well create a bunch of pseudo-variables alike CBHNDL, CBCTLMSG etc.
    for diaogs
    CBDLGINDEX Alias CBDLGINDEX ' for the one in CBHNDL
    CBDLGINDEX2 - if 2D- but i think rarely used for dialogs, maybe mdi-childs...
    and for controls
    CBCTLINDEX Alias CBCTLINDEX1
    CBCTLINDEX2
    which will avoid errors that could be caused by wrong usage when the slots to receive the indicators are incorrect in count or vartype. That will happen once --- to every user. But it would encrypt the function for users that have become friends of the new, better readability of named controls & dialogs



    i like the thought intend to finally create a dialog as
    Begin Dialog MainWindow, hParent, sCaption, X, Y, W, H, Style, ExStyle
       
      Apply Button BtnExit, "Exit", X,Y, W, H, Style, ExStyle
        ' "Apply" new keyword in Begin Dialog-End Dialog frame to substitute Control Add
        ' because parent etc. is obvious & names are mandatory here
    
      for long i = 1 to 10  
         Apply Button BtnSelectRecent(i), sRecent$(i), 5, 5 + i * 25, 100, 20, style
       next 
       Apply Viewport vptRightMain, "~unused but acceptable~", 110, 5, This.CW -115, This.CH-10 
                          ' "This" can be used for the object that is mentioned after "Begin Dialog" as "ME" in functions
                           ' it would be created already in the first line and before applies any controls it would know client size
                           ' the line after Begin Dialog could already be This.SetMinsize(..,..)
    End Dialog
    Dialog Show Modeless Mainwindow.handle
    Repeat
       DoEvents
    Until Not IsWindow(MainWindow.handle)
    '...
    CallBack Function MainWindow.OnInit()
    
      Begin Dialog insideRightMainVpt, vptRightMain.handle, "", 0, 0, vptRightMain.GetClientWidth, vptRightMain.GetClientHeight, %WS_CHILD
    '...
    
    Last edited by ReneMiner; 25-04-2020 at 10:14.
    I think there are missing some Forum-sections as beta-testing and support

  8. #208
    Quote Originally Posted by primo View Post
    Hi DirectuX
    it pops up when we write txtBox.hi like this
    hide.PNG
    i remember using this feature in VB6 in which we can hide any control, it is a fun feature
    it is also in powerbasic functions
    https://forum.powerbasic.com/forum/a...hide-statement
    CONTROL HIDE HDlg, ID&
    Normalize is not yet added to the tips in thinbasic but it is accepted

    the "Hide" is available for any control including Buttons.
    Eros will tell, but the popup is not context aware , try it by yourself you get the ".hide" suggestion for anything you type, plus hide is not referenced in the TB's help file.
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  9. #209
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170

    Thumbs up

    Quote Originally Posted by DirectuX View Post
    ...is not referenced in the TB's help file.

    There are dozens undocumented functions- since maybe... Ages... Try Uses "File", Disk_Free("C:") or Disk_Size(app_path) or Tell me someone what is Try and Catch? Really i don't know how these work..

    Eros, you know what is meant when i say thinBasic.CreateSyntax.AllModules.inc
    There are few - obviously going to be deprecated or maybe replaced by new stuff. Ist IT only the commented ones or also the 4 below that you are still thinking If or If Not.
    I think the commented ones ist absolutely correct decision. Never anyone asked to play online in TB-forum and Excel has changed a Lot since the Module was published.Also Fileline is Not reallIy needed. I can reproduce all Functions of it using core only. Just to mention Parse File or Load_File, Save_File. Anyway its better If calculation ist done in memory instead to write and overwrite and overwrite.
    I would also suggest to completely Alias LL-module with LList- so this has made It from being a Module into the heart of core - its the best that can happen to a library - finally fully implemented. If you replace the LL-module-file with some dummyfile or some that contains a few Functions to Test before they will get implemented to core, IT should be No Problem. As Long all LL-Functions are covered by Alias LList . Also the LL could handle few things that give their Name a meaning. It could for example Link User-Data in memory with a Listview or treeview Control. A Listview currently only can be filled wth a 2d-matrix - thats an Array(x,y) but means all Elements must BE same and filled to the array to upfate all cells. If we had a straight udt-array and want to list certain subelements in a certain column of the Listview then IT needs the linked list - best If we're a class that can invoke its own callback using a Timer to stay "Up-to-data". If using udt_elementOffset and let IT link a column then IT still must know how much data in what shape or AS which subtype of the ist. Udt_Elementoffset can not Transfer the information easily and it causes to write many many ines of Code. If the linked list would understand thats ist duty to check repeatedly the subelements of an array to update row by row . And probably IT would be nice to LL_LinkUdt2Listview(hDlg, %ID_lvw, myudt(Startindex) using.Keyword, .Module, .Group, .Returns, .Syntax,.Parameter(1),. Parameter (2),. Parameter (3),. Parameter (4)...
    So the LList will regularily update these subelements of myUdt. So it should store Type of and which subelements in memory. The order how i place the subelements ist the one to be used for the Listview or grid. IT can be - IT will dir Sure bei, that Not all of the udts subelements should be displayed that into the columns. And IT might depend If 5 or 25 columns to fill the list might make a difference and If the User would every Seconds have to wait for the PC to respond again... better transfer 50 values and let the system do Events until the next timer-up- event. Then Transfer again and If all the way down start in top again.Or might IT be faster to Monitor the udt for Changes- let it constantly compare a stored Copy ... and there is certainly more possible If linked list have learned to keep constantly a connection.
    And what i discovered- , moduleTokenExporter has probably a Bug - or its the sorting-bug. Finally all end Up in "moduleTokens.ini" where is 1 row of Keywords for each Module. To See, scroll very far right, for example to the end of GDI+ Module, and its in a few more places the class attached to the previous udt means somewhere ist Missing that delimiting comma. Guess at Front when classes are exported should be a comma. to place comma at the end of listed types makes Not much Sense since its Not that many classes. But If you look and Check cDateTime is a core-class. How did IT get in there? And multiple times...i expect Array sort to Start with Element(1) If i do Not specify. But If i do Not specify Startindex IT will create some data-mess-up, some items get additional cryptic chars, some disappear and some jump around anywhere in memory and Mix with other Data. Either say :Error, Startindex required or let IT Default sort all the Array.
    Last edited by ReneMiner; 26-04-2020 at 21:08.
    I think there are missing some Forum-sections as beta-testing and support

  10. #210
    Feedback:
    Type variables autocomplete fail in this case:

    Type tXY
    	x as DWord
    	y as DWord
    End Type
    
    Dim myVar as tXY
    
    myVar.x = 1  '  autosuggestion of x works
    myVar.y=myVar.x  ' autosuggestion of x does not work because of lack of space
    
    Also as idea, can we improve the 'auto indent' feature to some code beautifier ? → add spaces where forgotten, remove useless white spaces, format comments, add/remove empty lines, ...
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

Page 21 of 24 FirstFirst ... 111920212223 ... LastLast

Members who have read this thread: 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •