This repository was archived by the owner on Jul 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCFSquareFAB.bas
More file actions
87 lines (55 loc) · 1.54 KB
/
CFSquareFAB.bas
File metadata and controls
87 lines (55 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
B4J=true
Group=Cuppy Framework\Cuppy\Controls
ModulesStructureVersion=1
Type=Class
Version=5.51
@EndOfDesignText@
'Custom View class
#Region Internal Segment
Sub Class_Globals
Private fx As JFX
Private mEventName As String 'ignore
Private mCallBack As Object 'ignore
Private mBase As Pane
Public FAB_Btn As Label
End Sub
Public Sub Initialize (Callback As Object, EventName As String)
mEventName = EventName
mCallBack = Callback
End Sub
Public Sub DesignerCreateView (Base As Pane, Lbl As Label, Props As Map)
mBase = Base
mBase.LoadLayout("SquareFABLayout")
'set using theme...
SetBg(CFStyleManager.DefaultTheme.Get("accent"))
setRotationX(135) 'rotate by default
End Sub
Private Sub Base_Resize (Width As Double, Height As Double)
'maintain aspect ratio
FAB_Btn.PrefWidth = Width
FAB_Btn.PrefHeight = Width
End Sub
Public Sub GetBase As Pane
Return mBase
End Sub
#End Region
#Region Actions and Effects
Public Sub SetBg(color As String)
CSSUtils.SetStyleProperty( FAB_Btn, "-fx-background-color", color)
End Sub
Public Sub setRotationX(angle As Float)
CFControlsUtils.setRotationX(FAB_Btn, angle) 'rotate
End Sub
Public Sub setBorder(color As String , width As Int)
CFControlsUtils.setBorder(FAB_Btn, color, width)
End Sub
Public Sub setBorderRadius(radius As Int)
CFControlsUtils.setBorderRadius(FAB_Btn, radius)
End Sub
Public Sub setPaneEffect(effect As String)
CFControlsUtils.setEffect(FAB_Btn, effect)
End Sub
Public Sub removeEffects()
CFControlsUtils.removeEffect(FAB_Btn)
End Sub
#End Region