Android Question How to perform a Show event

Discussion in 'Android Questions' started by imgsimonebiliato, Jun 10, 2015.

  1. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    Hello,
    I'm writing a class module on which I want to display a dialog.
    I saw about "CustomDialog" and others types and I wish to know how to create the event "Show" of the panel that I create in the class module.
    Please, an example code?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You will not be able to create a modal dialog without writing a library. However not all dialogs should be modal. See AnotherDatePicker for an example.
     
  3. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    So, right now I use a CustomDialog.
    I've got this problem. If I add a button on a panel and then I call this event

    Code:
    o.AddView(p, 0%x15%x100%x85%y)
    The button_click event on the panel p, isn't performed.
    Why?
     
  4. DonManfred

    DonManfred Expert Licensed User

    Dont know; my glas sphere is defect.

    With the code you posted NOBODY can give an congrete answer.
    What is o? what p? how did you initialize the button? how is you button click event sub signature looking?
     
    RandomCoder likes this.
  5. imgsimonebiliato

    imgsimonebiliato Well-Known Member Licensed User

    Sorry.
    Here you are:


    Code:
    Sub Globals
    Public edNum1, edNum2 As EditText
    Dim cb As CheckBox
    Public p As Panel
    Public btAgg1, btAgg2 As Button
    Public btSot1, btSot2 As Button
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    Dim o As CustomDialog

    p.Initialize(
    "p")
    btAgg1.Initialize(
    "btAgg1") : p.AddView ( btAgg1, 0%x0%y50%x7.0%y) : btAgg1.Text = "+"
    btAgg2.Initialize(
    "btAgg2") : p.AddView ( btAgg2, 50%x0%y50%x7.0%y) : btAgg2.Text = "+"

    edNum1.Initialize(
    "edNum1") : p.AddView ( edNum1,  0%x9.4%y50%x15.6%y) : edNum1.Text = "0"
    edNum2.Initialize(
    "edNum2") : p.AddView ( edNum2, 50%x9.4%y50%x15.6%y) : edNum2.Text = "0"

    btSot1.Initialize(
    "btSot1") : p.AddView ( btSot1,  0%x27.2%y50%x7.0%y) : btSot1.Text = "-"
    btSot2.Initialize(
    "btSot2") : p.AddView ( btSot2, 50%x27.2%y50%x7.0%y) : btSot2.Text = "-"

    cb.Initialize(
    "cb") : p.AddView( cb, 1.4%x36.7%y100%x7.0%y) : cb.Checked = False

    o.AddView(p, 
    0%x15%x100%x85%y)
    o.Show(
    "fsfd""yes""""no"Null)
    End Sub

    Sub btAgg1_click
    Dim n As Int
    n = edNum1.Text
    If n = 9 Then n = -1
    n = n + 
    1
    edNum1.Text = n
    End Sub
     
Loading...