InfoSkin1.0 - OpenSource Theme Engine for PB4

Developed or developing a new product in PureBasic? Tell the world about it.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Inf0Byt3 wrote:Thanks.
Remember we wanted to build something like this some time ago? Let's improve this one, add new gadgets, etc. What do you say?
I don't care how just get it done so i can use it! :o
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

:lol: WIP.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

:P
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

@InfoByte: I can see what I do, in my first snippets, I hacked up the window buttons (their size, position, etc.).. So, if you want to make your engine better, don't make your own custom OpenWindow() function, you should create a function like: "EnableInfoSkin(hWnd)" that way more and more people would use the product and even buy if you make it commercial, but I see you want to keep it for free, so it's up to you what you will make.

Also, we code in whole different ways, your code looks easy-to-understand and optimized, but mine looks dirty and really(x10)-hard-to-understand. So, we can't work together, as good + evil = chaos.. (And I'm the evil :twisted: )
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Also, we code in whole different ways
Agree. But your code is better ;)
your code looks easy-to-understand and optimized, but mine looks dirty
Come on.. Be serious. You code like a real programmer. All I do is simplify things until the program does not work anymore :lol: .

About the EnableInfoSkin(hWnd) - style, how to achieve this? Create something like a hook for the window? That's too hard for me, I guess.

A question: How can I create an owner draw progressbar? I have 2 pictures, the border for the pr-bar and the State image? Any ideas?
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

Well, sure I'm a professional programmer, as I was a former VB user so I am very (and very means VERY) experienced in API programming.

About the owner drawn progressbar, well you could use something similar to this:

Code: Select all

StartDrawing(WindowOutput())
 LoadImage(#ProgressBar_Background, "MyImage.gif")
 LoadImage(#ProgressBar_State, "MyImage_2.gif")
 DrawImage(ImageID(#ProgressBar_Background), UserX, UserY)
 For i=1 To UserState
  DrawImage(ImageID(#ProgressBar_State), UserX+i, UserY+1)
 Next
StopDrawing()
It propably doesn't work as I typed from my mind... I am now at a friend..

EDIT: Forgot to tell about the EnableInfoSkin(hWnd) procedure. Well, that procedure internally sets the windowcallback of the specified hWnd to InfoSkinCallback(hWnd, Msg, wParam, lParam)
You enumerate all child windows of the hWnd window and get each child window's classname. After that you check the classname if it's valid (Button, ComboBox32, etc..), then you REAL skin the gadget.

It isn't hard to make, but requires a high knowledge of the Win API. So if I were you, I wouldn't start with such a big project, but I know this means a lot to you. And real skinning the gadget isn't hard, but requires more than 1 or 2 routines (structures/interfaces).

I hope you know now how to make things. But I am busy now, so I can't help you much.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Got it. Thank you. One more thing I don't know. What do you mean by REAL skinning of the button? If you can, when you are free, can you show me a small example of how to subclass a single normal gadget to change the way it looks? If I have an example, it's easy to implement the rest, I just need a quickstart. I simply cannot find a logical explanation of how to change the content of a control with a bitmap.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

Ok, I'll try to help you-
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Great! Thanks.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Update2 . Added progressbar infogadget :). Check the main post for the changelog and download link.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

Post by Poshu »

Look good. If you can add a few more gadget, it will even look great ^_^.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Thanks! I will add some more gadgets soon. I am thinking to improve it a little bit and add some compression routines inside.

[Update]
Check the main post.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

Post by Poshu »

lovely ^^;
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Never use getasynckeystate_(#VK_LBUTTON)

Instead, you must catch the messages #WM_LBUTTONDOWN and #WM_LBUTTONUP !.

You CAN catch those without using a callback, but you should use one already for secure messaging.

And if you really want to use GetAsyncKeyState(); Then you'll need to do a test to see if your window has focus first, because it will fire/trigger whenever you click your LMB anywhere at your system.

This is an overhead of 2 api calls vs catching a message. It's your call though, I'd go with the callback for some comfy messaging. But you could always call GetKeyState()...
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Thanks for the tip :). I'm adding it as soon as i can.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Post Reply