June 8, 2019
Building A Calculator – Part 2 – The Framework
Comments
(4)
June 8, 2019
Building A Calculator – Part 2 – The Framework
I am currently a provider of technical training and support in the electronic manufacturing industry. My prior training and work experience as a teacher, network administrator, web design, and instructional design make me well prepared to design it, develop it, and deliver it. I am a father of five, a US Army veteran, and I enjoy playing the guitar as well as performing in local community theater. 
Legend 99 posts
Followers: 154 people
(4)

In the first post, I presented a basic functioning calculator. If you missed it, you can check here (Building A Calculator – Part 1).

In this post we will begin going through the steps to create the framework for the calculator.
Essentially, this is the body, buttons, and display of the calculator.

As with all things like this, I am sure there are lots of ways to approach the task. Feel free to layout your buttons differently, change the colors, etc as you desire.

Buttons

This calculator uses a total of 19 buttons
– Eleven number buttons (0-9 plus the decimal button)
– Four operation buttons (plus, minus, times, divide)
– Two function buttons (Percent and polarity)
– A clear button
– An equals button

Displays

This calculator uses four rectangles as different displays
– A display to store the first numeric entry
– A display to store the second numeric entry
– A display to store the calculated answer
– a small box to display the symbol current operation being performed (**optional – not shown in video**)

Body

This calculator has eight elements that make up the body
– A large rounded rectangle for the main body of the calculator
– A rectangle for the model number (Stagcalc 3000) (**optional not shown in video**)
– Six small rectangles to make the “solar panel” (**optional not shown in video**)

Creation Tips for Buttons

Here is my recommendation for creating the buttons. Do with it as you wish.
1. Draw out a rounded rectangle to a size of your liking.
2. Format the background color and border color to taste.
3. Format the button text to taste.
4. Check the “Use as button” box.
5. Duplicate the button as many times as needed.
6. Arrange, align, and modify the buttons as desired. (I chose to make the plus button a double size and the clear button a different color. I made those modifications after duplicating based on the majority.)

I prefer this general procedure so that when I duplicate, the copies will pick up as many attributes as possible to minimize doing the same setups on multiple objects – though you do have the ability to apply styles across multiple objects of the same type.

Here is a short video where I quickly try to show making the basic framework of this just to help visualize things.

Stay tuned for Part 3!

4 Comments
2019-06-14 20:23:07
2019-06-14 20:23:07

This is great

Like
2019-06-10 19:08:59
2019-06-10 19:08:59

Hmm I never trust Copy/Paste, had too much issues with it in the past.  Trying to avoid Windows clipboard whenever possible, hence my preference for CTRL-D  or to use object styles.

Like
2019-06-10 17:07:37
2019-06-10 17:07:37

Thanks Greg. I mostly prefer to create an object style, unless the shape button has a visited state, because that cannot be part of the object style. In that case I also use duplicate (CTRL-D). What did you miss in the object style? Advantage is, that you can edit that style as many times as you want, and editing will be applied to all the buttons.

Like
(1)
>
Lieve Weymeis
's comment
2019-06-10 18:06:23
2019-06-10 18:06:23
>
Lieve Weymeis
's comment

I don’t think I miss anything with object styles per se – but I figure I just defaulted to Ctrl-C and Ctrl-V as a method that would be easily recognizable to most people for the video and made a mention of that ability. I did not dwell on that aspect as it was not the focus of the post.

In smaller quantities, I also like to use the Ctrl-‘click and drag’ method to make copies.

Like
Add Comment