I am trying to set up a custom dialog box 2, but the instructions are vague. I set up a layout and am trying to use the layout in the CD2
I get this error at the point it loads the custom dialog 2 (not when the main layout is loaded):
"Warning: Panel.LoadLayout called with zero sized panel."
===============================
Also, I am trying to load and unload variables. The 3 lables are supposed to be loaded and display variables. They don't. I think it is how I'm trying to do to do this. They show "-" in the picture which is the default and not the variable. The variables do have info in them.
I have never understood initialize. I thought things were inited when the layout is loaded, but if I do not init, it gives and error. I have no ideal of what goes inside the ().
You can see in picture that it doesn't even set the radio buttons. none are set when the popup occurs.
This is probably a simple solution. Thanks in advance.
===============================
I get this error at the point it loads the custom dialog 2 (not when the main layout is loaded):
"Warning: Panel.LoadLayout called with zero sized panel."
===============================
Also, I am trying to load and unload variables. The 3 lables are supposed to be loaded and display variables. They don't. I think it is how I'm trying to do to do this. They show "-" in the picture which is the default and not the variable. The variables do have info in them.
I have never understood initialize. I thought things were inited when the layout is loaded, but if I do not init, it gives and error. I have no ideal of what goes inside the ().
You can see in picture that it doesn't even set the radio buttons. none are set when the popup occurs.
This is probably a simple solution. Thanks in advance.
===============================
B4X:
'-----------------------------------------
Dim CustPanel1 As Panel
Dim CD1Time, CD1Table, CD1Type As Label
Dim CD1ETTime, CD1ETTable As EditText
Dim CD1TypeC, CD1TypeT, CD1Type1, CD1TypeX As RadioButton
'---------------------------------
CustPanel1.Initialize(1)
CD1Time.Initialize(1)
CD1Table.Initialize(1)
CD1Type.Initialize(1)
CD1ETTime.Initialize(1)
CD1ETTable.Initialize(1)
CD1TypeC.Initialize(1)
CD1TypeT.Initialize(1)
CD1Type1.Initialize(1)
CD1TypeX.Initialize(1)
DoEvents
'----------------------------------
Cd2.AddView(CustPanel1, 320, 300) 'width, height
'-------------------------------------
CustPanel1.LoadLayout("layoutcd1.bal")
'-------------------------------------
CD1Time.Text = ST1200amA
CD1Table.Text = ST1200amB
CD1Type.Text = ST1200amC
Log("---------------------------------")
Log("Time: " & CD1Time.Text & "-" & ST1200amA)
Log("Table: " & CD1Table.Text & "-" & ST1200amB)
Log("Type: " & CD1Type.Text & "-" & ST1200amC)
Log("---------------------------------")
'----------------------------------------
If ST1200amC = "Cash" Then
CD1TypeC.Checked = True
CD1TypeT.Checked = False
CD1Type1.Checked = False
CD1TypeX.Checked = False
Else If ST1200amC = "Tourn" Then
CD1TypeC.Checked = False
CD1TypeT.Checked = True
CD1Type1.Checked = False
CD1TypeX.Checked = False
Else If ST1200amC = "Sit/Go" Then
CD1TypeC.Checked = False
CD1TypeT.Checked = False
CD1Type1.Checked = True
CD1TypeX.Checked = False
Else If ST1200amC = "Free" Then
CD1TypeC.Checked = False
CD1TypeT.Checked = False
CD1Type1.Checked = False
CD1TypeX.Checked = True
Else
'default in case the text is not right
CD1TypeC.Checked = True
CD1TypeT.Checked = False
CD1Type1.Checked = False
CD1TypeX.Checked = False
End If
'----------------------------------
RetModify = Cd2.Show("Changes all 3 fields:" & CRLF & "Time, Table & Type.", "Change", "Cancel", "", Bmp_Chips15)
-
Attachments
Last edited: