History log of /haiku/src/apps/deskcalc/CalcWindow.cpp
Revision Date Author Comments
# 2c856023 21-Nov-2017 Kacper Kasper <kacperkasper@gmail.com>

DeskCalc: fix cut off buttons.

* Window frame might change based on set size limits.
Creating view with rectangle used to create the window causes it
to anchor outside the window.
To address that pass current frame rectangle to the view.
* Fixes #13167.


# 29fbfe31 27-Jun-2013 John Scipione <jscipione@gmail.com>

DeskCalc: Style fixes


# b98de092 27-Jun-2013 John Scipione <jscipione@gmail.com>

DeskCalc: Update copyright headers

Style fixes to header, update copyright years, remove my name
from files that I didn't have anything to do with besides style fixes,
add myself to ExpressionTextView.cpp


# 0046f444 01-Aug-2012 John Scipione <jscipione@gmail.com>

Modify about window to take an app signature.

* Grabs the app icon and version from the resource file.
* Allow you to specify the copyright holder instead of hardcoding
"Haiku, Inc."
* Support multiple extra copyright fields.
* Modify BAlert to take a custom icon.
* Set the custom icon of the BAlert to the app icon.
* Also set the app version.

* Convert BAboutWindow to derive from BWindow
* Place a 128x128 icon and fill out a scrolling BTextView
with options such as authors, version history, copyright,
license, etc. Still needs some work but is coming along.

* Add the word Version to the version line, i8n'ed of course,
and tweak the info box and default sizes.


# 593808d9 03-Aug-2012 John Scipione <jscipione@gmail.com>

Return authors name's to DeskCalc headers.

No functional change.

* Surround email addresses in angle brackets.
* Add myself to ExpressionParser.cpp and .h
* Remove myself from ExpressionTextView.cpp and .h
* Alphatetize authors by last name.

Thanks Ingo and Axel.


# 9f5d4ecd 01-Aug-2012 John Scipione <jscipione@gmail.com>

Style fixes, update copyright, add myself as author.

No functional change.


# fa37d94d 31-Jul-2012 John Scipione <jscipione@gmail.com>

Fix radian/degree mode toggling bug in Deskcalc

I overlooked this problem in my last commit...

If you select the current angle (radian/degree) mode from the menu
it toggles the angle mode, fixed this to make it keep the current
mode.


# 8ffd0477 30-Jul-2012 John Scipione <jscipione@gmail.com>

Implement degree mode in DeskCalc.

Default is radian mode, You set the option in the right click menu
like the other options.

Note: degree mode does not affect hyperbolic trigonometric functions.
This is how Mac Calculator, Windows Calculator, and Google Calculator
work.


# 63c55f02 17-Apr-2012 John Scipione <jscipione@gmail.com>

Update Deskcalc's right-click menu options.

If CalcView is embedded as a replicant on the desktop it's parent
window is not CalcWindow. Furthermore, it can't switch between
compact, basic and scientific keypad modes, you are locked in tox
the one you picked at the time you embeded the view into the desktop.
So, I have updated the right-click message to reflect this reality
by taking away the keypad mode switching options. You can still
set auto num-lock and turn beep on and off (theoretically someday
anyway) but the CalcView receives these messages instead of
CalcWindow. So, these 2 options now work in the case of a CalcView
embedded in the desktop at least.


# 546208a5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# 60ba75c5 06-Nov-2011 John Scipione <jscipione@gmail.com>

Add a scientific mode to Deskcalc.

Deskcalc already contains support for all the functions in scientific mode
but up until now you had to know what they were called and type them in to
figure them out. Scientific mode gives you access to most of the available
functions via buttons.

Pushing one of the the scientific mode buttons inserts the function name
along with an innertube () at the current cursor location. If you have some
text highlighted when you push a scientific mode button it will put that
text inside the innertube. So you can type 0.5, then highlight the text with
the mouse, and then push the sin button and you will get sin(0.5).

The contextual menu has been altered to support the new mode.
Instead of having a single show keypad option in the contextual menu there
are 3 new options instead. Compact mode, Basic mode, and Scientific mode.
Basic mode is the default mode showing the basic keypad. Compact mode is the
same as show keypad turned off, showing just a bare text field. Scientific
mode is the new mode which adds buttons for the different transcendental
functions and constants that Deskcalc supports. You can also use Alt+0, Alt+1,
and Alt+2 keyboard modifiers to switch between the modes.

In addition to accepting the word 'pi' for the circumference of the unit
circle, Deskcalc now also recognizes the UTF-8 character π which has a
dedicated button in scientific mode. I also changed the parser so that
lowercase 'e' always means Euler's number and uppercase 'E' always means
'times 10 to the' so 1E5 means 1 times 10 to the 5th.

Another small tweak I did was to adjust the minimum basic mode width so that
the window is flush with the tab.

I also renamed fColums to fColumns, took out some spaces and other style
changes and bumped the version to 2.2.0.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43199 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1be3653a 11-Sep-2011 Axel Dörfler <axeld@pinc-software.de>

* Made DeskCalc "not anchored on activate" meaning that instead of changing the
workspace to an already open DeskCalc, it moves to the current workspace
instead. That's because you usually use DeskCalc in the context of another
application (or just for a single use), so it makes little sense to have sort
of a fixed workspace for it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42738 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 560ff447 25-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Use resource definition files instead of DoCatalogs rule. Rename B_TRANSLATE_APP_NAME and related macros to the more generic B_TRANSLATE_SYSTEM_NAME, to also fits add-ons, folders, etc, and make 'System name' its standard context. Change CodyCam and PoorMan's app signatures to match the overall x-vnd.Haiku-App pattern. Some clean-up. Make SlideShowSaver build again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 480d660f 13-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Introducing a catalog app name context, related macros, and making use of this in DeskCalc.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40930 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cd7548f5 04-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Some apps get the name lookup attribute.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40811 a95241bf-73f2-0310-859d-f6bbb57e9c96


# accec9a7 06-Nov-2009 Alexandre Deckner <alex@zappotek.com>

* Style fixes. Encountered ambiguous cases, please see my following questions
in the commit ml.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33923 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c0f89a7 10-May-2009 Stephan Aßmus <superstippi@gmx.de>

Fixed small coding style violations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30696 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 51e404fd 09-May-2009 Philippe Saint-Pierre <stpere@gmail.com>

Fixed the initial size of the DeskCalc window.

For some reason, it was resizing the window to the size of the dragger frame :-) (the frame variable was reused to a different purpose)

Fixes ticket #3896


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30679 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bc3229d6 22-Feb-2009 Jérôme Duval <korli@users.berlios.de>

* load settings before building the window: the behavior is then similar with the replicant version.
* change window limits when keypad option is off
* style cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29293 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 551612ea 21-Feb-2009 Jérôme Duval <korli@users.berlios.de>

Applied patch from richy_rich for bug #3034. Seems like 100*100 is a good minimum size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29270 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cd6b83dd 09-Feb-2008 Jonas Sundström <jonas@kirilla.com>

The title of the (primary) window of (non-document) apps and preferences should be the filename of the executable. File and window names should be changed in tandem in the future. All IMO. Sorry, Marcus, for changing TV-O-Rama. :/ We may want to consider using more proper language, e.g. 'Screensaver' or 'Screen Saver' instead of 'ScreenSaver'. DeskCalc or 'Desk Calculator' should be just Calculator. We should avoid clinging to BeOS history, like with the name CodyCam, which hardly makes any sense anymore, even if you happen to be one of the few BeOS oldtimers.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23935 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1f84dba7 07-Jun-2006 Stephan Aßmus <superstippi@gmx.de>

the finishing touches...
* now displays the calculator icon besides the text entry
when the keypad is off, also draws a frame around the text
entry and uses standard black on white...
* fixed a few other issues
* should hopefully be complete now
* on R5, there are sometimes rendering bugs with the
app_server (sometimes it doesn't invalidate views that
are transparent and have been resized before the window is
shown)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17777 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7cb395c4 06-Jun-2006 Stephan Aßmus <superstippi@gmx.de>

adding DeskCalc by Timothy Wayper

huge cleanup of the DeskCalc code:
* applied style guide
* fixed any TODOs from timmy
* slightly nicer looking options window
* new way to store settings
* code should be more robust
* includes parser kindly donated by Daniel Wallner


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17737 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 29fbfe311067dbe6606afde7043b98a1234cef12 27-Jun-2013 John Scipione <jscipione@gmail.com>

DeskCalc: Style fixes


# b98de092d8e0609615f4509c84498bb7df207f50 27-Jun-2013 John Scipione <jscipione@gmail.com>

DeskCalc: Update copyright headers

Style fixes to header, update copyright years, remove my name
from files that I didn't have anything to do with besides style fixes,
add myself to ExpressionTextView.cpp


# 0046f4443675694b16fda4829e6f838954bf23fa 01-Aug-2012 John Scipione <jscipione@gmail.com>

Modify about window to take an app signature.

* Grabs the app icon and version from the resource file.
* Allow you to specify the copyright holder instead of hardcoding
"Haiku, Inc."
* Support multiple extra copyright fields.
* Modify BAlert to take a custom icon.
* Set the custom icon of the BAlert to the app icon.
* Also set the app version.

* Convert BAboutWindow to derive from BWindow
* Place a 128x128 icon and fill out a scrolling BTextView
with options such as authors, version history, copyright,
license, etc. Still needs some work but is coming along.

* Add the word Version to the version line, i8n'ed of course,
and tweak the info box and default sizes.


# 593808d96ab873ed345cf3a1ac1f5bf04809755f 03-Aug-2012 John Scipione <jscipione@gmail.com>

Return authors name's to DeskCalc headers.

No functional change.

* Surround email addresses in angle brackets.
* Add myself to ExpressionParser.cpp and .h
* Remove myself from ExpressionTextView.cpp and .h
* Alphatetize authors by last name.

Thanks Ingo and Axel.


# 9f5d4ecd972134f48a330f95d8a9a9ea49dbc3a1 01-Aug-2012 John Scipione <jscipione@gmail.com>

Style fixes, update copyright, add myself as author.

No functional change.


# fa37d94d1bd5b2c559f1ab1cac40826a945cec9c 31-Jul-2012 John Scipione <jscipione@gmail.com>

Fix radian/degree mode toggling bug in Deskcalc

I overlooked this problem in my last commit...

If you select the current angle (radian/degree) mode from the menu
it toggles the angle mode, fixed this to make it keep the current
mode.


# 8ffd0477dd4998324e051800da35cadd91a7fb8c 30-Jul-2012 John Scipione <jscipione@gmail.com>

Implement degree mode in DeskCalc.

Default is radian mode, You set the option in the right click menu
like the other options.

Note: degree mode does not affect hyperbolic trigonometric functions.
This is how Mac Calculator, Windows Calculator, and Google Calculator
work.


# 63c55f0212d9893fc435b45894c4ce8691556905 17-Apr-2012 John Scipione <jscipione@gmail.com>

Update Deskcalc's right-click menu options.

If CalcView is embedded as a replicant on the desktop it's parent
window is not CalcWindow. Furthermore, it can't switch between
compact, basic and scientific keypad modes, you are locked in tox
the one you picked at the time you embeded the view into the desktop.
So, I have updated the right-click message to reflect this reality
by taking away the keypad mode switching options. You can still
set auto num-lock and turn beep on and off (theoretically someday
anyway) but the CalcView receives these messages instead of
CalcWindow. So, these 2 options now work in the case of a CalcView
embedded in the desktop at least.


# 546208a53940a26c6379c48a7854ade1a8250fc5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# 60ba75c5ec6df48a5fa2ae8a14802ea8001791bb 06-Nov-2011 John Scipione <jscipione@gmail.com>

Add a scientific mode to Deskcalc.

Deskcalc already contains support for all the functions in scientific mode
but up until now you had to know what they were called and type them in to
figure them out. Scientific mode gives you access to most of the available
functions via buttons.

Pushing one of the the scientific mode buttons inserts the function name
along with an innertube () at the current cursor location. If you have some
text highlighted when you push a scientific mode button it will put that
text inside the innertube. So you can type 0.5, then highlight the text with
the mouse, and then push the sin button and you will get sin(0.5).

The contextual menu has been altered to support the new mode.
Instead of having a single show keypad option in the contextual menu there
are 3 new options instead. Compact mode, Basic mode, and Scientific mode.
Basic mode is the default mode showing the basic keypad. Compact mode is the
same as show keypad turned off, showing just a bare text field. Scientific
mode is the new mode which adds buttons for the different transcendental
functions and constants that Deskcalc supports. You can also use Alt+0, Alt+1,
and Alt+2 keyboard modifiers to switch between the modes.

In addition to accepting the word 'pi' for the circumference of the unit
circle, Deskcalc now also recognizes the UTF-8 character π which has a
dedicated button in scientific mode. I also changed the parser so that
lowercase 'e' always means Euler's number and uppercase 'E' always means
'times 10 to the' so 1E5 means 1 times 10 to the 5th.

Another small tweak I did was to adjust the minimum basic mode width so that
the window is flush with the tab.

I also renamed fColums to fColumns, took out some spaces and other style
changes and bumped the version to 2.2.0.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43199 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1be3653a7b5a07191caf1bc0729c31afb02633ed 11-Sep-2011 Axel Dörfler <axeld@pinc-software.de>

* Made DeskCalc "not anchored on activate" meaning that instead of changing the
workspace to an already open DeskCalc, it moves to the current workspace
instead. That's because you usually use DeskCalc in the context of another
application (or just for a single use), so it makes little sense to have sort
of a fixed workspace for it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42738 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 560ff4478d5c85455ea3e5ed5e392ef93132d545 25-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Use resource definition files instead of DoCatalogs rule. Rename B_TRANSLATE_APP_NAME and related macros to the more generic B_TRANSLATE_SYSTEM_NAME, to also fits add-ons, folders, etc, and make 'System name' its standard context. Change CodyCam and PoorMan's app signatures to match the overall x-vnd.Haiku-App pattern. Some clean-up. Make SlideShowSaver build again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41103 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 480d660fb023665b76b44aa2ad9e9ce17499b25b 13-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Introducing a catalog app name context, related macros, and making use of this in DeskCalc.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40930 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cd7548f537d5833b7ec6e6c09f0cf984fd53b422 04-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Some apps get the name lookup attribute.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40811 a95241bf-73f2-0310-859d-f6bbb57e9c96


# accec9a7ae72185d181c72fbeca054a101b83a0d 06-Nov-2009 Alexandre Deckner <alex@zappotek.com>

* Style fixes. Encountered ambiguous cases, please see my following questions
in the commit ml.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33923 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c0f89a7fdb3123261179d694c50c7eaf5609241 10-May-2009 Stephan Aßmus <superstippi@gmx.de>

Fixed small coding style violations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30696 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 51e404fde5ca6de35db375bfd5c054438cf33706 09-May-2009 Philippe Saint-Pierre <stpere@gmail.com>

Fixed the initial size of the DeskCalc window.

For some reason, it was resizing the window to the size of the dragger frame :-) (the frame variable was reused to a different purpose)

Fixes ticket #3896


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30679 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bc3229d648655bf13d4297f4dfef9884987fdbfb 22-Feb-2009 Jérôme Duval <korli@users.berlios.de>

* load settings before building the window: the behavior is then similar with the replicant version.
* change window limits when keypad option is off
* style cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29293 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 551612ea1121c7f2dad3cb8372776661a6bc0572 21-Feb-2009 Jérôme Duval <korli@users.berlios.de>

Applied patch from richy_rich for bug #3034. Seems like 100*100 is a good minimum size.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29270 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cd6b83ddc1b4cbd90eb6565752f6ef930360bb3b 09-Feb-2008 Jonas Sundström <jonas@kirilla.com>

The title of the (primary) window of (non-document) apps and preferences should be the filename of the executable. File and window names should be changed in tandem in the future. All IMO. Sorry, Marcus, for changing TV-O-Rama. :/ We may want to consider using more proper language, e.g. 'Screensaver' or 'Screen Saver' instead of 'ScreenSaver'. DeskCalc or 'Desk Calculator' should be just Calculator. We should avoid clinging to BeOS history, like with the name CodyCam, which hardly makes any sense anymore, even if you happen to be one of the few BeOS oldtimers.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23935 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1f84dba758bfad519f525d2e835fd1525b4a1b6a 07-Jun-2006 Stephan Aßmus <superstippi@gmx.de>

the finishing touches...
* now displays the calculator icon besides the text entry
when the keypad is off, also draws a frame around the text
entry and uses standard black on white...
* fixed a few other issues
* should hopefully be complete now
* on R5, there are sometimes rendering bugs with the
app_server (sometimes it doesn't invalidate views that
are transparent and have been resized before the window is
shown)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17777 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7cb395c433f4ba7efee9f127f9d41fb651f3c30f 06-Jun-2006 Stephan Aßmus <superstippi@gmx.de>

adding DeskCalc by Timothy Wayper

huge cleanup of the DeskCalc code:
* applied style guide
* fixed any TODOs from timmy
* slightly nicer looking options window
* new way to store settings
* code should be more robust
* includes parser kindly donated by Daniel Wallner


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17737 a95241bf-73f2-0310-859d-f6bbb57e9c96