Android Question Study : How to code the custom view

Olaan

Expert
Licensed User
Longtime User
Hi all,
I have problem about creating the custom view. I've tried to add some code in the expert's code for learning
,but I can't make it completely.

Code: Copy
'Study
#DesignerProperty: Key: Enabled, DisplayName: Enabled,FieldType: Boolean,DefaultValue:True,Description: Enabled the progressBar
#DesignerProperty: Key: Visibled, DisplayName:Visibled,FieldType: Boolean,DefaultValue:True,Description: Visibled the progressBar
Code: Copy
Public Sub SetEnabled(myenabled As Boolean)  'Theera's code for study
    Enabled =myenabled
    mBase.Enabled=Enabled
End Sub

Public Sub SetVisibled(myvisibled As Boolean) 'Theera's code for study
    Visibled=myvisibled
    mBase.Visibled=Visibled
End Sub
 
Solution
B4X: Copy
    Private m_Enabled As Boolean = True
    Private m_Visible As Boolean = True
B4X: Copy
Public Sub setEnabled(Enabled As Boolean)  'Theera's code for study
    m_Enabled = Enabled
    mBase.Enabled=Enabled
End Sub

Public Sub setVisible(Visible As Boolean) 'Theera's code for study
    m_Visible = Visible
    mBase.Visible=Visible
End Sub

B4X: Copy
    sel.Enabled = False
    sel.Visible = False
the properties enable and visible are booleans, so the expect either True or False
 
Upvote 0
the properties enable and visible are booleans, so the expect either True or False
the lastest, the compiler told me. I never declare enabled and visibled,there are not members . I think I'm lost myself how to code these properties.
I tried to copy the same code,how to do,but it isn't worked.
 
Upvote 0
B4X: Copy
    Private m_Enabled As Boolean = True
    Private m_Visible As Boolean = True
B4X: Copy
Public Sub setEnabled(Enabled As Boolean)  'Theera's code for study
    m_Enabled = Enabled
    mBase.Enabled=Enabled
End Sub

Public Sub setVisible(Visible As Boolean) 'Theera's code for study
    m_Visible = Visible
    mBase.Visible=Visible
End Sub

B4X: Copy
    sel.Enabled = False
    sel.Visible = False
 
Upvote 0
Solution
I think this code has something be wrong.
Code: Copy
'Study
#DesignerProperty: Key: Enabled, DisplayName: Enabled,FieldType: Boolean,DefaultValue:True,Description: Enabled the progressBar
#DesignerProperty: Key: Visible, DisplayName:Visible,FieldType: Boolean,DefaultValue:True,Description: Visible the progressBar
 
Last edited:
Upvote 0
Upvote 0
After to compile b4xlib file. It's error message.
Undeclared variable 'enabled' is used before it was assigned any value.
How do I do? ,Sir
 
Upvote 0
Due to the AmirMK82's b4xlib, I have to ask him permit me before, Could I send you privately?
 
Upvote 0
if it is a paid library or the license is restricted, you should not send it to me privately. Ask the developer of the original library for help.
Thank you for guiding to me.I try be careful.
 
Upvote 0
Back
Top