When trying to find a woraround I embedded a ProgressBarGadget instead the use of a StatusBarProgress - but as soon the gadget will be resized a 3D border appears. So help is still needed - to fix the workaround
The code below draws the progressbar without 3D border until its size changes (code ResizeGadget...201...):
Code: Select all
; Define
#PB_DpiBits= 16
#PB_DpiScale= 1<<#PB_DpiBits
Global DpiScale=GetDeviceCaps_(GetDC_(0),#LOGPIXELSX)<<#PB_DpiBits/96; 12 Bit (statt Fließkommaberechnung)
#SB_SETBKCOLOR= $2001
#PBM_SETBARCOLOR= 1033
#PBM_SETBKCOLOR= 8193
Macro ScaleUp(value)
(((value)*DpiScale)/#PB_DpiScale)
EndMacro
Macro ScaleDown(value)
(((value)<<#PB_DpiBits)/DpiScale)
EndMacro
; EndDefine
Procedure StatusBarFieldWidth(StatusBar,Field.i,Width.l)
If IsStatusBar(StatusBar)
Protected StatusBarID=StatusBarID(StatusBar)
Protected nParts,lResult
Protected lLeftField.l
Protected *dwFields
nParts=SendMessage_(StatusBarID,#SB_GETPARTS,0,0)
*dwFields=AllocateMemory(nParts*4)
If *dwFields
SendMessage_(StatusBarID,#SB_GETPARTS,nParts,*dwFields)
If Field>0
lLeftField=PeekL(*dwFields+(Field-1)*4)
EndIf
PokeL(*dwFields+Field*4,lLeftField+ScaleUp(Width))
lResult=SendMessage_(StatusBarID,#SB_SETPARTS,nParts,*dwFields)
FreeMemory(*dwFields)
ProcedureReturn lResult
EndIf
ProcedureReturn #False
EndIf
EndProcedure
Procedure Main()
OpenWindow(0,0,0,600,200,"Progress Bar", #PB_Window_SystemMenu|#PB_Window_TitleBar|#PB_Window_ScreenCentered)
CreateStatusBar(0, WindowID(0))
AddStatusBarField(ScaleUp(20))
AddStatusBarField(ScaleUp(200))
AddStatusBarField(#PB_Ignore)
StatusBarText(0,0,"> >",#PB_StatusBar_BorderLess)
StatusBarText(0,1,"",#PB_StatusBar_BorderLess)
StatusBarText(0,2,"< < < < < < < < < <",#PB_StatusBar_BorderLess)
ProgressBarGadget(0,ScaleUp(20),4,ScaleUp(200),ScaleUp(16),0,100)
SetGadgetState(0,50)
SetParent_(GadgetID(0),StatusBarID(0))
SetWindowTheme_(GadgetID(0),#Null,"")
SendMessage_(GadgetID(0),#PBM_SETBARCOLOR,0,$0A0AAA)
SendMessage_(GadgetID(0),#PBM_SETBKCOLOR,0,$F8E7DC)
SetWindowTheme_(StatusBarID(0),#Null,"")
SendMessage_(StatusBarID(0),#SB_SETBKCOLOR,0,$EFD0BB)
AddWindowTimer(0,0,10)
p=0
Repeat
Select WaitWindowEvent()
Case #PB_Event_Timer
p+1
If p<100
SetGadgetState(0,p)
ElseIf p=100
ResizeGadget(0,#PB_Ignore,#PB_Ignore,ScaleUp(200),#PB_Ignore)
ElseIf p=110
StatusBarText(0,2,"< < ATTENTION < <",#PB_StatusBar_BorderLess)
ElseIf p=150
ResizeGadget(0,#PB_Ignore,#PB_Ignore,ScaleUp(201),#PB_Ignore)
ElseIf p=200
StatusBarText(0,2,"< 3D BORDER : (",#PB_StatusBar_BorderLess)
EndIf
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
EndProcedure
Main()
// Solved by chi - search for #WS_EX_STATICEDGE in this thread //

