@@ -10,7 +10,7 @@ Dim win_Launcher
10
10
Dim win_Other As Integer
11
11
12
12
win_Img_Image = LoadImage (" images/image.jpg" , 32 )
13
- SetAlpha 200 , , win_Img_Image
13
+ ' SetAlpha 250 , , win_Img_Image
14
14
15
15
temp = __template_Win
16
16
temp.IH = NewImage (temp.W, temp.H, 32 )
71
71
If (w (win ).NeedsRefresh <> 0 ) Or (w (win_Launcher ).Z = 0 ) Then
72
72
resizeWin win
73
73
Dest w (win ).IH
74
- Line (0 , 0 )-Step (100 , 16 ), RGBA32 ( 64 , 64 , 64 , 200 ) , BF
75
- Line (0 , 20 )-Step (100 , 16 ), RGBA32 ( 64 , 64 , 64 , 200 ) , BF
76
- Line (0 , 40 )-Step (100 , 16 ), RGBA32 ( 64 , 64 , 64 , 200 ) , BF
77
- Line (0 , 60 )-Step (100 , 16 ), RGBA32 ( 64 , 64 , 64 , 200 ) , BF
74
+ Line (0 , 0 )-Step (100 , 16 ), & H404040C8 , BF
75
+ Line (0 , 20 )-Step (100 , 16 ), & H404040C8 , BF
76
+ Line (0 , 40 )-Step (100 , 16 ), & H404040C8 , BF
77
+ Line (0 , 60 )-Step (100 , 16 ), & H404040C8 , BF
78
78
If win_Log Then PrintString (2 , 2 ), " Close log" Else PrintString (2 , 2 ), " Open log"
79
79
If win_Cat Then PrintString (2 , 22 ), " Close text editor" Else PrintString (2 , 22 ), " Open text editor"
80
80
If win_Img Then PrintString (2 , 42 ), " Close image" Else PrintString (2 , 42 ), " Open image"
81
81
If win_Other Then PrintString (2 , 62 ), " Close debug" Else PrintString (2 , 62 ), " Open debug"
82
82
End If
83
+
83
84
If w (win_Launcher ).Z = 0 Then
84
- If MouseButton ( 1 ) And ((w (win ).MX < 100 ) And (w (win ).MX > 0 )) Then
85
+ If ((w (win ).MX < 100 ) And (w (win ).MX > 0 )) Then
85
86
w (win ).NeedsRefresh = True
86
87
Select Case w (win ).MY
87
88
Case 0 TO 16
88
- If win_Log Then
89
- freeWin win_Log
90
- win_Log = 0
89
+ If MouseButton (1 ) Then
90
+ If win_Log Then
91
+ freeWin win_Log
92
+ win_Log = 0
93
+ Else
94
+ temp = __template_Win
95
+ temp.X = 50
96
+ temp.IH = NewImage (320 , 240 , 32 )
97
+ temp.T = " Log"
98
+ temp.FH = __font_Mono
99
+ win_Log = newWin (temp )
100
+ End If
91
101
Else
92
- temp = __template_Win
93
- temp.X = 50
94
- temp.IH = NewImage (320 , 240 , 32 )
95
- temp.T = " Log"
96
- temp.FH = __font_Mono
97
- win_Log = newWin (temp )
102
+ Line (0 , 0 )-(100 , 16 ), &H66666666 , BF
98
103
End If
99
104
100
105
Case 20 TO 36
101
- If win_Cat Then
102
- freeWin win_Cat
103
- win_Cat = 0
106
+ If MouseButton (1 ) Then
107
+ If win_Cat Then
108
+ freeWin win_Cat
109
+ win_Cat = 0
110
+ Else
111
+ temp = __template_Win
112
+ temp.X = 200
113
+ temp.IH = NewImage (320 , 240 , 32 )
114
+ temp.T = " Text editor"
115
+ temp.FH = __font_Sans
116
+ win_Cat = newWin (temp )
117
+ End If
104
118
Else
105
- temp = __template_Win
106
- temp.X = 200
107
- temp.IH = NewImage (320 , 240 , 32 )
108
- temp.T = " Text editor"
109
- temp.FH = __font_Sans
110
- win_Cat = newWin (temp )
119
+ Line (0 , 20 )-(100 , 36 ), &H66666666 , BF
111
120
End If
112
121
113
122
Case 40 TO 56
114
- If win_Img Then
115
- freeWin win_Img
116
- win_Img = 0
123
+ If MouseButton (1 ) Then
124
+ If win_Img Then
125
+ freeWin win_Img
126
+ win_Img = 0
127
+ Else
128
+ temp = __template_Win
129
+ temp.IH = NewImage (temp.W, temp.H, 32 )
130
+ temp.T = " Image"
131
+ win_Img = newWin (temp )
132
+ End If
117
133
Else
118
- temp = __template_Win
119
- temp.IH = NewImage (temp.W, temp.H, 32 )
120
- temp.T = " Image"
121
- win_Img = newWin (temp )
134
+ Line (0 , 40 )-(100 , 56 ), &H66666666 , BF
122
135
End If
123
136
124
137
Case 60 TO 76
125
- If win_Other Then
126
- freeWin win_Other
127
- win_Other = 0
138
+ If MouseButton (1 ) Then
139
+ If win_Other Then
140
+ freeWin win_Other
141
+ win_Other = 0
142
+ Else
143
+ temp = __template_Win
144
+ temp.IH = NewImage (temp.W, temp.H, 32 )
145
+ temp.FH = __font_Mono
146
+ win_Other = newWin (temp )
147
+ End If
128
148
Else
129
- temp = __template_Win
130
- temp.IH = NewImage (temp.W, temp.H, 32 )
131
- temp.FH = __font_Mono
132
- win_Other = newWin (temp )
149
+ Line (0 , 60 )-(100 , 76 ), &H66666666 , BF
133
150
End If
134
151
End Select
135
152
End If
148
165
149
166
' Window title
150
167
w (win ).T = " Window " + LTrim $(Str $(win )) + " (" + LTrim $(Str $(w (win ).X )) + " ," + LTrim $(Str $(w (win ).Y )) + " )-(" + LTrim $(Str $(w (win ).W + w (win ).X )) + " ," + LTrim $(Str $(w (win ).H + w (win ).Y )) + " )"
168
+
151
169
End Select
152
170
Next
153
171
upd
@@ -227,7 +245,7 @@ $Checking:On
227
245
$Checking :Off
228
246
$If LIGHT = TRUE Then
229
247
Sub putWin (w As winType )
230
- Shared __param_TBHeight As Unsigned Integer
248
+ Shared __param_TBHeight As Unsigned byte
231
249
232
250
If w.IH = 0 Then Exit Sub ' Make sure the handle isn't invalid to prevent Illegal Function Call errors!
233
251
_DontBlend
@@ -243,7 +261,7 @@ $If LIGHT = TRUE Then
243
261
End Sub
244
262
$Else
245
263
Sub putWin (w As winType )
246
- Shared __param_TBHeight As Unsigned Integer
264
+ Shared __param_TBHeight As Unsigned Byte
247
265
248
266
' For speed
249
267
Rem RGBA32(0, 0, 0, 10) = &H0A000000
@@ -267,19 +285,26 @@ $Else
267
285
268
286
If w.Z Then Line (w.X, w.Y )-Step (w.W + 2 , w.H + __param_TBHeight + 1 ), &H40000000 , BF ' Dark overlay if not focused
269
287
End Sub
288
+
289
+ Sub putOverlay (w As winType )
290
+ Shared __param_TBHeight As Unsigned Byte
291
+ Line (w.X, w.Y )-Step (w.W, w.H ), &HFF000000 , B
292
+ PutImage (w.X + 1 , w.Y + 1 ), w.IH
293
+ End Sub
270
294
$End If
271
295
$Checking :On
272
296
273
297
274
298
$Checking :Off
275
- Sub upd Static
299
+ Sub upd
276
300
Shared w () As winType
277
301
Shared winZOrder () As Byte
278
302
Shared __image_Background As Long
279
303
Shared __image_Screen As Long
280
304
Shared __image_ScreenBuffer As Long
281
305
Shared __image_Cursor As Long
282
306
Shared __param_ScreenFont As Long
307
+ ' Shared __inKey$
283
308
284
309
__inKey$ = InKey $
285
310
@@ -325,7 +350,7 @@ Sub upd Static
325
350
Dim i As Integer
326
351
For i = UBound (winZOrder ) To LBound (winZOrder ) Step -1
327
352
If winZOrder (i ) <> 0 Then
328
- putWin w (winZOrder (i ))
353
+ If w ( winZOrder ( i )). T = " " Then putOverlay w ( winZOrder ( i )) Else putWin w (winZOrder (i ))
329
354
End If
330
355
Next
331
356
@@ -373,11 +398,13 @@ End Function
373
398
374
399
375
400
' $Checking:Off
376
- Sub logP (s As String ) Static
401
+ Sub logP (s As String )
377
402
Shared w () As winType
378
403
Shared win_Log As Integer
379
404
380
- Dim i As Long , l As String
405
+ Static l As String
406
+
407
+ Dim i As Long
381
408
i = Dest
382
409
383
410
If s <> " " Then l = l + s + " " + Chr $(13 ) + " "
@@ -394,8 +421,8 @@ End Sub
394
421
395
422
396
423
397
- Function fps% Static
398
- Dim t As Double
424
+ Function fps%
425
+ Static t As Double
399
426
Dim t2 As Double
400
427
401
428
t2 = Timer (0.0001 )
@@ -419,26 +446,29 @@ End Sub
419
446
420
447
421
448
$Checking :Off
422
- Sub updateMouse Static
449
+ Sub updateMouse
423
450
Shared w () As winType
424
451
Shared winZOrder () As Byte
425
- Shared __param_TBHeight As Unsigned Integer
452
+ Shared __param_TBHeight As Unsigned Byte
426
453
427
454
428
- Dim optMenu As Integer , optWin As Integer
429
- Dim mLockX As Single , mLockY As Single ' Or as I like to call it, mmmlocks and mmmlockie
430
- Dim mouseLatch As Bit
455
+ Static optMenu As Integer , optWin As Integer
456
+ Static mLockX As Single , mLockY As Single ' Or as I like to call it, mmmlocks and mmmlockie
457
+ Static mouseLatch As Bit
431
458
432
459
Dim win As Integer , i As Integer
433
460
For win = LBound (winZOrder ) To UBound (winZOrder )
434
461
i = winZOrder (win )
435
462
436
463
If i = 0 Then Continue
437
464
438
- w (i ).MX = MouseX - (w (i ).X + 1 )
439
- w (i ).MY = MouseY - (w (i ).Y + __param_TBHeight + 1 )
440
-
441
- If w (i ).T = " " Then Continue
465
+ If w (i ).T = " " Then
466
+ w (i ).MX = MouseX - (w (i ).X + 1 )
467
+ w (i ).MY = MouseY - (w (i ).Y + 1 )
468
+ Else
469
+ w (i ).MX = MouseX - (w (i ).X + 1 )
470
+ w (i ).MY = MouseY - (w (i ).Y + __param_TBHeight + 1 )
471
+ End If
442
472
443
473
If mouseIsOver (i ) Then
444
474
@@ -493,10 +523,15 @@ Sub updateMouse Static
493
523
ElseIf MouseButton (2 ) Then ' Resize (Right click)
494
524
w (__focusedWindow ).W = w (__focusedWindow ).W + (MouseX - mLockX )
495
525
w (__focusedWindow ).H = w (__focusedWindow ).H + (MouseY - mLockY )
496
-
497
- ElseIf (w (__focusedWindow ).W <> _Width (w (__focusedWindow ).IH )) Or (w (__focusedWindow ).H <> _Height (w (__focusedWindow ).IH )) Then
498
- w (__focusedWindow ).NeedsRefresh = True
499
- Else
526
+ $If LIGHT = FALSE Then
527
+ w (__focusedWindow ).NeedsRefresh = True
528
+ $End If
529
+
530
+ $If LIGHT = TRUE Then
531
+ ElseIf (w (__focusedWindow ).W <> _Width (w (__focusedWindow ).IH )) Or (w (__focusedWindow ).H <> _Height (w (__focusedWindow ).IH )) Then
532
+ w (__focusedWindow ).NeedsRefresh = True
533
+ $End If
534
+ ' Else
500
535
' w(__focusedWindow).NeedsRefresh = False
501
536
502
537
End If : End If
0 commit comments