Wish B4XImageView - Click event

oparra

Well-Known Member
Licensed User
good question !!!!

I don't see any exposed events.

Or should it be placed inside a panel for events?
 

oparra

Well-Known Member
Licensed User
Yes, I have checked the code and I don't see any exposed events.

it should have the same imageview events.
 

Mahares

Expert
Licensed User
This time we will wait for Erel to add it; it's easier
Adding a panel should work.
Indeed, I have a transparent panel holding a B4XImageView in the items layout of an xCLV. I bring the panel to the front. and I raise the panel click event to change the shape of the B4XImageView:
B4X:
Private Sub Panel1_Click  'to create a pseudo raise click event of B4XImageView1 by clicking the panel that holds the img
    Dim index As Int = CustomListView1.GetItemFromView(Sender)
    Dim pnl As B4XView = CustomListView1.GetPanel(index)
    Dim b4xiv As B4XImageView = pnl.getview(1).GetView(0).Tag  'B4XImageView1 is 1st view of panel1. Panel1 is the 2nd view in item layout
    If b4xiv.RoundedImage =True Then
        b4xiv.RoundedImage = False
    Else
        b4xiv.RoundedImage =True
    End If
End Sub
 

LucaMs

Expert
Licensed User
Indeed... you had to do it.

Furthermore:

1 - there is no consistency with respect to the properties and methods of the classic ImageView

2 - if you have to move the B4XImageView at runtime you have to do it also for the panel.

I will have to do it for myself and insert the class in the B4Xlib every time it is updated. Not a good thing.
 

stevel05

Expert
Licensed User
I will have to do it for myself and insert the class in the B4Xlib every time it is updated. Not a good thing.
Why not just create you own custom view with the B4xImageView on a panel, and handle the events you want. You only have to do it once and you can reuse the custom view without editing the original B4xlib. You could even make it cross platform.
 

LucaMs

Expert
Licensed User
Why not just create you own custom view with the B4xImageView on a panel, and handle the events you want. You only have to do it once and you can reuse the custom view without editing the original B4xlib. You could even make it cross platform.
Yes, I could, but I don't like it too much. I did it for xCustomListView, so I have my lmCustomListView (and two other).
If I created my own completely different custom view this makes sense, but having to make a small change to a view that we should consider as a native view of the language does not.
And I want to repeat that having ImageView that has the Click event, the Width, Height properties but a B4XImageView that does not have them is an inconsistency.
Also, I can do it and do it, but there are also members starting with these which are new tools for them.
 

LucaMs

Expert
Licensed User
Last edited:

stevel05

Expert
Licensed User
We will have to agree to disagree on this one. One of the advantages of customviews is that it allows quick customization for exactly this type of situation.
 

LucaMs

Expert
Licensed User
We will have to agree to disagree on this one. One of the advantages of customviews is that it allows quick customization for exactly this type of situation.
I can agree if, as I did creating my DBSearchView by modifying the original SearchView because the change is specific and "heavy".
This specific case, B4XImageView... if the native ImageView has Click, Width, Height I'm still convinced that B4XImageView, which should be the same but cross-plattform, should have these event and properties.
 

stevel05

Expert
Licensed User
I don't actually have a need for it. I was just pointing out one solution to help out.
 

LucaMs

Expert
Licensed User
I know what I could do; mine was a "Wish" for an event (and even better for the other properties) that I believe are missing in this View.
 

LucaMs

Expert
Licensed User
lmB4XImageView 🙁

1.gif
 

stevel05

Expert
Licensed User
Making a view over other views has no difference with modifying the existing one.
I'm not sure what you mean. And I guess it depends what additional functionality you want to implement. If you modify a B4xView directly and a new version is released, you have to remember to update your version if you want the new functionality. In this case with a customview, you can add an existing B4xImageView to a panel and catch the events on the panel as the B4xImageView just ignores the events so they are passed straight through. When a new version is released, you don't need to do anything as long as the new functionality doesn't conflict, as it will automatically use the new version.
 
Top