Code: Select all
Frame3DGadget(#Gadget, x, y, width, hight, "", #PB_Frame3D_Flat)
Is it possible to change the color?
hth
Code: Select all
Frame3DGadget(#Gadget, x, y, width, hight, "", #PB_Frame3D_Flat)
Code: Select all
; netmaestro: http://www.purebasic.fr/english/viewtopic.php?p=173362#p173362
Global TextBackground = CreateSolidBrush_(GetSysColor_(#COLOR_BTNFACE))
Global TextForeground = #Red
Procedure WinProc(hWnd, Msg, wParam, lParam)
result = #PB_ProcessPureBasicEvents
If Msg = #WM_CTLCOLORSTATIC And lParam = GadgetID(0)
SetBkMode_(wParam, #TRANSPARENT)
SetTextColor_(wParam, TextForeground)
result = TextBackGround
EndIf
ProcedureReturn result
EndProcedure
OpenWindow(0, 0, 0, 250, 100, "Colored Frame3D", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
SetWindowCallback(@WinProc())
Frame3DGadget(0, 10, 10, 230, 80, "This is a Frame3D")
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
DeleteObject_(TextForeground)
DeleteObject_(TextBackground)
Draw it yourself? It is more flexible.hth wrote:Thanks,
but not the text, but the border line should be of a different colour.
Code: Select all
Procedure MyFrame3DGadget(window, gadget, x, y, width, height, text$, frontcolor=0, backcolor=0, shadow=$FFFFFF)
background = GetSysColor_(#COLOR_BTNFACE);GetWindowColor(window))
container = ContainerGadget(gadget,x,y,width,height)
img = CreateImage(#PB_Any,width,height)
If img And StartDrawing(ImageOutput(img))
Box(0,0,width,height,background)
DrawingMode(#PB_2DDrawing_Outlined)
RoundBox(6,6,width-12,height-12,3,3,shadow)
RoundBox(5,5,width-10,height-10,3,3,backcolor)
DrawingFont(GetGadgetFont(#PB_Default))
DrawText(10,0," "+text$+" ",frontcolor, background)
StopDrawing()
DisableGadget(ImageGadget(#PB_Any,0,0,width,height,ImageID(img)),1)
EndIf
ProcedureReturn container
EndProcedure
OpenWindow(0, 0, 0, 250, 100, "Colored Frame3D", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
MyFrame3DGadget(0, 0, 10, 10, 230, 80, "This is a Frame3D",RGB($00,$00,$FF),RGB($FF,$00,$00))
ButtonGadget(1,10,20,100,20,"Button")
CloseGadgetList()
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow : Break
Case #PB_Event_Gadget : If EventGadget()=1 : MessageRequester("Info","Button pressed") : EndIf
EndSelect
ForEver