InfoSkin1.0 - OpenSource Theme Engine for PB4

Developed or developing a new product in PureBasic? Tell the world about it.
Coolman
Enthusiast
Enthusiast
Posts: 103
Joined: Sat Sep 03, 2005 4:07 pm

Post by Coolman »

Inf0Byt3 wrote:Thanks for the file, Coolman. I've restored the download link on the first page.
8), Thank you has you for your excellent work...
*** Excuse my bad English, I uses has translating program ***
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4326
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Inf0byt3 does a lot of really good work!

I use his installer for my FREE Restaurant POS (Currently the #1 Free POS in the world!) :D
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Post by Thunder93 »

Hi,

I'm trying Inf0Byt3 - InfoSkin with PureBasic 4.30 beta 5, by the way, InfoSkin nicely done!

Using it on the x86 version, it works perfectly, but using it on the x64 version, it fails to show everything and has no mouseover and mousedown support.

From the InfoSkin Example.pb, 'My Gadget 1' and 'I like InfoSkin' and the working Progressbar appears and with the transparent window but that's all.

Hopefully it's not much troubles to be adjusted for x64.


Regards,
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Post by Thunder93 »

I hope Inf0Byt3 doesn't mind, I made some adjustments to make it x64 compatible..

InfoSkin.pbi changes;

Code: Select all

Procedure InfoSkinOpenWindow(WindowID,x,y,ImgID,Title.s,Flags,Parent)

 w = ImageWidth(ImgID)
 h = ImageHeight(ImgID)

 If Parent <> -1
  hWnd = OpenWindow(0, x, y, w, h, title,#PB_Window_BorderLess|#PB_Window_Invisible|Flags,Parent)
 Else
  hWnd = OpenWindow(0, x, y, w, h, title,#PB_Window_BorderLess|#PB_Window_Invisible|Flags)
 EndIf
 
 hBrush = CreatePatternBrush_(ImageID(ImgID))

 SetClassLongPtr_(WindowID(WindowID), #GCL_HBRBACKGROUND, hBrush)
;SetClassLong_(WindowID(WindowID), #GCL_HBRBACKGROUND, hBrush)

 InvalidateRect_(WindowID(WindowID), 0, #True)
 
 HideWindow(WindowID,0)
 ProcedureReturn hWnd

EndProcedure
and

Code: Select all

Structure myPOINT
  x.i
  y.i
EndStructure

Procedure InfoSkinEvent()

 Shared OnTop,Checked,Selected,Clicked
 
 GetCursorPos_(mousepos.myPOINT)
;GetCursorPos_(mousepos.POINT)
 
 ForEach InfoSkinGadgets() 
  
  GetWindowRect_(InfoSkinGadgets()\handle,position.RECT)

   If PtInRect_(position,mousepos\x,mousepos\y) And GetForegroundWindow_()=InfoSkinGadgets()\hwnd
    If Clicked = 0
     If InfoSkinGadgets()\type = 0 ;Button
      SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[1])
      OnTop = 1
     ElseIf InfoSkinGadgets()\type = 1
      If Checked = 0
       SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[1])
      ElseIf Checked = 1
       SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[3])
      EndIf
      OnTop = 1
     EndIf
    EndIf
  
    If GetAsyncKeyState_(#VK_LBUTTON) & $8000
;If GetAsyncKeyState_(#VK_LBUTTON) = -32767
     If OnTop = 1
      If InfoSkinGadgets()\type = 0 ;Button
       SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[2])
      ElseIf InfoSkinGadgets()\type = 1 ;CheckBox
       If Checked = 0
        SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[5])
       ElseIf Checked = 1
        SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[5])
       EndIf
      EndIf
      If Selected = 0
       If InfoSkinGadgets()\type = 0 ;Button
        SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[2])
       ElseIf InfoSkinGadgets()\type = 1 ;CheckBox
        If Checked = 0
         SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[5])
         Checked = 1
        ElseIf Checked = 1
         SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[5])
         Checked = 0
        EndIf
       EndIf
      Else
       Selected = 0
      EndIf
      Clicked = 1
     EndIf
    Else
     Clicked = 0
    EndIf
    
   Else
    If InfoSkinGadgets()\type = 0 ;Button
     SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[0])
    ElseIf InfoSkinGadgets()\type = 1 ;CheckBox
     If Checked = 1
      SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[4])
     Else
      SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[0])
     EndIf
    EndIf
   EndIf
 Next   
 
EndProcedure
KIKI
Enthusiast
Enthusiast
Posts: 145
Joined: Thu Dec 28, 2006 11:49 am
Location: FRANCE

Post by KIKI »

My computer Wibdows XP Pro Pack 3 French version and PB 4.30 version 5
When i launch your example (example.pb) I have a crash line 53
"The procedure specified in '@ProcedureName()' does not have the required argument or returntype"

Can you help me please because i want to use your program.
thanks
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

I hope Inf0Byt3 doesn't mind, I made some adjustments to make it x64 compatible..
That's great, thanks. I don't have a 64 bit OS installed that's why I couldn't update the code.

@Kiki:

Replace this:

Code: Select all

Procedure threaddie() ;Thread to control progressbar!
With this:

Code: Select all

Procedure threaddie(Param) ;Thread to control progressbar!
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Post by Thunder93 »

It would be awesome to have InfoSkin adjusted for use of InfoSkinCheckbox .. multiple times. :wink:
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Post by Thunder93 »

Once again .. I couldn't resist! I have modified Inf0Byt3 InfoSkin some more, .. only because InfoSkin has potential. :)

I modified it to permit the use of InfoSkinCheckbox multiple times, though small mod but still well needed.

.. If Inf0Byt3 hadn't released InfoSkin, our contributes wouldn't be possible, so thank Inf0Byt3.


Changes only in InfoSkin.pbi file;

Code: Select all

Procedure InfoSkinInit()
 Structure InfoGadget
  id.l
  type.l
  width.l
  height.l
  handle.l
  hwnd.l
  state.l
  progressbar_internal_images.l[3]
  progressbar_internal_values.l[3]
  progressbar_maximum.l
  skin.l[6]
  Checked.l
 EndStructure
 
 Global NewList InfoSkinGadgets.InfoGadget()
 
 Shared OnTop,Selected,Clicked
 
 ProcedureReturn 1 
EndProcedure




Procedure InfoSkinCheckbox(ID,hWnd,X,Y,ImageID,StateImageID,BackImageID)

 w = ImageWidth(ImageID)/3
 h = ImageHeight(ImageID)
 
 
 AddElement(InfoSkinGadgets())
 InfoSkinGadgets()\id = ID
 InfoSkinGadgets()\type = 1 ;Checkbox
 InfoSkinGadgets()\hwnd = hWnd
 
 InfoSkinGadgets()\Checked = 0
 
 InfoSkinGadgets()\Skin[0] = GrabImage(ImageID,#PB_Any,0,0,w,h)
 InfoSkinGadgets()\Skin[1] = GrabImage(ImageID,#PB_Any,w,0,w,h)
 InfoSkinGadgets()\Skin[2] = GrabImage(ImageID,#PB_Any,w*2,0,w,h)
 InfoSkinGadgets()\Skin[3] = GrabImage(StateImageID,#PB_Any,0,0,w,h)
 InfoSkinGadgets()\Skin[4] = GrabImage(StateImageID,#PB_Any,w,0,w,h)
 InfoSkinGadgets()\Skin[5] = GrabImage(StateImageID,#PB_Any,w*2,0,w,h) 

 StartDrawing(ImageOutput(BackImageID))
  oldcol = Point(x,y)
 StopDrawing()

 For draw = 0 To 5
  img = CreateImage(#PB_Any,w,h)
  DC = StartDrawing(ImageOutput(img))
  Box(0,0,w,h, oldcol)
  DrawTransparentImage(DC, ImageID(InfoSkinGadgets()\Skin[draw]), 0, 0, w, h, #Green)
  StopDrawing() 
  InfoSkinGadgets()\Skin[draw] = ImageID(img)
 Next
 
 InfoSkinGadgets()\handle=CreateWindowEx_(0,"STATIC","",1409286158,x,y,100,100,hWnd,0,0,0) 
 SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[0])

EndProcedure





Procedure InfoSkinEvent()
 Shared OnTop,Selected,Clicked 
 GetCursorPos_(mousepos.myPOINT)

 ForEach InfoSkinGadgets()  
  GetWindowRect_(InfoSkinGadgets()\handle,position.RECT)  

   If PtInRect_(position,mousepos\x,mousepos\y) And GetForegroundWindow_()=InfoSkinGadgets()\hwnd
    If Clicked = 0
     If InfoSkinGadgets()\type = 0 ;Button
      SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[1])
      OnTop = 1
     ElseIf InfoSkinGadgets()\type = 1
      If InfoSkinGadgets()\Checked = 0
       SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[1])
      ElseIf InfoSkinGadgets()\Checked = 1
       SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[3])
      EndIf
      OnTop = 1
     EndIf
    EndIf
    
    If GetAsyncKeyState_(#VK_LBUTTON) & $8000
    ;If GetAsyncKeyState_(#VK_LBUTTON) = -32767
     If OnTop = 1
      If InfoSkinGadgets()\type = 0 ;Button
       SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[2])
      ElseIf InfoSkinGadgets()\type = 1 ;CheckBox
          
       If InfoSkinGadgets()\Checked = 0       
        SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[5])
       ElseIf InfoSkinGadgets()\Checked = 1
        SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[5])
       EndIf     
      EndIf
      
      If Selected = 0
       If InfoSkinGadgets()\type = 0 ;Button
        SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[2])
       ElseIf InfoSkinGadgets()\type = 1 ;CheckBox
        If InfoSkinGadgets()\Checked = 0
         SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[5])
         InfoSkinGadgets()\Checked = 1:
        ElseIf InfoSkinGadgets()\Checked = 1
         SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[5])
         InfoSkinGadgets()\Checked = 0:
        EndIf        
       EndIf

      Else
       Selected = 0
      EndIf
      Clicked = 1
     EndIf
    Else
     Clicked = 0
    EndIf
    
   Else
    If InfoSkinGadgets()\type = 0 ;Button
     SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[0])
    ElseIf InfoSkinGadgets()\type = 1 ;CheckBox
     If InfoSkinGadgets()\Checked = 1
      SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[4])
     Else
      SendMessage_(InfoSkinGadgets()\handle,370,0,InfoSkinGadgets()\Skin[0])
     EndIf
    EndIf
   EndIf
   
 Next   
 
EndProcedure
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Post by Thunder93 »

Has anyone corrected the unusual behavior with InfoSkin InfoSkinCheckbox? When using simply the InfoSkin Example.pbi, you either need to click it several times to have a checkmark placed, or clicking it once to have the checkmark, .. just as fast as the checkmark appeared, it disappears.



Regards,
Thunder93
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4326
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Sounds like a refresh issue.

It probably needs to check state or (easier approach) you need to code it so that it sets a FLAG variable and then YOU set state based on that FLAG variable.
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
KIKI
Enthusiast
Enthusiast
Posts: 145
Joined: Thu Dec 28, 2006 11:49 am
Location: FRANCE

Re: InfoSkin1.0 - OpenSource Theme Engine for PB4

Post by KIKI »

The link for your Infoskin doesn't work.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

KIKI wrote:The link for your Infoskin doesn't work.
That's right another time :cry:

But thank to COOLMAN, you can rebuild the ZIP if you copy/paste this in your IDE :wink:

http://www.purebasic.fr/english/viewtop ... 584#257584
ImageThe happiness is a road...
Not a destination
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Hi,
I don't know about you guys/gals but the InfoSkin code only works if I change:

Code: Select all

PtInRect_(position, mousepos\x, mousepos\y)
to:

Code: Select all

PtInRect_(position, mousepos)
It seems PtInRect takes only two parameters (were the second parameter is a point structure).

bye
fsw

BTW:
PB = Version 4.3 (final)
OS = WinXP MediaCenter Edition 2002 Service Pack 3
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Code: Select all

Define mousepos.POINT
PtInRect_(position, mousepos\x | (mousepos\y << 32))
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

@ts-soft
Was wondering why my code didn't work as it should...
but after searching the forum and finding this it tells me it's a PB bug.

Thanks for your hint
fsw
Post Reply