Wish Doubleclick on view in Designer should go to event code

Diceman

Active Member
Licensed User
If I double click on a view, like a Button, I would like to have the editor open up and position itself to the btnMyButton_Click event (assuming I have the event defined in the code). If I have more than 1 event defined in code for this view, then a popup menu would appear and I would be given a choice of which event I want to see in the editor.

This will save me a great deal of time by not having to hunt and peck through the code using F3 for events that are attached to the designer. By doubleclicking, it establishes a "road" directly from the designer into the code editor. As it stands now if I am in the Designer and I want to see an existing event for the view, I have to take a detour and start searching through the code using F3 and this slows me down. Get rid of the barricades and build me a road.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Completely not necessary.
Right click on the view - choose Generate and choose the event you like.
 

Diceman

Active Member
Licensed User
Completely not necessary.
Right click on the view - choose Generate and choose the event you like.

I think you misread the post. I don't want to generate the event code a second time. If I right click on the button in the designer and select "Generate > Click", it does nothing because the click event already exists.

My request is for navigating to an existing view event in the code editor from the Designer by double clicking on the view. The event code could have been generated days ago. When I am in the designer I would like to be able to double click on the Button view for example, and the editor automatically comes into focus and repositions me to that btn_MyButton_Click event in the editor.
 

jahswant

Well-Known Member
Licensed User
Longtime User
Yes @Erel we should fine a way to reach the generated event if it exists.
+1
 

Diceman

Active Member
Licensed User
Button is more or less the only view that has an obvious default event.

My suggestion is if there is only one event defined for that view when you double click on the view in the Designer, then it will go directly to that event in the code.
If there are more than 1 view event defined in the code, then double clicking on the view in the designer will display a popup menu where the user can select which event he wants to go to. This allows the developer to easily navigate from the Designer views to the corresponding code in the editor with a double click. The user would get there in 1 second.

If I use Ctrl+F or Ctrl+E or F3 I have to figure out what name I gave the view, type it in, hopefully I don't make any typos because I have views with similar sounding names, find the correct event, then click on it. It would take me at least 5 seconds, maybe longer depending on my typing skills and my eyesight. But when you double click, you're there in 1 second and have no chance of making a mistake.

Your honor, what more can I say? I rest my case.
 

Sandman

Expert
Licensed User
Longtime User
We've been through this wish several times already, and @Erel has always declined it with good reason. I have absolutely no problem at all understanding that implementing it like requested here would create more confusion and user error than providing assistance.

Buuuut, to bring something constructive to the table, I'd like to add a suggestion for how this could be implemented:

In the virtual designer, there's an area with properties for the event. Imagine if we added a section for events. (And for all the eagle-eyed folks out there: Yes, my example events are very strange, because I'm not close to a B4X installation at the moment to check actual events, and I imagine this is good enough to get the idea across. )

For a selected view, where no events are currently created:


The user points to one of the available events. It underlines and the virtual designer show a helpful tooltip:


The user clicks Touch, which creates the event code (just as we do today using right-click). As the Touch event now exist, it shows as bold, with an arrow that provide a shortcut to the correct IDE location. (Which is what the wish in this thread requests, after all.)


I hope this is understandable. It's quite rough, I threw it together in three minutes so I'm sure there's lots of ways to make this better. But at least it's an idea for how we could solve it.
 

Diceman

Active Member
Licensed User
Sandman,

I think I may have improved on your suggestion by moving the events to the Views Tree since that is where the views are located. The user can expand the view name like "btnTerms" and it will show the available events underneath it (see image). If the Click event has already been generated then the caption reads "Click (See Code)". If the user clicks on it then it opens the editor and displays the code for this event. If the event does not yet exist in the code, then the caption reads "Button Up (Generate Code)" and clicking on it generates the code and since the event now exists, the caption turns into "Button Up (See Code)". Clicking on it takes the user to the editor for this event. This is all organized under one tree and can be easily expanded to see all available events. The "(See Code)" captions could be yellow or normal text and the "(Generate Code)" could be red text or bold text so it is easier to distinguish between the two. Well, that's it from me. What do you guys think?

 

Sandman

Expert
Licensed User
Longtime User
Yep, there are many ways of doing this. The important thing is that we might have given Erel an idea for how it could be solved. Let's let him marinate it in peace and we'll see what happens.
 

Diceman

Active Member
Licensed User
Yep, there are many ways of doing this. The important thing is that we might have given Erel an idea for how it could be solved. Let's let him marinate it in peace and we'll see what happens.

Agreed.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…