forked from BryanLunduke/Linux-Tycoon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conBase.rbfrm
100 lines (82 loc) · 2.12 KB
/
conBase.rbfrm
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
88
89
90
91
92
93
94
95
96
97
98
99
#tag Window
Begin ContainerControl conBase
AcceptFocus = ""
AcceptTabs = True
AutoDeactivate = True
BackColor = 16777215
Backdrop = ""
Enabled = True
EraseBackground = True
HasBackColor = False
Height = 211
HelpTag = ""
InitialParent = ""
Left = 32
LockBottom = ""
LockLeft = ""
LockRight = ""
LockTop = ""
TabIndex = 0
TabPanelIndex = 0
TabStop = True
Top = 32
UseFocusRing = ""
Visible = True
Width = 146
End
#tag EndWindow
#tag WindowCode
#tag Event
Function MouseDown(X As Integer, Y As Integer) As Boolean
OriginX = x
OriginY = y
Return true
End Function
#tag EndEvent
#tag Event
Sub MouseDrag(X As Integer, Y As Integer)
self.left = self.left + (x - OriginX)
self.top = self.top + (y - OriginY)
End Sub
#tag EndEvent
#tag Event
Sub Open()
PrefBackgroundColor = rgb(255,255,255)
PrefBorderColor = rgb(0,0,128)
ReDrawBG
End Sub
#tag EndEvent
#tag Event
Sub Paint(g As Graphics, areas() As REALbasic.Rect)
'g.DrawPicture mybg,0,0
End Sub
#tag EndEvent
#tag Method, Flags = &h0
Sub ReDrawBG()
// Draw BG
myBG = new Picture(me.Width, me.Height, 32)
myBG.Graphics.ForeColor = PrefBackgroundColor
myBG.Graphics.FillRect(0,0,me.Width, me.Height)
// Draw Border
dim tW as Integer
dim tH as integer
tw = myBG.Width
th = myBG.Height
myBG.Graphics.ForeColor = PrefBorderColor
myBG.Graphics.FillRect (0,0,myBG.Width, 1)
myBG.Graphics.FillRect (0,myBG.Height -1,myBG.Width, 1)
myBG.Graphics.FillRect (0,0,1, myBG.Height - 1)
myBG.Graphics.FillRect (myBG.Width -1,0,myBG.Width -1, myBG.Height -1)
me.Backdrop = myBG
End Sub
#tag EndMethod
#tag Property, Flags = &h0
myBG As Picture
#tag EndProperty
#tag Property, Flags = &h0
OriginX As Integer
#tag EndProperty
#tag Property, Flags = &h0
OriginY As Integer
#tag EndProperty
#tag EndWindowCode