-
Notifications
You must be signed in to change notification settings - Fork 0
ENH: Simple Calculator Example #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
leafyrabbet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 First pass runs and shows the calculator buttons and radix (base) slider, but obviously most of the code is incomplete and the display portion isn't visible or fully created yet.
Added a bunch of comments as reminders of minor changes to make along with the bigger stuff of finishing-out the example.
leafyrabbet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot about this that's causing warnings, so this is an addendum to the previous "review".
App is still operational and building, despite warnings.
|
App is breaking now with the |
|
I finally did it! SemaphoreCI added for this new sub-project and the test sub-project. I probably honestly should've done a separate Pull-Request but I was experimenting and was lazy. |
leafyrabbet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few new comments from things discovered when setting-up SemaphoreCI.
| - GTK+3 install: `3.24.18` (macOS Homebrew) | ||
| - gtkmm3 install: `3.24.2` (macOS Homebrew) | ||
| - GCC install: `9.3.0_1` (macOS Homebrew) | ||
| - GNU Make (`gmake`) install: `4.3` (macOS Homebrew) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is fine, but the brew command to install GNU Make is missing from either this README or the top-level repo README.
The install is:
brew install make
And a note should be added that a warning will be printed explaining that the latest install of GNU Make is symbolically linked as gmake instead of make, to preserve/maintain XCode functionality in the macOS environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to add cairomm to docs now, since c14911d.
- Makefile updated to add debug variable - Comments updated in Makefile - Comment added in Makefile to support flag - Compiler variables in Makefile updated for readability
- `cairomm` library added to support vector graphics - Makefile (macOS) updated to support `cairomm` - Callback/Handler function updated for drawing - Example line drawing used from GNOME documentation - BRK: This will break SemaphoreCI due to missing libs for build environment
- Adding Text Rendering to DisplayArea. - Using pangomm Library that was included with gtkmm (brew) install.
- Layout now oriented vertically and the `display_area` will now be drawn above the numberpad, like typical calculators. - A C++ string container was added and now has the buttons appended to it when they're pressed, and then emits the redraw signal to be enqueued for the `display_area` widget.
- 4 rows of text elements created for the dyadic operations. - Removed and cleaned-up commented-out code and copied comments.
- Added callback-handlers to write operators and change mode of the calculator, based on a new `enum`, to determine which operator argument to be writing button digits into. - Strings update logically with button presses and 3/4s of the calculator functionality is now in place. - Equals button needs to added in next commit to add the solve function.
- "Solve" functionality added with the `=` button. - Calculator can now solve basic algebraic field operations in any base system from `0` to `16`. - During testing a bug was discovered that the root selection enabling of the buttons is actually uninitialized and the root selection itself is enabling an extra button (off-by-1 indexing error). - Simple examples tested and functionality seems to be working for the `+`, `-`, and `*` operations of integers. Fractional values and division have not yet been tested/verified. - Current design is likely incompatible with fractional values, so it may be more prudent to remove the decimal button from the UI for now.
- Slider (Range / Scale) fixed so it no-longer is off by one, though unfortunately it now shows a fractional value. - Calculator design currently only supports integer operations due to string to int conversions, so the decimal point was removed to avoid any potential bugs.
|
Simple, integer operations of any base between 0 and 16 (doubly inclusive) are now operational in the calculator. The design/layout could be cleaned-up and modulus operator could be added, along with better UI information for binary/decimal values as a debugging/readability/usability reference ... but that could be for follow-up work. |
- Semaphore CI sent-out an email about a deprecated macOS image that went into effect on the 4th. - This should fix the issue with relying on the deprecated image, but everything else should still work.
Simple Calculator
Adding a new example subproject to the repo: a Simple Calculator, built with
gtkmm3and showing how to uselibsigc++functors to do slot-signal bindings.Calculator will do basic Integer/Rationals Field-Algebra based-on floating-point Field-Algebra.
Commit Messages
RVW: Commit addressing a Code Review comment or bug.FIX: Commit addressing a bug or implementing a bugfix.NEW: New files or new code (classes, functions, etc.).ENH: Enhacement or New Functionality (inbetweenNEWandUPD).UPD: Update to existing code, not related to an extant Code Review.BRK: An update that is introducing a new bug/error -- this is basically a "breaking change".