Dot-notation for UI-objects
issueid=540 23-04-2018 05:42
thinBasic MVPs
Number of reported issues by ReneMiner: 75
Dot-notation for UI-objects
Just a reminder

I read in the other thread (beta-testing) that Eros is up to implement dot-notation for the UI-objects (as Buttons, Textboxes, windows etc.) to set/get properties.

There's one important thing to think about before the work started:
In UI the objects currently only have names, no index yet as far as I know.

In vb6 it's alike if I design a button "command1" and give it an index then I can during runtime simply do something alike:
Command1(2).Load()
and it will add a new command-button with identical properties except the .Visible property always is set to FALSE. So the programmer can adjust properties as .Left, .Top or .Caption before it will become visible.

The other thing for the events (pseudo-callbacks):
If an object has an index the code-editor always creates Subs as this:

Sub Command1_Click(Byval Index As Long)

When the sub gets called from internal callbacks queue routine it passes the index to the sub so the user "knows" what Command1(?) raised the event.

And it's also useful in MDI-applications if like the document-windows have indexes and can share same functions. If a new window gets created it calls a Form_Load()-event so the programmer can actually set up all required steps before the window is shown.

...

Not really an idea nor feature-request but just to remind to add indexes to windows and controls if wrapping the ui-callbacks to an easy to handle, user-friendly basic


Oops- slipped into thinair-support accidentally, someone may move this to regular tB-support
Issue Details
Issue Number 540
Issue Type Feature
Project thinAir and Visual Designer
Category Unknown
Status Suggested
Priority 1 - Highest
Suggested Version 2.0.0
Implemented Version (none)
Milestone (none)
Votes for this feature 0
Votes against this feature 0
Assigned Users (none)
Tags (none)




24-06-2018 03:23
thinBasic MVPs
Just add something:
Every window has its own code-unit (a private scope)
If I have a Window, name "myWindow", and it would contain a few picturebox controls
"myPicbox(1), myPicbox(2),..."
then access within the same code-unit as the window-code just like:

myPicbox(index).Picture = LoadPicture(sFilename)

If from another scope, it works alike:

myWindow(index).myPicbox(index).Picture = LoadPicture(sFilename)

+ Reply