B4A Library DropList

Hello,
Here is a droplist. The attached files include an example and the droplist class source code. I hope someone finds it useful.

Barry.
 

Attachments

  • droplist.png
    droplist.png
    8.3 KB · Views: 859
  • droplist.zip
    10.1 KB · Views: 539

canalrun

Well-Known Member
Licensed User
Longtime User
Is there a difference between this and a spinner?
------
From the picture, it looks like they made it non-modal to operate like a Desktop machine. Looks cool, but the main reason for how the spinner shows the list is screen real estate and having to scroll the screen to show the list otherwise.

Yes, this is similar to a spinner. I believe a spinner is derived from an Android control. I developed this by combining panels, a label, an image, and a listview. A spinner shows the droplist centered on the screen. This shows the drop list beneath the control.

Yes, it is non-modal. It also will allow controls visible around the droplist to be clicked while the droplist is open. This last problem can be solved by creating a full-screen, transparent panel just behind the droplist control that captures any touch events outside of the droplist. You could also make a click on the transparent panel close the droplist similar to Windows.

Barry.
 

maleche

Active Member
Licensed User
Longtime User
How do you add more categories?

Vehicle Make (Category)
Ford (sub-category)
GMC
Dodge
Toyota

etc.
 

canalrun

Well-Known Member
Licensed User
Longtime User
How do you add more categories?

Vehicle Make (Category)
Ford (sub-category)
...

Hello,
It's been a year and a half since I uploaded the DropList –I have forgotten many of the details. It was written entirely in B4A code as a B4A class. The source is included in the included .bas module. The Spinner is actually a B4A/Android control versus my DropList which is written entirely using B4A. The spinner implements the look-and-feel of Android. The DropList is a UI element that looks more like a Windows control, but it offers some interesting flexibility options. The drop list cannot be added in the Designer. It has to be added from within your B4A code. See the included example.

Adding the capability for sub-categories is possible. I don't think I included that feature in the DropList, but it could be added. You would have to modify the source code to add that feature.

Barry.
 

John Woodsmall

Active Member
Licensed User
Longtime User
how can I tell which droplist is active (have 6 of them)?
is there a variable in the class that shows the droplist I have choosen?
 

John Woodsmall

Active Member
Licensed User
Longtime User
how do I set the droplist to show a previously selected value of the ones that are possible?
like if the year is 1942 you want to show is 1942, and you have 1900 thru 2024 in the list.
How you you show 1942 as selected?
 

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
It's been about a year and a half since I uploaded this, but I included the source code, so it can be modified to meet your needs.

As I look back in the droplist.bas file, it appears that I had intended the drop list to be reinitialized on each use.

I do have the selected position (selPos) variable. A subroutine to reopen and redraw a previously initialized drop list can be created. If selPos is greater than or equal to 0 the background of the selected item could be drawn in a different color indicating "selected" during the reopen.

I did not implement this functionality, but using the existing source you could easily add it.

Barry.
 
Top