; **************************************************************************** ; * By PBFrance : http://www.pbfrance.com/?url=source&cmd=viewer&val=72 ; **************************************************************************** Procedure MyFrame3DGadget(gadget, x, y, width, height, text$, frontcolor=0, backcolor=0, shadow=$FFFFFF) Protected.i Background, container, img If StartDrawing(WindowOutput(GetActiveWindow())) Background = Point(0,0) StopDrawing() EndIf If gadget = #PB_Any container = ContainerGadget(#PB_Any,x,y,width,height) Else container = ContainerGadget(Gadget,x,y,width,height) EndIf 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, "Exemple de Frame", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered) MyFrame3DGadget(#PB_Any, 10, 10, 230, 80, "Exemple d'un Frame personnalisé",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