I have a view. Buttons panels etc on it.
I want to hit a button, display listview, user select. (all standard fair).
However, I am looking for a better approach then what I am doing now.
When the listview is displayed, it don't cover up what's on the current form view.
So, say I have this:
So, in above, the button is clicked - display a listview.
And when I display the listview, I get this:
So, those buttons are being mean to me! - I give them all care and love!
So, I figure, ok, put the listview in a panel, load the listview, display the panel, let user select, and then hide the panel.
This seems to be a "bit more" code and work then it should be. (my spider sense suggests I writing too much code).
For some reason some of the panels/buttions show on top.
So, I created the panel with designer, but not the listview. (did not seem worth it to add it)
(probably should adopt and assume I'll create both in code in the future.).
The code snip I have is this:
Now, I expect over time (as get better with B4A) to use and have quite a few "selects" on a typical view with several
buttons that have the design pattern of:
Hit a button - select a value, hide the listview.
So two issues:
Am I writing too much code here to display/hide of the panel for a listview?
(a better approach is welcome).
How to ensure that buttons etc. on the view don't show though or on top of the panel?
(can/should I dump the panel idea?)
I can live with the amount of code and effort to deal with a panel to display the listview, but I'll need to solve the buttons and "other" things displaying on the view when they should simple appear behind the panel.
I can struggle forward here and start adding code to hide the buttons - , but my spider sense suggests I need to adopt a better approach then just "code" my way through this and whack everything with a big hammer.
So I'm am hitting some walls here with things and objects on that view not being covered when I turn on that panel.
Ideal would be:
ListView.OnTopOfEverything = true
(rather not need a panel at all here)
Ideas?
Any better way to hide and not show the cute lovable buttons that are fighting me in a nasty way today?
Regards,
Albert D. Kallal
Edmonton, Alberta Canada
I want to hit a button, display listview, user select. (all standard fair).
However, I am looking for a better approach then what I am doing now.
When the listview is displayed, it don't cover up what's on the current form view.
So, say I have this:
So, in above, the button is clicked - display a listview.
And when I display the listview, I get this:
So, those buttons are being mean to me! - I give them all care and love!
So, I figure, ok, put the listview in a panel, load the listview, display the panel, let user select, and then hide the panel.
This seems to be a "bit more" code and work then it should be. (my spider sense suggests I writing too much code).
For some reason some of the panels/buttions show on top.
So, I created the panel with designer, but not the listview. (did not seem worth it to add it)
(probably should adopt and assume I'll create both in code in the future.).
The code snip I have is this:
B4X:
Sub cmdSelTable_Click
' assume valid connection
' query database for all tables
Dim strSQL As String = "SELECT TABLE_NAME FROM " & txtDatabase.Text & ".INFORMATION_SCHEMA.TABLES " & _
"WHERE TABLE_TYPE = 'BASE TABLE'"
Dim rst As JdbcResultSet
ProgressBar1.Visible = True
ListView1.Initialize("ListView1")
ListView1.Clear
ListView1.Top = 0%x
'ListView1.Height = 100%x
ListView1.Width = 100%y
ListView1.SingleLineLayout.ItemHeight = 40dip
Try
Dim sf As Object = Main.mysql.ExecQueryAsync("mysqlWAIT", strSQL ,Null)
Wait For (sf) mysqlWAIT_QueryComplete(Success As Boolean, rst As JdbcResultSet)
If Success Then
Dim MyRowCount As Int = 0
ListView1.AddSingleLine("Select Table Name")
Dim s As String = ""
Do While rst.NextRow
MyRowCount = MyRowCount + 1
s = rst.GetString(rst.GetColumnName(0))
ListView1.AddSingleLine2(s,s)
'Sleep(0) ' comment out if table sizes are to be small (< 200 reocrds)
Loop
rst.Close
pnlListView1.Top = 0%y
pnlListView1.Height = 100%y
pnlListView1.Width = 100%x
pnlListView1.Visible = True
pnlListView1.AddView(ListView1,0,0,100%x, 100%y)
End If
Catch
Success = False
Log(LastException)
End Try
ProgressBar1.Visible = False
End Sub
Now, I expect over time (as get better with B4A) to use and have quite a few "selects" on a typical view with several
buttons that have the design pattern of:
Hit a button - select a value, hide the listview.
So two issues:
Am I writing too much code here to display/hide of the panel for a listview?
(a better approach is welcome).
How to ensure that buttons etc. on the view don't show though or on top of the panel?
(can/should I dump the panel idea?)
I can live with the amount of code and effort to deal with a panel to display the listview, but I'll need to solve the buttons and "other" things displaying on the view when they should simple appear behind the panel.
I can struggle forward here and start adding code to hide the buttons - , but my spider sense suggests I need to adopt a better approach then just "code" my way through this and whack everything with a big hammer.
So I'm am hitting some walls here with things and objects on that view not being covered when I turn on that panel.
Ideal would be:
ListView.OnTopOfEverything = true
(rather not need a panel at all here)
Ideas?
Any better way to hide and not show the cute lovable buttons that are fighting me in a nasty way today?
Regards,
Albert D. Kallal
Edmonton, Alberta Canada
Last edited: