Show Hide objects

joel2009

Member
Licensed User
I know how to show/ close forms and how to create a new object without the designer (and that is the only way i figure you can o this so far) i would like to show/hide an object such as a button upon an event.


Specifically i am looking at doing something like the opera mobile menu buttons do (if the mouse focus is on the screen the buttons hide, and when focus is lost they re-appear)


Any Help would be greatly appreciated.


thanks,

Joel
 

joel2009

Member
Licensed User
Its still not working for me... i've been having problems with "minimize button" in fullscreen and "gestures" and i wonder if it may have to do with the web object. I'm using agrahams webbrowser dll.

Here is a snippet of my code if you can find anything:

B4X:
Sub Form2_MouseDown (x,y)
back.Visible=False
End Sub


Sub Form2_MouseUp (x,y)
back.Visible=True
End Sub

Sub back_Click
web.GoBack
End Sub

PS: Back is the name of a button
 
Last edited:

klaus

Expert
Licensed User
Longtime User
You must post your full code and explain what you want to do and what problem you have, otherwise we cannot give you any advice.
- We dont know the location of the web object and what you are doing with it?
- We don't know what you you want to do and how with the minimize button and what the problem is?
- What gestures do you want to do and how and what the problem is?

The code snippet in your post works !

I tried to figure out what your problem or question could be.
- If the web object is on the same form as the buttons you want to hide and you click inside the web object it will not work because the mouse event is on the web object and not on the Form.

Attached my small test program.

Best regards.
 

Attachments

  • TestVisible.sbp
    1,003 bytes · Views: 185

joel2009

Member
Licensed User
I kind of though about that it not being the same object, but the web object wasn't created in the visual designers.... it was created using a new process. (i guess i just don't know how to refrence it) I eventually took the gestures out as i couldn't get them to work. I'd Like to use them though if you can help me do that :D

Here is a full script for showing or hiding a simple button. With the "go back" command that i am trying to get to work...
 
Last edited:

klaus

Expert
Licensed User
Longtime User
I tried your program, but there are two images missing, and without those it doesn't run.

Can you tell exactly how the gestures should work, where those should be implemented (Form1, Form2) and what you want to do with?

From what I have seen in your code on Form2 the webbrowser object covers the whole screen so you can't get the mouse positions anymore with Form2_MouseDown or Form2_MouseUp.
On Form1 the ImageButtons cover also the whole screen so the mouse positions will not be directly available either.

Best regards.
 

joel2009

Member
Licensed User
forgot about those... they are only on form one(which only basically has a buton leading to form two.

So is there no way to loop the mouse up and mouse down with the web object?

The whole point of the show hide is to increase the size of the screen (which is a browser)
Basically, it will hide evrything while you are scrolling and actively using the screen, but leaves the menu accessible. (what the back button will be... a menu button)
 

Cableguy

Expert
Licensed User
Longtime User
Sorry but I don't know if it is possible to get the Mouse positions on the webbrowser. This is a question for agraham.

Best regards.

As Klaus said, gestures are only catcheable by the FORM....
This means that, if a gesture is done on top of ANY control other that the FORM itself, the x:y coordinates will not be catched...
Some controls allow for x:y coordinates, but are relative to the control itself...
This said, Gestures, are these are commonly known, are not an easy thing to achieve...
Usually the developer reserves a "screen" area on wich the user can perform meaninful gestures....

I have been looking for a while for a gesture dll or some code to allow "Gesture everywere" with no luck..
 
Top