Aug 30, 2021 Replies: 6 This is my first attempt to create a library Please be kind This allows you to make a label with tiny indicator on left which can be turned on or off (with any choice of color) Usage instructions: - Download the ledlabel.jar & xml and put it in the B4X additional library folder - Add reference to LEDLabel - Add LEDLabel with the designer. Example and Library are attached. Request for source if you need. Have only checked for b4a. Uses xui library. Feedback welcome. Attachments LEDlabel_example.zip LEDlabel_example.zip 5.5 KB · Views: 633 LEDLabel_Lib.zip LEDLabel_Lib.zip 5 KB · Views: 651 Click to expand...
This is my first attempt to create a library Please be kind This allows you to make a label with tiny indicator on left which can be turned on or off (with any choice of color) Usage instructions: - Download the ledlabel.jar & xml and put it in the B4X additional library folder - Add reference to LEDLabel - Add LEDLabel with the designer. Example and Library are attached. Request for source if you need. Have only checked for b4a. Uses xui library. Feedback welcome.
epiCode Active Member Licensed User Sep 1, 2021 #2 Changelog Version 1.2 - code optimization to prevent crashes with "loadlayout" method - method gettext added - method "enabled" renamed to isTurnedON to avoid confusion with default item "enabled" - example updated with adding LEDLabels to xCustomListView with random thickness, roundness and turnedon state LEDLabel Author: M Mohsin Version: 1.2 LEDLabel Fields: mbase As anywheresoftware.b4a.objects.B4XViewWrapper tag As Object Methods: IsInitialized As boolean Tests whether the object has been initialized. gettext As String gettextsize As int initialize (ba As anywheresoftware.b4a.BA, Callback As Object, EventName As String) As String isturnedon As boolean setroundness (val As int) As String settext (txt As String) As String settextsize (txtsize As int) As String setthickness (thik As int) As String turnedon (NewValue As boolean) As String Properties: text As String textsize As int Attachments LEDlabel_examplev2.zip LEDlabel_examplev2.zip 6.2 KB · Views: 649 LEDLabelv1.2.zip LEDLabelv1.2.zip 4.9 KB · Views: 606
Changelog Version 1.2 - code optimization to prevent crashes with "loadlayout" method - method gettext added - method "enabled" renamed to isTurnedON to avoid confusion with default item "enabled" - example updated with adding LEDLabels to xCustomListView with random thickness, roundness and turnedon state LEDLabel Author: M Mohsin Version: 1.2 LEDLabel Fields: mbase As anywheresoftware.b4a.objects.B4XViewWrapper tag As Object Methods: IsInitialized As boolean Tests whether the object has been initialized. gettext As String gettextsize As int initialize (ba As anywheresoftware.b4a.BA, Callback As Object, EventName As String) As String isturnedon As boolean setroundness (val As int) As String settext (txt As String) As String settextsize (txtsize As int) As String setthickness (thik As int) As String turnedon (NewValue As boolean) As String Properties: text As String textsize As int
Magma Expert Licensed User Longtime User Sep 2, 2021 #3 IDEA: You can make it "blinking" - setting a Timer...
epiCode Active Member Licensed User Sep 2, 2021 #4 Magma said: IDEA: You can make it "blinking" - setting a Timer... Click to expand... It can be done from the main program easily B4X: 'Declare tmr as timer and initialize private Sub tmr_Tick LEDLabel4.TurnedON(Not(LEDLabel4.isTurnedON)) End Sub
Magma said: IDEA: You can make it "blinking" - setting a Timer... Click to expand... It can be done from the main program easily B4X: 'Declare tmr as timer and initialize private Sub tmr_Tick LEDLabel4.TurnedON(Not(LEDLabel4.isTurnedON)) End Sub
Gabino A. de la Gala Well-Known Member Licensed User Longtime User Sep 2, 2021 #5 IDEA: What about to can define a click event?. Could be used like a beatifull button or swicht...
Gabino A. de la Gala Well-Known Member Licensed User Longtime User Sep 2, 2021 #6 An example of "LEDSwicht": B4X: Private Sub clv_ItemClick (Index As Int, Value As Object) Dim l As LEDLabel l = clv.GetPanel(Index).GetView(0).tag l.TurnedON(Not(l.isTurnedON)) End Sub
An example of "LEDSwicht": B4X: Private Sub clv_ItemClick (Index As Int, Value As Object) Dim l As LEDLabel l = clv.GetPanel(Index).GetView(0).tag l.TurnedON(Not(l.isTurnedON)) End Sub
Gabino A. de la Gala Well-Known Member Licensed User Longtime User Sep 3, 2021 #7 Hello again. I have already achieved the desired effect by making the LEDLabel act as a Swicht, but much more beautiful and customizable. The only thing I have had to do is put it inside a panel and activate the click event of the panel and change the state of the LEDLabel each time that event occurs. Anyway, I think if you could put it directly on the LEDLabel it would make it much more versatile. Thank you for your work. Code: Private Sub Panel1_Click LEDLabel4.TurnedON(Not(LEDLabel4.isTurnedON)) End Sub
Hello again. I have already achieved the desired effect by making the LEDLabel act as a Swicht, but much more beautiful and customizable. The only thing I have had to do is put it inside a panel and activate the click event of the panel and change the state of the LEDLabel each time that event occurs. Anyway, I think if you could put it directly on the LEDLabel it would make it much more versatile. Thank you for your work. Code: Private Sub Panel1_Click LEDLabel4.TurnedON(Not(LEDLabel4.isTurnedON)) End Sub