DaProgrammer Posted August 20, 2007 Share Posted August 20, 2007 (edited) Ever needed to Calculate how much time are all 3 movies together and started to multiply the hours *3600 and the minutes *60, well no more. I present to you the time calculator. expandcollapse popupOpt("GUIOnEventMode",1) GuiCreate("KJ's TC", 130, 70,-1, -1) GUISetOnEvent(-3,"Exitt") GUICtrlCreateLabel(":",33,12,15,15) GUICtrlCreateLabel(":",63,12,15,15) GUICtrlCreateLabel(":",33,42,15,15) GUICtrlCreateLabel(":",63,42,15,15) $Input_h1 = GuiCtrlCreateInput("", 10, 10, 20, 20) $Input_m1 = GuiCtrlCreateInput("", 40, 10, 20, 20) $Input_s1 = GuiCtrlCreateInput("", 70, 10, 20, 20) $Input_h2 = GuiCtrlCreateInput("", 10, 40, 20, 20) $Input_m2 = GuiCtrlCreateInput("", 40, 40, 20, 20) $Input_s2 = GuiCtrlCreateInput("", 70, 40, 20, 20) $Button_a = GuiCtrlCreateButton("+", 100, 5, 15, 15) $Button_s = GuiCtrlCreateButton("-", 100, 25, 15, 15) $Button_r = GuiCtrlCreateButton("R", 100, 45, 15, 15) GUICtrlSetOnEvent($Button_a,"Add") GUICtrlSetOnEvent($Button_s,"Subtract") GUICtrlSetOnEvent($Button_r,"Reset") GuiSetState() While 1 Sleep(1000) WEnd Func Add() GUICtrlSetData($Input_s1,GUICtrlRead($Input_s1)+GUICtrlRead($Input_s2)) GUICtrlSetData($Input_s2,"") While GUICtrlRead($Input_s1)>=60 GUICtrlSetData($Input_m1,GUICtrlRead($Input_m1)+1) GUICtrlSetData($Input_s1,GUICtrlRead($Input_s1)-60) WEnd GUICtrlSetData($Input_m1,GUICtrlRead($Input_m1)+GUICtrlRead($Input_m2)) GUICtrlSetData($Input_m2,"") While GUICtrlRead($Input_m1)>=60 GUICtrlSetData($Input_h1,GUICtrlRead($Input_h1)+1) GUICtrlSetData($Input_m1,GUICtrlRead($Input_m1)-60) WEnd GUICtrlSetData($Input_h1,GUICtrlRead($Input_h1)+GUICtrlRead($Input_h2)) GUICtrlSetData($Input_h2,"") EndFunc Func Subtract() GUICtrlSetData($Input_s1,GUICtrlRead($Input_s1)-GUICtrlRead($Input_s2)) GUICtrlSetData($Input_s2,"") While GUICtrlRead($Input_s1)<0 GUICtrlSetData($Input_m1,GUICtrlRead($Input_m1)-1) GUICtrlSetData($Input_s1,GUICtrlRead($Input_s1)+60) WEnd GUICtrlSetData($Input_m1,GUICtrlRead($Input_m1)-GUICtrlRead($Input_m2)) GUICtrlSetData($Input_m2,"") While GUICtrlRead($Input_m1)<0 GUICtrlSetData($Input_h1,GUICtrlRead($Input_h1)-1) GUICtrlSetData($Input_m1,GUICtrlRead($Input_m1)+60) WEnd GUICtrlSetData($Input_h1,GUICtrlRead($Input_h1)-GUICtrlRead($Input_h2)) GUICtrlSetData($Input_h2,"") EndFunc Func Reset() GUICtrlSetData($Input_h1,"") GUICtrlSetData($Input_m1,"") GUICtrlSetData($Input_s1,"") GUICtrlSetData($Input_h2,"") GUICtrlSetData($Input_m2,"") GUICtrlSetData($Input_s2,"") EndFunc Func Exitt() Exit EndFunc Edited August 21, 2007 by DaProgrammer Link to comment Share on other sites More sharing options...
gseller Posted August 20, 2007 Share Posted August 20, 2007 Cool, may I suggest a reset button, and a close either on top right corner or elswhere.. Very good start or tidbit for another script. Link to comment Share on other sites More sharing options...
DaProgrammer Posted August 21, 2007 Author Share Posted August 21, 2007 Cool, may I suggest a reset button, and a close either on top right corner or elswhere.. Very good start or tidbit for another script. Done Link to comment Share on other sites More sharing options...
gseller Posted August 21, 2007 Share Posted August 21, 2007 Sweet! Nice improvements... Did you build this for another project or just like me kinda wandering around doing a bit here and there for fun? Link to comment Share on other sites More sharing options...
Mast3rpyr0 Posted August 21, 2007 Share Posted August 21, 2007 Nice My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here! Link to comment Share on other sites More sharing options...
Achilles Posted August 21, 2007 Share Posted August 21, 2007 Nice, I like the simplicity of it. One suggestion, modify the tray icon or get rid of it. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
DaProgrammer Posted August 22, 2007 Author Share Posted August 22, 2007 Sweet! Nice improvements... Did you build this for another project or just like me kinda wandering around doing a bit here and there for fun? i made a couple of projects, some of which u can find by following my sig. but mainly thinking of ideas for a big project and plying around in the meantime. Link to comment Share on other sites More sharing options...
DaProgrammer Posted August 22, 2007 Author Share Posted August 22, 2007 Nice, I like the simplicity of it.One suggestion, modify the tray icon or get rid of it. its a tool to work with and an idea for others to implement i didnt bother to make it pretty and stuff, if u want pretty follow my sig and download the alarm clock its what u might call a finished product, published on Download.com(C.Net) Link to comment Share on other sites More sharing options...
TheSaint Posted September 2, 2007 Share Posted September 2, 2007 (edited) Have'nt tried yours yet, but here's a version I quickly knocked up some time agoTime Calculator v1.5 Edited September 2, 2007 by TheSaint Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now