The small(and unimportant) bug with "Parent" not showing up is still there.
It happens if you copy the code from my post, and paste it in a new file in WinFBE. If you then go to line 52, and type "This." (without any indentation), then "Parent" will show in the list, but if you type "p" then the list will show no matching words. If you first do the same, but add one or more tabs before "This." then "Parent" will work as expected(and keep working even if you delete the text and type "This." without a tab).
Quote from: ji_vildaasen on May 12, 2020, 06:38:00 PM
This code misses the "w" in "FBImageBox_Parent" when showing autocomplete with "This.Parent." at line 53. I did try to replicate the the error with some test code, but could not replicate it. So there is something with this code that triggers it =)
Also if I type "This." on line 52, the autocompletet list will show "Parent" in the list, but if type "p" then the autocomplete list wont find any matches in the list..
I'm using Tabs, not spaces for indentation.
Type FBImageBox_Options
V_Centered as Boolean
H_Centered as Boolean
end type
type FBImageBox_Parent
hWindow as HWND
w as Long
h as Long
Declare Sub Update()
end type
Type FBImageBox
Options as FBImageBox_Options
Parent as FBImageBox_Parent
x as Long
y as Long
w as long
h as Long
Scale as Long = 1
Border as long = 0
Border_Col as ulong = 0
Buffer as FB.Image Ptr
TempBuffer as FB.Image Ptr
MaxW as Long = 1000
MaxH as Long = 1000
Declare sub Draw()
Declare sUB Update()
Declare Destructor()
end type
'____________________________________________________________________________________________________________________________________
Sub FBImageBox.Update()
This.Parent.Update
Parent.Update()
This.Parent
If Options.V_Centered then
end if
This.Draw()
end sub
'____________________________________________________________________________________________________________________________________
Sub FBImageBox.Draw()
PrintMSG "FBImageBox.Draw()"
if Buffer = 0 then exit sub
If TempBuffer = 0 Then TempBuffer = ImageCreate(MaxW, MaxH, 0, 32)
Put TempBuffer, (0, 0), Buffer, Pset
Dim As BITMAPV4HEADER bmi
With BMI
.bV4Size = Len(BITMAPV4HEADER)
.bv4width = TempBuffer->Pitch / 4
.bv4height = -(TempBuffer->Height)
.bv4planes = 1
.bv4bitcount = 32
.bv4v4compression = 0
.bv4sizeimage = ((TempBuffer->Pitch / 4) * TempBuffer->Height) * 4
.bV4RedMask = &h0f00
.bV4GreenMask = &h00f0
.bV4BlueMask = &h000f
.bV4AlphaMask = &hf000
End With
Var hdc = GetDC(Parent.hWindow)
StretchDIBits(hDC, x, y, Buffer->Width, Buffer->Height, 0, 0, Buffer->Width, Buffer->Height, CPtr(Any Ptr, TempBuffer) + SizeOf(FB.Image), CPtr( BITMAPINFO Ptr, @BMI), DIB_RGB_COLORS, SRCCOPY )
DeleteDC(hdc)
end sub
'____________________________________________________________________________________________________________________________________
Destructor FBImageBox()
PrintMSG "FBImageBox.Destructor()"
If Buffer <> 0 then ImageDestroy(Buffer)
Buffer = 0
If TempBuffer <> 0 then ImageDestroy(TempBuffer)
TempBuffer = 0
end destructor
'____________________________________________________________________________________________________________________________________
Sub FBImageBox_Parent.Update()
w = AfxGetWindowClientWidth( hWindow )
h = AfxGetWindowClientHeight( hWindow )
PrintMSG "FBImageBox_Parent.Update() : w = " & w & ", h = " & h
end sub