Imported WineCalc by James Briggs.

svn path=/trunk/; revision=8502
This commit is contained in:
Steven Edwards 2004-03-01 23:27:02 +00:00
parent 43a529f49b
commit 636e39eb03
24 changed files with 5762 additions and 1261 deletions

155
rosapps/calc/En.rc Normal file
View file

@ -0,0 +1,155 @@
/*
* WineCalc (En.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "GNU Calculator"
IDS_COPYRIGHT1, "GNU Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

155
rosapps/calc/Es.rc Normal file
View file

@ -0,0 +1,155 @@
/*
* WineCalc (Es.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "GNU Calculator"
IDS_COPYRIGHT1, "GNU Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

155
rosapps/calc/Fr.rc Normal file
View file

@ -0,0 +1,155 @@
/*
* WineCalc (Fr.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "GNU Calculator"
IDS_COPYRIGHT1, "GNU Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

155
rosapps/calc/It.rc Normal file
View file

@ -0,0 +1,155 @@
/*
* WineCalc (It.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "GNU Calculator"
IDS_COPYRIGHT1, "GNU Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

155
rosapps/calc/Nl.rc Normal file
View file

@ -0,0 +1,155 @@
/*
* WineCalc (Nl.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "GNU Calculator"
IDS_COPYRIGHT1, "GNU Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

155
rosapps/calc/Pt.rc Normal file
View file

@ -0,0 +1,155 @@
/*
* WineCalc (Pt.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "GNU Calculator"
IDS_COPYRIGHT1, "GNU Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

155
rosapps/calc/Ru.rc Normal file
View file

@ -0,0 +1,155 @@
/*
* WineCalc (Ru.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "GNU Calculator"
IDS_COPYRIGHT1, "GNU Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

156
rosapps/calc/Si.rc Normal file
View file

@ -0,0 +1,156 @@
/*
* WineCalc (Si.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "resource.h"
#include "winecalc.h"
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_APPNAME, "GNU Calculator"
IDS_COPYRIGHT1, "GNU Calculator 5.0. Licensed under LGPL 2"
IDS_COPYRIGHT2 "Copyright 2003, James Briggs"
IDS_COPYRIGHT3 "San Jose, California, USA"
IDS_COPYRIGHT4 "james@ActionMessage.com"
IDS_COPYRIGHT5 "http://www.ActionMessage.com/winecalc/"
IDS_BTN_BACKSPACE, "Backspace"
IDS_BTN_CLEAR_ENTRY, "CE"
IDS_BTN_CLEAR_ALL, "C"
IDS_BTN_MEM_CLEAR, "MC"
IDS_BTN_MEM_RECALL, "MR"
IDS_BTN_MEM_STORE, "MS"
IDS_BTN_MEM_PLUS, "M+"
IDS_BTN_MEM_STATUS_M, "M"
IDS_BTN_SQRT, "sqrt"
IDS_ERR_INVALID_INPUT, "Invalid input for function."
IDS_ERR_DIVIDE_BY_ZERO, "Cannot divide by zero."
IDS_ERR_UNDEFINED, "Result of function is undefined."
}
MAIN_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIMS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Degrees\tF2", ID_CALC_MS_DEGREES
MENUITEM "Radians\tF3", ID_CALC_MS_RADIANS
MENUITEM "Grads\tF4", ID_CALC_MS_GRADS
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
SCIWS_MENU MENU DISCARDABLE
{
POPUP "&Edit" {
MENUITEM "&Copy Ctrl+C", IDM_COPY
MENUITEM "&Paste Ctrl+V", IDM_PASTE
}
POPUP "&View" {
MENUITEM "Standard", IDM_MODE_STANDARD
MENUITEM "Scientific", IDM_MODE_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "Hex\tF5", ID_CALC_NS_HEX
MENUITEM "Decimal\tF6", ID_CALC_NS_DEC
MENUITEM "Octal\tF7", ID_CALC_NS_OCT
MENUITEM "Binary\tF8", ID_CALC_NS_BIN
MENUITEM SEPARATOR
MENUITEM "Qword\tF12", ID_CALC_WS_QWORD
MENUITEM "Dword\tF2", ID_CALC_WS_DWORD
MENUITEM "Word\tF3", ID_CALC_WS_WORD
MENUITEM "Byte\tF4", ID_CALC_WS_BYTE
MENUITEM SEPARATOR
MENUITEM "Digit Grouping", IDM_DIGIT_GROUPING
}
POPUP "&Help" {
MENUITEM "Help Topics", IDM_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "About Calculator", IDM_ABOUT
}
}
MAIN_MENU ACCELERATORS
BEGIN
VK_F1, IDV_HELP, VIRTKEY
END
WHATS_THIS_MENU MENU DISCARDABLE
{
POPUP "" {
MENUITEM "What's This?", IDM_WHATS_THIS
}
}
DLG_ABOUT DIALOG 12,0,120,82
CAPTION "About GNU winecalc"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
BEGIN
DEFPUSHBUTTON "OK", IDOK, 42, 60, 30, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
END
DLG_STATS DIALOG 12,0,125,78
CAPTION "Statistics Box"
FONT 9, "Tahoma"
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
BEGIN
DEFPUSHBUTTON "&RET", ID_STATS_RET, 4, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&LOAD", ID_STATS_LOAD, 34, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "&CD" ID_STATS_CD, 64, 52, 25, 13, WS_TABSTOP | WS_GROUP
PUSHBUTTON "C&AD", ID_STATS_CAD, 94, 52, 25, 13, WS_TABSTOP | WS_GROUP
END

View file

@ -1,219 +0,0 @@
/*
* ReactOS calc
*
* button.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <tchar.h>
#include "resource.h"
#include "button.h"
COLORREF text_colour;
COLORREF background_colour;
COLORREF disabled_background_colour;
COLORREF light;
COLORREF highlight;
COLORREF shadow;
COLORREF dark_shadow;
const COLORREF CLR_BTN_WHITE = RGB(255, 255, 255);
const COLORREF CLR_BTN_BLACK = RGB(0, 0, 0);
const COLORREF CLR_BTN_DGREY = RGB(128, 128, 128);
const COLORREF CLR_BTN_GREY = RGB(192, 192, 192);
const COLORREF CLR_BTN_LLGREY = RGB(223, 223, 223);
const int BUTTON_IN = 0x01;
const int BUTTON_OUT = 0x02;
const int BUTTON_BLACK_BORDER = 0x04;
void InitColours(void)
{
// text_colour = GetSysColor(COLOR_BTNTEXT);
text_colour = RGB(255,0,0);
background_colour = GetSysColor(COLOR_BTNFACE);
disabled_background_colour = background_colour;
light = GetSysColor(COLOR_3DLIGHT);
highlight = GetSysColor(COLOR_BTNHIGHLIGHT);
shadow = GetSysColor(COLOR_BTNSHADOW);
dark_shadow = GetSysColor(COLOR_3DDKSHADOW);
}
static void FillSolidRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clr)
{
RECT rect;
SetBkColor(hDC, clr);
rect.left = x;
rect.top = y;
rect.right = x + cx;
rect.bottom = y + cy;
ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);
}
void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)
{
FillSolidRect(hDC, x, y, cx - 1, 1, clrTopLeft);
FillSolidRect(hDC, x, y, 1, cy - 1, clrTopLeft);
FillSolidRect(hDC, x + cx, y, -1, cy, clrBottomRight);
FillSolidRect(hDC, x, y + cy, cx, -1, clrBottomRight);
}
void DrawFilledRect(HDC hdc, LPRECT r, COLORREF colour)
{
HBRUSH hBrush;
hBrush = CreateSolidBrush(colour);
FillRect(hdc, r, hBrush);
}
void DrawLine(HDC hdc, long sx, long sy, long ex, long ey, COLORREF colour)
{
HPEN new_pen;
HPEN old_pen;
new_pen = CreatePen(PS_SOLID, 1, colour);
old_pen = SelectObject(hdc, &new_pen);
MoveToEx(hdc, sx, sy, NULL);
LineTo(hdc, ex, ey);
SelectObject(hdc, old_pen);
DeleteObject(new_pen);
}
void DrawFrame(HDC hdc, RECT r, int state)
{
COLORREF colour;
if (state & BUTTON_BLACK_BORDER) {
colour = CLR_BTN_BLACK;
DrawLine(hdc, r.left, r.top, r.right, r.top, colour); // Across top
DrawLine(hdc, r.left, r.top, r.left, r.bottom, colour); // Down left
DrawLine(hdc, r.left, r.bottom - 1, r.right, r.bottom - 1, colour); // Across bottom
DrawLine(hdc, r.right - 1, r.top, r.right - 1, r.bottom, colour); // Down right
InflateRect(&r, -1, -1);
}
if (state & BUTTON_OUT) {
colour = highlight;
DrawLine(hdc, r.left, r.top, r.right, r.top, colour); // Across top
DrawLine(hdc, r.left, r.top, r.left, r.bottom, colour); // Down left
colour = dark_shadow;
DrawLine(hdc, r.left, r.bottom - 1, r.right, r.bottom - 1, colour); // Across bottom
DrawLine(hdc, r.right - 1, r.top, r.right - 1, r.bottom, colour); // Down right
InflateRect(&r, -1, -1);
colour = light;
DrawLine(hdc, r.left, r.top, r.right, r.top, colour); // Across top
DrawLine(hdc, r.left, r.top, r.left, r.bottom, colour); // Down left
colour = shadow;
DrawLine(hdc, r.left, r.bottom - 1, r.right, r.bottom - 1, colour); // Across bottom
DrawLine(hdc, r.right - 1, r.top, r.right - 1, r.bottom, colour); // Down right
}
if (state & BUTTON_IN) {
colour = dark_shadow;
DrawLine(hdc, r.left, r.top, r.right, r.top, colour); // Across top
DrawLine(hdc, r.left, r.top, r.left, r.bottom, colour); // Down left
DrawLine(hdc, r.left, r.bottom - 1, r.right, r.bottom - 1, colour); // Across bottom
DrawLine(hdc, r.right - 1, r.top, r.right - 1, r.bottom, colour); // Down right
InflateRect(&r, -1, -1);
colour = shadow;
DrawLine(hdc, r.left, r.top, r.right, r.top, colour); // Across top
DrawLine(hdc, r.left, r.top, r.left, r.bottom, colour); // Down left
DrawLine(hdc, r.left, r.bottom - 1, r.right, r.bottom - 1, colour); // Across bottom
DrawLine(hdc, r.right - 1, r.top, r.right - 1, r.bottom, colour); // Down right
}
}
void DrawButtonText(HDC hdc, LPRECT r, LPCTSTR Buf, COLORREF text_colour)
{
COLORREF previous_colour;
previous_colour = SetTextColor(hdc, text_colour);
SetBkMode(hdc, TRANSPARENT);
DrawText(hdc, Buf, _tcslen(Buf), r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SetTextColor(hdc, previous_colour);
}
#define bufSize 512
void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
HDC hdc;
RECT focus_rect, button_rect, offset_button_rect;
UINT state;
TCHAR buffer[bufSize];
hdc = lpDrawItemStruct->hDC;
state = lpDrawItemStruct->itemState;
CopyRect(&focus_rect, &lpDrawItemStruct->rcItem);
CopyRect(&button_rect, &lpDrawItemStruct->rcItem);
// Set the focus rectangle to just past the border decoration
focus_rect.left += 4;
focus_rect.right -= 4;
focus_rect.top += 4;
focus_rect.bottom -= 4;
// Retrieve the button's caption
GetWindowText(lpDrawItemStruct->hwndItem, buffer, bufSize);
if (state & ODS_DISABLED) {
DrawFilledRect(hdc, &button_rect, disabled_background_colour);
} else {
DrawFilledRect(hdc, &button_rect, background_colour);
}
if (state & ODS_SELECTED) {
DrawFrame(hdc, button_rect, BUTTON_IN);
} else {
if ((state & ODS_DEFAULT) || (state & ODS_FOCUS)) {
DrawFrame(hdc, button_rect, BUTTON_OUT | BUTTON_BLACK_BORDER);
} else {
DrawFrame(hdc, button_rect, BUTTON_OUT);
}
}
if (state & ODS_DISABLED) {
offset_button_rect = button_rect;
OffsetRect(&offset_button_rect, 1, 1);
DrawButtonText(hdc, &offset_button_rect, buffer, CLR_BTN_WHITE);
DrawButtonText(hdc, &button_rect, buffer, CLR_BTN_DGREY);
} else {
if (lpDrawItemStruct->CtlID >= ID_RED_START && lpDrawItemStruct->CtlID <= ID_RED_FINISH) {
DrawButtonText(hdc, &button_rect, buffer, RGB(255,0,0));
} else
if (lpDrawItemStruct->CtlID >= ID_PURPLE_START && lpDrawItemStruct->CtlID <= ID_PURPLE_FINISH) {
DrawButtonText(hdc, &button_rect, buffer, RGB(0,128,128));
} else
if (lpDrawItemStruct->CtlID >= ID_BLUE_START && lpDrawItemStruct->CtlID <= ID_BLUE_FINISH) {
DrawButtonText(hdc, &button_rect, buffer, RGB(0,0,255));
} else {
DrawButtonText(hdc, &button_rect, buffer, text_colour);
}
}
if (state & ODS_FOCUS) {
DrawFocusRect(lpDrawItemStruct->hDC, (LPRECT)&focus_rect);
}
}

View file

@ -1,44 +0,0 @@
/*
* ReactOS calc
*
* button.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __BUTTON_H__
#define __BUTTON_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
void InitColours(void);
void Draw3dRect(HDC hDC, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight);
void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
#ifdef __cplusplus
};
#endif
#endif // __BUTTON_H__

View file

@ -1,388 +1,6 @@
/* Do not Make changes here */
#include <windows.h>
#include <reactos/resource.h>
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (Australia) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_CALC_STANDARD MENU DISCARDABLE
BEGIN
POPUP "&Edit"
BEGIN
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
END
POPUP "&View"
BEGIN
MENUITEM "S&tandard", ID_VIEW_STANDARD, CHECKED
MENUITEM "&Scientific", ID_VIEW_SCIENTIFIC
MENUITEM SEPARATOR
MENUITEM "D&igit grouping", ID_VIEW_DIGIT_GROUPING
END
POPUP "&Help"
BEGIN
MENUITEM "&Help Topics", ID_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "&About Calculator", ID_HELP_ABOUT
END
END
IDR_CALC_SCIENTIFIC MENU DISCARDABLE
BEGIN
POPUP "&Edit"
BEGIN
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
END
POPUP "&View"
BEGIN
MENUITEM "S&tandard", ID_VIEW_STANDARD
MENUITEM "&Scientific", ID_VIEW_SCIENTIFIC, CHECKED
MENUITEM SEPARATOR
MENUITEM "&Hex\tF5", ID_VIEW_HEX
MENUITEM "&Decimal\tF6", ID_VIEW_DECIMAL
MENUITEM "&Octal\tF7", ID_VIEW_OCTAL
MENUITEM "&Binary\tF8", ID_VIEW_BINARY
MENUITEM SEPARATOR
MENUITEM "D&egrees\tF2", ID_VIEW_DEGREES
MENUITEM "&Radians\tF3", ID_VIEW_RADIANS
MENUITEM "&Grads\tF4", ID_VIEW_GRADS
MENUITEM SEPARATOR
MENUITEM "D&igit grouping", ID_VIEW_DIGIT_GROUPING
END
POPUP "&Help"
BEGIN
MENUITEM "&Help Topics", ID_HELP_TOPICS
MENUITEM SEPARATOR
MENUITEM "&About Scientific Calculator", ID_HELP_ABOUT
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_STANDARD DIALOG DISCARDABLE 0, 0, 170, 126
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "ReactOS Calculator"
MENU IDR_CALC_STANDARD
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "M+",IDC_MPLUS,"Button",BS_OWNERDRAW,5,106,
23,16
CONTROL "MS",IDC_MS,"Button",BS_OWNERDRAW,5,85,23,
16
CONTROL "MR",IDC_MR,"Button",BS_OWNERDRAW,5,65,23,
16
CONTROL "MC",IDC_MC,"Button",BS_OWNERDRAW,5,45,23,
16
CONTROL "0",IDC_0,"Button",BS_OWNERDRAW,37,106,23,
16
CONTROL "1",IDC_1,"Button",BS_OWNERDRAW,37,85,23,16
CONTROL "4",IDC_4,"Button",BS_OWNERDRAW,37,65,23,16
CONTROL "7",IDC_7,"Button",BS_OWNERDRAW,37,45,23,16
CONTROL "+/-",IDC_PLUSMINUS,"Button",BS_OWNERDRAW,
63,106,23,16
CONTROL "2",IDC_2,"Button",BS_OWNERDRAW,63,85,23,16
CONTROL "5",IDC_5,"Button",BS_OWNERDRAW,63,65,23,16
CONTROL "8",IDC_8,"Button",BS_OWNERDRAW,63,45,23,16
CONTROL ".",IDC_DECPOINT,"Button",BS_OWNERDRAW,89,
106,23,16
CONTROL "3",IDC_3,"Button",BS_OWNERDRAW,89,85,23,16
CONTROL "6",IDC_6,"Button",BS_OWNERDRAW,89,65,23,16
CONTROL "9",IDC_9,"Button",BS_OWNERDRAW,89,45,23,16
CONTROL "+",IDC_PLUS,"Button",BS_OWNERDRAW,115,106,
23,16
CONTROL "-",IDC_MINUS,"Button",BS_OWNERDRAW,115,85,
23,16
CONTROL "*",IDC_MULTIPLY,"Button",BS_OWNERDRAW,115,
65,23,16
CONTROL "/",IDC_DIVIDE,"Button",BS_OWNERDRAW,115,45,
23,16
CONTROL "=",IDC_EQUALS,"Button",BS_OWNERDRAW,142,
106,23,16
CONTROL "1/x",IDC_INVERT,"Button",BS_OWNERDRAW,142,
85,23,16
CONTROL "%",IDC_PERCENT,"Button",BS_OWNERDRAW,142,
65,23,16
CONTROL "sqrt",IDC_SQRT,"Button",BS_OWNERDRAW,142,
45,23,16
CONTROL "C",IDC_CLEAR,"Button",BS_OWNERDRAW,126,23,
39,16
CONTROL "CE",IDC_CE,"Button",BS_OWNERDRAW,83,23,39,
16
CONTROL "Backspace",IDC_BSPACE,"Button",BS_OWNERDRAW,38,23,41,16
CTEXT "M",IDC_MEMTEXT,7,23,19,16,SS_CENTERIMAGE | SS_SUNKEN
EDITTEXT IDC_RESULT,7,0,157,15,ES_RIGHT | ES_AUTOHSCROLL
END
IDD_SCIENTIFIC DIALOG DISCARDABLE 0, 0, 313, 161
STYLE DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ReactOS Scientific Calculator"
MENU IDR_CALC_SCIENTIFIC
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "M+",IDC_MPLUS,"Button",BS_OWNERDRAW,122,
121,23,16
CONTROL "MS",IDC_MS,"Button",BS_OWNERDRAW,122,101,
23,16
CONTROL "MR",IDC_MR,"Button",BS_OWNERDRAW,122,81,23,
16
CONTROL "MC",IDC_MC,"Button",BS_OWNERDRAW,122,61,23,
16
CONTROL "0",IDC_0,"Button",BS_OWNERDRAW,156,121,23,
16
CONTROL "1",IDC_1,"Button",BS_OWNERDRAW,156,101,23,
16
CONTROL "4",IDC_4,"Button",BS_OWNERDRAW,156,81,23,
16
CONTROL "7",IDC_7,"Button",BS_OWNERDRAW,156,61,23,
16
CONTROL "+/-",IDC_PLUSMINUS,"Button",BS_OWNERDRAW,
182,121,23,16
CONTROL "2",IDC_2,"Button",BS_OWNERDRAW,182,101,23,
16
CONTROL "5",IDC_5,"Button",BS_OWNERDRAW,182,81,23,
16
CONTROL "8",IDC_8,"Button",BS_OWNERDRAW,182,61,23,
16
CONTROL ".",IDC_DECPOINT,"Button",BS_OWNERDRAW,208,
121,23,16
CONTROL "3",IDC_3,"Button",BS_OWNERDRAW,208,101,23,
16
CONTROL "6",IDC_6,"Button",BS_OWNERDRAW,208,81,23,
16
CONTROL "9",IDC_9,"Button",BS_OWNERDRAW,208,61,23,
16
CONTROL "+",IDC_PLUS,"Button",BS_OWNERDRAW,234,121,
23,16
CONTROL "-",IDC_MINUS,"Button",BS_OWNERDRAW,234,101,
23,16
CONTROL "*",IDC_MULTIPLY,"Button",BS_OWNERDRAW,234,
81,23,16
CONTROL "/",IDC_DIVIDE,"Button",BS_OWNERDRAW,234,61,
23,16
CONTROL "=",IDC_EQUALS,"Button",BS_OWNERDRAW,260,
121,23,16
CONTROL "Lsh",IDC_LSH,"Button",BS_OWNERDRAW,260,101,
23,16
CONTROL "Or",IDC_OR,"Button",BS_OWNERDRAW,260,81,23,
16
CONTROL "Mod",IDC_MOD,"Button",BS_OWNERDRAW,260,61,
23,16
CONTROL "C",IDC_CLEAR,"Button",BS_OWNERDRAW,268,38,
41,16
CONTROL "CE",IDC_CE,"Button",BS_OWNERDRAW,224,38,40,
16
CONTROL "Backspace",IDC_BSPACE,"Button",BS_OWNERDRAW,178,38,42,16
CTEXT "M",IDC_MEMTEXT,123,38,19,16,SS_CENTERIMAGE | SS_SUNKEN
CONTROL "Int",IDC_INT,"Button",BS_OWNERDRAW,286,121,
23,16
CONTROL "Not",IDC_NOT,"Button",BS_OWNERDRAW,286,101,
23,16
CONTROL "Xor",IDC_XOR,"Button",BS_OWNERDRAW,286,81,
23,16
CONTROL "And",IDC_AND,"Button",BS_OWNERDRAW,286,61,
23,16
CONTROL "pi",IDC_PI,"Button",BS_OWNERDRAW,122,142,
23,16
CONTROL "A",IDC_A,"Button",BS_OWNERDRAW,156,142,23,
16
CONTROL "B",IDC_B,"Button",BS_OWNERDRAW,182,142,23,
16
CONTROL "C",IDC_C,"Button",BS_OWNERDRAW,208,142,23,
16
CONTROL "D",IDC_D,"Button",BS_OWNERDRAW,234,142,23,
16
CONTROL "E",IDC_E,"Button",BS_OWNERDRAW,260,142,23,
16
CONTROL "F",IDC_F,"Button",BS_OWNERDRAW,286,142,23,
16
CONTROL "cos",IDC_COS,"Button",BS_OWNERDRAW,37,121,
23,16
CONTROL "sin",IDC_SIN,"Button",BS_OWNERDRAW,37,101,
23,16
CONTROL "dms",IDC_DMS,"Button",BS_OWNERDRAW,37,81,
23,16
CONTROL "F-E",IDC_FE,"Button",BS_OWNERDRAW,37,61,23,
16
CONTROL "x^3",IDC_CUBE,"Button",BS_OWNERDRAW,63,121,
23,16
CONTROL "x^y",IDC_POWER,"Button",BS_OWNERDRAW,63,
101,23,16
CONTROL "Exp",IDC_EXP,"Button",BS_OWNERDRAW,63,81,
23,16
CONTROL "(",IDC_OPENBKT,"Button",BS_OWNERDRAW,63,61,
23,16
CONTROL "n!",IDC_BANG,"Button",BS_OWNERDRAW,89,121,
23,16
CONTROL "log",IDC_LOG,"Button",BS_OWNERDRAW,89,101,
23,16
CONTROL "ln",IDC_LN,"Button",BS_OWNERDRAW,89,81,23,
16
CONTROL ")",IDC_CLOSEBK,"Button",BS_OWNERDRAW,89,61,
23,16
CONTROL "tan",IDC_TAN,"Button",BS_OWNERDRAW,37,142,
23,16
CONTROL "x^2",IDC_SQUARE,"Button",BS_OWNERDRAW,63,
142,23,16
CONTROL "1/x",IDC_INVERT,"Button",BS_OWNERDRAW,89,
142,23,16
CONTROL "s",IDC_S,"Button",BS_OWNERDRAW,4,121,23,16
CONTROL "Sum",IDC_SUM,"Button",BS_OWNERDRAW,4,101,
23,16
CONTROL "Ave",IDC_AVE,"Button",BS_OWNERDRAW,4,81,23,
16
CONTROL "Sta",IDC_STA,"Button",BS_OWNERDRAW,4,61,23,
16
CONTROL "Dat",IDC_DAT,"Button",BS_OWNERDRAW,4,142,
23,16
CTEXT "9",IDC_BKTTEXT,91,38,19,16,SS_CENTERIMAGE | SS_SUNKEN
GROUPBOX "",IDC_INVHYP,6,34,80,22,WS_GROUP
CONTROL "Inv",IDC_INV,"Button",BS_AUTOCHECKBOX,9,42,26,10
CONTROL "Hyp",IDC_HYP,"Button",BS_AUTOCHECKBOX,47,41,29,10
GROUPBOX "",IDC_BASE,6,13,141,22,WS_GROUP
CONTROL "Hex",IDC_HEX,"Button",BS_AUTORADIOBUTTON,8,21,29,10
CONTROL "Dec",IDC_DEC,"Button",BS_AUTORADIOBUTTON,42,21,29,10
CONTROL "Oct",IDC_OCT,"Button",BS_AUTORADIOBUTTON,76,21,27,10
CONTROL "Bin",IDC_BIN,"Button",BS_AUTORADIOBUTTON,109,21,26,10
GROUPBOX "",IDC_UNITS,150,13,160,22,WS_GROUP
CONTROL "Degrees",IDC_DEGREES,"Button",BS_AUTORADIOBUTTON,152,21,
43,10
CONTROL "Radians",IDC_RADIANS,"Button",BS_AUTORADIOBUTTON,204,21,
42,10
CONTROL "Grads",IDC_GRADS,"Button",BS_AUTORADIOBUTTON,255,21,35,
10
EDITTEXT IDC_RESULT,6,0,303,15,ES_RIGHT | ES_AUTOHSCROLL
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
(1) VERSIONINFO
FILEVERSION 0,0,19,147
PRODUCTVERSION 0,0,19,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "Absolutely no warranties whatsoever - Use at your own risk\0"
VALUE "CompanyName", "ReactOS Development Team\0"
VALUE "FileDescription", "ReactOS Calculator by Robert Dickenson\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "calc\0"
VALUE "LegalCopyright", "Copyright © 2002 Robert Dickenson\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "calc.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "ReactOS Operating System\0"
VALUE "ProductVersion", "0.0.19\0"
VALUE "SpecialBuild", "Non-versioned Development Beta Release\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0xc09, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_APP_TITLE "ReactOS Calculator"
IDS_APP_REG_KEY "\\Calculator"
IDS_APP_REG_PATH "Software\\ReactWare"
END
#endif // English (Australia) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
#include "rsrc.rc"

93
rosapps/calc/dialog.c Normal file
View file

@ -0,0 +1,93 @@
/*
* WineCalc (dialog.c)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include "dialog.h"
#include "resource.h"
#include "winecalc.h"
extern HINSTANCE hInstance;
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
HDC hdc;
PAINTSTRUCT ps;
switch( uMsg ) {
case WM_INITDIALOG:
SendMessage (hDlg, WM_SETFONT, (UINT)GetStockObject(DEFAULT_GUI_FONT), TRUE);
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDOK:
EndDialog( hDlg, 0 );
return TRUE;
}
break;
case WM_PAINT:
{
HDC hMemDC;
HFONT hFont;
HFONT hFontOrg;
char c1[CALC_BUF_SIZE];
char c2[CALC_BUF_SIZE];
char c3[CALC_BUF_SIZE];
char c4[CALC_BUF_SIZE];
char c5[CALC_BUF_SIZE];
hdc = BeginPaint( hDlg, &ps );
hMemDC = CreateCompatibleDC( hdc );
LoadString( hInstance, IDS_COPYRIGHT1, c1, sizeof(c1));
LoadString( hInstance, IDS_COPYRIGHT2, c2, sizeof(c2));
LoadString( hInstance, IDS_COPYRIGHT3, c3, sizeof(c3));
LoadString( hInstance, IDS_COPYRIGHT4, c4, sizeof(c4));
LoadString( hInstance, IDS_COPYRIGHT5, c5, sizeof(c5));
hFont = GetStockObject(DEFAULT_GUI_FONT);
hFontOrg = SelectObject(hdc, hFont);
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc, 10, 10, c1, strlen(c1));
TextOut(hdc, 10, 35, c2, strlen(c2));
TextOut(hdc, 10, 50, c3, strlen(c3));
TextOut(hdc, 10, 75, c4, strlen(c4));
TextOut(hdc, 10, 90, c5, strlen(c5));
SelectObject(hdc, hFontOrg);
DeleteDC( hMemDC );
EndPaint( hDlg, &ps );
return 0;
}
case WM_CLOSE:
EndDialog( hDlg, TRUE );
return 0;
}
return FALSE;
}

24
rosapps/calc/dialog.h Normal file
View file

@ -0,0 +1,24 @@
/*
* WineCalc (dialog.h)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );

View file

@ -1,266 +0,0 @@
/*
* ReactOS calc
*
* calc.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <shellapi.h>
#include <tchar.h>
#include "main.h"
#include "button.h"
#include "settings.h"
// Global Variables:
HINSTANCE hInst;
HWND hDlgWnd;
TCHAR szTitle[MAX_LOADSTRING];
CALC_TYPES CalcType;
HACCEL hAccel;
BOOL bDigitGrouping = FALSE;
/*TODO: Figure out why we are copying MFC map style programming.
** This pattern is difficult to maintain.
*/
#define BEGIN_CMD_MAP(a) switch(##a) {
#define CMD_MAP_ENTRY(a, b) case a: b(); break;
#define END_CMD_MAP(a) }
BOOL OnCreate(HWND hWnd)
{
HMENU hMenu;
HMENU hViewMenu;
hMenu = GetMenu(hDlgWnd);
hViewMenu = GetSubMenu(hMenu, ID_MENU_VIEW);
if (bDigitGrouping) {
CheckMenuItem(hViewMenu, ID_VIEW_DIGIT_GROUPING, MF_BYCOMMAND|MF_CHECKED);
}
//SendMessage(hDlgWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(hInst, MAKEINTRESOURCE(IDI_CALC)));
// Initialize the Windows Common Controls DLL
//InitCommonControls();
return TRUE;
}
void OnEditCopy(void)
{
SendMessage(GetDlgItem(hDlgWnd, IDC_RESULT), WM_COMMAND, MAKELONG(ID_EDIT_COPY, 0), 0);
}
void OnEditPaste(void)
{
SendMessage(GetDlgItem(hDlgWnd, IDC_RESULT), WM_COMMAND, MAKELONG(ID_EDIT_PASTE, 0), 0);
}
void OnViewStandard(void)
{
CalcType = STANDARD;
DestroyWindow(hDlgWnd);
}
void OnViewScientific(void)
{
CalcType = SCIENTIFIC;
DestroyWindow(hDlgWnd);
}
void OnViewDigitGrouping(void)
{
HMENU hMenu = GetMenu(hDlgWnd);
HMENU hViewMenu = GetSubMenu(hMenu, ID_MENU_VIEW);
bDigitGrouping = !bDigitGrouping;
if (bDigitGrouping) {
CheckMenuItem(hViewMenu, ID_VIEW_DIGIT_GROUPING, MF_BYCOMMAND|MF_CHECKED);
} else {
CheckMenuItem(hViewMenu, ID_VIEW_DIGIT_GROUPING, MF_BYCOMMAND|MF_UNCHECKED);
}
}
void OnViewHex(void)
{
}
void OnViewDecimal(void)
{
}
void OnViewOctal(void)
{
}
void OnViewBinary(void)
{
}
void OnViewDegrees(void)
{
}
void OnViewRadians(void)
{
}
void OnViewGrads(void)
{
}
void OnHelpTopics(void)
{
WinHelp(hDlgWnd, _T("calc"), HELP_CONTENTS, 0);
}
void OnHelpAbout(void)
{
ShellAbout(hDlgWnd, _T("ReactOS Calculator"), _T(""), LoadIcon(hInst, MAKEINTRESOURCE(IDI_CALC)));
}
void OnButtonClick(int ButtonID)
{
}
// Message handler for dialog box.
LRESULT CALLBACK CalcWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case WM_INITDIALOG:
hDlgWnd = hDlg;
InitColours();
return OnCreate(hDlg);
case WM_DRAWITEM:
DrawItem((LPDRAWITEMSTRUCT)lParam);
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
if (HIWORD(wParam) == BN_CLICKED) {
switch (LOWORD(wParam)) {
OnButtonClick(LOWORD(wParam));
//case IDC_OWNERDRAW:
// // application-defined processing
// break;
}
}
//BEGIN_CMD_MAP( LOWORD(wParam) )
switch (LOWORD(wParam))
{
CMD_MAP_ENTRY(ID_EDIT_COPY, OnEditCopy)
CMD_MAP_ENTRY(ID_EDIT_PASTE, OnEditPaste)
CMD_MAP_ENTRY(ID_VIEW_STANDARD, OnViewStandard)
CMD_MAP_ENTRY(ID_VIEW_SCIENTIFIC, OnViewScientific)
CMD_MAP_ENTRY(ID_VIEW_DIGIT_GROUPING, OnViewDigitGrouping)
CMD_MAP_ENTRY(ID_VIEW_HEX, OnViewHex)
CMD_MAP_ENTRY(ID_VIEW_DECIMAL, OnViewDecimal)
CMD_MAP_ENTRY(ID_VIEW_OCTAL, OnViewOctal)
CMD_MAP_ENTRY(ID_VIEW_BINARY, OnViewBinary)
CMD_MAP_ENTRY(ID_VIEW_DEGREES, OnViewDegrees)
CMD_MAP_ENTRY(ID_VIEW_RADIANS, OnViewRadians)
CMD_MAP_ENTRY(ID_VIEW_GRADS, OnViewGrads)
CMD_MAP_ENTRY(ID_HELP_TOPICS, OnHelpTopics)
CMD_MAP_ENTRY(ID_HELP_ABOUT, OnHelpAbout)
}
//END_CMD_MAP(0)
break;
/*
case WM_KEYUP:
case WM_KEYDOWN:
{
MSG msg;
msg.hwnd = hDlg;
msg.message = message;
msg.wParam = wParam;
msg.lParam = lParam;
// msg.time;
// msg.pt;
if (TranslateAccelerator(hDlg, hAccel, &msg)) return 0;
}
break;
*/
case WM_NOTIFY:
{
int idctrl;
LPNMHDR pnmh;
idctrl = (int)wParam;
pnmh = (LPNMHDR)lParam;
/*
if ((pnmh->hwndFrom == hTabWnd) &&
(pnmh->idFrom == IDC_TAB) &&
(pnmh->code == TCN_SELCHANGE))
{
_OnTabWndSelChange();
}
*/
}
break;
case WM_DESTROY:
WinHelp(hDlgWnd, _T("regedit"), HELP_QUIT, 0);
return DefWindowProc(hDlg, message, wParam, lParam);
}
return 0;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
CALC_TYPES CurrentCalcType;
// Initialize global variables
hInst = hInstance;
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
// Load our settings from the registry
LoadSettings();
hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDR_ACCELERATOR);
do {
CurrentCalcType = CalcType;
switch (CalcType) {
case HP42S:
break;
case SCIENTIFIC:
DialogBox(hInst, (LPCTSTR)IDD_SCIENTIFIC, NULL, (DLGPROC)CalcWndProc);
break;
case STANDARD:
default:
DialogBox(hInst, (LPCTSTR)IDD_STANDARD, NULL, (DLGPROC)CalcWndProc);
break;
}
} while (CalcType != CurrentCalcType);
// Save our settings to the registry
SaveSettings();
return 0;
}

View file

@ -1,52 +0,0 @@
/*
* ReactOS calc
*
* main.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __MAIN_H__
#define __MAIN_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h"
#define MAX_LOADSTRING 100
typedef enum _CALC_TYPES { STANDARD, SCIENTIFIC, HP42S, OTHER } CALC_TYPES;
extern HINSTANCE hInst;
extern HWND hDlgWnd;
extern TCHAR szTitle[];
extern CALC_TYPES CalcType;
#ifdef __cplusplus
};
#endif
#endif // __MAIN_H__

View file

@ -6,25 +6,15 @@
PATH_TO_TOP = ../../reactos
WINE_MODE = yes
WINE_RC = calc
TARGET_TYPE = program
TARGET_APPTYPE = windows
TARGET_NAME = calc
WINE_INCLUDE = ./
TARGET_CFLAGS = -D__USE_W32API -D_WIN32_IE=0x0501
TARGET_CFLAGS = -D__USE_W32API
#TARGET_CFLAGS = -I$(TEST_ROOT) -DDBG -DUNICODE -D_UNICODE
BASE_CFLAGS = -D_WIN32_IE=0x0400
RCFLAGS = -D_WIN32_IE=0x0400
TARGET_RCFLAGS = -D__USE_W32API -D_WIN32_IE=0x0501
TARGET_SDKLIBS = \
kernel32.a \
@ -34,9 +24,9 @@ TARGET_SDKLIBS = \
TARGET_GCCLIBS = comctl32
TARGET_OBJECTS = \
settings.o \
button.o \
main.o
dialog.o \
stats.o \
winecalc.o
include $(PATH_TO_TOP)/rules.mak

View file

@ -1,130 +1,68 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by calc.rc
//
#define ID_MENU_EDIT 0
#define ID_MENU_VIEW 1
#define ID_MENU_HELP 2
#define IDI_CALC 100
#define IDD_STANDARD 101
#define IDD_SCIENTIFIC 102
#define IDR_CALC_STANDARD 103
#define IDR_CALC_SCIENTIFIC 104
#define IDS_APP_TITLE 105
#define IDR_ACCELERATOR 106
#define IDS_APP_REG_KEY 107
#define IDS_APP_REG_PATH 108
/*
* WineCalc (resource.h)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define ID_EDIT_COPY 0xE122
#define ID_EDIT_PASTE 0xE125
/* menus */
#define ID_BLUE_START 1000
#define IDC_0 1000
#define IDC_1 1001
#define IDC_3 1002
#define IDC_2 1003
#define IDC_4 1004
#define IDC_5 1005
#define IDC_6 1006
#define IDC_7 1007
#define IDC_8 1008
#define IDC_9 1009
#define IDC_A 1010
#define IDC_B 1011
#define IDC_C 1012
#define IDC_D 1013
#define IDC_E 1014
#define IDC_F 1015
#define IDC_PLUSMINUS 1020
#define IDC_DECPOINT 1021
#define IDC_PERCENT 1022
#define IDC_SQRT 1023
#define IDC_PI 1024
#define IDC_S 1025
#define IDC_SUM 1026
#define IDC_AVE 1027
#define IDC_STA 1028
#define IDC_DAT 1029
#define ID_BLUE_FINISH 1029
#define IDM_COPY 1001
#define IDM_PASTE 1002
#define IDM_MODE_STANDARD 1003
#define IDM_MODE_SCIENTIFIC 1004
#define IDM_DIGIT_GROUPING 1005
#define IDM_HELP_TOPICS 1006
#define IDM_ABOUT 1007
#define IDM_SEPARATOR1 1008
#define IDM_SEPARATOR2 1009
#define IDM_SEPARATOR3 1010
#define IDM_WHATS_THIS 1011
#define ID_RED_START 1036
#define IDC_PLUS 1036
#define IDC_MINUS 1037
#define IDC_MULTIPLY 1038
#define IDC_DIVIDE 1039
#define IDC_MPLUS 1040
#define IDC_MS 1041
#define IDC_MR 1042
#define IDC_MC 1043
#define IDC_EQUALS 1046
#define IDC_LSH 1047
#define IDC_OR 1048
#define IDC_MOD 1049
#define IDC_CLEAR 1050
#define IDC_CE 1051
#define IDC_BSPACE 1052
#define IDC_INT 1053
#define IDC_NOT 1054
#define IDC_XOR 1055
#define IDC_AND 1056
#define ID_RED_FINISH 1056
/* strings */
#define ID_PURPLE_START 1057
#define IDC_COS 1058
#define IDC_SIN 1059
#define IDC_DMS 1060
#define IDC_FE 1061
#define IDC_CUBE 1062
#define IDC_POWER 1063
#define IDC_EXP 1064
#define IDC_OPENBKT 1065
#define IDC_BANG 1066
#define IDC_LOG 1067
#define IDC_LN 1068
#define IDC_CLOSEBK 1069
#define IDC_TAN 1070
#define IDC_SQUARE 1071
#define IDC_INVERT 1072
#define ID_PURPLE_FINISH 1072
#define IDS_APPNAME 1100
#define IDC_INV 1078
#define IDC_HYP 1079
#define IDC_HEX 1080
#define IDC_DEC 1081
#define IDC_OCT 1082
#define IDC_BIN 1083
#define IDC_DEGREES 1084
#define IDC_RADIANS 1085
#define IDC_GRADS 1086
#define IDC_RESULT 1087
#define IDS_BTN_BACKSPACE 1101
#define IDS_BTN_CLEAR_ENTRY 1102
#define IDS_BTN_CLEAR_ALL 1103
#define IDS_BTN_MEM_CLEAR 1104
#define IDS_BTN_MEM_RECALL 1105
#define IDS_BTN_MEM_STORE 1106
#define IDS_BTN_MEM_PLUS 1107
#define IDS_BTN_MEM_STATUS_M 1108
#define IDS_BTN_SQRT 1109
#define IDC_MEMTEXT 1090
#define IDC_UNITS 1091
#define IDC_BASE 1092
#define IDC_INVHYP 1093
#define IDC_BKTTEXT 1094
#define IDS_ERR_INVALID_INPUT 1120
#define IDS_ERR_DIVIDE_BY_ZERO 1121
#define IDS_ERR_UNDEFINED 1122
#define ID_VIEW_STANDARD 40003
#define ID_VIEW_SCIENTIFIC 40004
#define ID_VIEW_DIGIT_GROUPING 40005
#define ID_VIEW_HEX 40006
#define ID_VIEW_DECIMAL 40007
#define ID_VIEW_OCTAL 40008
#define ID_VIEW_BINARY 40009
#define ID_VIEW_DEGREES 40010
#define ID_VIEW_RADIANS 40011
#define ID_VIEW_GRADS 40012
#define ID_HELP_TOPICS 40013
#define ID_HELP_ABOUT 40014
#define IDS_COPYRIGHT1 1130
#define IDS_COPYRIGHT2 1131
#define IDS_COPYRIGHT3 1132
#define IDS_COPYRIGHT4 1133
#define IDS_COPYRIGHT5 1134
/* keys */
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_COMMAND_VALUE 40015
#define _APS_NEXT_CONTROL_VALUE 1095
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
#define IDV_HELP 103
/* stats dialog */
#define ID_STATS_RET 3000
#define ID_STATS_LOAD 3001
#define ID_STATS_CD 3002
#define ID_STATS_CAD 3003

33
rosapps/calc/rsrc.rc Normal file
View file

@ -0,0 +1,33 @@
/*
* WineCalc (rsrc.rc)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include "resource.h"
#include "En.rc"
#include "Es.rc"
#include "Fr.rc"
#include "It.rc"
#include "Nl.rc"
#include "Pt.rc"
#include "Ru.rc"
#include "Si.rc"
LANGUAGE LANG_NEUTRAL,SUBLANG_NEUTRAL

View file

@ -1,115 +0,0 @@
/*
* ReactOS calc
*
* settings.c
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <tchar.h>
#include <assert.h>
#define ASSERT assert
#include "main.h"
#include "settings.h"
BOOL CheckResult(LONG error)
{
if (error != ERROR_SUCCESS) {
PTSTR msg;
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
0, error, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (PTSTR)&msg, 0, NULL))
MessageBox(NULL, msg, szTitle, MB_ICONERROR | MB_OK);
else
MessageBox(NULL, _T("Error"), szTitle, MB_ICONERROR | MB_OK);
LocalFree(msg);
return FALSE;
}
return TRUE;
}
static BOOL CreateRegistryPath(LPTSTR szRegPath, int nMaxLen)
{
LPTSTR pRegPath = szRegPath;
// Initialise registry path string from application PATH and KEY resources
int nLength = LoadString(hInst, IDS_APP_REG_PATH, szRegPath, nMaxLen);
nLength += LoadString(hInst, IDS_APP_REG_KEY, szRegPath + nLength, nMaxLen - nLength);
ASSERT(nLength < (nMaxLen - 1));
szRegPath[nLength] = _T('\\');
// walk the registry path string creating the tree if required
while ((pRegPath = _tcschr(pRegPath, _T('\\')))) {
LONG result;
HKEY hKey = NULL;
*pRegPath = _T('\0');
// Open (or create) the key
result = RegCreateKeyEx(HKEY_CURRENT_USER, szRegPath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
if (!CheckResult(result)) return FALSE;
RegCloseKey(hKey);
*pRegPath = _T('\\');
pRegPath = pRegPath + 1;
}
szRegPath[nLength] = _T('\0');
return TRUE;
}
void LoadSettings(void)
{
TCHAR szRegPath[MAX_LOADSTRING];
HKEY hKey;
DWORD dwSize;
LONG result;
if (!CreateRegistryPath(szRegPath, MAX_LOADSTRING)) return;
// Open the key
result = RegOpenKeyEx(HKEY_CURRENT_USER, szRegPath, 0, KEY_READ, &hKey);
if (!CheckResult(result)) return;
// Read the settings
dwSize = sizeof(CALC_TYPES);
result = RegQueryValueEx(hKey, _T("Preferences"), NULL, NULL, (LPBYTE)&CalcType, &dwSize);
// Close the key
RegCloseKey(hKey);
}
void SaveSettings(void)
{
TCHAR szRegPath[MAX_LOADSTRING];
HKEY hKey = NULL;
LONG result;
if (!CreateRegistryPath(szRegPath, MAX_LOADSTRING)) return;
// Open the key
result = RegOpenKeyEx(HKEY_CURRENT_USER, szRegPath, 0, KEY_WRITE, &hKey);
if (!CheckResult(result)) return;
// Save the settings
result = RegSetValueEx(hKey, _T("Preferences"), 0, REG_DWORD, (LPBYTE)&CalcType, sizeof(CALC_TYPES));
if (!CheckResult(result)) goto abort;
abort:
// Close the key
RegCloseKey(hKey);
}

View file

@ -1,44 +0,0 @@
/*
* ReactOS calc
*
* settings.h
*
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __SETTINGS_H__
#define __SETTINGS_H__
#ifdef __cplusplus
extern "C" {
#endif
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
BOOL CheckResult(LONG error);
void LoadSettings(void);
void SaveSettings(void);
#ifdef __cplusplus
};
#endif
#endif // __SETTINGS_H__

131
rosapps/calc/stats.c Normal file
View file

@ -0,0 +1,131 @@
/*
* WineCalc (stats.c)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h> // sprintf
#include <windows.h>
#include "stats.h"
#include "resource.h"
#include "winecalc.h"
HWND hWndListBox;
extern CALC calc;
extern HWND hWndDlgStats;
BOOL CALLBACK StatsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
HDC hdc;
PAINTSTRUCT ps;
switch( uMsg ) {
case WM_INITDIALOG:
hWndListBox = CreateWindow(
"LISTBOX", // pointer to registered class name
"Listbox", // pointer to window name
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LBS_NOINTEGRALHEIGHT, // window style
6, // horizontal position of window
6, // vertical position of window
208, // window width
66, // window height
hDlg, // handle to parent or owner window
NULL, // handle to menu or child-window identifier
NULL, // handle to application instance
NULL // pointer to window-creation data
);
ShowWindow(hWndListBox, SW_SHOW);
SendMessage (hWndListBox, WM_SETFONT, (UINT)GetStockObject(DEFAULT_GUI_FONT), TRUE);
// SetFocus(hWndDlgStats);
return TRUE;
case WM_COMMAND:
switch( LOWORD( wParam ) ) {
case ID_STATS_RET:
SetFocus(GetParent(hDlg));
return 0;
case ID_STATS_LOAD:
{
int i;
i = SendMessage(hWndListBox, LB_GETCURSEL, 0, 0);
SendMessage(hWndListBox, LB_GETTEXT, i, (LPARAM)calc.buffer);
calc_buffer_display(&calc);
}
return 0;
case ID_STATS_CD:
{
int i;
i = SendMessage(hWndListBox, LB_GETCURSEL, 0, 0);
SendMessage(hWndListBox, LB_DELETESTRING, i, 0);
InvalidateRect(hDlg,NULL,TRUE);
UpdateWindow(hDlg);
}
return 0;
case ID_STATS_CAD:
SendMessage(hWndListBox, LB_RESETCONTENT, 0, 0);
InvalidateRect(hDlg,NULL,TRUE);
UpdateWindow(hDlg);
return 0;
}
break;
case WM_PAINT:
{
char s[CALC_BUF_SIZE];
int lb_count;
HFONT hFont;
HFONT hFontOrg;
hdc = BeginPaint( hDlg, &ps );
hFont = GetStockObject(DEFAULT_GUI_FONT);
hFontOrg = SelectObject(hdc, hFont);
lb_count = SendMessage(hWndListBox, LB_GETCOUNT, 0, 0);
sprintf(s, "n=%d", lb_count);
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc, 98, 121, s, strlen(s));
SelectObject(hdc, hFontOrg);
EndPaint( hDlg, &ps );
return 0;
}
case WM_CLOSE:
hWndDlgStats = 0; // invalidate stats dialog
SendMessage(GetParent(hDlg), WM_CHAR, '\x13', 1); // disable stats related calculator buttons
DestroyWindow( hDlg );
return 0;
}
return FALSE;
}

24
rosapps/calc/stats.h Normal file
View file

@ -0,0 +1,24 @@
/*
* WineCalc (stats.h)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
BOOL CALLBACK StatsDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );

3785
rosapps/calc/winecalc.c Normal file

File diff suppressed because it is too large Load diff

364
rosapps/calc/winecalc.h Normal file
View file

@ -0,0 +1,364 @@
/*
* WineCalc (winecalc.h)
*
* Copyright 2003 James Briggs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//////////////////////////////////////////////////////////////////
// numerics are defined here for easier porting
typedef double calcfloat;
#define FMT_DESC_FLOAT "%.32g"
#define FMT_DESC_EXP "%.32e"
#define CALC_ATOF(x) atof(x)
#define CONST_PI 3.1415926535897932384626433832795
/////////////////////////////////////////////////////////////////
#define CALC_BUF_SIZE 128
// statistics dialog dimensions
#define CALC_STA_X 235
#define CALC_STA_Y 180
// sentinel for differentiating Return from Ctrl+M events
#define NUMBER_OF_THE_BEAST 666
#define CALC_COLOR_BLUE 0
#define CALC_COLOR_RED 1
#define CALC_COLOR_GRAY 2
#define CALC_COLOR_MAGENTA 3
// gray hilite on rectangle owner-drawn controls RGB(CALC_GRAY, CALC_GRAY, CALC_GRAY)
#define CALC_GRAY 132
// count of buttons needing special toggle states depending on number base
#define TOGGLE_COUNT 23
// there are 3 window menus, standard, decimal measurement system and word size menus
#define COUNT_MENUS 3
#define MENU_STD 0
#define MENU_SCIMS 1
#define MENU_SCIWS 2
// count of buttons
#define CALC_BUTTONS_STANDARD 28
#define CALC_BUTTONS_SCIENTIFIC 73
// winecalc window outer dimensions
#define CALC_STANDARD_WIDTH 260
#define CALC_STANDARD_HEIGHT 252
#define CALC_SCIENTIFIC_WIDTH 480
#define CALC_SCIENTIFIC_HEIGHT 310
// winecalc private ids for events
#define ID_CALC_ZERO 0
#define ID_CALC_ONE 1
#define ID_CALC_TWO 2
#define ID_CALC_THREE 3
#define ID_CALC_FOUR 4
#define ID_CALC_FIVE 5
#define ID_CALC_SIX 6
#define ID_CALC_SEVEN 7
#define ID_CALC_EIGHT 8
#define ID_CALC_NINE 9
#define ID_CALC_BACKSPACE 20
#define ID_CALC_CLEAR_ENTRY 21
#define ID_CALC_CLEAR_ALL 22
#define ID_CALC_MEM_CLEAR 23
#define ID_CALC_DIVIDE 24
#define ID_CALC_SQRT 25
#define ID_CALC_MEM_RECALL 26
#define ID_CALC_MULTIPLY 27
#define ID_CALC_PERCENT 28
#define ID_CALC_MEM_STORE 29
#define ID_CALC_MINUS 30
#define ID_CALC_RECIPROCAL 31
#define ID_CALC_MEM_PLUS 32
#define ID_CALC_SIGN 33
#define ID_CALC_DECIMAL 34
#define ID_CALC_PLUS 35
#define ID_CALC_EQUALS 36
#define ID_CALC_STA 37
#define ID_CALC_FE 38
#define ID_CALC_LEFTPAREN 39
#define ID_CALC_RIGHTPAREN 40
#define ID_CALC_MOD 41
#define ID_CALC_AND 42
#define ID_CALC_OR 43
#define ID_CALC_XOR 44
#define ID_CALC_SUM 45
#define ID_CALC_SIN 46
#define ID_CALC_LOG10 47
#define ID_CALC_LSH 48
#define ID_CALC_NOT 49
#define ID_CALC_S 50
#define ID_CALC_COS 52
#define ID_CALC_FACTORIAL 53
#define ID_CALC_INT 54
#define ID_CALC_DAT 55
#define ID_CALC_TAN 56
#define ID_CALC_SQUARE 57
#define ID_CALC_A 58
#define ID_CALC_B 59
#define ID_CALC_C 60
#define ID_CALC_D 61
#define ID_CALC_E 62
#define ID_CALC_F 63
#define ID_CALC_AVE 64
#define ID_CALC_DMS 65
#define ID_CALC_EXP 66
#define ID_CALC_LN 67
#define ID_CALC_PI 68
#define ID_CALC_CUBE 69
#define ID_CALC_POWER 51
// Number System Radio Buttons
#define CALC_NS_COUNT 4
#define ID_CALC_NS_HEX 2000
#define ID_CALC_NS_DEC 2001
#define ID_CALC_NS_OCT 2002
#define ID_CALC_NS_BIN 2003
#define NBASE_DECIMAL 0
#define NBASE_BINARY 1
#define NBASE_OCTAL 2
#define NBASE_HEX 3
#define CALC_NS_OFFSET_X 15
#define CALC_NS_OFFSET_Y 37
#define SZ_RADIO_NS_X 50
#define SZ_RADIO_NS_Y 15
#define CALC_NS_HEX_LEFT 0
#define CALC_NS_HEX_TOP 0
#define CALC_NS_DEC_LEFT 50
#define CALC_NS_DEC_TOP 0
#define CALC_NS_OCT_LEFT 98
#define CALC_NS_OCT_TOP 0
#define CALC_NS_BIN_LEFT 148
#define CALC_NS_BIN_TOP 0
// Measurement System Radio Buttons
#define CALC_MS_COUNT 3
#define ID_CALC_MS_DEGREES 2010
#define ID_CALC_MS_RADIANS 2011
#define ID_CALC_MS_GRADS 2012
#define TRIGMODE_DEGREES 0
#define TRIGMODE_RADIANS 1
#define TRIGMODE_GRADS 2
#define CALC_MS_OFFSET_X 225
#define CALC_MS_OFFSET_Y 37
#define SZ_RADIO_MS_X 75
#define SZ_RADIO_MS_Y 15
#define CALC_MS_DEGREES_LEFT 0
#define CALC_MS_DEGREES_TOP 0
#define CALC_MS_RADIANS_LEFT 82
#define CALC_MS_RADIANS_TOP 0
#define CALC_MS_GRADS_LEFT 162
#define CALC_MS_GRADS_TOP 0
// Inv and Hyp Checkboxes
#define CALC_CB_COUNT 2
#define ID_CALC_CB_INV 2020
#define ID_CALC_CB_HYP 2021
#define WORDSIZE_BYTE 1
#define WORDSIZE_WORD 2
#define WORDSIZE_DWORD 4
#define WORDSIZE_QWORD 8
#define CALC_CB_OFFSET_X 15
#define CALC_CB_OFFSET_Y 58
#define CALC_CB_INV_LEFT 0
#define CALC_CB_INV_TOP 10
#define SZ_RADIO_CB_X 50
#define SZ_RADIO_CB_Y 14
#define CALC_CB_HYP_LEFT 58
#define CALC_CB_HYP_TOP 10
// Word Size Radio Buttons
#define CALC_WS_COUNT 4
#define ID_CALC_WS_QWORD 2030
#define ID_CALC_WS_DWORD 2031
#define ID_CALC_WS_WORD 2032
#define ID_CALC_WS_BYTE 2033
#define CALC_WS_OFFSET_X CALC_MS_OFFSET_X
#define CALC_WS_OFFSET_Y CALC_MS_OFFSET_Y
#define CALC_WS_QWORD_LEFT 0
#define CALC_WS_QWORD_TOP 0
#define CALC_WS_DWORD_LEFT 57
#define CALC_WS_DWORD_TOP 0
#define CALC_WS_WORD_LEFT 120
#define CALC_WS_WORD_TOP 0
#define CALC_WS_BYTE_LEFT 175
#define CALC_WS_BYTE_TOP 0
#define SZ_RADIO_WS_X 50
#define SZ_RADIO_WS_Y 15
// drawing offsets
#define CALC_EDIT_HEIGHT 20
#define SZ_FILLER_X 32
#define SZ_FILLER_Y 30
#define SZ_BIGBTN_X 62
#define SZ_BIGBTN_Y 30
#define SZ_MEDBTN_X 36
#define SZ_MEDBTN_Y 30
#define MARGIN_LEFT 7
#define MARGIN_SMALL_X 3
#define MARGIN_SMALL_Y 3
#define MARGIN_BIG_X 274
#define MARGIN_STANDARD_BIG_X 11
#define MARGIN_BIG_Y 6
#define SZ_SPACER_X 11
// winecalc results display area
#define WDISPLAY_STANDARD_LEFT MARGIN_LEFT + 4
#define WDISPLAY_STANDARD_TOP 5
#define WDISPLAY_STANDARD_RIGHT 244
#define WDISPLAY_STANDARD_BOTTOM 24
#define CALC_STANDARD_MARGIN_TOP 16
#define WDISPLAY_SCIENTIFIC_LEFT MARGIN_LEFT + 4
#define WDISPLAY_SCIENTIFIC_TOP 5
#define WDISPLAY_SCIENTIFIC_RIGHT 465
#define WDISPLAY_SCIENTIFIC_BOTTOM 24
#define CALC_SCIENTIFIC_MARGIN_TOP 44
typedef struct tagCalcBtn {
int id; // private id
HWND hBtn; // button child window handle
char label[80]; // text on buttonface
int color; // text color
RECT r; // location
int enable; // 1 = control enbabled, 0 = disabled
}
CALCBTN;
typedef struct tagPos {
int x;
int y;
}
POS;
typedef struct tagCalc {
HINSTANCE hInst; // this HINSTANCE
HWND hWnd; // main window's HWND
POS pos;
int numButtons; // standard = 28, scientific = more
char buffer [CALC_BUF_SIZE]; // current keyboard buffer
char display[CALC_BUF_SIZE]; // display buffer before output
calcfloat value; // most recent computer value
calcfloat memory; // most recent stored memory value from display buffer
int paren; // current parentheses level
int sciMode; // standard = 1, scientific = 0
int displayMode; // 0 = float, 1 = scientific exponential notation like 1.0e+10
char oper; // most recent operator pushed
calcfloat operand; // most recent operand pushed
int newenter; // track multiple =
int next; // binary operation flag
int err; // errror status for divide by zero, infinity, etc.
int init; // starting buffer
int digitGrouping; // no separators = 0, separators = 1
int trigMode; // degrees = 0, radians = 1, grads = 2
int numBase; // 10 = decimal, 2 = binary, 8 = octal, 16 = hex
int wordSize; // 1 = byte, 2 = word, 4 = dword, 8 = qword
int invMode; // INV mode 0 = off, 1 = on
int hypMode; // HYP mode 0 = off, 1 = on
int new; // first time 0 = false, 1 = true
CALCBTN cb[80]; // enough buttons for standard or scientific mode
}
CALC;
BOOL CALLBACK AboutDlgProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void InitLuts(void);
void InitMenus(HINSTANCE hInst);
void InitCalc (CALC *calc);
void DestroyCalc (CALC *calc);
void calc_buffer_format(CALC *calc);
void calc_buffer_display(CALC *calc);
char *calc_sep(char *s);
void DrawCalcText (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, int object, char *s);
void CalcRect (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, int object);
void DrawCalcRectSci(HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc, RECT *r);
void DrawCalc (HDC hdc, HDC hMemDC, PAINTSTRUCT *ps, CALC *calc);
void calc_setmenuitem_radio(HMENU hMenu, UINT id);
void show_debug(CALC *calc, char *title, long wParam, long lParam);
calcfloat calc_atof(char *s, int base);
void calc_ftoa(CALC *calc, calcfloat r, char *buf);
long factorial(long n);
calcfloat calc_convert_to_radians(CALC *calc);
calcfloat calc_convert_from_radians(CALC *calc);