If I create a new Custom View using Project > Add New Module > Class Module > Custom View
and give it the name of TMyView, it will generate the following code:
This is the default CustomView code that it creates. If I use the Designer and add TMyView to an activity and click on TMyView I see a lot of properties that are not defined in code and are probably for the base panel (I think). For example, there are "Text", TextStyle properties and Base Background properties. See the enclosed image.
1) How can I access these properties in code?
2) The TMyView Text shows up when I'm using the WYSIWYG Designer, but when the program is run the TMyView view displays no text. It has the Base Background colors, but no text. Why?
Can anyone clear this up?
TIA
and give it the name of TMyView, it will generate the following code:
B4X:
#Event: ExampleEvent (Value As Int)
#DesignerProperty: Key: BooleanExample, DisplayName: Boolean Example, FieldType: Boolean, DefaultValue: True, Description: Example of a boolean property.
#DesignerProperty: Key: IntExample, DisplayName: Int Example, FieldType: Int, DefaultValue: 10, MinRange: 0, MaxRange: 100, Description: Note that MinRange and MaxRange are optional.
#DesignerProperty: Key: StringWithListExample, DisplayName: String With List, FieldType: String, DefaultValue: Sunday, List: Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday
#DesignerProperty: Key: StringExample, DisplayName: String Example, FieldType: String, DefaultValue: Text
#DesignerProperty: Key: ColorExample, DisplayName: Color Example, FieldType: Color, DefaultValue: 0xFFCFDCDC, Description: You can use the built-in color picker to find the color values.
Sub Class_Globals
Private EventName As String 'ignore
Private CallBack As Object 'ignore
Private mBase As Panel
End Sub
Public Sub Initialize (vCallback As Object, vEventName As String)
EventName = vEventName
CallBack = vCallback
End Sub
Public Sub DesignerCreateView (Base As Panel, Lbl As Label, Props As Map)
mBase = Base
End Sub
Public Sub GetBase As Panel
Return mBase
End Sub
This is the default CustomView code that it creates. If I use the Designer and add TMyView to an activity and click on TMyView I see a lot of properties that are not defined in code and are probably for the base panel (I think). For example, there are "Text", TextStyle properties and Base Background properties. See the enclosed image.
1) How can I access these properties in code?
2) The TMyView Text shows up when I'm using the WYSIWYG Designer, but when the program is run the TMyView view displays no text. It has the Base Background colors, but no text. Why?
Can anyone clear this up?
TIA