From: Mapi B. <ma...@us...> - 2009-12-15 21:39:27
|
Update of /cvsroot/easycalc/PPCport/system - UI In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32675 Modified Files: EasyCalc.cpp EasyCalc.h EasyCalcppc.aps EasyCalcppc.rc EasyCalcppc.rc2 resourceppc.h shell_loadimage.cpp Skin.cpp Skin.h StateManager.cpp Log Message: Release 1.25e Index: EasyCalc.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EasyCalc.h 16 Nov 2009 22:18:41 -0000 1.7 --- EasyCalc.h 15 Dec 2009 21:39:18 -0000 1.8 *************** *** 53,57 **** #define BCD_SECT ! #if defined(WINDOWS) && !defined(__GNUC__) #define int8 __int64 #define uint8 unsigned __int64 --- 53,57 ---- #define BCD_SECT ! #if defined(_WINDOWS) && !defined(__GNUC__) #define int8 __int64 #define uint8 unsigned __int64 *************** *** 66,72 **** * the fact). */ ! #ifdef __cplusplus ! extern "C" { ! #endif int isnan(double x); int finite(double x); --- 66,72 ---- * the fact). */ ! //#ifdef __cplusplus ! // extern "C" { ! //#endif int isnan(double x); int finite(double x); *************** *** 81,87 **** double hypot(double x, double y); #endif ! #ifdef __cplusplus ! } ! #endif #else --- 81,87 ---- double hypot(double x, double y); #endif ! //#ifdef __cplusplus ! // } ! //#endif #else *************** *** 106,110 **** // Version of the state file #define STATE_VERSION_ORIG 1 ! #define STATE_VERSION 2 /* Magic number and version number for the state file. --- 106,110 ---- // Version of the state file #define STATE_VERSION_ORIG 1 ! #define STATE_VERSION 3 /* Magic number and version number for the state file. *************** *** 129,132 **** --- 129,135 ---- #define altErrorGifFile 12 #define altWriteStateFile 13 + #define altSolverResult 14 + #define altGraphBadVal 15 + #define altMemoImportError 16 #define FrmAlert FrmPopupForm #define FrmAlertMain(a) FrmPopupForm(a, NULL) *************** *** 172,174 **** --- 175,190 ---- void MtxEditSetRowValue(int rowNb, int colNb, TCHAR *cell); + void SlvEnableAll(Boolean enable); + void SlvSetExeButton(int cmd); + void SlvEqFldSet(TCHAR *eq); + TCHAR *SlvEqFldGet(void); + void SlvVarSetRow(int rowNb, TCHAR *label, TCHAR *value); + void SlvVarHelp(TCHAR *text); + + void FinSetRow(int rowNb, TCHAR *label, TCHAR *value); + void FinShowValue(int rowNb, TCHAR *value); + + void wait_draw(void); + void wait_erase(void); + #endif Index: shell_loadimage.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/shell_loadimage.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shell_loadimage.cpp 22 Jun 2009 22:13:35 -0000 1.1 --- shell_loadimage.cpp 15 Dec 2009 21:39:18 -0000 1.2 *************** *** 128,132 **** */ ! pm->cmap = (SkinColor *) malloc(256 * sizeof(SkinColor)); // TODO - handle memory allocation failure if (has_global_cmap) { --- 128,132 ---- */ ! pm->cmap = (SkinColor *) mmalloc(256 * sizeof(SkinColor)); // TODO - handle memory allocation failure if (has_global_cmap) { *************** *** 192,196 **** size = pm->bytesperline * pm->height; ! pm->pixels = (unsigned char *) malloc(size); // TODO - handle memory allocation failure memset(pm->pixels, pm->depth == 1 ? background * 255 : background, size); --- 192,196 ---- size = pm->bytesperline * pm->height; ! pm->pixels = (unsigned char *) mmalloc(size); // TODO - handle memory allocation failure memset(pm->pixels, pm->depth == 1 ? background * 255 : background, size); *************** *** 260,264 **** lbpp = (info & 7) + 1; lncolors = 1 << lbpp; ! lcmap = (SkinColor *) malloc(256 * sizeof(SkinColor)); // TODO - handle memory allocation failure for (i=0 ; i<lncolors ; i++) { --- 260,264 ---- lbpp = (info & 7) + 1; lncolors = 1 << lbpp; ! lcmap = (SkinColor *) mmalloc(256 * sizeof(SkinColor)); // TODO - handle memory allocation failure for (i=0 ; i<lncolors ; i++) { *************** *** 277,281 **** int v, h; unsigned char *newpixels = (unsigned char *) ! malloc(newbytesperline * pm->height); // TODO - handle memory allocation failure for (v=0 ; v<pm->height ; v++) --- 277,281 ---- int v, h; unsigned char *newpixels = (unsigned char *) ! mmalloc(newbytesperline * pm->height); // TODO - handle memory allocation failure for (v=0 ; v<pm->height ; v++) *************** *** 294,298 **** newpixel[3] = pm->cmap[pixel].b; } ! free(pm->pixels); pm->pixels = newpixels; pm->bytesperline = newbytesperline; --- 294,298 ---- newpixel[3] = pm->cmap[pixel].b; } ! mfree(pm->pixels); pm->pixels = newpixels; pm->bytesperline = newbytesperline; *************** *** 492,496 **** if (lcmap != pm->cmap) ! free(lcmap); lcmap = NULL; } else if (whatnext == '!') { --- 492,496 ---- if (lcmap != pm->cmap) ! mfree(lcmap); lcmap = NULL; } else if (whatnext == '!') { *************** *** 522,532 **** done: ! if (lcmap != NULL && lcmap != pm->cmap) free(lcmap); if (pm->depth == 24) { ! free(pm->cmap); pm->cmap = NULL; } if (pm->depth == 1) { ! free(pm->cmap); pm->cmap = NULL; if (invert) --- 522,532 ---- done: ! if (lcmap != NULL && lcmap != pm->cmap) mfree(lcmap); if (pm->depth == 24) { ! mfree(pm->cmap); pm->cmap = NULL; } if (pm->depth == 1) { ! mfree(pm->cmap); pm->cmap = NULL; if (invert) *************** *** 552,557 **** /* Done writing; delete the image and return. */ ! if (pm->cmap != NULL) free(pm->cmap); ! free(pm->pixels); return (res); --- 552,557 ---- /* Done writing; delete the image and return. */ ! if (pm->cmap != NULL) mfree(pm->cmap); ! mfree(pm->pixels); return (res); *************** *** 563,573 **** failed: ! if (lcmap != NULL && lcmap != pm->cmap) free(lcmap); if (pm->cmap != NULL) { ! free(pm->cmap); pm->cmap = NULL; } if (pm->pixels != NULL) { ! free(pm->pixels); pm->pixels = NULL; } --- 563,573 ---- failed: ! if (lcmap != NULL && lcmap != pm->cmap) mfree(lcmap); if (pm->cmap != NULL) { ! mfree(pm->cmap); pm->cmap = NULL; } if (pm->pixels != NULL) { ! mfree(pm->pixels); pm->pixels = NULL; } Index: EasyCalcppc.aps =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalcppc.aps,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvsxHaRON and /tmp/cvsDefWAg differ Index: EasyCalc.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EasyCalc.cpp 16 Nov 2009 22:18:41 -0000 1.8 --- EasyCalc.cpp 15 Dec 2009 21:39:18 -0000 1.9 *************** *** 30,33 **** --- 30,34 ---- // too big a code (1+ MB !!). // #include "afxwin.h" + #include "compat/PalmOS.h" #define _EASYCALC_C_ *************** *** 52,55 **** --- 53,63 ---- #include "core/mtxedit.h" [...2302 lines suppressed...] HWND hWnd = GetDlgItem(hDlg, IDC_EDIT2); SendMessage(hWnd, EM_REPLACESEL, (WPARAM) TRUE, (LPARAM) lParam); ! mfree(lParam); ! SetFocus(hWnd); } processed = TRUE; *************** *** 4813,4817 **** HWND hWnd = GetDlgItem(hDlg, IDC_EDIT2); main_insert(cur_skin, hWnd, (TCHAR *) lParam, false, true, false, NULL); ! free((void *) lParam); } processed = TRUE; --- 6026,6031 ---- HWND hWnd = GetDlgItem(hDlg, IDC_EDIT2); main_insert(cur_skin, hWnd, (TCHAR *) lParam, false, true, false, NULL); ! mfree(lParam); ! SetFocus(hWnd); } processed = TRUE; Index: Skin.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Skin.h 16 Nov 2009 22:18:41 -0000 1.9 --- Skin.h 15 Dec 2009 21:39:18 -0000 1.10 *************** *** 84,90 **** TOGONIO, ENGDISPLAY, ! TODEGREE2 }resSelection; ! #define SELECTION_COUNT 10 #define RESULTAREA_SIZE 128 --- 84,93 ---- TOGONIO, ENGDISPLAY, ! SCIDISPLAY, ! NORMDISPLAY, ! TODEGREE2, ! TOGRAD }resSelection; ! #define SELECTION_COUNT 11 #define RESULTAREA_SIZE 128 *************** *** 95,99 **** // Used while loading a skin; specifies how much to enlarge it. // This is necessary to force low-res skins to fill high-res screens. - int magnification; SkinPoint display_loc; // Description of the display in the skin --- 98,101 ---- *************** *** 132,137 **** TCHAR dispResult[RESULTAREA_SIZE]; // Contains the result area string TCHAR work_dispResult[RESULTAREA_SIZE]; // Working area for pow results ! int result_len; // Length of the result area string (-1 to ask for recalculation of result_size) bool result_pow; // Signals that we are mixing small and big fonts (exponential display) SIZE result_size; // Result "would-be" size on display without clipping int scroll_result; // DT_LEFT if scrolled left (left align), DT_RIGHT if scrolled right (right align) --- 134,140 ---- TCHAR dispResult[RESULTAREA_SIZE]; // Contains the result area string TCHAR work_dispResult[RESULTAREA_SIZE]; // Working area for pow results ! int result_len; // Length of the result area string bool result_pow; // Signals that we are mixing small and big fonts (exponential display) + bool result_size_recompute; // Ask for recalculation of result_size SIZE result_size; // Result "would-be" size on display without clipping int scroll_result; // DT_LEFT if scrolled left (left align), DT_RIGHT if scrolled right (right align) *************** *** 152,155 **** --- 155,160 ---- public: + int magnification; + Skin(); // Constructor ~Skin(); // Destructor Index: StateManager.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/StateManager.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StateManager.cpp 16 Nov 2009 22:18:41 -0000 1.5 --- StateManager.cpp 15 Dec 2009 21:39:18 -0000 1.6 *************** *** 68,73 **** if (read_shell_state(hWnd_p)) { init_mode = 1; ! } else { // Could not read state file FrmPopupForm(altNoStateFile, hWnd_p); init_shell_state(-1, NULL); init_mode = 2; --- 68,77 ---- if (read_shell_state(hWnd_p)) { init_mode = 1; ! } else { // Could not read state file, create default bases and create state contents FrmPopupForm(altNoStateFile, hWnd_p); + Err error = db_open(); + ErrFatalDisplayIf(error, _T("Can't open CalcDB")); + error = history_open(); + ErrFatalDisplayIf(error, _T("Can't open History DB")); init_shell_state(-1, NULL); init_mode = 2; *************** *** 190,194 **** int4 stVersion; int4 state_size; ! DataManager *dm, *dmHist; Err error; --- 194,198 ---- int4 stVersion; int4 state_size; ! DataManager *dm, *dmHist, *dmSolv; Err error; *************** *** 247,250 **** --- 251,273 ---- ErrFatalDisplayIf(error, _T("Can't open History DB")); + if (stVersion <= 2) { // Introduced with version 3 + dmSolv = NULL; + } else { + if (shell_read_saved_state(&dmSolv, sizeof(DataManager *)) != sizeof(DataManager *)) + return (false); + + if (dmSolv != NULL) { + dmSolv = new DataManager (); + if (dmSolv->deSerialize(stateFile)) { + delete dmSolv; + return (false); + } + // Overwrite previously initialized object + if (stateMgrSolvDB != NULL) + delete stateMgrSolvDB; + stateMgrSolvDB = dmSolv; + } + } + // Initialize the parts of the shell state // that were NOT read from the state file *************** *** 286,289 **** --- 309,317 ---- if ((stateMgrHistDB != NULL) && stateMgrHistDB->serialize(stateFile)) return (false); + // Introduced with state version 3 + if (!shell_write_saved_state(&stateMgrSolvDB, sizeof(DataManager *))) + return (false); + if ((stateMgrSolvDB != NULL) && stateMgrSolvDB->serialize(stateFile)) + return (false); return (true); Index: EasyCalcppc.rc =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalcppc.rc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EasyCalcppc.rc 16 Nov 2009 22:18:41 -0000 1.7 --- EasyCalcppc.rc 15 Dec 2009 21:39:18 -0000 1.8 *************** *** 30,34 **** // ! IDD_RES_MENU DIALOG 70, 10, 82, 100 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_BORDER FONT 8, "MS Shell Dlg" --- 30,34 ---- // ! IDD_RES_MENU DIALOG 65, 10, 82, 100 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_BORDER FONT 8, "MS Shell Dlg" *************** *** 37,50 **** END ! IDD_VARENTRY DIALOG 0, 0, 115, 45 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Save var as" FONT 8, "MS Shell Dlg" BEGIN ! DEFPUSHBUTTON "OK",IDOK,1,31,32,14 ! PUSHBUTTON "Cancel",IDCANCEL,73,31,41,14 LTEXT "Name:",IDC_VARNAME,3,3,35,12 ! COMBOBOX IDC_VARCOMBO,44,1,70,40,CBS_DROPDOWN | CBS_SORT | CBS_LOWERCASE | WS_VSCROLL | WS_TABSTOP ! CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE | WS_TABSTOP,47,31,14,14 END --- 37,56 ---- END ! IDD_SOLVER_CONFIG DIALOG 0, 0, 115, 79 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Solver config" FONT 8, "MS Shell Dlg" BEGIN ! DEFPUSHBUTTON "OK",IDOK,1,65,32,14 ! PUSHBUTTON "Cancel",IDCANCEL,73,65,41,14 LTEXT "Name:",IDC_VARNAME,3,3,35,12 ! EDITTEXT IDC_EDIT1,44,1,70,14,ES_AUTOHSCROLL ! LTEXT "Minimum:",IDC_MIN,3,19,35,12 ! EDITTEXT IDC_EDITMIN,44,17,70,14,ES_AUTOHSCROLL ! LTEXT "Maximum:",IDC_MAX,3,35,35,12 ! EDITTEXT IDC_EDITMAX,44,33,70,14,ES_AUTOHSCROLL ! LTEXT "Precision:",IDC_PREC,3,51,35,12 ! EDITTEXT IDC_EDITPREC,44,49,70,14,ES_AUTOHSCROLL ! CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE | WS_TABSTOP,47,65,14,14 END *************** *** 59,63 **** PUSHBUTTON "f",IDC_CALCF,143,66,16,14 LTEXT "Name:",IDC_VARNAME,0,4,25,8,NOT WS_GROUP ! EDITTEXT IDC_EDIT1,32,2,60,14,ES_LOWERCASE | ES_AUTOHSCROLL EDITTEXT IDC_EDIT2,0,19,159,43,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL PUSHBUTTON "Cancel",IDCANCEL,33,66,50,14 --- 65,69 ---- PUSHBUTTON "f",IDC_CALCF,143,66,16,14 LTEXT "Name:",IDC_VARNAME,0,4,25,8,NOT WS_GROUP ! EDITTEXT IDC_EDIT1,32,2,60,14,ES_AUTOHSCROLL EDITTEXT IDC_EDIT2,0,19,159,43,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL PUSHBUTTON "Cancel",IDCANCEL,33,66,50,14 *************** *** 88,92 **** PUSHBUTTON "f",IDC_CALCF,143,66,16,14 LTEXT "Name:",IDC_VARNAME,0,4,25,8 ! EDITTEXT IDC_EDIT1,32,2,60,14,ES_LOWERCASE | ES_AUTOHSCROLL | WS_GROUP EDITTEXT IDC_EDIT2,0,19,159,43,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL EDITTEXT IDC_EDIT3,129,2,30,14,ES_AUTOHSCROLL --- 94,98 ---- PUSHBUTTON "f",IDC_CALCF,143,66,16,14 LTEXT "Name:",IDC_VARNAME,0,4,25,8 ! EDITTEXT IDC_EDIT1,32,2,60,14,ES_AUTOHSCROLL | WS_GROUP EDITTEXT IDC_EDIT2,0,19,159,43,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL EDITTEXT IDC_EDIT3,129,2,30,14,ES_AUTOHSCROLL *************** *** 96,104 **** END ! IDD_LARGE_MENU DIALOG 30, 10, 102, 116 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE FONT 8, "MS Shell Dlg" BEGIN ! LISTBOX IDC_LIST_LARGE,0,0,102,116,LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_GROUP | WS_TABSTOP,WS_EX_DLGMODALFRAME END --- 102,110 ---- END ! IDD_LARGE_MENU DIALOG 30, 10, 102, 117 ! STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_BORDER FONT 8, "MS Shell Dlg" BEGIN ! LISTBOX IDC_LIST_LARGE,0,0,102,117,LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_GROUP | WS_TABSTOP END *************** *** 160,168 **** END ! IDD_SLIM_MENU DIALOG 30, 10, 72, 116 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE FONT 8, "MS Shell Dlg" BEGIN ! LISTBOX IDC_LIST_SLIM,0,0,72,116,LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_GROUP | WS_TABSTOP,WS_EX_DLGMODALFRAME END --- 166,174 ---- END ! IDD_SLIM_MENU DIALOG 40, 10, 72, 117 ! STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_BORDER FONT 8, "MS Shell Dlg" BEGIN ! LISTBOX IDC_LIST_SLIM,0,0,72,117,LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_GROUP | WS_TABSTOP END *************** *** 227,231 **** PUSHBUTTON "Cancel",IDCANCEL,73,31,41,14 LTEXT "Value:",IDC_VARNAME,3,3,35,12 ! EDITTEXT IDC_EDIT2,43,1,71,14,ES_LOWERCASE | ES_AUTOHSCROLL PUSHBUTTON "V",IDC_VAR,66,16,16,14 PUSHBUTTON "F",IDC_USERF,82,16,16,14 --- 233,237 ---- PUSHBUTTON "Cancel",IDCANCEL,73,31,41,14 LTEXT "Value:",IDC_VARNAME,3,3,35,12 ! EDITTEXT IDC_EDIT2,43,1,71,14,ES_AUTOHSCROLL PUSHBUTTON "V",IDC_VAR,66,16,16,14 PUSHBUTTON "F",IDC_USERF,82,16,16,14 *************** *** 248,251 **** --- 254,334 ---- END + IDD_SOLVER DIALOG 0, 0, 160, 165 + STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU + CAPTION "Solver" + FONT 8, "MS Shell Dlg" + BEGIN + CONTROL "",IDC_VARLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,1,85,158,63 + DEFPUSHBUTTON "OK",IDOK,0,150,30,14 + PUSHBUTTON "Modify",IDC_MODIFY,34,150,40,14 + PUSHBUTTON "Solve",IDC_SOLVE,107,150,52,14 + COMBOBOX IDC_COMBO_WKSHT,1,1,67,80,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Delete",IDC_DELETE,119,1,40,14 + EDITTEXT IDC_EDIT2,0,20,141,43,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL + PUSHBUTTON "Update",IDC_UPDATE,74,68,40,14 + PUSHBUTTON "Config",IDC_CONFIG,74,1,40,14 + PUSHBUTTON "Notes",IDC_NOTES,119,68,40,14 + EDITTEXT IDC_VARCOMMENT,1,68,67,14,ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "V",IDC_VAR,143,20,16,14 + PUSHBUTTON "F",IDC_USERF,143,35,16,14 + PUSHBUTTON "f",IDC_CALCF,143,49,16,14 + CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE | WS_TABSTOP,83,150,14,14 + END + + IDD_NOTES DIALOG 0, 0, 160, 165 + STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU + CAPTION "Solver" + FONT 8, "MS Shell Dlg" + BEGIN + DEFPUSHBUTTON "OK",IDOK,0,150,30,14 + EDITTEXT IDC_EDIT2,0,1,159,146,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL + CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE | WS_TABSTOP,83,150,14,14 + END + + IDD_VARENTRY DIALOG 0, 0, 115, 45 + STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU + CAPTION "Save var as" + FONT 8, "MS Shell Dlg" + BEGIN + DEFPUSHBUTTON "OK",IDOK,1,31,32,14 + PUSHBUTTON "Cancel",IDCANCEL,73,31,41,14 + LTEXT "Name:",IDC_VARNAME,3,3,35,12 + COMBOBOX IDC_VARCOMBO,44,1,70,40,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE | WS_TABSTOP,47,31,14,14 + END + + IDD_FINANCIALS DIALOG 0, 0, 160, 124 + STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU + CAPTION "Financial calculator" + FONT 8, "MS Shell Dlg" + BEGIN + DEFPUSHBUTTON "OK",IDOK,0,108,30,14 + CONTROL "",IDC_VARLIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,0,17,159,56 + CONTROL "Begin period",IDC_BEGINP,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE | WS_GROUP,53,106,50,16 + CONTROL "End period",IDC_ENDP,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE,109,106,50,16 + CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE,33,108,14,14 + EDITTEXT IDC_VARCOMMENT,0,2,159,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "Total payment",IDC_VARNAME3,0,77,87,12 + EDITTEXT IDC_EDIT3,89,75,70,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "Total cost",IDC_VARNAME4,0,92,87,12 + EDITTEXT IDC_EDIT4,89,90,70,14,ES_AUTOHSCROLL | ES_READONLY + END + + IDD_FINANCIALS1 DIALOG 0, 0, 160, 124 + STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU + CAPTION "Financial calculator" + FONT 8, "MS Shell Dlg" + BEGIN + DEFPUSHBUTTON "OK",IDOK,0,108,30,14 + CONTROL "",IDC_VARLIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,0,17,159,56 + CONTROL "Begin period",IDC_BEGINP,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE | WS_GROUP,53,106,50,16 + CONTROL "End period",IDC_ENDP,"Button",BS_AUTORADIOBUTTON | BS_MULTILINE,109,106,50,16 + CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE,33,108,14,14 + EDITTEXT IDC_VARCOMMENT,0,2,159,14,ES_AUTOHSCROLL | ES_READONLY + EDITTEXT IDC_EDIT3,89,75,70,14,ES_AUTOHSCROLL | ES_READONLY + EDITTEXT IDC_EDIT4,89,90,70,14,ES_AUTOHSCROLL | ES_READONLY + CONTROL "",IDC_TREE1,"SysTreeView32",TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,22,73,60,50 + END + ///////////////////////////////////////////////////////////////////////////// *************** *** 257,264 **** GUIDELINES DESIGNINFO BEGIN ! IDD_VARENTRY, DIALOG BEGIN RIGHTMARGIN, 114 TOPMARGIN, 1 END --- 340,348 ---- GUIDELINES DESIGNINFO BEGIN ! IDD_SOLVER_CONFIG, DIALOG BEGIN RIGHTMARGIN, 114 TOPMARGIN, 1 + BOTTOMMARGIN, 45 END *************** *** 285,288 **** --- 369,377 ---- END + IDD_LARGE_MENU, DIALOG + BEGIN + BOTTOMMARGIN, 116 + END + IDD_OPT_GENERAL, DIALOG BEGIN *************** *** 345,348 **** --- 434,471 ---- BOTTOMMARGIN, 164 END + + IDD_SOLVER, DIALOG + BEGIN + LEFTMARGIN, 1 + RIGHTMARGIN, 159 + TOPMARGIN, 1 + BOTTOMMARGIN, 164 + END + + IDD_NOTES, DIALOG + BEGIN + LEFTMARGIN, 1 + RIGHTMARGIN, 159 + TOPMARGIN, 1 + BOTTOMMARGIN, 164 + END + + IDD_VARENTRY, DIALOG + BEGIN + RIGHTMARGIN, 114 + TOPMARGIN, 1 + END + + IDD_FINANCIALS, DIALOG + BEGIN + RIGHTMARGIN, 159 + TOPMARGIN, 2 + END + + IDD_FINANCIALS1, DIALOG + BEGIN + RIGHTMARGIN, 159 + TOPMARGIN, 2 + END END #endif // APSTUDIO_INVOKED *************** *** 368,371 **** --- 491,503 ---- BEGIN MENUITEM "Options", IDM_FILE_OPTIONS + MENUITEM SEPARATOR + MENUITEM "Import", IDM_FILE_IMPORT + POPUP "Export" + BEGIN + MENUITEM "Variables", IDM_EXPORT_VARIABLES + MENUITEM "Functions", IDM_EXPORT_FUNCTIONS + MENUITEM "Equations", IDM_EXPORT_EQUATIONS + END + MENUITEM SEPARATOR MENUITEM "Exit", IDM_FILE_EXIT END *************** *** 378,384 **** --- 510,522 ---- MENUITEM "Clear history", IDM_EDIT_CLEARHISTORY MENUITEM SEPARATOR + MENUITEM "Data Manager", IDM_EDIT_DATAMANAGER MENUITEM "List Editor", IDM_EDIT_LISTEDITOR MENUITEM "Matrix Editor", IDM_EDIT_MATRIXEDITOR END + POPUP "Special" + BEGIN + MENUITEM "Solver", IDM_SPECIAL_SOLVER + MENUITEM "Financial calculator", IDM_SPECIAL_FINANCIALCALCULATOR + END POPUP "Help" BEGIN *************** *** 416,419 **** --- 554,558 ---- IDS_HELP "Help" IDS_EDIT "Edit" + IDS_SPECIAL "Special" END Index: EasyCalcppc.rc2 =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalcppc.rc2,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EasyCalcppc.rc2 22 Jun 2009 22:13:35 -0000 1.1 --- EasyCalcppc.rc2 15 Dec 2009 21:39:18 -0000 1.2 *************** *** 25,29 **** BEGIN IDR_MENU, ! 3, I_IMAGENONE, IDM_FILE, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, --- 25,29 ---- BEGIN IDR_MENU, ! 4, I_IMAGENONE, IDM_FILE, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, *************** *** 33,38 **** IDS_EDIT, 0, 1, I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, ! IDS_HELP, 0, 2, END --- 33,41 ---- IDS_EDIT, 0, 1, + I_IMAGENONE, IDM_SPECIAL, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, + IDS_SPECIAL, 0, 2, + I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, ! IDS_HELP, 0, 3, END Index: resourceppc.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/resourceppc.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** resourceppc.h 16 Nov 2009 22:18:41 -0000 1.7 --- resourceppc.h 15 Dec 2009 21:39:18 -0000 1.8 *************** *** 5,9 **** #define IDS_APP_TITLE 1 #define IDC_EASYCALC 2 ! #define IDC_EASYCALC_ACCEL 2 #define IDI_EASYCALC 101 #define IDR_MENU 102 --- 5,9 ---- #define IDS_APP_TITLE 1 #define IDC_EASYCALC 2 ! #define IDC_EASYCALC_ACCEL 3 #define IDI_EASYCALC 101 #define IDR_MENU 102 *************** *** 13,20 **** #define IDD_ABOUTBOX_WIDE 106 #define IDS_EDIT 107 #define IDD_OPT_GENERAL 131 #define IDD_OPT_SKINS 132 #define IDD_RES_MENU 134 ! #define IDD_VARENTRY 137 #define IDD_EDITVAR 138 #define IDD_DATAMGR 139 --- 13,22 ---- #define IDD_ABOUTBOX_WIDE 106 #define IDS_EDIT 107 + #define IDS_SPECIAL 108 #define IDD_OPT_GENERAL 131 #define IDD_OPT_SKINS 132 #define IDD_RES_MENU 134 ! #define IDD_VARENTRY 136 ! #define IDD_SOLVER_CONFIG 137 #define IDD_EDITVAR 138 #define IDD_DATAMGR 139 *************** *** 26,31 **** #define IDD_LISTEDIT 147 #define IDD_VARSTRINGENTRY 148 - #define IDD_LISTEDIT1 149 #define IDD_MATRIXEDIT 149 #define IDC_STATIC_1 201 #define IDC_STATIC_2 202 --- 28,36 ---- #define IDD_LISTEDIT 147 #define IDD_VARSTRINGENTRY 148 #define IDD_MATRIXEDIT 149 + #define IDD_SOLVER 150 + #define IDD_NOTES 151 + #define IDD_FINANCIALS 152 + #define IDD_FINANCIALS1 153 #define IDC_STATIC_1 201 #define IDC_STATIC_2 202 *************** *** 44,47 **** --- 49,55 ---- #define IDC_NEW 1044 #define IDC_MODIFY 1045 + #define IDC_UPDATE 1047 + #define IDC_CONFIG 1048 + #define IDC_NOTES 1049 #define IDC_USERF 1054 #define IDC_CALCF 1055 *************** *** 74,78 **** --- 82,91 ---- #define IDC_ASSISTGROUP 1085 #define IDC_VARNAME 1088 + #define IDC_MIN 1089 + #define IDC_VARNAME2 1089 + #define IDC_VARNAME4 1089 #define IDC_TITLE 1090 + #define IDC_MAX 1090 + #define IDC_PREC 1091 #define IDC_LANGUAGE_CB 1093 #define IDC_LANGUAGE 1094 *************** *** 87,96 **** #define IDC_DELETE 1116 #define IDC_EDIT1 1117 #define IDC_SIP 1120 #define IDC_EDITMATRIX 1128 #define IDC_COMBO_MATRIX 1129 #define IDC_COMBO_NBROWS 1130 #define IDC_COMBO_NBCOLS 1131 ! #define IDM_EXIT 32774 #define IDM_FILE_EXIT 32777 #define IDM_EDIT_CLEARHISTORY 32782 --- 100,122 ---- #define IDC_DELETE 1116 #define IDC_EDIT1 1117 + #define IDC_EDIT4 1118 + #define IDC_EDITMAX 1119 #define IDC_SIP 1120 + #define IDC_EDITPREC 1121 #define IDC_EDITMATRIX 1128 #define IDC_COMBO_MATRIX 1129 #define IDC_COMBO_NBROWS 1130 #define IDC_COMBO_NBCOLS 1131 ! #define IDC_SOLVE 1132 ! #define IDC_VARLIST 1133 ! #define IDC_COMBO_WKSHT 1134 ! #define IDC_EDITMIN 1136 ! #define IDC_VARCOMMENT 1137 ! #define IDC_LIST1 1138 ! #define IDC_ENDP 1139 ! #define IDC_BEGINP 1140 ! #define IDC_RADIO2 1142 ! #define IDC_VARNAME3 1143 ! #define IDC_TREE1 1144 #define IDM_FILE_EXIT 32777 #define IDM_EDIT_CLEARHISTORY 32782 *************** *** 100,105 **** #define IDM_EDIT_CLIPCOPY 32787 #define IDM_EDIT_LISTEDITOR 32789 - #define ID_EDIT_MATRIXEDITOR 32790 #define IDM_EDIT_MATRIXEDITOR 32791 #define IDM_OK 40000 #define IDM_HELP 40001 --- 126,143 ---- #define IDM_EDIT_CLIPCOPY 32787 #define IDM_EDIT_LISTEDITOR 32789 #define IDM_EDIT_MATRIXEDITOR 32791 + #define IDM_SPECIAL_SOLVER 32793 + #define IDM_SPECIAL_FINANCIALCALCULATOR 32794 + #define ID_FILE_IMPORT 32795 + #define ID_FILE_EXPORT 32796 + #define ID_EXPORT_VARIABLES 32797 + #define ID_EXPORT_FUNCTIONS 32798 + #define ID_EXPORT_EQUATIONS 32799 + #define IDM_FILE_IMPORT 32800 + #define IDM_EXPORT_VARIABLES 32801 + #define IDM_EXPORT_FUNCTIONS 32802 + #define IDM_EXPORT_EQUATIONS 32803 + #define ID_Menu 32804 + #define IDM_EDIT_DATAMANAGER 32805 #define IDM_OK 40000 #define IDM_HELP 40001 *************** *** 107,110 **** --- 145,149 ---- #define IDM_FILE 40003 #define IDM_EDIT 40004 + #define IDM_SPECIAL 40005 #define IDC_STATIC -1 *************** *** 114,120 **** #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 ! #define _APS_NEXT_RESOURCE_VALUE 149 ! #define _APS_NEXT_COMMAND_VALUE 32792 ! #define _APS_NEXT_CONTROL_VALUE 1132 #define _APS_NEXT_SYMED_VALUE 112 #endif --- 153,159 ---- #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 ! #define _APS_NEXT_RESOURCE_VALUE 152 ! #define _APS_NEXT_COMMAND_VALUE 32806 ! #define _APS_NEXT_CONTROL_VALUE 1145 #define _APS_NEXT_SYMED_VALUE 112 #endif Index: Skin.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Skin.cpp 16 Nov 2009 22:18:41 -0000 1.9 --- Skin.cpp 15 Dec 2009 21:39:18 -0000 1.10 *************** *** 69,72 **** --- 69,73 ---- *dispResult = 0; // Empty string result_len = 0; + result_size_recompute = true; result_pow = false; scroll_result = DT_RIGHT; *************** *** 301,305 **** if (keylist != NULL) ! free(keylist); keylist = NULL; nkeys = 0; --- 302,306 ---- if (keylist != NULL) ! mfree(keylist); keylist = NULL; nkeys = 0; *************** *** 308,317 **** while (macrolist != NULL) { SkinMacro *m = macrolist->next; ! free(macrolist); macrolist = m; } if (keymap != NULL) ! free(keymap); keymap = NULL; keymap_length = 0; --- 309,318 ---- while (macrolist != NULL) { SkinMacro *m = macrolist->next; ! mfree(macrolist); macrolist = m; } if (keymap != NULL) ! mfree(keymap); keymap = NULL; keymap_length = 0; *************** *** 366,370 **** if (nkeys == keys_cap) { keys_cap += 50; ! keylist = (SkinKey *) realloc(keylist, keys_cap * sizeof(SkinKey)); // TODO - handle memory allocation failure } --- 367,371 ---- if (nkeys == keys_cap) { keys_cap += 50; ! keylist = (SkinKey *) mrealloc(keylist, keys_cap * sizeof(SkinKey)); // TODO - handle memory allocation failure } *************** *** 400,404 **** /* Not a proper number; ignore this macro */ if (macro != NULL) { ! free(macro); macro = NULL; break; --- 401,405 ---- /* Not a proper number; ignore this macro */ if (macro != NULL) { ! mfree(macro); macro = NULL; break; *************** *** 409,413 **** /* Macro code out of range; ignore this macro */ break; ! macro = (SkinMacro *) malloc(sizeof(SkinMacro)); // TODO - handle memory allocation failure macro->code = n; --- 410,414 ---- /* Macro code out of range; ignore this macro */ break; ! macro = (SkinMacro *) mmalloc(sizeof(SkinMacro)); // TODO - handle memory allocation failure macro->code = n; *************** *** 415,419 **** if (n < 1 || n > NB_KEYS) { /* Key code out of range; ignore this macro */ ! free(macro); macro = NULL; break; --- 416,420 ---- if (n < 1 || n > NB_KEYS) { /* Key code out of range; ignore this macro */ ! mfree(macro); macro = NULL; break; *************** *** 453,457 **** if (keymap_length == kmcap) { kmcap += 50; ! keymap = (keymap_entry *) realloc(keymap, kmcap * sizeof(keymap_entry)); // TODO - handle memory allocation failure } --- 454,458 ---- if (keymap_length == kmcap) { kmcap += 50; ! keymap = (keymap_entry *) mrealloc(keymap, kmcap * sizeof(keymap_entry)); // TODO - handle memory allocation failure } *************** *** 492,496 **** // on a larger screen, fall back on a tidy integral scale factor // and just leave some screen space unused. ! display_scale.x = (int) (magnification * 1.67); else display_scale.x *= magnification; --- 493,498 ---- // on a larger screen, fall back on a tidy integral scale factor // and just leave some screen space unused. ! // display_scale.x = (int) (magnification * 1.67); ! display_scale.x = magnification; else display_scale.x *= magnification; *************** *** 529,533 **** display_w = 216; else ! display_w = 131 * display_scale.x; display_h = 16 * display_scale.y; } --- 531,536 ---- display_w = 216; else ! // display_w = 131 * display_scale.x; ! display_w = 216 * display_scale.x; display_h = 16 * display_scale.y; } *************** *** 558,562 **** /********************************/ if (disp_bitmap != NULL) ! free(disp_bitmap); int lcd_w, lcd_h; --- 561,565 ---- /********************************/ if (disp_bitmap != NULL) ! mfree(disp_bitmap); int lcd_w, lcd_h; *************** *** 573,577 **** disp_bytesperline = ((lcd_w * display_scale.x + 15) >> 3) & ~1; size = disp_bytesperline * lcd_h * display_scale.y; ! disp_bitmap = (unsigned char *) malloc(size); // TODO - handle memory allocation failure memset(disp_bitmap, 255, size); --- 576,580 ---- disp_bytesperline = ((lcd_w * display_scale.x + 15) >> 3) & ~1; size = disp_bytesperline * lcd_h * display_scale.y; ! disp_bitmap = (unsigned char *) mmalloc(size); // TODO - handle memory allocation failure memset(disp_bitmap, 255, size); *************** *** 586,590 **** int width, int height) { if (skin_bitmap != NULL) { ! free(skin_bitmap); skin_bitmap = NULL; } --- 589,593 ---- int width, int height) { if (skin_bitmap != NULL) { ! mfree(skin_bitmap); skin_bitmap = NULL; } *************** *** 594,598 **** } if (skin_header != NULL) { ! free(skin_header); skin_header = NULL; } --- 597,601 ---- } if (skin_header != NULL) { ! mfree(skin_header); skin_header = NULL; } *************** *** 620,624 **** } ! skin_bitmap = (unsigned char *) malloc(skin_bytesperline * height); // TODO - handle memory allocation failure skin_width = width; --- 623,627 ---- } ! skin_bitmap = (unsigned char *) mmalloc(skin_bytesperline * height); // TODO - handle memory allocation failure skin_width = width; *************** *** 744,748 **** RGBQUAD *cmap; int i; ! bh = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER) + skin_ncolors * sizeof(RGBQUAD)); // TODO - handle memory allocation failure cmap = (RGBQUAD *) (bh + 1); --- 747,751 ---- RGBQUAD *cmap; int i; ! bh = (BITMAPINFOHEADER *) mmalloc(sizeof(BITMAPINFOHEADER) + skin_ncolors * sizeof(RGBQUAD)); // TODO - handle memory allocation failure cmap = (RGBQUAD *) (bh + 1); *************** *** 756,760 **** RGBQUAD *cmap; int i; ! bh = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); // TODO - handle memory allocation failure cmap = (RGBQUAD *) (bh + 1); --- 759,763 ---- RGBQUAD *cmap; int i; ! bh = (BITMAPINFOHEADER *) mmalloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); // TODO - handle memory allocation failure cmap = (RGBQUAD *) (bh + 1); *************** *** 764,768 **** } } else ! bh = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)); // TODO - handle memory allocation failure --- 767,771 ---- } } else ! bh = (BITMAPINFOHEADER *) mmalloc(sizeof(BITMAPINFOHEADER)); // TODO - handle memory allocation failure *************** *** 819,823 **** return (0); memcpy(bits, skin_bitmap, skin_bytesperline * skin_height); ! free(skin_bitmap); skin_bitmap = NULL; } --- 822,826 ---- return (0); memcpy(bits, skin_bitmap, skin_bytesperline * skin_height); ! mfree(skin_bitmap); skin_bitmap = NULL; } *************** *** 1148,1157 **** if (hwndE != NULL) { BOOL res = MoveWindow(hwndE, ! display_loc.x, display_loc.y + 18, display_w, 30, TRUE); } else { // hwndE = CreateWindow(_T("EDIT2"), NULL, dwStyle, hwndE = CreateWindow(_T("EDIT"), NULL, dwStyle, ! display_loc.x, display_loc.y + 18, display_w, 30, hWnd_p, NULL, hinst, NULL); cedit2_obj = subclassEdit(hWnd_p, hwndE); --- 1151,1162 ---- if (hwndE != NULL) { BOOL res = MoveWindow(hwndE, ! display_loc.x, display_loc.y + 18 * magnification, ! display_w, 30 * magnification, TRUE); } else { // hwndE = CreateWindow(_T("EDIT2"), NULL, dwStyle, hwndE = CreateWindow(_T("EDIT"), NULL, dwStyle, ! display_loc.x, display_loc.y + 18 * magnification, ! display_w, 30 * magnification, hWnd_p, NULL, hinst, NULL); cedit2_obj = subclassEdit(hWnd_p, hwndE); *************** *** 1164,1168 **** // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 14; _tcscpy(lf.lfFaceName, _T("Tahoma")); hFont_input = CreateFontIndirect(&lf); --- 1169,1173 ---- // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 14 * magnification; _tcscpy(lf.lfFaceName, _T("Tahoma")); hFont_input = CreateFontIndirect(&lf); *************** *** 1294,1298 **** if (hwnd_edit == NULL) hwnd_edit = hwndE; ! BOOL res = SetWindowText (hwnd_edit, text); } --- 1299,1303 ---- if (hwnd_edit == NULL) hwnd_edit = hwndE; ! BOOL res = SetWindowText(hwnd_edit, text); } *************** *** 1301,1305 **** ********************************************************************************/ TCHAR *Skin::get_input_text() { ! int res = GetWindowText (hwndE, inputText, INPUTAREA_SIZE); return (inputText); } --- 1306,1310 ---- ********************************************************************************/ TCHAR *Skin::get_input_text() { ! int res = GetWindowText(hwndE, inputText, INPUTAREA_SIZE); return (inputText); } *************** *** 1310,1314 **** void Skin::print_result (void *hWnd_p, TCHAR *res_text) { // Save the text and call the main method ! _tcscpy (dispResult, res_text); result_pow = false; // Just a mono font result --- 1315,1325 ---- void Skin::print_result (void *hWnd_p, TCHAR *res_text) { // Save the text and call the main method ! //_tcscpy(dispResult, res_text); ! result_len = _tcslen(res_text); ! if (result_len >= RESULTAREA_SIZE) { ! result_len = RESULTAREA_SIZE - 1; ! } ! _tcsncpy(dispResult, res_text, result_len); ! dispResult[result_len] = _T('\0'); result_pow = false; // Just a mono font result *************** *** 1322,1336 **** ********************************************************************************/ void Skin::print_result (HDC hdc) { ! HBITMAP bitmap = CreateBitmap(display_w, 18, 1, 1, disp_bitmap); HDC memdc = CreateCompatibleDC(hdc); HGDIOBJ oldObject = SelectObject(memdc, bitmap); COLORREF old_bg = SetBkColor(hdc, display_bg); COLORREF old_fg = SetTextColor(hdc, display_fg); ! BitBlt(hdc, display_loc.x, display_loc.y, display_w, 18, memdc, 0, 0, SRCCOPY); SelectObject(memdc, oldObject); // Set back default object DeleteDC(memdc); DeleteObject(bitmap); ! result_len = -1; // Recalculate result_size in paint_result() scroll_result = DT_RIGHT; paint_result(hdc); --- 1333,1347 ---- ********************************************************************************/ void Skin::print_result (HDC hdc) { ! HBITMAP bitmap = CreateBitmap(display_w, 18 * magnification, 1, 1, disp_bitmap); HDC memdc = CreateCompatibleDC(hdc); HGDIOBJ oldObject = SelectObject(memdc, bitmap); COLORREF old_bg = SetBkColor(hdc, display_bg); COLORREF old_fg = SetTextColor(hdc, display_fg); ! BitBlt(hdc, display_loc.x, display_loc.y, display_w, 18 * magnification, memdc, 0, 0, SRCCOPY); SelectObject(memdc, oldObject); // Set back default object DeleteDC(memdc); DeleteObject(bitmap); ! result_size_recompute = true; // Recalculate result_size in paint_result() scroll_result = DT_RIGHT; paint_result(hdc); *************** *** 1342,1346 **** void Skin::paint_result (HDC hdc) { RECT rc = {display_loc.x, display_loc.y, ! display_loc.x + display_w, display_loc.y + 18}; // Set colors and font --- 1353,1357 ---- void Skin::paint_result (HDC hdc) { RECT rc = {display_loc.x, display_loc.y, ! display_loc.x + display_w, display_loc.y + 18 * magnification}; // Set colors and font *************** *** 1351,1355 **** // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 18; lf.lfWeight = FW_BOLD; _tcscpy(lf.lfFaceName, _T("Tahoma")); --- 1362,1366 ---- // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 18 * magnification; lf.lfWeight = FW_BOLD; _tcscpy(lf.lfFaceName, _T("Tahoma")); *************** *** 1358,1364 **** HFONT oldFont = (HFONT)SelectObject(hdc, hFontBig_display); ! if (result_len == -1) { ! result_len = _tcslen(dispResult); GetTextExtentPoint32(hdc, dispResult, result_len, &result_size); } // Display text - scroll result is either DT_LEFT or DT_RIGHT --- 1369,1375 ---- HFONT oldFont = (HFONT)SelectObject(hdc, hFontBig_display); ! if (result_size_recompute) { GetTextExtentPoint32(hdc, dispResult, result_len, &result_size); + result_size_recompute = false; } // Display text - scroll result is either DT_LEFT or DT_RIGHT *************** *** 1391,1395 **** void Skin::print_resultpow (void *hWnd_p, TCHAR *res_text) { // Save the text and call the appropriate method ! _tcscpy (dispResult, res_text); HDC hdc = GetDC((HWND) hWnd_p); --- 1402,1412 ---- void Skin::print_resultpow (void *hWnd_p, TCHAR *res_text) { // Save the text and call the appropriate method ! //_tcscpy(dispResult, res_text); ! result_len = _tcslen(res_text); ! if (result_len >= RESULTAREA_SIZE) { ! result_len = RESULTAREA_SIZE - 1; ! } ! _tcsncpy(dispResult, res_text, result_len); ! dispResult[result_len] = _T('\0'); HDC hdc = GetDC((HWND) hWnd_p); *************** *** 1408,1422 **** ********************************************************************************/ void Skin::print_resultpow (HDC hdc) { ! HBITMAP bitmap = CreateBitmap(display_w, 18, 1, 1, disp_bitmap); HDC memdc = CreateCompatibleDC(hdc); HGDIOBJ oldObject = SelectObject(memdc, bitmap); COLORREF old_bg = SetBkColor(hdc, display_bg); COLORREF old_fg = SetTextColor(hdc, display_fg); ! BitBlt(hdc, display_loc.x, display_loc.y, display_w, 18, memdc, 0, 0, SRCCOPY); SelectObject(memdc, oldObject); // Set back default object DeleteDC(memdc); DeleteObject(bitmap); ! result_len = -1; // Recalculate result_size in paint_resultpow() scroll_result = DT_RIGHT; paint_resultpow(hdc); --- 1425,1439 ---- ********************************************************************************/ void Skin::print_resultpow (HDC hdc) { ! HBITMAP bitmap = CreateBitmap(display_w, 18 * magnification, 1, 1, disp_bitmap); HDC memdc = CreateCompatibleDC(hdc); HGDIOBJ oldObject = SelectObject(memdc, bitmap); COLORREF old_bg = SetBkColor(hdc, display_bg); COLORREF old_fg = SetTextColor(hdc, display_fg); ! BitBlt(hdc, display_loc.x, display_loc.y, display_w, 18 * magnification, memdc, 0, 0, SRCCOPY); SelectObject(memdc, oldObject); // Set back default object DeleteDC(memdc); DeleteObject(bitmap); ! result_size_recompute = true; // Recalculate result_size in paint_resultpow() scroll_result = DT_RIGHT; paint_resultpow(hdc); *************** *** 1432,1436 **** int oldBg = SetBkMode(hdc, TRANSPARENT); ! if (result_len == -1) { // Calculate approximate size with big font only COLORREF oldFg = SetTextColor(hdc, display_fg); --- 1449,1453 ---- int oldBg = SetBkMode(hdc, TRANSPARENT); ! if (result_size_recompute) { // Calculate approximate size with big font only COLORREF oldFg = SetTextColor(hdc, display_fg); *************** *** 1440,1444 **** // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 18; lf.lfWeight = FW_BOLD; _tcscpy(lf.lfFaceName, _T("Tahoma")); --- 1457,1461 ---- // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 18 * magnification; lf.lfWeight = FW_BOLD; _tcscpy(lf.lfFaceName, _T("Tahoma")); *************** *** 1457,1462 **** _tcscpy(work_dispResult, dispResult); // Use a work area, since text will be altered paint_resultpow_rec(hdc, false, work_dispResult); // Start with normal text. ! if (result_len == -1) // Was left at -1 to provoke recomputation of result_size.cx ! result_len = _tcslen(dispResult); if (result_len > 0) { // Handle scroll annunciators when necessary --- 1474,1479 ---- _tcscpy(work_dispResult, dispResult); // Use a work area, since text will be altered paint_resultpow_rec(hdc, false, work_dispResult); // Start with normal text. ! if (result_size_recompute) // Was left at -1 to provoke recomputation of result_size.cx ! result_size_recompute = false; if (result_len > 0) { // Handle scroll annunciators when necessary *************** *** 1561,1565 **** // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 12; lf.lfWeight = FW_BOLD; _tcscpy(lf.lfFaceName, _T("Tahoma")); --- 1578,1582 ---- // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 12 * magnification; lf.lfWeight = FW_BOLD; _tcscpy(lf.lfFaceName, _T("Tahoma")); *************** *** 1574,1578 **** // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 18; lf.lfWeight = FW_BOLD; _tcscpy(lf.lfFaceName, _T("Tahoma")); --- 1591,1595 ---- // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); ! lf.lfHeight = 18 * magnification; lf.lfWeight = FW_BOLD; _tcscpy(lf.lfFaceName, _T("Tahoma")); *************** *** 1588,1592 **** } ! if (result_len == -1) // update result size result_size.cx += sz.cx; --- 1605,1609 ---- } ! if (result_size_recompute) // update result size result_size.cx += sz.cx; *************** *** 1598,1602 **** rc.top = display_loc.y; rc.right = display_loc.x + display_w - pow_pos; ! rc.bottom = display_loc.y + 18; pow_pos += sz.cx; } else { --- 1615,1619 ---- rc.top = display_loc.y; rc.right = display_loc.x + display_w - pow_pos; ! rc.bottom = display_loc.y + 18 * magnification; pow_pos += sz.cx; } else { *************** *** 1604,1608 **** rc.top = display_loc.y; rc.right = display_loc.x + display_w - pow_pos; ! rc.bottom = display_loc.y + 18; pow_pos = display_w; } --- 1621,1625 ---- rc.top = display_loc.y; rc.right = display_loc.x + display_w - pow_pos; ! rc.bottom = display_loc.y + 18 * magnification; pow_pos = display_w; } *************** *** 1612,1616 **** rc.top = display_loc.y; rc.right = display_loc.x + pow_pos + sz.cx; ! rc.bottom = display_loc.y + 18; pow_pos += sz.cx; } else { --- 1629,1633 ---- rc.top = display_loc.y; rc.right = display_loc.x + pow_pos + sz.cx; ! rc.bottom = display_loc.y + 18 * magnification; pow_pos += sz.cx; } else { *************** *** 1618,1622 **** rc.top = display_loc.y; rc.right = display_loc.x + display_w; ! rc.bottom = display_loc.y + 18; pow_pos = display_w; } --- 1635,1639 ---- rc.top = display_loc.y; rc.right = display_loc.x + display_w; ! rc.bottom = display_loc.y + 18 * magnification; pow_pos = display_w; } *************** *** 1635,1639 **** ********************************************************************************/ void Skin::scroll_result_left (HWND hWnd) { ! HBITMAP bitmap = CreateBitmap(display_w, 18, 1, 1, disp_bitmap); HDC hdc = GetDC(hWnd); HDC memdc = CreateCompatibleDC(hdc); --- 1652,1656 ---- ********************************************************************************/ void Skin::scroll_result_left (HWND hWnd) { ! HBITMAP bitmap = CreateBitmap(display_w, 18 * magnification, 1, 1, disp_bitmap); HDC hdc = GetDC(hWnd); HDC memdc = CreateCompatibleDC(hdc); *************** *** 1642,1646 **** COLORREF old_bg = SetBkColor(hdc, display_bg); COLORREF old_fg = SetTextColor(hdc, display_fg); ! BitBlt(hdc, display_loc.x, display_loc.y, display_w, 18, memdc, 0, 0, SRCCOPY); SelectObject(memdc, oldObject); // Set back default object --- 1659,1663 ---- COLORREF old_bg = SetBkColor(hdc, display_bg); COLORREF old_fg = SetTextColor(hdc, display_fg); ! BitBlt(hdc, display_loc.x, display_loc.y, display_w, 18 * magnification, memdc, 0, 0, SRCCOPY); SelectObject(memdc, oldObject); // Set back default object *************** *** 1660,1664 **** ********************************************************************************/ void Skin::scroll_result_right (HWND hWnd) { ! HBITMAP bitmap = CreateBitmap(display_w, 18, 1, 1, disp_bitmap); HDC hdc = GetDC(hWnd); HDC memdc = CreateCompatibleDC(hdc); --- 1677,1681 ---- ********************************************************************************/ void Skin::scroll_result_right (HWND hWnd) { ! HBITMAP bitmap = CreateBitmap(display_w, 18 * magnification, 1, 1, disp_bitmap); HDC hdc = GetDC(hWnd); HDC memdc = CreateCompatibleDC(hdc); *************** *** 1667,1671 **** COLORREF old_bg = SetBkColor(hdc, display_bg); COLORREF old_fg = SetTextColor(hdc, display_fg); ! BitBlt(hdc, display_loc.x, display_loc.y, display_w, 18, memdc, 0, 0, SRCCOPY); SelectObject(memdc, oldObject); // Set back default object --- 1684,1688 ---- COLORREF old_bg = SetBkColor(hdc, display_bg); COLORREF old_fg = SetTextColor(hdc, display_fg); ! BitBlt(hdc, display_loc.x, display_loc.y, display_w, 18 * magnification, memdc, 0, 0, SRCCOPY); SelectObject(memdc, oldObject); // Set back default object |