Jump to content

Calculator


Yashied
 Share

Recommended Posts

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

You can use keyboard to control the basic operations. The following is a list of Calculator buttons and their keyboard equivalents (similar to the standard Windows Calculator). Note that these hotkeys, unlike the skins, you can not change.

Hotkeys.png

Skins

I prepared four skins for this Сalculator, one of them (Dark Classic) is already installed in the program as default. To install external skins just right click on the Сalculator window and choose "Select skin..." from the popup menu, then specify the path to the desired skin (.ini). You can download a ready-made skins using the links below.

Dark Classic (Default)

Autor: Jonas (modified Yashied)

Dark_Classik_small.png

Orange Clouds

Autor: The Kapsules Team (modified Yashied)

Orange_Clouds_small.png

White XL

Autor: Yashied

White_XL_small.png

White Minimal

Autor: Yashied

White_Minimal_small.png

Dark Project

Autor: Garrett

Dark_Project_small.png

Miscellaneous

  • Calculator can work without any additional skins, default skin (Dark Classic) is located within the resources of .exe file.
  • If you tried to run .au3 file, it will not work, you must first compile the script by using compile.cmd. Also, for a successful compilation you will need additional utilities that are not included in the archive. Download them and put to the "Utilities" folder.
  • To close the program, press ESC, or right click on the Сalculator window and choose "Exit" from the popup menu, or move the mouse cursor to the top right corner of the window and click the Close button that will appear (see screenshot).
  • Images for the skin can be in any format that supports Windows, including those containing transparency.
  • For more beauty, you can use two undocumented parameters that are in the "HKEY_CURRENT_USERSoftwareCalculator" registry hive. By default, these parameters are not used.

    FadeOut = (0..100)

    Enables a fade in/out effects at program startup/exit, respectively. Recommended value - (5 .. 20). 0 - disable effect.

    TransOnInactive = (0..255)

    Sets a transparency for the window if it is not active. TransOnInactive value specifies the level of transparency. Recommended value - 200. 0 - disable effect.

  • The .ini file that defines the skin must contain the following sections, even if they are not used (can be empty).

    [info]

    [icon]

    [buttons]

    [Digits]

    [Display]

Files to download

Binary

Redirection to Calculator_bin.zip, 572 KB

Calculator_bin.html

Source

Redirection to Calculator_source.zip, 284 KB

Calculator_source.html

Edited by Yashied
Link to comment
Share on other sites

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
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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Link to comment
Share on other sites

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
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.
Link to comment
Share on other sites

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
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.
Link to comment
Share on other sites

Link to comment
Share on other sites

Link to comment
Share on other sites

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...