W wheretheidivides Active Member Licensed User Longtime User May 2, 2012 #1 I have a main screen with a panel (panel_main). There are 4 buttons. When you press a button it takes you to another panel (panel_2). Both of these panels are full screen. When panel_2 is full screen, if you press on the area whenre panel_main's buttons are, they work. You can not see them, but they work. I thought if panel_2 was brought to the front and full screen that it covered up the lower panels and thus the lower panels buttons would not work. Am I right on this or what?
I have a main screen with a panel (panel_main). There are 4 buttons. When you press a button it takes you to another panel (panel_2). Both of these panels are full screen. When panel_2 is full screen, if you press on the area whenre panel_main's buttons are, they work. You can not see them, but they work. I thought if panel_2 was brought to the front and full screen that it covered up the lower panels and thus the lower panels buttons would not work. Am I right on this or what?
W wheretheidivides Active Member Licensed User Longtime User May 2, 2012 #2 So is this for the main panel (with the hidden button) or the 2nd panel (now full screen)? Also, does this de-activate the 1st panel or activate the second? I am having this same problem. Sub Panel1_Touch(Action As Int, X As Float, Y As Float) As Boolean Return True End Sub Last edited: May 2, 2012 Upvote 0
So is this for the main panel (with the hidden button) or the 2nd panel (now full screen)? Also, does this de-activate the 1st panel or activate the second? I am having this same problem. Sub Panel1_Touch(Action As Int, X As Float, Y As Float) As Boolean Return True End Sub
Kevin Well-Known Member Licensed User Longtime User May 2, 2012 #3 Code: Copy Sub Panel2_Click End Sub That is by design. The code above should prevent the clicks from going through. Upvote 0
Code: Copy Sub Panel2_Click End Sub That is by design. The code above should prevent the clicks from going through.
Ricky D Well-Known Member Licensed User Longtime User May 2, 2012 #4 in Android panels will pass through their touch events. What I do is make all other panels hidden as I move from one to another. This stops the bahaviour you're describing. regards, Ricky Upvote 0
in Android panels will pass through their touch events. What I do is make all other panels hidden as I move from one to another. This stops the bahaviour you're describing. regards, Ricky
W wheretheidivides Active Member Licensed User Longtime User May 2, 2012 #5 "Sub Panel2_Click End Sub" this did the trick, but it still makes a clinking sound as if i pressed the button Upvote 0
"Sub Panel2_Click End Sub" this did the trick, but it still makes a clinking sound as if i pressed the button
W wheretheidivides Active Member Licensed User Longtime User May 2, 2012 #6 Ricky D said: in Android panels will pass through their touch events. What I do is make all other panels hidden as I move from one to another. This stops the bahaviour you're describing. regards, Ricky Click to expand... hidden as in not enabled? so the code would be panel1.enabled=false??? Upvote 0
Ricky D said: in Android panels will pass through their touch events. What I do is make all other panels hidden as I move from one to another. This stops the bahaviour you're describing. regards, Ricky Click to expand... hidden as in not enabled? so the code would be panel1.enabled=false???
Ricky D Well-Known Member Licensed User Longtime User May 2, 2012 #7 You set the Visible property : Code: Copy Sub buttonClick(PanelNumber As Int) If PanelNumber=1 Then panel1.Visible = True panel2.Visible = False panel3.Visible = False Else If PanelNumber=2 Then panel1.Visible = False panel2.Visible = True panel3.Visible = False End If End Sub cheers, Ricky Upvote 0
You set the Visible property : Code: Copy Sub buttonClick(PanelNumber As Int) If PanelNumber=1 Then panel1.Visible = True panel2.Visible = False panel3.Visible = False Else If PanelNumber=2 Then panel1.Visible = False panel2.Visible = True panel3.Visible = False End If End Sub cheers, Ricky
W wheretheidivides Active Member Licensed User Longtime User May 2, 2012 #8 Ok, cool. so if a panel is not visible (false) the buttons will not work. So I just bring the new panel to the front, make it visible and make every other panel invisible (I guess I make them all invisible when the program is created.) Thanks Upvote 0
Ok, cool. so if a panel is not visible (false) the buttons will not work. So I just bring the new panel to the front, make it visible and make every other panel invisible (I guess I make them all invisible when the program is created.) Thanks
Ricky D Well-Known Member Licensed User Longtime User May 2, 2012 #9 I set all mine invisible then show whichever one I want using this technique. regards, Ricky Upvote 0
A Andras Active Member Licensed User Longtime User May 2, 2012 #10 Assuming you then want the upper panel to disappear when the user taps the 'back' button, you can trap that event to make the top panel invisible and the bottom one visible again - something like this: Code: Copy Sub Activity_KeyPress (KeyCode As Int) As Boolean If KeyCode = KeyCodes.KEYCODE_BACK Then If Panel2.Visible = True Then Panel2.Visible = False Panel1.Visible = True End If End If End Sub Very useful! John Upvote 0
Assuming you then want the upper panel to disappear when the user taps the 'back' button, you can trap that event to make the top panel invisible and the bottom one visible again - something like this: Code: Copy Sub Activity_KeyPress (KeyCode As Int) As Boolean If KeyCode = KeyCodes.KEYCODE_BACK Then If Panel2.Visible = True Then Panel2.Visible = False Panel1.Visible = True End If End If End Sub Very useful! John
Ricky D Well-Known Member Licensed User Longtime User May 2, 2012 #11 You would need to consume the keypress by Code: Copy Return True otherwise the activity would be closed. Cheers Ricky Upvote 0
You would need to consume the keypress by Code: Copy Return True otherwise the activity would be closed. Cheers Ricky