1. Flat toolbar bug and fix
Hi Derek,
I have discovered another bug, It doesn't appear on Win98 and above, It
only
appears on win95 OS. According to Microsoft Documentation, it says you
have
to set the button size, and image size before creating a toolbar
button.
The sight of a Flattoolbar on win95 is disastrous using win32lib. Here
is a fix.
global function MAKELONG( integer lo, integer hi)-- clib.e Chris Bensler
return hi*#10000 + lo
end function
atom ILx,ILy
--<SNIP> Win32lib code in createEX
VOID = sendMessage( id, TB_SETTOOLTIPS, 0, getHandle(
tooltipControl ) )
-- Set image lists for the 3 states
VOID = sendMessage( id, TB_SETIMAGELIST, 0,
getHandle(himlFTBDefault) )
VOID = sendMessage( id, TB_SETHOTIMAGELIST, 0,
getHandle(himlFTBHot) )
VOID = sendMessage( id, TB_SETDISABLEDIMAGELIST, 0
,getHandle(himlFTBDisabled) )
-- <End Win32lib>
-- Start Code:
ILx = w32Func(xGetSystemMetrics,{SM_CXICON})
ILy = w32Func(xGetSystemMetrics,{SM_CYICON})
if sendMessage(toolbar_id,TB_SETBUTTONSIZE,0,MAKELONG(ILx,ILy))=NULL
then
warnErr("TB_SETBUTTONSIZE failed")
end if
if sendMessage(toolbar_id,TB_SETBITMAPSIZE,0,MAKELONG(ILx,ILy))=NULL
then
warnErr("TB_SETBUTTONSIZE failed")
end if
-- End Code:
Cheers,
Jordah Ferguson
aka Sir LoJik