B4A Library SD: MenuExtender

I created a new library that adds new menus that are not in my other libraries. (menu and PanelExtra)
The sources are written exclusively in B4A

ManagerPanel: This class has been transferred to the PanelExtra Library

Catalog: It has a series of articles with relative photos, name, code, description and price in grid format.
Clicking the article opens at full schemro to the card and you can buy it or go back.
Clicking the purchase button (the shopping cart) generates the Select event
ATTENTION: This library intercepts the back key to return

SD_MenuExtender

Author: Star-Dust
Version: 0.13
  • catalog
    • Events:
      • CustomizePanelDescription (PanelDescription As Panel, ID As String)
      • KeyBack
      • SearchBarEvent (Text As String)
      • Select (ID() As String, Code() As String)
    • Fields:
      • ColorSearchButton As Int
      • ContestSearch As String
        Constant
        • ContestSearchCode As String
        • ContestSearchDescription As String
        • ContestSearchEvent As String
        • ContestSearchName As String
      • CustomizePanelDescription As Boolean
      • KeyBackCloseDetails As Boolean
      • OpenDetail As Boolean
      • SearchBar As Boolean
      • ColorCatalog As Int
      • CustomPanelDescriptionHeight As Int
    • Functions:
      • Add (ID As String, Image As Bitmap, Name As String, Code As String, Description As String, Price As String) As String
      • Class_Globals As String
      • Clear As String
      • DesignerCreateView (Base As Panel, Lbl As Label, Props As Map) As String
      • GetBase As Panel
      • Initialize (Callback As Object, EventName As String) As String
      • Invalidate As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • ModeDips (Width As Int, Height As Int) As String
      • ModeRowCol (Col As Int, Row As Int) As String
      • ResizeCatalog As String
      • getName (ID As String) As String
      • getCode (ID As String) As String
      • getDescription (ID As String) As String
      • getPrice (ID As String) As String
      • setImage (ID As String, Image As Bitmap)
      • setName (ID As String,Name As String)
      • setCode (ID As String,Code As String)
      • setDescription (ID As String, Description As String)
      • setPrice (ID As String,Price As String)
      • sort (Field As String, Ascending As Boolean)
      • closePanelDetail
      • setButtonConfirm (Text As String,Font As Typeface, TextSize as int, TextColor As Int, Backgroundcolo As Int)
    • Properties:
      • ColorCatalog
      • CustomPanelDescriptionHeight
      • SearchBar As Boolean
      • TextButtonConfirm
demo1.gif
demo2.gif
screenshot.png
 

Attachments

  • sample1.zip
    407.6 KB · Views: 862
  • sample2.zip
    407.7 KB · Views: 833
  • sample3.zip
    409.2 KB · Views: 836
  • SD_MenuExtender 0.13.zip
    16.2 KB · Views: 827
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Really nice work....
can add images direct from a url ????
Thank you. I see if I can add it to the next update.

Clearly if I have to download from the Internet 10 (or even 100) images, it may require a substantial amount of time before the interface appears
 

scsjc

Well-Known Member
Licensed User
Longtime User
Thank you. I see if I can add it to the next update.

Clearly if I have to download from the Internet 10 (or even 100) images, it may require a substantial amount of time before the interface appears
Yes, of course... can do load image in a groups 20 o 30 and when move the scrollview, continue loading.... is only a idea ;)
i think really nice library ;)
 

Star-Dust

Expert
Licensed User
Longtime User
Update to version 0.12

setImage (ID As String, Image As Bitmap)

use:
B4X:
For I=1 To 18
    ' Not set Image - Null
    catalog1.Add(I,Null,"Element " & I, "Code: " & I ,"Description " & I,"€. " )
Next
 
'Set image after
For I=1 To 18
    catalog1.setImage(I, LoadBitmap(File.DirAssets,filename(I)))
Next

Download Image from internet:
B4X:
For I=1 To 18
    catalog1.Add(I,Null,"Element " & I, "Code: " & I ,"Description " & I,"€. " )
Next

For I=1 To 18
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download(Link(i))
    Wait For (j) JobDone(j As HttpJob)
 
    If j.Success Then
        catalog1.setImage(I, j.GetBitmap)
    End If
    j.Release
Next



Note: ManagerPanel has been transferred to the PanelExtra Library
 
Last edited:

Johan Hormaza

Well-Known Member
Licensed User
Longtime User
B4X:
    Dim files As List
    files = File.ListFiles(File.DirRootExternal & "/Fotos")
    If files.Size = 0 Then
        ToastMessageShow("No se ha encontrado imagenes " & CRLF & File.DirRootExternal    & "/Fotos", True)
    Else
        For i = 0 To files.Size - 1
            catalog1.Add(I,LoadBitmap(File.DirRootExternal & "/Fotos",files.Get(I)),"Nombre" & I,"€. " & Rnd(1,4) & "." & Rnd(10,99),"AAA","2.000")
        Next
    End If
This is the code that I use. The problem is that my computer is slow when loading the application, which could be the problem so that it does not behave so slowly?
Thanks and blessings!!!
 

Star-Dust

Expert
Licensed User
Longtime User
B4X:
    Dim files As List
    files = File.ListFiles(File.DirRootExternal & "/Fotos")
    If files.Size = 0 Then
        ToastMessageShow("No se ha encontrado imagenes " & CRLF & File.DirRootExternal    & "/Fotos", True)
    Else
        For i = 0 To files.Size - 1
            catalog1.Add(I,LoadBitmap(File.DirRootExternal & "/Fotos",files.Get(I)),"Nombre" & I,"€. " & Rnd(1,4) & "." & Rnd(10,99),"AAA","2.000")
        Next
    End If

Unfortunately it is not possible to speed it up, because this library is produced entirely in B4A and therefore is slower than those made entirely in Java.

More often it is designed to divide the various choices in the catalog.
In the first catalog should open photos and categories, clicking the category the catalog will be repopulated with the content of that category.

I do not know if it is suitable to use it for a ListFile, it is more suitable to create an App for the sale of products, similar to EBAY or to create a catalog of products of a company.
 

Star-Dust

Expert
Licensed User
Longtime User
If the photos are many it is better to use CustomListView, xCustomListView and UltimateListView. They are the fastest and most suitable for managing lots of data quickly.
If the images are less than 50, my Catalog can be fine and do not slow down.

Of course, an old device is slower ... A new device with my library is also fine with heavy DataBase.
 

Star-Dust

Expert
Licensed User
Longtime User
Version 0.13 released

Now allows multiple selection.
The examples have been updated, WARNING: The Select event now restores Array.

screenshot.png
 
Last edited:

BluSky76

Member
Licensed User
Longtime User
[CODICE = b4x] catalog1.Add (I, Null, "Element Name Product Line1" & I, "Code:" & I, "Description" & I, "€.") [/ CODE]

The written "Element Name Product Line 1" is not displayed correctly but is cut off. You can increase the height of the Element field

Thanks
 
Top