I've tested it by replacing the ButtonImageGadget with a ButtonGadget in the three files below, and it seems to work pretty much as it should, except that I have to force the return result of the GetRequiredSize() function to be specified.
Instead of the #BS_ICON and #IMAGE_ICON constants, the #BS_BITMAP and #IMAGE_BITMAP constants should be used.
Code: Select all
ProcedureBrowser.pb
Issues.pb
CompilerOptions.pb
Code: Select all
CompilerIf #CompileWindows
Space = 3
Width = 28
Height = 28
CompilerElse
Space = 6 ; looks better on Linux/OSX with some more space
CompilerEndIf
The CompilerOptions.xml file also needs to modify "buttonimage" to "
button", which doesn't look good because it automatically changes the width of the
button to the width of the hidden string.
Code: Select all
<buttonimage id="#GADGET_Option_AddTarget" />
<buttonimage id="#GADGET_Option_CopyTarget" />
<buttonimage id="#GADGET_Option_EditTarget" />
<buttonimage id="#GADGET_Option_RemoveTarget" />
<buttonimage id="#GADGET_Option_TargetUp" />
<buttonimage id="#GADGET_Option_TargetDown" />
Anyway, for the reason mentioned above, the two files CompilerOptions.pb and CompilerOptions.xml are optional.
https://www.dropbox.com/scl/fi/1dexl9r4 ... 4oj0f&dl=0
Edit:
It would be better to use a 1x1 dummy
image, as shown below.
Code: Select all
If OpenWindow(0, 0, 0, 200, 60, "ButtonImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
If LoadImage(0, #PB_Compiler_Home + "examples/sources/Data/CDPlayer.ico")
hwnd = ButtonImageGadget(0, 10, 10, 180, 40, ImageID(0), #BS_BITMAP)
; set a dummy image.
CreateImage(1, 1, 1, 24, GetSysColor_(#COLOR_BTNFACE))
SendMessage_(hwnd, #BM_SETIMAGE, #IMAGE_BITMAP, ImageID(1))
SetGadgetText(0, "This text shows over the image :(")
EndIf
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
The files modified to use the trick above. Without the above files, only these 4 modified files are needed.
Code: Select all
Common.pb
CompilerOptions.pb
Issues.pb
ProcedureBrowser.pb
https://www.dropbox.com/scl/fi/2oykvkc8 ... qpehl&dl=0