It sounds little silly perhaps, but with some tweaking, it;s possible to create your own customized window. The problem here is that when dragging/resizing using my own dragbar, the window will be repositioned at the top y ooord, or top y, left x coord.. (just run it, makes more sense :).. I've watched it so long, I just don't see it anymore :) anyone a suggestion?
-----------------------------------
APP=CreateWindow("app",0,0,640,480):MaximizeWindow APP
win=CreateWindow("win",160,32,384,256,APP,1)
windrag=CreateCanvas(0,ClientHeight(win)-32,ClientWidth(win),32,win)
SetGadgetLayout windrag,0,0,0,1
choice=CreateButton("[ ]=size [x]=drag",32,32,128,16,APP,2)
SetButtonState choice, 1
;dragbar
dragIMG=CreateImage(4,4):SetBuffer ImageBuffer(dragIMG)
Color 192,192,192:Rect 0,0,4,4,True
Color 240,240,240:Plot 1,1
Color 144,144,144:Plot 2,2
SetBuffer CanvasBuffer(windrag):ClsColor 192,64,16:Cls:TileBlock dragIMG:FlipCanvas windrag
Repeat
WaitEvent()
; drag ?
If EventSource()=windrag
If EventID()=$201 ; mouse down
If Not drag
oldx=EventX()
oldy=EventY()
drag=True
EndIf
EndIf
If EventID()=$202 ; mouse up
drag=False
EndIf
If drag
If EventID()=$203 ; mouse move
newx=EventX()
newy=EventY()
If ButtonState(choice)
SetGadgetShape win,GadgetX(win)+newx-oldx,GadgetY(win)+newy-oldy,GadgetWidth(win),GadgetHeight(win)
Else
SetGadgetShape win,GadgetX(win),GadgetY(win),GadgetWidth(win),GadgetHeight(win)+newy-oldy
EndIf
EndIf
EndIf
EndIf
If KeyHit(1) Exit
Forever
FreeImage dragIMG
FreeGadget windrag
FreeGadget app
End
-----------------------------------
-----------------------------------
APP=CreateWindow("app",0,0,640,480):MaximizeWindow APP
win=CreateWindow("win",160,32,384,256,APP,1)
windrag=CreateCanvas(0,ClientHeight(win)-32,ClientWidth(win),32,win)
SetGadgetLayout windrag,0,0,0,1
choice=CreateButton("[ ]=size [x]=drag",32,32,128,16,APP,2)
SetButtonState choice, 1
;dragbar
dragIMG=CreateImage(4,4):SetBuffer ImageBuffer(dragIMG)
Color 192,192,192:Rect 0,0,4,4,True
Color 240,240,240:Plot 1,1
Color 144,144,144:Plot 2,2
SetBuffer CanvasBuffer(windrag):ClsColor 192,64,16:Cls:TileBlock dragIMG:FlipCanvas windrag
Repeat
WaitEvent()
; drag ?
If EventSource()=windrag
If EventID()=$201 ; mouse down
If Not drag
oldx=EventX()
oldy=EventY()
drag=True
EndIf
EndIf
If EventID()=$202 ; mouse up
drag=False
EndIf
If drag
If EventID()=$203 ; mouse move
newx=EventX()
newy=EventY()
If ButtonState(choice)
SetGadgetShape win,GadgetX(win)+newx-oldx,GadgetY(win)+newy-oldy,GadgetWidth(win),GadgetHeight(win)
Else
SetGadgetShape win,GadgetX(win),GadgetY(win),GadgetWidth(win),GadgetHeight(win)+newy-oldy
EndIf
EndIf
EndIf
EndIf
If KeyHit(1) Exit
Forever
FreeImage dragIMG
FreeGadget windrag
FreeGadget app
End
-----------------------------------