VistaClock II - a gadget for your gui

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

VistaClock II - a gadget for your gui

Post by netmaestro »

Drop a working analog clock onto your form with one command. You can download the library here:

http://www.networkmaestro.com/VistaCloc ... taller.exe (*new* Gadget version replaces dll version)

edit: I'll probably be adding some optional faces to it for different looks.
Last edited by netmaestro on Sun Jun 24, 2007 4:08 pm, edited 7 times in total.
BERESHEIT
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

that's really neat - netmaestro.
much more interessant than a clock on the desktop.
what about a ResizeClock() function, to be usable and to fit in my apps ?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Seems reasonable. I added the function, you can call ResizeClock(left,top,newsize) and it will change size. (or move) Here's a demo:

Code: Select all

OpenWindow(0,0,0,640,480,"VistaClock dll Test",#PB_Window_ScreenCentered|#PB_Window_SystemMenu) 
CreateGadgetList(WindowID(0)) 
TrackBarGadget(0,200,400,240,20,64,320) 
SetGadgetState(0,196) ; original clock size 
OpenLibrary(0,"vistaclock.dll") 
CallFunction(0,"InitClock",WindowID(0),RGB(224,223,227),320-GetGadgetState(0)/2,200-GetGadgetState(0)/2) 

Repeat 
  EventID=WaitWindowEvent(20) 
  If EventID = #PB_Event_Gadget 
     CallFunction(0,"ResizeClock",320-GetGadgetState(0)/2,200-GetGadgetState(0)/2,GetGadgetState(0))  
  EndIf 
   CallFunction(0,"UpdateClock") 
  
Until EventID=#PB_Event_CloseWindow 
CloseWindow(0) 
CloseLibrary(0) 
One more small change, the InitClock() function returns the handle of the clock window now, to give you control over it if needed.
Last edited by netmaestro on Thu May 04, 2006 9:26 pm, edited 1 time in total.
BERESHEIT
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post by Konne »

Is the dll free, also in maybe money make programms?
Apart from that Mrs Lincoln, how was the show?
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

Yea, I also wanted to ask if we can use it in commercial apps too.
It's very nice BTW.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

It's a gift. Use it any way you like!

- fixed a bug, please re-download, everyone. Should be final now.
BERESHEIT
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

netmaestro wrote:It's a gift. Use it any way you like!

- fixed a bug, please re-download, everyone. Should be final now.
Ok, thanks for the info..

(Grrrr! Try to post a reply the same time as I did and you can taste my fist :twisted: )
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

also one more wish : can you provide the .lib if possible (for Import/EndImport ) ? :)

( also if it could work on 16bit desktop :roll: )
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

I must be doing something dumb.. in this demo I can't see anything.. I've checked the return value from the openlibrary function & it's non-zero so I guess it's loading ok but no clock.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

when i downloaded the link above, my browser opera renamed the file as vistaclock.exe. i had to rename it... maybe this is your problem.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

Thanks Flype, but it was presented as a dll for saving.. but maybe it got corrupted somehow. @Netmaestro, would you mind packaging it into a rar or zip file? Thanks.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Very cool. 8)

Thanks.
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

repackaged as a zip:

http://www.networkmaestro.com/vistaclock128.zip

16-bit desktop support is coming.
Last edited by netmaestro on Wed May 10, 2006 1:19 pm, edited 1 time in total.
BERESHEIT
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

That is very cool. Nice work netmaestro :)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I finally found a computer where this worked, and I must say that the look of it is absolutely gorgeous. (Can I say that about clock?)

Two small problems: When I click it my window loses focus and the clock background colour is not the same background colour as my window (I did nothing to change the window color).
Post Reply