It is currently Sat May 25, 2013 11:04 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: New version of the screen gadget lib
PostPosted: Fri Nov 14, 2008 4:04 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Jul 17, 2003 2:53 pm
Posts: 148
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
Image


and here you can find the source code and the compiled demo (87k zipped)
http://purebasic.stdojedmahr.de/projekte/ScreengadgetDemo.zip

The 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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 15, 2008 7:13 pm 
Offline
User
User
User avatar

Joined: Wed Jan 16, 2008 11:28 am
Posts: 80
Location: china
thanks~~@_@


Top
 Profile  
 
 Post subject: Re: New version of the screen gadget lib
PostPosted: Sun Nov 16, 2008 12:14 am 
Offline
Enthusiast
Enthusiast

Joined: Tue May 20, 2008 2:12 am
Posts: 643
Location: Cologne, Germany
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
Image


and here you can find the source code and the compiled demo (87k zipped)
http://purebasic.stdojedmahr.de/projekte/ScreengadgetDemo.zip

The 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.

_________________
Regards,
JamiroKwai

---
5.10-x64/x86 - MacBook Pro, Mountain Lion
My Blog (German): http://www.quadworks.de


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 16, 2008 10:24 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Jul 17, 2003 2:53 pm
Posts: 148
Thx jamirokwai for testing it on mac.

The constants was my fault. I forgot the redident-file. I will add it on monday.

But I dont have any idea why "Extern" does not work? Is a "feature" with PB - Mac?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 16, 2008 11:51 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 2704
What is the advantage of a window manager that can't leave the window? Maybe for games.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 9:10 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Jul 17, 2003 2:53 pm
Posts: 148
Quote:
What is the advantage of a window manager that can't leave the window? Maybe for games.


Sorry, I didnt understand what you mean. Can you explain a bit more?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 1:35 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4004
Location: Spa, relaxing and thinking, and thinking...
Mistrel wrote:
What is the advantage of a window manager that can't leave the window? Maybe for games.
I would say not exactly for games, but for editors, filerequesters without having to close full screen, and in general any windows-like management needed some times in permanent fullscreens.

It is useful to me, thanks!
Waiting for those constants :wink:

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


for (humanlife=0 ; world==business ; humanlife++)
{
mafia+=world;
}


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2008 7:54 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Jul 17, 2003 2:53 pm
Posts: 148
@Psychophanta
Thx

I uploaded the File again, now with the resident file.
Hope that it will work now


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2008 1:49 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4004
Location: Spa, relaxing and thinking, and thinking...
Yes, it works. Many thanks!

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


for (humanlife=0 ; world==business ; humanlife++)
{
mafia+=world;
}


Top
 Profile  
 
 Post subject: Re: New version of the screen gadget lib
PostPosted: Wed Mar 28, 2012 8:01 pm 
Offline
User
User

Joined: Thu Apr 30, 2009 5:23 pm
Posts: 11
very usefull job !!
Does anyone else use that kind of program for full screen and would like to share ?


Top
 Profile  
 
 Post subject: Re:
PostPosted: Thu Mar 29, 2012 4:32 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1284
Location: Waterloo, WI - USA
Psychophanta wrote:
Mistrel wrote:
What is the advantage of a window manager that can't leave the window? Maybe for games.
I would say not exactly for games, but for editors, filerequesters without having to close full screen, and in general any windows-like management needed some times in permanent fullscreens.

It is useful to me, thanks!
Waiting for those constants :wink:


When I watch video files in MPC in full-screen I can load a click-menu / file requester that looks like standard Winforms stuff without leaving fullscreen?

Is that a fake fullscreen or something?

_________________
Image


Top
 Profile  
 
 Post subject: Re: New version of the screen gadget lib
PostPosted: Thu Mar 29, 2012 6:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 711
Location: Germany, Glienicke
yes.
WindowedScreen with maximizes and borderless window:

Code:
InitSprite()

Enumeration
   #Window
   #MenuItem
   #MenuItem2
EndEnumeration

ExamineDesktops()
OpenWindow(#Window, 0, 0, DesktopWidth(0), DesktopHeight(0), "ScreenTitle", #PB_Window_BorderLess|#PB_Window_Maximize)
OpenWindowedScreen(WindowID(#Window), 0, 0, WindowWidth(#Window), WindowHeight(#Window), 0, 0, 0)

AddKeyboardShortcut(#Window, #PB_Shortcut_Escape, #MenuItem)

Repeat
   
   Repeat
      
      Select WindowEvent()
         Case #PB_Event_CloseWindow
            End
         Case #PB_Event_Menu
            Select EventMenu()
               Case #MenuItem
                  End
            EndSelect
         Case #Null
            Break
      EndSelect
      
   ForEver
   
   ClearScreen(0)
   
   FlipBuffers()
   
ForEver

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye