Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Calculator


  • Please log in to reply
36 replies to this topic

#1 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 05 March 2010 - 07:14 PM

LAST VERSION - 1.4
25-Mar-10

Many people on this forum have written a calculator. I also decided to write my version of this useful program, but only with skins support. What came of it you can see below and play with it. Calculator works with 10 digits (not including "-" and ".") and supports basic arithmetic operations, such as addition, subtraction, multiplication, and division. Also, it can work with the memory: "M+", "M-", "MC", and "MR". If someone wants, he can draw your own skin as desired. I will be glad to any feedback and suggestions. Maybe somebody wants to prepare their own skins?


Calculator.png


Hotkeys

Spoiler


Skins

Spoiler


Miscellaneous

Spoiler


Files to download

Binary
Redirection to Calculator_bin.zip, 572 KB

Attached File  Calculator_bin.html   137bytes   232 downloads

Source
Redirection to Calculator_source.zip, 284 KB

Attached File  Calculator_source.html   140bytes   295 downloads

Edited by Yashied, 08 December 2013 - 02:42 PM.








#2 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 05 March 2010 - 08:15 PM

That is a beautiful calculator Yashied! Great work and 5 stars from me straight away.

I couldn't get it to run and be visible though until I commented out the line
_ReadRegistry()

I had the Dark_Classic in the correct folder. Maybe I had tried to run before I put the skin ini in the correct place, I'm not sure, but the script had $cSkin set to '' which should make _LoadSkin return with @error = 1 but there is no message for Case 1 so I added one. Anyway you should make it exit if there is no skin loaded.

EDIT: Maybe the binary has the Dark_Classic skin included but the au3 script does not. If I select a new skin and choose "default" I get no calculator again, but this time it exits. Once that happens there is no way back! (Well except for commenting out the _ReadRegistry.)

Edited by martin, 05 March 2010 - 08:26 PM.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#3 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 05 March 2010 - 09:29 PM

martin, Calculator can do without additional skins, default skin is located within the resources of .exe file (Calculator.exe). If you tried to run .au3 file, naturally it will not work, you must first compile the script. Other reason can not be.

Edited by Yashied, 05 March 2010 - 09:34 PM.


#4 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 05 March 2010 - 10:06 PM

Very nice Yashied. I really like your skins. :mellow:

#5 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 05 March 2010 - 10:14 PM

Not that it really matters but I noticed that you put the source file size as 512kb when its really only 222kb. Also Utilities folder is empty so the compile.cmd does not work. Didn't know if you ment to do that. :mellow:

#6 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 05 March 2010 - 10:22 PM

Not that it really matters but I noticed that you put the source file size as 512kb when its really only 222kb. Also Utilities folder is empty so the compile.cmd does not work.

I didn't included these utilities to archive, because there is no reason to increase the file size. It's freeware and well-known utilities.

:mellow:

But if you insist...

AutoIt3Wrapper
Resource Hacker
UPX

Edited by Yashied, 05 March 2010 - 11:11 PM.


#7 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 05 March 2010 - 10:57 PM

martin, Calculator can do without additional skins, default skin is located within the resources of .exe file (Calculator.exe). If you tried to run .au3 file, naturally it will not work, you must first compile the script. Other reason can not be.

Oh, sorry I was a bit hasty trying it. Maybe you could have a note next to the link for the source code, and maybe a line in the script something like
If Not @Compiled then  MsgBox(262144,"ERROR","You must compile this to run it")  exit EndIf



But now that I've tried running it as a script and it won't show anything, running the exe still shows nothing because my registry entry skin is "" , so I still think you need to fix it to protect against, um, fools.

Also, if it can't load a skin it tells you only if the Skin in the registry is not "", and then it does not exit. If the registry skin name is missing or "" then it should load the default skin. If it can't find a skin it should first tell you what file it was looking for and then give the option of loading a skin so that if nothing else the user can choose the default.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#8 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 05 March 2010 - 11:11 PM

Also, if it can't load a skin it tells you only if the Skin in the registry is not "", and then it does not exit. If the registry skin name is missing or "" then it should load the default skin. If it can't find a skin it should first tell you what file it was looking for and then give the option of loading a skin so that if nothing else the user can choose the default.

We think alike. It works this way. Empty windows can not arise... unless you overdo it with skins.

:mellow:

#9 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 05 March 2010 - 11:50 PM

We think alike. It works this way. Empty windows can not arise... unless you overdo it with skins.

:mellow:


I don't understand your answer :lol: So we don't think alike :(
I simply think that having an exe running running which has no visible window and has to be closed from the task bar by choosing close is not good. Suppose you choose a skin and close the program. Then remove the folder with the skin or rename it or the skin file is corrupt and run the program again it will not show any gui but still run run in the background. It would be better if it ran the default skin in that situiation. My compiled calculator exe doesn't work because of this problem and there is no way provided to retrieve the situation. So I think it needs attention.
But I won't go on about it any more and I'll shut up now.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#10 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 06 March 2010 - 12:01 AM

martin, just run .exe file, in this case, if there is any mistake with your chosen skin, default skin will be loaded (from the resources!).

:mellow:

Edited by Yashied, 06 March 2010 - 12:15 AM.


#11 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 06 March 2010 - 11:50 AM

martin, just run .exe file, in this case, if there is any mistake with your chosen skin, default skin will be loaded (from the resources!).

:mellow:


But this is what I have been trying to tell you, it doesn't.
_LoadDefaultSkin doesn't load anything that I can see. In my resources folder and in the list of resources added to the exe there is no background image, but in the Dark Classic ini and in the folder of images for that skin there is a background.

EDIT: Remember, I have only downloaded the Calculator_Source.zip.

Edited by martin, 06 March 2010 - 11:55 AM.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#12 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 06 March 2010 - 12:11 PM

OK.

Source + Utilities

But first compile .au3 by using compile.cmd.

Edited by Yashied, 06 March 2010 - 12:15 PM.


#13 martin

martin

    ~~\o/~~~/0\=¬''~~~

  • MVPs
  • 7,321 posts

Posted 06 March 2010 - 01:31 PM

OK.

Source + Utilities

But first compile .au3 by using compile.cmd.


OK yashied, that works. Thanks.
I see that the only difference is that I didn't use the compile.cmd before because there was no AUtoit3Wrapper.exe included and so I used F7.

I see that I was wrong about a missing background because that is 0.png.
Apologies for all the fuss:>

Edited by martin, 06 March 2010 - 01:37 PM.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

#14 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 07 March 2010 - 07:54 PM

The program has been updated to version 1.1. Improved a calculating algorithm. For example, now it works as:

[8][9] - 89
[/] - 89
[7] - 7
[*] - 12.71428571
[2][1] - 21
[=] - 267 (previously 266.9999999)

#15 Rizonetech

Rizonetech

    Seeker

  • Active Members
  • 28 posts

Posted 07 March 2010 - 11:58 PM

Would it be possible to use your source to create and publish a calculator app for my site. I will give you the credit for the orginal source and design. Regards

http://www.rizonetech.com

#16 czardas

czardas

  • MVPs
  • 7,049 posts

Posted 08 March 2010 - 01:11 AM

It's got a nice feel about it, but I didn't like the fact that I had to mess around to quit the program. :mellow:

#17 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 08 March 2010 - 02:29 AM

Would it be possible to use your source to create and publish a calculator app for my site. I will give you the credit for the orginal source and design.

Yes, of course.

:mellow:

#18 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 08 March 2010 - 02:17 PM

Added a new skins - White XL and White Minimal, see first post.

Edited by Yashied, 08 March 2010 - 03:02 PM.


#19 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 08 March 2010 - 02:36 PM

...but I didn't like the fact that I had to mess around to quit the program.

What is the reason?

Edited by Yashied, 08 March 2010 - 02:43 PM.


#20 czardas

czardas

  • MVPs
  • 7,049 posts

Posted 08 March 2010 - 05:43 PM

What is the reason?

Mainly the fact that it wasn't obvious at first. After failing to quit with escape and finding nothing on the GUI, I decided to quit using Task Manager. I didn't see anything in the system tray, though I should have thought to right click the the task bar icon :mellow: I can imagine that a lot of users might struggle with it at first. Apart from that, I think it's great.

Perhaps changing the hotkeys: Del for Cancel, and Esc for quit would be an idea?

Edited by czardas, 08 March 2010 - 05:58 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users