This requires BlueGui, and Although Not fully completed, this is a working demo of a custom titlebar which i've just made for the Forums.
startBlue "",""
Global Desktop As Integer
Dim TITLEBAR(4,1) As Integer
Set Window on : Set Window Layout 0,0,0
TITLEBAR(4,0) = CreateGadgetFromWindow(MainWindow())
DESKTOP = CreateGadgetFromWindow(DesktopWindow())
CreateWindowFrame(200,200,"ThemesMac",DESKTOP)
` Add some stuff
Make object cube 1,10
Do : GetEvent
UpdateWindowFrame()
Sync : Loop
Function CreateWindowFrame(x,y,Skin$,p)
TITLEBAR(0,0) = CreateWindow(0,0,10,10,"",WINDOW_NOBORDER,0,1,p) : TITLEBAR(0,1) = CreatePanel(0,0,10,10,TITLEBAR(0,0)) : SetGadgetShape TITLEBAR(0,0),Skin$+"TITLEBAR_IMAGE_1.BMP" : SetPanelImage TITLEBAR(0,1),Skin$+"TITLEBAR_IMAGE_1.BMP"
TITLEBAR(1,0) = CreateWindow(0,0,10,10,"",WINDOW_NOBORDER,0,1,p) : TITLEBAR(1,1) = CreatePanel(0,0,10,10,TITLEBAR(1,0)) : SetPanelImage TITLEBAR(1,1),Skin$+"TITLEBAR_IMAGE_2.BMP"
TITLEBAR(2,0) = CreateWindow(0,0,10,10,"",WINDOW_NOBORDER,0,1,p) : TITLEBAR(2,1) = CreatePanel(0,0,10,10,TITLEBAR(2,0)) : SetGadgetShape TITLEBAR(2,0),Skin$+"TITLEBAR_IMAGE_3.BMP" : SetPanelImage TITLEBAR(2,1),Skin$+"TITLEBAR_IMAGE_3.BMP"
TITLEBAR(3,0) = CreateWindow(0,0,10,10,"",WINDOW_NOBORDER,0,1,p) : TITLEBAR(3,1) = CreatePanel(0,0,10,10,TITLEBAR(3,0)) : SetPanelImage TITLEBAR(3,1),Skin$+"TITLEBAR_IMAGE_4.BMP"
ResizeGadget TITLEBAR(0,0),GadgetWidth(TITLEBAR(0,1)),GadgetHeight(TITLEBAR(0,1))
ResizeGadget TITLEBAR(1,0),GadgetWidth(TITLEBAR(4,0))-GadgetWidth(TITLEBAR(0,1))-GadgetWidth(TITLEBAR(2,1)),GadgetHeight(TITLEBAR(1,1))
ResizeGadget TITLEBAR(2,0),GadgetWidth(TITLEBAR(2,1)),GadgetHeight(TITLEBAR(2,1))
ResizeGadget TITLEBAR(3,0),GadgetWidth(TITLEBAR(4,0)),GadgetHeight(TITLEBAR(3,1))
PositionWindowFrame(x,y)
BringToFront TITLEBAR(0,0)
BringToFront TITLEBAR(1,0)
BringToFront TITLEBAR(2,0)
BringToFront TITLEBAR(3,0)
BringToFront TITLEBAR(4,0)
EndFunction
Function UpdateWindowFrame()
` Bring To Front
If EventSource() = TITLEBAR(0,1) Or EventSource() = TITLEBAR(1,1) Or EventSource() = TITLEBAR(2,1) Or EventSource() = TITLEBAR(3,1) or EventSource() = TITLEBAR(4,0)
If EventType() = MOUSE_CLICK Then BringToFront TITLEBAR(0,0) : BringToFront TITLEBAR(1,0) : BringToFront TITLEBAR(2,0) : BringToFront TITLEBAR(3,0) : BringToFront TITLEBAR(4,0)
EndIf
` Moving Window
If EventSource() = TITLEBAR(1,1) And EventType() = MOUSE_CLICK
x = MousePosX(Desktop) - GadgetX(TITLEBAR(0,0))
y = MousePosY(Desktop) - GadgetY(TITLEBAR(1,0))
Repeat : GetEvent
PositionWindowFrame(MousePosX(Desktop)-x,MousePosY(Desktop)-y)
Until EventType() = MOUSE_CLICK
EndIf
` Closing Window
If EventSource() = TITLEBAR(2,1) And EventType() = MOUSE_CLICK Then SafeEnd()
EndFunction 0
Function PositionWindowFrame(x,y)
If x = GadgetX(TITLEBAR(0,0)) and y = GadgetY(TITLEBAR(0,0)) Then ExitFunction
PositionGadget TITLEBAR(0,0),x,y
PositionGadget TITLEBAR(1,0),x+GadgetWidth(TITLEBAR(0,0)),y
PositionGadget TITLEBAR(2,0),x+GadgetWidth(TITLEBAR(0,0))+GadgetWidth(TITLEBAR(1,0)),y
PositionGadget TITLEBAR(3,0),x,y+GadgetHeight(TITLEBAR(0,0))
PositionGadget TITLEBAR(4,0),x,y+GadgetHeight(TITLEBAR(0,0))+GadgetHeight(TITLEBAR(3,0))
EndFunction
Function SafeEnd()
End
EndFunction
In order to use this code you will need a theme, i've attached a mac one which you can download below with an exe example, There is also a ScreenShot Below.
The titlebar is made up of 8 gadget, and you can also set alpha to these which is useful for a fading Titlebar when mouse is not over
...DOWNLOAD HERE...
Everyone Be Cool, You, Be Cool.