Hi,
tested on Mac Intel PB 4.30b4. Following problems occured:
558 - constant not found #SG_BackgroundColor
730 - constant not found #SG_BackgroundImage
4381 - constant not found #SG_ListIcon_ChangeColumnWidth
5745 - constants not found #PB_FileSystem_ReadOnly and such
59xx - constant not founds #SG_BackgroundTransparent and such, following four lines
76xx - constants not found #SG_BackgroundTransparent and such
(xx occured because I removed some lines of code, as I thought the problem with
the constants would not occure again

)
Keyword EXTRN does not work. Put $0 into every missing constant, removed EXTRN from
Procedure.l ScreenWidth()
!EXTRN _PB_Screen_Width
!MOV Eax, [_PB_Screen_Width]
ProcedureReturn
EndProcedure
Procedure.l ScreenHeight()
!EXTRN _PB_Screen_Height
!MOV Eax, [_PB_Screen_Height]
ProcedureReturn
EndProcedure
Crashes a few seconds after start.
Best Regards,
JamiroKwai
Hurga wrote:
I needed some requester on a screen so I decided to add some window-functionality to my screen gadget lib.
These functions are new:
Code:
SG_OpenWindow(SG_WindowID_L.l, xPos_L.l, yPos_L.l, Width_L.l, Height_L.l, Title_S.s)
SG_CloseWindow(WindowNr_L.l)
SG_HideWindow(WindowNr_L.l, State_L.l)
SG_DisableWindow(WindowNr_L.l, Status_L.l)
SG_CreateGadgetList(SG_WindowID_L.l)
SG_SetActiveWindow(WindowNr_L.l) ; sets the currently active window
SG_IsWindow(SG_WindowID_L.l) ; returns 0, if the window does not exist, else a value <> 0 (= Window ID)
SG_GetWindowBackGround(WindowNr_L.l) ; returns the background of the window - 0 = no Background 1= Color 2 = image
SG_GetWindowBackgroundDetail(WindowNr_L.l) ; returns the Backround - Value (Color or imageID)
SG_SetWindowBackGround(WindowNr_L.l, State_L.l); change the background of the window - 0 = no Background 1= Color 2 = image
SG_SetWindowBackgroundDetail(WindowNr_L.l, Value_L.l) ; sets the ImageID of the background of the window
SG_SetWindowState(WindowNr_L.l, Status_L.l)
SG_SetWindowTitle(WindowNr_L.l, Title_S.s)
SG_ResizeWindow(WindowNr_L.l, xPos_L.l, yPos_L.l, Width_L.l, Height_L.l) ; set the window to a new position and and size
SG_StickyWindow(WindowNr_L.l, Status_L.l)
SG_WindowID(WindowNr_L.l)
SG_WindowHeight(WindowNr_L.l)
SG_WindowWidth(WindowNr_L.l)
SG_WindowMouseX(WindowNr_L.l)
SG_WindowMouseY(WindowNr_L.l)
SG_WindowX(WindowNr_L.l)
SG_WindowY(WindowNr_L.l)
SG_GetActiveWindow() ; return the currently active window
SG_GetWindowState(WindowNr_L.l)
Here is a little demo of the windows with some gadgets

and here you can find the source code and the compiled demo (87k zipped)
http://purebasic.stdojedmahr.de/projekte/ScreengadgetDemo.zipThe source is written for PB 4.2
If someone is using Linux, maybe (s)he can test the code under linux, if it runs. (I hope so, but have no change of testing it). Same with Mac.
I have use a rather old PC, so the fps (upper left corner) are more or less low. Can someone post his configuration and fps?
I got 52 fps with the demo.
If someone found any bugs, please report.