Page 5 of 6

Posted: Thu Sep 04, 2008 12:28 pm
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...

Posted: Thu Sep 04, 2008 10:35 pm
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

Posted: Tue Dec 02, 2008 4:50 pm
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,

Posted: Tue Dec 02, 2008 9:03 pm
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

Posted: Wed Dec 03, 2008 7:49 am
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

Posted: Wed Dec 03, 2008 8:28 am
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!

Posted: Sun Dec 14, 2008 9:29 pm
by Thunder93
It would be awesome to have InfoSkin adjusted for use of InfoSkinCheckbox .. multiple times. :wink:

Posted: Mon Dec 15, 2008 4:11 am
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

Posted: Sat Dec 20, 2008 2:36 am
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

Posted: Sat Dec 20, 2008 8:52 pm
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.

Re: InfoSkin1.0 - OpenSource Theme Engine for PB4

Posted: Sat Mar 21, 2009 2:31 pm
by KIKI
The link for your Infoskin doesn't work.

Posted: Sat Mar 21, 2009 5:28 pm
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

Posted: Sun May 17, 2009 7:01 pm
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

Posted: Sun May 17, 2009 7:10 pm
by ts-soft

Code: Select all

Define mousepos.POINT
PtInRect_(position, mousepos\x | (mousepos\y << 32))

Posted: Mon May 18, 2009 1:33 am
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