big OK button in msgbox

Georg

Member
Licensed User
Longtime User
How to realize a big ok button in a messagebox "cMsgboxOK" so that it can be pressed with the finger?
 
Is there some sort of panel that can be made smaller? Maybe a quarter of the pocket pc screen. I have several used for such an animal
 

Ariel_Z

Active Member
Licensed User
Try this (note that I use form1.text for dubug only):

B4X:
Sub Globals
   'Declare the global variables here.
   jump = -10
End Sub

Sub App_Start
   AddForm("Form1", "Form1")
   AddPanel("Form1", "Panel1", 0, Form1.Height, Form1.Width, 100)
   AddTimer("Timer1")
   panel1.color = cRed
   AddButton("Form1", "B2", 0, 0, 50, 50)
   form1.text = panel1.top
   timer1.interval = 10
   AddButton("Panel1", "B1", 90, 20, 50, 50)
   Form1.Show
   
End Sub

Sub Timer1_Tick
   panel1.top = panel1.top + jump
   form1.text = panel1.top

   If panel1.top + panel1.height <= form1.height Then
      panel1.top = form1.height - panel1.height
      timer1.enabled = False
   End If
End Sub

Sub b2_Click
   timer1.enabled = True
End Sub
Sub B1_Click

   AppClose
End Sub
 

Georg

Member
Licensed User
Longtime User
how to realize that the app waits on a click on the ok button in the panel like it works at msgbox?
 

Cableguy

Expert
Licensed User
Longtime User
As long as the customized panel in the top-most z-order, the app will wait for the button click, as long as there is no other loops or for-next going on...
 

Ariel_Z

Active Member
Licensed User
Z-order is the order in which controls (visible or invisible) controls on the form are sorted.
Use textbox1.sentToBack to send a control (textbox1 in this case) to be the last one. This means if anything else is at the same place it will be drawn on top of this textbox. Use control.BringToFront for the opposite action. The last one you place is the last on the z order. So, "last on the z-order" means - totaly visible, on top of others. If your panel (like in the sample code above) is the last one and is visible, the user can click the button. Note that the program does not necessarily wait, this depends on what you do after you show the panel. But if it's there you can click it.
 

Georg

Member
Licensed User
Longtime User
Ariel - I used this code. But it doesn't work like I wont. I need a wait after calling the OK panel, because there a some commands behind calling the panelok the sub.

p.E.

sub test
....
....
panelok
.... ' here the app should wait
....
form1.show
end sub
 
Last edited:

klaus

Expert
Licensed User
Longtime User
Hi Georg,

The way I see is to have either:
- a full screen size panel with the OK button
- a panel that covers all parts of the screen where the user can do something, in order that the only thing he can do is to press the OK button when the OK Panel is displayed.

Attached a small example.
B1 opens a panel that covers all Buttons and the TextBox
B2 opens a full screnn panel
B3, B4, B5 are just other buttons

Best regards.
 
Last edited:

RandomCoder

Well-Known Member
Licensed User
Longtime User
Can I just ask if you intend to use the program on the device or is it intended as a desktop only application?

I'm thinking along the lines that you could you Agrahams FormEXDesktop library and a child form which if being shown you program for all other subroutines to ignore click and key presses events etc.

Just an idea.

Regards,
RandomCoder
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
Attached is a very quick example of what I had in mind (and fortunately you don't need to add any conditional statements to check if the form is being shown as it automatically takes priority).
This is applies only to the desktop though!

Regards,
RandomCoder
 

agraham

Expert
Licensed User
Longtime User
But the Modal mode is not supported on the device.
I tried it but I removed it as it caused several problems, including the app hanging, if the user used a Task Manager to switch to another task and then back. I think that MessageBox, which is modal, on the device is cleverer than it looks and does some things deep in the system to avoid these hangs and to draw itself. For example it's not obvious how it draws the wireframe when it moves, I tried to emulate that but cannot see a way to do it at the moment :(.
 
Top