Update of /cvsroot/easycalc/PPCport/system - UI In directory vz-cvs-4.sog:/tmp/cvs-serv7431 Modified Files: EasyCalc.cpp EasyCalc.gif EasyCalc.h EasyCalc.layout EasyCalc2.gif EasyCalc2.layout EasyCalc3.gif EasyCalc3.layout EasyCalcppc.aps EasyCalcppc.rc resourceppc.h shell_loadimage.cpp shell_loadimage.h Skin.cpp Skin.h StateManager.cpp StateManager.h Added Files: bitmap1.bmp bitmap2.bmp EasyCalcG.gif EasyCalcG.layout SkinList.cpp SkinList.h Log Message: 1.25g Index: EasyCalc.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** EasyCalc.h 24 Dec 2009 16:40:25 -0000 1.9 --- EasyCalc.h 28 Feb 2011 22:13:55 -0000 1.10 *************** *** 58,87 **** #define LL(x) x - /* MSVC++ 6.0 lacks a few math functions that Free42 needs. - * I've defined workarounds in mathfudge.c. NOTE: my versions - * of isnan(), finite(), and isinf() are a bit lame -- I *think* - * they handle infinities properly, but definitely not NaNs - * (although NaNs shouldn't be much of a problem because the Free42 - * code mostly tries to avoid them, rather than detect them after - * the fact). - */ - //#ifdef __cplusplus - // extern "C" { - //#endif - int isnan(double x); - int finite(double x); - int isinf(double x); - void sincos(double x, double *sinx, double *cosx); - double asinh(double x); - double acosh(double x); - double atanh(double x); - double expm1(double x); - double log1p(double x); - #ifdef _WIN32_WCE - double hypot(double x, double y); - #endif - //#ifdef __cplusplus - // } - //#endif #else --- 58,61 ---- *************** *** 106,110 **** // Version of the state file #define STATE_VERSION_ORIG 1 ! #define STATE_VERSION 4 /* Magic number and version number for the state file. --- 80,84 ---- // Version of the state file #define STATE_VERSION_ORIG 1 ! #define STATE_VERSION 5 /* Magic number and version number for the state file. *************** *** 132,135 **** --- 106,116 ---- #define altGraphBadVal 15 #define altMemoImportError 16 + #define altBadGifFile 17 + #define altMemAllocError 18 + #define altCalcNeedTrackPt 19 + #define altCalcNeedCurveSel 20 + #define altCalcNeedSelect 21 + #define altComputeResult 22 + #define altGrcFuncErr 23 #define FrmAlert FrmPopupForm #define FrmAlertMain(a) FrmPopupForm(a, NULL) *************** *** 152,158 **** --- 133,141 ---- extern LibLang *libLang; extern int g_systUserLangId; // Detected language of the system user + extern HWND g_hWnd; // current main window handle extern HWND g_hwndE; // Handle to the edit control input area. extern void *g_cedit2_obj; // Input area subclassing object. extern StateManager *stateMgr; + extern int ann_state[NB_ANNUN]; // Annunciators state #endif *************** *** 162,167 **** void read_state (void); void save_state (void); void shell_beeper(int frequency, int duration); ! void shell_annunciators(int skin, int shf, int angle_mode, int int_mode, int run); void shell_scroll_annunciators(int scroll); void shell_powerdown(); --- 145,151 ---- void read_state (void); void save_state (void); + void shell_graphAction (int key); void shell_beeper(int frequency, int duration); ! void shell_annunciators(int skin, int shf, int angle_mode, int int_mode, int pen_mode, int run); void shell_scroll_annunciators(int scroll); void shell_powerdown(); *************** *** 189,192 **** --- 173,178 ---- void FinShowValue(int rowNb, TCHAR *value); + void GraphConfSetRow (int rowNb, TCHAR *celltext); + void wait_draw(void); void wait_erase(void); Index: EasyCalc.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** EasyCalc.cpp 24 Dec 2009 17:15:16 -0000 1.11 --- EasyCalc.cpp 28 Feb 2011 22:13:55 -0000 1.12 *************** *** 36,43 **** #include "StateManager.h" #include "system - UI/Skin.h" #include "compat/Lang.h" #include "core/core_main.h" #include "core/core_display.h" ! #include "defuns.h" #include "core/Main.h" #include "core/varmgr.h" --- 36,44 ---- #include "StateManager.h" [...3640 lines suppressed...] + + /******************************************************************************** * FUNCTION: WndGetVarString (HWND, UINT, WPARAM, LPARAM) * * Message handler for the IDD_VARSTRINGENTRY dialog. * *************** *** 6201,6205 **** } } else if (notify_src == IDCANCEL) { - unsigned int notify_msg = wParam >> 16; if (notify_msg == BN_CLICKED) { EndDialog(hDlg, 0); --- 8004,8007 ---- *************** *** 6207,6211 **** } } else if (notify_src == IDOK) { - unsigned int notify_msg = wParam >> 16; if (notify_msg == BN_CLICKED) { // When input is made, retrieve it --- 8009,8012 ---- Index: Skin.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Skin.h 24 Dec 2009 16:40:25 -0000 1.11 --- Skin.h 28 Feb 2011 22:13:55 -0000 1.12 *************** *** 26,29 **** --- 26,30 ---- #include "defuns.h" + #define GR_WHITE 0x00FFFFFF typedef struct { *************** *** 51,54 **** --- 52,60 ---- #define IMGTYPE_TRUECOLOR 4 + #define INPUTFONT_SIZE 14 + #define BIGFONT_SIZE 18 + #define SMALLFONT_SIZE 12 + #define VERYSMALLFONT_SIZE 11 + #define KEYMAP_MAX_MACRO_LENGTH 31 typedef struct { *************** *** 69,73 **** typedef struct { ! SkinRect disp_rect; SkinPoint src; SkinPoint sel; --- 75,80 ---- typedef struct { ! bool exists; ! SkinRect disp_rect; SkinPoint src; SkinPoint sel; *************** *** 75,78 **** --- 82,91 ---- typedef enum { + track_set, + track_move, + track_off + } TtrackAction; + + typedef enum { COPYRESULT=0, VARSAVEAS, *************** *** 88,96 **** TODEGREE2, TOGRAD ! }resSelection; #define SELECTION_COUNT 13 #define RESULTAREA_SIZE 128 #define INPUTAREA_SIZE 2048 class Skin { protected: --- 101,122 ---- TODEGREE2, TOGRAD ! } resSelection; #define SELECTION_COUNT 13 + typedef enum { + grphStart=0, + grphInitComplete, + grphZoneStarted, + grphZoneComplete, + grphViewStart, + grphViewStarted, + grphEnd + } t_graphState; + #define RESULTAREA_SIZE 128 #define INPUTAREA_SIZE 2048 + + #define MAX_GRFUNCS 6 // Max number of functions which can be graphed on screen + class Skin { protected: *************** *** 100,109 **** SkinPoint display_loc; // Description of the display in the skin ! int display_w, display_h; SkinPoint display_scale; COLORREF display_bg, display_fg; HFONT hFontBig_display; HFONT hFontSmall_display; HFONT hFont_input; SkinKey *keylist; // Array of keys in the skin int nkeys; // Number of keys in the skin --- 126,162 ---- SkinPoint display_loc; // Description of the display in the skin ! int display_w, display_h, display_basey, zonebmp_basey; ! SkinPoint view_loc; // Description of the wide view in the graph skin ! int view_w, view_h, view_basey, viewbmp_basey; SkinPoint display_scale; + SkinPoint view_scale; + RECT viewRect; // Describes view area + RECT zoneOnView, tempZoneOnView; + RECT zv_intersect, tempzv_intersect; + bool intersect, tempIntersect; COLORREF display_bg, display_fg; + COLORREF graphColors[MAX_GRFUNCS+3]; // 6 line colors + axis, grids and background + HPEN graphPens[MAX_GRFUNCS+3]; // 6 line colors + axis, grids and background + HDC resultDC; + HDC displayDC; + HDC zoneDC; // For keeping graph bitmap in memory + HDC viewDC; // For keeping wide view bitmap in memory + HGDIOBJ oldResultObj, oldZoneObj, oldViewObj; + HBITMAP resultBmp; + HBITMAP zoneBmp; + HBITMAP viewBmp; + t_graphState graphState; // Tells where we are during graph drawing + double viewX, viewY, span, wonz_xr, wonz_yr; + double selx0, sely0, calcx, calcy, calcr; + int selArea, prevx, prevy, prevsx, prevsy, selsx0, selsy0, selprevsx, selprevsy; + RECT cross_rcx, cross_rcy, sel_rc; + HRGN zone_rgn, zgph_rgn, zcomplement_rgn; + HRGN view_rgn, vgph_rgn, vcomplement_rgn; HFONT hFontBig_display; HFONT hFontSmall_display; + HFONT hFontVerySmall_display; HFONT hFont_input; + // HANDLE graph_thread; // Handle to the graph drawing thread + HPEN hPenSelZone; SkinKey *keylist; // Array of keys in the skin int nkeys; // Number of keys in the skin *************** *** 119,124 **** int skin_type; - int skin_width, - skin_height; int skin_ncolors; const SkinColor *skin_colors; --- 172,175 ---- *************** *** 130,134 **** HBITMAP skin_dib; unsigned char *disp_bitmap; // Source bitmap to clear display parts - HBITMAP result_hbitmap; // Handle to bitmap for clearing result int disp_bytesperline; bool display_enabled; // Enable or disable screen repaints. --- 181,184 ---- *************** *** 150,159 **** public: ! int magnification; Skin(); // Constructor ~Skin(); // Destructor ! int load(TCHAR *skinname, const TCHAR *basedir, int width, int height); int getchar(void); void rewind(void); --- 200,219 ---- public: ! bool graph; // Tells if this is a graphic display skin ! bool recalc, recalc_zone, recalc_view; // Signal to recompute graph or only parts of it on next repaint ! bool graphComplete, zoneComplete, viewComplete, continueOnView; ! int skin_width, ! skin_height; ! int magnification; ! HBRUSH editBgBrush; ! int curve_nb; // Curve being tracked ! bool is_cross, is_selecting; // Type of selection on curve ! double param0, param; // Start and end of selection on input parameter. ! // If only a cross, value is in param, and param0 == NaN Skin(); // Constructor ~Skin(); // Destructor ! int load(TCHAR *skinname, const TCHAR *basedir, int width, int height, HDC hdc); int getchar(void); void rewind(void); *************** *** 161,165 **** int width, int height); void put_pixels(unsigned const char *data); ! void finish_image(void); void repaint(HDC hdc, HDC memdc); --- 221,225 ---- int width, int height); void put_pixels(unsigned const char *data); ! void finish_image(HDC hdc); void repaint(HDC hdc, HDC memdc); *************** *** 170,176 **** unsigned char *keymap_lookup(int keycode, bool ctrl, bool alt, bool shift, bool cshift, bool *exact); void repaint_key(HDC hdc, HDC memdc, int key, int state); ! void display_blitter(HDC hdc, const char *bits, int bytesperline, int x, int y, ! int width, int height); ! void repaint_result(HDC hdc, HDC memdc); COLORREF getDisplayFgColor(void); COLORREF getDisplayBgColor(void); --- 230,235 ---- unsigned char *keymap_lookup(int keycode, bool ctrl, bool alt, bool shift, bool cshift, bool *exact); void repaint_key(HDC hdc, HDC memdc, int key, int state); ! bool tapOnResult(HDC hdc, int x, int y, TtrackAction action); ! void repaint_result(HDC hdc); COLORREF getDisplayFgColor(void); COLORREF getDisplayBgColor(void); *************** *** 189,192 **** --- 248,254 ---- void print_result(HDC hdc); void paint_result(HDC hdc); + HBITMAP allocResult(LONG cx, LONG cy); + void deleteResult(void); + void erase_result(HDC hdc); void print_resultpow(void *hWnd_p, TCHAR *res_text); void print_resultpow(HDC hdc); *************** *** 205,208 **** --- 267,306 ---- void varDefList(TCHAR *name, TCHAR *deftext, int itemNum, void *hWnd); void display_set_enabled(bool enable); + + void dragGraph(HDC hdc, int area, int dx, int dy); + void showOnGraph(HDC hdc, double param); + void tapOnGraph(HDC hdc, int area, int x, int y, TtrackAction action); + void repaint_grphVal(HDC hdc, int annun); + + void refreshWonzRatio(HDC hdc); + void scaleGraph(HDC hdc, int area, double scale_in); + void centerView(HDC hdc); + void refreshView(HDC hdc); + void refreshViewAndTrigRecalc(HDC hdc); + void moveGraph(HDC hdc, int area, double x, double y); + void normZone(HDC hdc); + void selPen(int i); + void drawline(int x1, int y1, int x2, int y2); + void finishline(int color); + void trigRecalcGraph(void); + void trigRecalcZone(void); + void trigRecalcView(void); + void resetGraphSel(void); + void resetZone(void); + void resetView(void); + void switchSelGraph(HDC hdc); + int initGraph(void); + int initView(void); + void clearZoneGraph(void); + void drawZoneGraph(void); + void clearViewGraph(void); + DWORD drawgraph_async(void); + // DWORD drawgraph_thread(void); + int draw_graph(HDC hdc); + void stop_graph(void); + void draw_tempZoneOnView(HDC hdc); + void set_tempZoneOnView(int sx, int sy); + void draw_zoneOnView(HDC hdc); + void calc_zoneOnView(void); }; Index: StateManager.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/StateManager.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StateManager.cpp 24 Dec 2009 16:40:25 -0000 1.7 --- StateManager.cpp 28 Feb 2011 22:13:55 -0000 1.8 *************** *** 5,8 **** --- 5,9 ---- #include "core/mlib/fp.h" #include "core/mlib/history.h" + #include "core/mlib/mathem.h" #include "EasyCalc.h" *************** *** 13,16 **** --- 14,18 ---- _tcscpy(state.skinName[1], _T("EasyCalc2")); _tcscpy(state.skinName[2], _T("EasyCalc3")); + _tcscpy(state.skinName[3], _T("EasyCalcG")); state.cur_skin_nb = 0; _tcscpy(state.langName, _T("en")); // Language = english by default *************** *** 19,22 **** --- 21,25 ---- state.listPrefs.list[1][0] = _T('\0'); state.listPrefs.list[2][0] = _T('\0'); + state.listPrefs.list[3][0] = _T('\0'); state.matrixName[0] = _T('\0'); *************** *** 42,46 **** state.calcPrefs.selPosStart=calcPrefs.selPosEnd = 0; state.calcPrefs.solverWorksheet = -1; - state.calcPrefs.finBegin = false; state.calcPrefs.matchParenth = false; --- 45,48 ---- *************** *** 54,64 **** state.calcPrefs.dispPrefs.mode = disp_normal; state.calcPrefs.dispPrefs.cvtUnits = true; state.calcPrefs.insertHelp = true; state.calcPrefs.acceptOSPref = false; state.calcPrefs.dispScien = false; ! // Publish calcPrefs and dispPrefs for old core modules calcPrefs = state.calcPrefs; dispPrefs = state.calcPrefs.dispPrefs; /* db_recompile needs dispPrefs */ db_recompile_all(); } --- 56,108 ---- state.calcPrefs.dispPrefs.mode = disp_normal; state.calcPrefs.dispPrefs.cvtUnits = true; + state.calcPrefs.dispPrefs.penMode = pen_centerwide; state.calcPrefs.insertHelp = true; state.calcPrefs.acceptOSPref = false; state.calcPrefs.dispScien = false; ! state.graphPrefs.xmin = -7.0; ! state.graphPrefs.xmax = 7.0; ! state.graphPrefs.ymin = -7.0; ! state.graphPrefs.ymax = 7.0; ! state.graphPrefs.xscale = 1.0; ! state.graphPrefs.yscale = 1.0; ! state.graphPrefs.fimin = 0.0; ! state.graphPrefs.fimax = M_PIl * 2.0; ! state.graphPrefs.fistep = M_PIl * 0.02; ! state.graphPrefs.tmin = 0.0; ! state.graphPrefs.tmax = 10.0; ! state.graphPrefs.tstep = 0.1; ! state.graphPrefs.functype = graph_func; ! for (int i=0 ; i<MAX_GRFUNCS ; i++) { ! graphPrefs.funcFunc[i][0]='\0'; ! graphPrefs.funcPol[i][0]='\0'; ! graphPrefs.funcPar[i][0][0]='\0'; ! graphPrefs.funcPar[i][1][0]='\0'; ! } ! state.graphPrefs.logx = false; ! state.graphPrefs.logy = false; ! state.graphPrefs.speed = 1; ! for (int i=0; i<9; i++){ ! /* Note: grEnable[8] enables axis labels, ! * colors[8] is the background color ! */ ! // Re-note: this structure is never used for now in the Windows version, ! // since there is no palette to change colors specified in the .layout file ! // and no way to enable/disable axis or grid on the GUI. ! for (int ft=graph_func ; ft<nb_func_types ; ft++) ! state.graphPrefs.grEnable[ft][i] = true; ! // if (colorDisplay) ! state.graphPrefs.colors[i] = WinRGBToIndex(graphRGBColors+i); ! // if (grayDisplay) ! // graphPrefs.colors[i] = funcolors[i]; ! } ! for (int i=0 ; i<6 ; i++) { ! state.graphPrefs.grType[i] = 1; // Use lines ! } ! ! // Publish calcPrefs, dispPrefs and graphPrefs for old core modules calcPrefs = state.calcPrefs; dispPrefs = state.calcPrefs.dispPrefs; /* db_recompile needs dispPrefs */ + graphPrefs = state.graphPrefs; db_recompile_all(); } *************** *** 102,105 **** --- 146,150 ---- void StateManager::save(TCHAR *fn, void *hWnd_p) { state.calcPrefs = calcPrefs; + state.graphPrefs = graphPrefs; stateFilename = fn; *************** *** 135,138 **** --- 180,239 ---- _tcscpy(state.skinName[1], _T("EasyCalc2")); _tcscpy(state.skinName[2], _T("EasyCalc3")); + case 3: // Version 4 to 5 + // Insert the new skin name space + memmove(state.langName, state.skinName+3, + sizeof(state) - (((size_t) &(state.langName)) + - ((size_t) &state) + ) + ); + _tcscpy(state.skinName[3], _T("EasyCalcG")); + // Insert the new graph pen mode space + memmove(&(state.calcPrefs.insertHelp), + &(state.calcPrefs.dispPrefs.penMode), + sizeof(state) - (((size_t) &(state.calcPrefs.insertHelp)) + - ((size_t) &state) + ) + ); + // Set the new graph preferences to defaults + state.calcPrefs.dispPrefs.penMode = pen_centerwide; + state.graphPrefs.xmin = -7.0; + state.graphPrefs.xmax = 7.0; + state.graphPrefs.ymin = -7.0; + state.graphPrefs.ymax = 7.0; + state.graphPrefs.xscale = 1.0; + state.graphPrefs.yscale = 1.0; + state.graphPrefs.fimin = 0.0; + state.graphPrefs.fimax = M_PIl * 2.0; + state.graphPrefs.fistep = M_PIl * 0.02; + state.graphPrefs.tmin = 0.0; + state.graphPrefs.tmax = 10.0; + state.graphPrefs.tstep = 0.1; + state.graphPrefs.functype = graph_func; + for (int i=0 ; i<MAX_GRFUNCS ; i++) { + graphPrefs.funcFunc[i][0]='\0'; + graphPrefs.funcPol[i][0]='\0'; + graphPrefs.funcPar[i][0][0]='\0'; + graphPrefs.funcPar[i][1][0]='\0'; + } + state.graphPrefs.logx = false; + state.graphPrefs.logy = false; + state.graphPrefs.saved_reducePrecision = state.calcPrefs.reducePrecision; + state.graphPrefs.speed = 1; + for (int i=0 ; i<9 ; i++){ + /* Note: grEnable[8] enables axis labels, + * colors[8] is the background color + */ + for (int ft=graph_func ; ft<nb_func_types ; ft++) + state.graphPrefs.grEnable[ft][i] = true; + // if (colorDisplay) + state.graphPrefs.colors[i] = WinRGBToIndex(graphRGBColors+i); + // if (grayDisplay) + // graphPrefs.colors[i] = funcolors[i]; + } + for (int i=0 ; i<6 ; i++) { + state.graphPrefs.grType[i] = 1; // Use lines + } + default: // No migration + ; } *************** *** 142,149 **** initCalcPrefs(); } else { ! // Publish calcPrefs and dispPrefs for old core modules // as done by initCalcPrefs(). calcPrefs = state.calcPrefs; dispPrefs = state.calcPrefs.dispPrefs; } } --- 243,251 ---- initCalcPrefs(); } else { ! // Publish calcPrefs, dispPrefs and graphPrefs for old core modules // as done by initCalcPrefs(). calcPrefs = state.calcPrefs; dispPrefs = state.calcPrefs.dispPrefs; + graphPrefs = state.graphPrefs; } } Index: StateManager.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/StateManager.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StateManager.h 24 Dec 2009 16:40:25 -0000 1.7 --- StateManager.h 28 Feb 2011 22:13:55 -0000 1.8 *************** *** 7,10 **** --- 7,11 ---- #include "core/prefs.h" #include "core/lstedit.h" + #include "core/grprefs.h" // Filename, including path, max size. *************** *** 12,16 **** // Number of skins that one can load and access ! #define NB_SKINS 3 typedef struct { --- 13,17 ---- // Number of skins that one can load and access ! #define NB_SKINS 4 typedef struct { *************** *** 22,26 **** tlistPrefs listPrefs; TCHAR matrixName[MAX_FUNCNAME+1]; ! // Always add new fields at end, for kepping version migration simple } t_state; --- 23,28 ---- tlistPrefs listPrefs; TCHAR matrixName[MAX_FUNCNAME+1]; ! TgrPrefs graphPrefs; ! // Always add new fields at end, for keeping version migration simple } t_state; Index: EasyCalc.gif =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.gif,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvsRs2uXq and /tmp/cvsVzJzXm differ Index: shell_loadimage.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/shell_loadimage.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** shell_loadimage.cpp 15 Dec 2009 21:39:18 -0000 1.2 --- shell_loadimage.cpp 28 Feb 2011 22:13:55 -0000 1.3 *************** *** 57,61 **** ! int shell_loadimage(Skin *pskin) { SkinPixmap *pm = &pixmap; SkinColor *lcmap = NULL; --- 57,61 ---- ! int shell_loadimage(Skin *pskin, HDC hdc) { SkinPixmap *pm = &pixmap; SkinColor *lcmap = NULL; *************** *** 129,133 **** pm->cmap = (SkinColor *) mmalloc(256 * sizeof(SkinColor)); ! // TODO - handle memory allocation failure if (has_global_cmap) { for (i=0 ; i<ncolors ; i++) { --- 129,135 ---- pm->cmap = (SkinColor *) mmalloc(256 * sizeof(SkinColor)); ! if (pm->cmap == NULL) { //Memory allocation failure ! return (-1); ! } if (has_global_cmap) { for (i=0 ; i<ncolors ; i++) { *************** *** 193,197 **** 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); --- 195,202 ---- size = pm->bytesperline * pm->height; pm->pixels = (unsigned char *) mmalloc(size); ! if (pm->pixels == NULL) { //Memory allocation failure ! mfree(pm->cmap); ! return (-2); ! } memset(pm->pixels, pm->depth == 1 ? background * 255 : background, size); *************** *** 548,552 **** ptr += pm->bytesperline; } ! skin->finish_image(); } --- 553,560 ---- ptr += pm->bytesperline; } ! skin->finish_image(hdc); ! // Build immediately the screen bitmap to free memory. ! } else { // Error allocating space to build scaled bitmap ! res = -3; } Index: EasyCalc3.gif =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc3.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsSMq2np and /tmp/cvsh4Xiql differ --- NEW FILE: SkinList.h --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ /* SkinList.h : SkinList object for registering Skin usage of the calculator. *****************************************************************************/ #ifndef SKINLIST_H #define SKINLIST_H 1 // Object to contain a skin number and usage class SkinUsage { public: int skin_nb; int usage; SkinUsage *prev, *next; SkinUsage(int nb); // Constructor ~SkinUsage(); // Destructor }; // SkinList object class SkinList { protected: SkinUsage *list; SkinUsage *cur_skin; int nb_skins; public: SkinList(); // Constructor ~SkinList(); // Destructor void clear(void); void add(int nb); void add_use(int nb); int least_used(void); }; #endif Index: EasyCalc2.gif =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc2.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsclZX1p and /tmp/cvsJsSm5l differ Index: EasyCalcppc.aps =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalcppc.aps,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvsWiTFWs and /tmp/cvspSVb1o differ --- NEW FILE: SkinList.cpp --- /***************************************************************************** * EasyCalc -- a scientific calculator * Copyright (C) 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, * as published by the Free Software Foundation. * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ /* SkinList.cpp : Methods for the SkinList object. *****************************************************************************/ #include "stdafx.h" #include "SkinList.h" /*------------------------------------------------------------------------------- - SkinUsage constructor and destructor. - -------------------------------------------------------------------------------*/ SkinUsage::SkinUsage(int nb) { skin_nb = nb; usage = 0; prev = next = NULL; } SkinUsage::~SkinUsage() { // if (next != NULL) // delete next; } /*------------------------------------------------------------------------------- - SkinList constructor and destructor. - -------------------------------------------------------------------------------*/ SkinList::SkinList() { list = cur_skin = NULL; nb_skins = 0; } SkinList::~SkinList() { clear(); } /*------------------------------------------------------------------------------- - Methods. - -------------------------------------------------------------------------------*/ /******************************************************************************** * Clear list. * ********************************************************************************/ void SkinList::clear (void) { SkinUsage *temp; while (list != NULL) { temp = list; list = list->next; delete temp; } cur_skin = NULL; nb_skins = 0; } /******************************************************************************** * Add new skin. * ********************************************************************************/ void SkinList::add (int nb) { // Verify it doesn't exist already. If so reset the object and reuse it SkinUsage *temp = list; while (temp != NULL) { if (temp->skin_nb == nb) break; temp = temp->next; } if (temp != NULL) { // Remove it from list if (temp->prev == NULL) list = temp->next; else { temp->prev->next = temp->next; if (temp->next != NULL) temp->next->prev = temp->prev; temp->prev = NULL; } // Reset usage count temp->usage = 0; } else { temp = new SkinUsage(nb); } // Add at head temp->next = list; if (list != NULL) list->prev = temp; list = temp; } /******************************************************************************** * Register usage. * ********************************************************************************/ void SkinList::add_use (int nb) { // Find it SkinUsage *temp = list; while (temp != NULL) { if (temp->skin_nb == nb) break; temp = temp->next; } if (temp != NULL) { // Register usage, and keep list sorted in increasing usage order cur_skin = temp; // Remember last used temp->usage++; // Find new position SkinUsage *temp2 = temp; while ((temp2->next != NULL) && (temp2->next->usage < temp->usage)) { temp2 = temp2->next; } if (temp2 != temp) { // Move ... if (temp->prev == NULL) { list = temp->next; temp->next->prev = NULL; } else { temp->prev->next = temp->next; temp->next->prev = temp->prev; } temp->next = temp2->next; if (temp->next != NULL) temp->next->prev = temp; temp2->next = temp; temp->prev = temp2; } } } /******************************************************************************** * Get least used, different from last used (if possible). * ********************************************************************************/ int SkinList::least_used (void) { int nb = -1; // Get first, or second if exists and first is last used. if ((list == cur_skin) && (list->next != NULL)) { nb = list->next->skin_nb; } else { nb = list->skin_nb; } return (nb); } Index: EasyCalcppc.rc =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalcppc.rc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** EasyCalcppc.rc 24 Dec 2009 16:40:25 -0000 1.9 --- EasyCalcppc.rc 28 Feb 2011 22:13:55 -0000 1.10 *************** *** 132,138 **** LTEXT "Skin 2",IDC_SKIN2,84,39,39,10 LTEXT "Skin 3",IDC_SKIN3,84,58,39,10 ! COMBOBOX IDC_SKINVAL,72,73,21,40,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! LTEXT "Current skin",IDC_SKIN,10,76,58,8 ! CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE,121,71,14,14 END --- 132,140 ---- LTEXT "Skin 2",IDC_SKIN2,84,39,39,10 LTEXT "Skin 3",IDC_SKIN3,84,58,39,10 ! COMBOBOX IDC_SKINVAL,72,94,21,51,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! LTEXT "Current skin",IDC_SKIN,9,96,58,8 ! CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE,121,95,14,14 ! COMBOBOX IDC_COMBO_SKING,9,75,70,80,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! LTEXT "Skin G",IDC_SKING,84,77,39,10 END *************** *** 180,185 **** BEGIN ICON IDI_EASYCALC,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE ! LTEXT "EasyCalc Version 1.25a PPC",IDC_STATIC_2,12,36,100,8,SS_NOPREFIX ! LTEXT "Copyright (C) 2009",IDC_STATIC_3,12,48,66,8 END --- 182,187 ---- BEGIN ICON IDI_EASYCALC,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE ! LTEXT "EasyCalc Version 1.25a PPC",IDC_STATIC_2,12,36,100,21,SS_NOPREFIX ! LTEXT "Copyright (C) 2010",IDC_STATIC_3,12,60,66,8 END *************** *** 191,196 **** BEGIN ICON IDI_EASYCALC,IDC_STATIC_1,9,12,20,20,SS_REALSIZEIMAGE ! LTEXT "EasyCalc Version 1.25a PPC",IDC_STATIC_2,49,12,76,8,SS_NOPREFIX ! LTEXT "Copyright (C) 2009",IDC_STATIC_3,49,24,66,8 END --- 193,198 ---- BEGIN ICON IDI_EASYCALC,IDC_STATIC_1,9,12,20,20,SS_REALSIZEIMAGE ! LTEXT "EasyCalc Version 1.25a PPC",IDC_STATIC_2,49,12,76,21,SS_NOPREFIX ! LTEXT "Copyright (C) 2010",IDC_STATIC_3,49,36,66,8 END *************** *** 307,311 **** 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 --- 309,312 ---- *************** *** 313,332 **** 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 --- 314,440 ---- LTEXT "Total cost",IDC_VARNAME4,0,92,87,12 EDITTEXT IDC_EDIT4,89,90,70,14,ES_AUTOHSCROLL | ES_READONLY + CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE,33,108,14,14 END ! IDD_GRAPH_PREFS DIALOG 0, 0, 160, 148 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Graph preferences" FONT 8, "MS Shell Dlg" BEGIN ! DEFPUSHBUTTON "OK",IDOK,1,133,32,14 ! PUSHBUTTON "Cancel",IDCANCEL,118,133,41,14 ! LTEXT "xmin:",IDC_XMIN,3,3,25,12 ! EDITTEXT IDC_EDITXMIN,33,1,62,14,ES_AUTOHSCROLL ! LTEXT "xmax:",IDC_XMAX,3,19,25,12 ! EDITTEXT IDC_EDITXMAX,33,17,62,14,ES_AUTOHSCROLL ! LTEXT "ymin:",IDC_YMIN,3,35,25,12 ! EDITTEXT IDC_EDITYMIN,33,33,62,14,ES_AUTOHSCROLL ! LTEXT "ymax:",IDC_YMAX,3,51,25,12 ! EDITTEXT IDC_EDITYMAX,33,49,62,14,ES_AUTOHSCROLL ! LTEXT "th-min:",IDC_THMIN,3,67,25,12 ! EDITTEXT IDC_EDITTHMIN,33,65,62,14,ES_AUTOHSCROLL ! LTEXT "th-max:",IDC_THMAX,3,83,25,12 ! EDITTEXT IDC_EDITTHMAX,33,81,62,14,ES_AUTOHSCROLL ! LTEXT "th-step:",IDC_THSTEP,3,99,25,12 ! EDITTEXT IDC_EDITTHSTEP,33,97,62,14,ES_AUTOHSCROLL ! CONTROL "Log X",IDC_CHECKLOGX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,1,33,10 ! CONTROL "Log Y",IDC_CHECKLOGY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,33,33,10 ! CONTROL "Function",IDC_RADIOFCT,"Button",BS_AUTORADIOBUTTON | WS_GROUP,99,58,58,10 ! CONTROL "Polar",IDC_RADIOPOLAR,"Button",BS_AUTORADIOBUTTON,99,73,58,10 ! CONTROL "Parametric",IDC_RADIOPARAM,"Button",BS_AUTORADIOBUTTON,99,88,58,10 ! GROUPBOX "",IDC_STATICGRMODE,96,50,63,51 ! PUSHBUTTON "Default",IDC_BUTTONDEFAULT,1,115,50,14 ! PUSHBUTTON "Trigo defaults",IDC_BUTTONTRIGODEF,66,115,50,14 ! CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE | WS_TABSTOP,47,133,14,14 ! END ! ! IDD_GRAPH_CONFIG DIALOG 0, 0, 160, 118 ! STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Graph config" ! FONT 8, "MS Shell Dlg" ! BEGIN ! DEFPUSHBUTTON "OK",IDOK,1,103,32,14 ! CONTROL 156,IDC_COLORY1,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,3,9,9 ! CONTROL 156,IDC_COLORY2,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,19,9,9 ! CONTROL 156,IDC_COLORY3,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,35,9,9 ! CONTROL 156,IDC_COLORY4,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,51,9,9 ! CONTROL 156,IDC_COLORY5,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,67,9,9 ! CONTROL 156,IDC_COLORY6,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,83,9,9 ! CONTROL "",IDC_CHECKY1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,3,10,10 ! CONTROL "",IDC_CHECKY2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,19,10,10 ! CONTROL "",IDC_CHECKY3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,35,10,10 ! CONTROL "",IDC_CHECKY4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,51,10,10 ! CONTROL "",IDC_CHECKY5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,67,10,10 ! CONTROL "",IDC_CHECKY6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,83,10,10 ! PUSHBUTTON "Y1",IDC_BUTTONY1,30,2,13,13 ! PUSHBUTTON "Y2",IDC_BUTTONY2,30,18,13,13 ! PUSHBUTTON "Y3",IDC_BUTTONY3,30,34,13,13 ! PUSHBUTTON "Y4",IDC_BUTTONY4,30,50,13,13 ! PUSHBUTTON "Y5",IDC_BUTTONY5,30,66,13,13 ! PUSHBUTTON "Y6",IDC_BUTTONY6,30,82,13,13 ! EDITTEXT IDC_EDITY1,47,2,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY2,47,18,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY3,47,34,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY4,47,50,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY5,47,66,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY6,47,82,80,14,ES_AUTOHSCROLL | ES_READONLY ! CONTROL 157,IDC_LINEY1,"Static",SS_BITMAP | SS_NOTIFY,133,6,16,7 ! CONTROL 157,IDC_LINEY2,"Static",SS_BITMAP | SS_NOTIFY,133,22,16,7 ! CONTROL 157,IDC_LINEY3,"Static",SS_BITMAP | SS_NOTIFY,133,38,16,7 ! CONTROL 157,IDC_LINEY4,"Static",SS_BITMAP | SS_NOTIFY,133,54,16,7 ! CONTROL 157,IDC_LINEY5,"Static",SS_BITMAP | SS_NOTIFY,133,70,16,7 ! CONTROL 157,IDC_LINEY6,"Static",SS_BITMAP | SS_NOTIFY,133,85,16,7 ! CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE | WS_TABSTOP,51,103,14,14 ! END ! ! IDD_GRAPH_CONFIGXY DIALOG 0, 0, 254, 125 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_HSCROLL | WS_SYSMENU ! CAPTION "Graph config" ! FONT 8, "MS Shell Dlg" ! BEGIN ! DEFPUSHBUTTON "OK",IDOK,110,100,32,14 ! CONTROL 156,IDC_COLORY1,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,3,9,9 ! CONTROL 156,IDC_COLORY2,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,19,9,9 ! CONTROL 156,IDC_COLORY3,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,35,9,9 ! CONTROL 156,IDC_COLORY4,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,51,9,9 ! CONTROL 156,IDC_COLORY5,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,67,9,9 ! CONTROL 156,IDC_COLORY6,"Static",SS_BITMAP | SS_NOTIFY | WS_BORDER,4,83,9,9 ! CONTROL "",IDC_CHECKY1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,3,10,10 ! CONTROL "",IDC_CHECKY2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,19,10,10 ! CONTROL "",IDC_CHECKY3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,35,10,10 ! CONTROL "",IDC_CHECKY4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,51,10,10 ! CONTROL "",IDC_CHECKY5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,67,10,10 ! CONTROL "",IDC_CHECKY6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,83,10,10 ! PUSHBUTTON "Y1",IDC_BUTTONY1,30,2,13,13 ! PUSHBUTTON "Y2",IDC_BUTTONY2,30,18,13,13 ! PUSHBUTTON "Y3",IDC_BUTTONY3,30,34,13,13 ! PUSHBUTTON "Y4",IDC_BUTTONY4,30,50,13,13 ! PUSHBUTTON "Y5",IDC_BUTTONY5,30,66,13,13 ! PUSHBUTTON "Y6",IDC_BUTTONY6,30,82,13,13 ! EDITTEXT IDC_EDITY1,46,2,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY2,46,18,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY3,46,34,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY4,46,50,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY5,46,66,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITY6,46,82,80,14,ES_AUTOHSCROLL | ES_READONLY ! PUSHBUTTON "X1",IDC_BUTTONX1,128,2,13,13 ! PUSHBUTTON "X2",IDC_BUTTONX2,128,19,13,13 ! PUSHBUTTON "X3",IDC_BUTTONX3,128,35,13,13 ! PUSHBUTTON "X4",IDC_BUTTONX4,128,50,13,13 ! PUSHBUTTON "X5",IDC_BUTTONX5,128,66,13,13 ! PUSHBUTTON "X6",IDC_BUTTONX6,128,82,13,13 ! EDITTEXT IDC_EDITX1,143,2,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITX2,143,18,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITX3,143,34,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITX4,143,50,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITX5,143,66,80,14,ES_AUTOHSCROLL | ES_READONLY ! EDITTEXT IDC_EDITX6,143,82,80,14,ES_AUTOHSCROLL | ES_READONLY ! CONTROL 157,IDC_LINEY1,"Static",SS_BITMAP | SS_NOTIFY,229,6,16,7 ! CONTROL 157,IDC_LINEY2,"Static",SS_BITMAP | SS_NOTIFY,229,22,16,7 ! CONTROL 157,IDC_LINEY3,"Static",SS_BITMAP | SS_NOTIFY,229,38,16,7 ! CONTROL 157,IDC_LINEY4,"Static",SS_BITMAP | SS_NOTIFY,229,54,16,7 ! CONTROL 157,IDC_LINEY5,"Static",SS_BITMAP | SS_NOTIFY,229,70,16,7 ! CONTROL 157,IDC_LINEY6,"Static",SS_BITMAP | SS_NOTIFY,229,85,16,7 ! CONTROL "SIP1",IDC_SIP,"SIPPREF",NOT WS_VISIBLE | WS_TABSTOP,154,100,14,14 END *************** *** 374,382 **** END - IDD_LARGE_MENU, DIALOG - BEGIN - BOTTOMMARGIN, 121 - END - IDD_OPT_GENERAL, DIALOG BEGIN --- 482,485 ---- *************** *** 397,405 **** END - IDD_SLIM_MENU, DIALOG - BEGIN - BOTTOMMARGIN, 117 - END - IDD_ABOUTBOX, DIALOG BEGIN --- 500,503 ---- *************** *** 473,480 **** END ! IDD_FINANCIALS1, DIALOG BEGIN RIGHTMARGIN, 159 ! TOPMARGIN, 2 END END --- 571,593 ---- END ! IDD_GRAPH_PREFS, DIALOG BEGIN RIGHTMARGIN, 159 ! TOPMARGIN, 1 ! BOTTOMMARGIN, 147 ! END ! ! IDD_GRAPH_CONFIG, DIALOG ! BEGIN ! RIGHTMARGIN, 159 ! TOPMARGIN, 1 ! BOTTOMMARGIN, 117 ! END ! ! IDD_GRAPH_CONFIGXY, DIALOG ! BEGIN ! RIGHTMARGIN, 253 ! TOPMARGIN, 1 ! BOTTOMMARGIN, 114 END END *************** *** 618,621 **** --- 731,754 ---- + ///////////////////////////////////////////////////////////////////////////// + // French (France) resources + + #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) + #ifdef _WIN32 + LANGUAGE LANG_FRENCH, SUBLANG_FRENCH + #pragma code_page(1252) + #endif //_WIN32 + + ///////////////////////////////////////////////////////////////////////////// + // + // Bitmap + // + + IDB_BITMAP1 BITMAP "bitmap1.bmp" + IDB_BITMAP2 BITMAP "bitmap2.bmp" + #endif // French (France) resources + ///////////////////////////////////////////////////////////////////////////// + + #ifndef APSTUDIO_INVOKED --- NEW FILE: EasyCalcG.layout --- # EasyCalc standard graph skin (PocketPC) # Some annunciators used here can only exist with xxxxG skins (G for Graph). # Normal calc keys cannot be used in this layout, there are additional keys # for graph functions. # Skin rectangle coordinates x1,y1,x2,y2 Skin: 0,0,240,268 # Description of the graph display area: x1,y1 xscale yscale bg_color fg_color # With xscale = 0, screen width is 216 dots (only value used for now). # Do not touch yscale either for now. Display: 35,6 1 1 a3b39d 0b2327 WideView: 1,212 1 1 a3b39d 0b2327 # Description of available graph colors (background comes from Display: above # and Axis is initially set to foreground from Display: as well). Graph: 1 ff0000 Graph: 2 00ff00 Graph: 3 0000ff Graph: 4 808000 Graph: 5 008080 Graph: 6 800080 Graph: 7 0b2327 # Axis Graph: 8 808080 # Grid # Active elements: num x1,y1,l,h (on screen) x1_off,y1_off x1_on,y1_on (in the gif) Annunciator: 2 35,0,16,13 20,268 20,281 # Degree indicator Annunciator: 3 54,0,16,13 35,268 35,281 # Radian indicator Annunciator: 4 73,0,21,13 50,268 50,281 # Gradian indicator Annunciator: 11 205,0,6,13 0,268 0,281 # Skin 1 indicator Annunciator: 12 212,0,6,13 5,268 5,281 # Skin 2 indicator Annunciator: 13 219,0,6,13 10,268 10,281 # Skin 3 indicator Annunciator: 14 226,0,6,13 15,268 15,281 # Graph indicator Annunciator: 20 93,211,29,19 124,268 124,287 # Select zone indicator Annunciator: 21 126,211,29,19 153,268 153,287 # Move graph indicator Annunciator: 22 159,211,29,19 211,268 211,287 # Track point indicator Annunciator: 23 126,232,29,19 182,268 182,287 # Center wide view indicator Annunciator: 24 1,2,30,11 2,2 -1,-1 # Zone Y max (no selection) Annunciator: 25 1,198,30,11 2,198 -1,-1 # Zone Y min (no selection) Annunciator: 26 59,211,30,11 62,212 -1,-1 # Zone X min (no selection) Annunciator: 27 209,211,30,11 211,212 -1,-1 # Zone X max (no selection) Annunciator: 28 112,255,22,11 113,255 -1,-1 # Wide view / zone ratio X (no selection) Annunciator: 29 138,255,22,11 139,255 -1,-1 # Wide view / zone ratio Y (no selection) Annunciator: 30 168,241,30,11 173,241 -1,-1 # Sel param start (no selection) Annunciator: 31 209,241,30,11 211,241 -1,-1 # Sel param end (no selection) Annunciator: 32 209,227,30,11 211,227 -1,-1 # Pointed/calculated Y (no selection) Annunciator: 33 209,255,30,11 211,255 -1,-1 # Pointed/calculated X (no selection) Annunciator: 34 168,255,30,11 173,255 -1,-1 # Pointed/calculated r (no selection) Annunciator: 35 192,215,11,11 192,215 -1,-1 # For curve Yn (no selection) # Keys on the calculator gif: # num[, shifted_num] x1_sel,y1_sel,l_sel,h_sel (selection zone) x1_off,y1_off,l,h x1_on,y1_on # with num and shifted_num as follows: # -5 -> Center zone on origin, "0" # -6 -> center wide view on origin, "0" # -7 -> Graph preferences, "prefs" # -8 -> Graph config, "conf" # -9 -> Graph calculations, "calc" # -10 -> Zone set X =, "-> X" # -11 -> Zone zoom in, "+" # -12 -> Zone zoom out, "-" # -13 -> Wide view zoom in, "+" # -14 -> Wide view zoom out, "-" # -15 -> Normed zone coordinates (= square in wide view) # # 1st row # prefs key: -7 0,15,31,21 5,19,22,12 5,18 # 2nd row # conf Key: -8 0,37,31,21 5,41,22,12 5,40 # 3rd row # calc Key: -9 0,59,31,21 5,63,22,12 5,62 # 4th row # + zone Key: -11 0,87,31,21 5,91,22,12 5,90 # 5th row # - zone Key: -12 0,109,31,21 5,113,22,12 5,112 # 6th row # Normed square zone Key: -15 0,131,31,21 5,135,22,12 5,134 # 7th row # 0 zone Key: -5 0,153,31,21 5,157,22,12 5,156 # 8th row # -> X Key: -10 0,175,31,21 5,179,22,12 5,178 # 9th row # + wide view 0 wide view Key: -13 60,226,31,21 65,230,22,12 65,229 Key: -6 92,231,29,19 97,235,22,12 97,234 # 10th row # - wide view Key: -14 60,247,31,21 65,251,22,12 65,250 --- NEW FILE: bitmap2.bmp --- (This appears to be a binary file; contents omitted.) Index: shell_loadimage.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/shell_loadimage.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shell_loadimage.h 22 Jun 2009 22:13:35 -0000 1.1 --- shell_loadimage.h 28 Feb 2011 22:13:55 -0000 1.2 *************** *** 25,29 **** * These functions should be declared in shell_skin.h. */ ! int shell_loadimage(Skin *skin); #endif --- 25,29 ---- * These functions should be declared in shell_skin.h. */ ! int shell_loadimage(Skin *skin, HDC hdc); #endif Index: Skin.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Skin.cpp 24 Dec 2009 16:40:25 -0000 1.11 --- Skin.cpp 28 Feb 2011 22:13:55 -0000 1.12 *************** *** 16,20 **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ ! /* skin.cpp : Methods for the skin object of the calculator. *****************************************************************************/ --- 16,20 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *****************************************************************************/ ! /* Skin.cpp : Methods for the Skin object of the calculator. *****************************************************************************/ [...2947 lines suppressed...] + } + + /******************************************************************************** + * Calculate zone inside view coordinates. * + ********************************************************************************/ + void Skin::calc_zoneOnView (void) { + // Calculate screen coordinates of the zone rectangle inside view + graph_get_zoneOnView(&(zoneOnView.top), &(zoneOnView.left), + &(zoneOnView.bottom), &(zoneOnView.right)); + zoneOnView.top = view_basey - zoneOnView.top; + zoneOnView.left += view_loc.x; + zoneOnView.bottom = view_basey - zoneOnView.bottom; + zoneOnView.right += view_loc.x; + + // Calculate intersection with view rectangle + intersect = (IntersectRect(&zv_intersect, &zoneOnView, &viewRect) != 0); + // Adapt for use by InvertRect .. (one more Windows API oddity !) + zv_intersect.bottom++; + zv_intersect.right++; + } Index: EasyCalc2.layout =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc2.layout,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EasyCalc2.layout 24 Dec 2009 16:41:09 -0000 1.1 --- EasyCalc2.layout 28 Feb 2011 22:13:55 -0000 1.2 *************** *** 3,7 **** # Skin rectangle coordinates x1,y1,x2,y2 Skin: 0,0,240,268 ! # Description of the display area: x1,y1 xscale yscale fg_color bg_color # With xscale = 0, screen width is 216 dots (only value used for now). # Do not touch yscale either for now. --- 3,7 ---- # Skin rectangle coordinates x1,y1,x2,y2 Skin: 0,0,240,268 ! # Description of the display area: x1,y1 xscale yscale bg_color fg_color # With xscale = 0, screen width is 216 dots (only value used for now). # Do not touch yscale either for now. *************** *** 9,36 **** # Active elements: num x1,y1,l,h (on screen) x1_off,y1_off x1_on,y1_on (in the gif) ! Annunciator: 1 8,6,22,7 50,268 -1,-1 # Shift indicator (no selection) ! Annunciator: 2 34,6,16,7 20,268 20,275 # Degree indicator ! Annunciator: 3 53,6,16,7 35,268 35,275 # Radian indicator ! Annunciator: 4 72,6,21,7 30,268 30,275 # Gradian indicator ! Annunciator: 5 97,6,16,7 71,268 71,275 # Decimal indicator ! Annunciator: 6 116,6,15,7 86,268 86,275 # Octal indicator ! Annunciator: 7 134,6,13,7 100,268 100,275 # Binary indicator ! Annunciator: 8 150,6,16,7 112,268 112,275 # Hexadecimal indicator ! Annunciator: 9 4,16,6,7 155,268 155,275 # Result scroll left indicator ! Annunciator: 10 227,16,6,7 160,268 160,275 # Result scroll right indicator ! Annunciator: 11 205,6,6,7 0,268 0,275 # Skin 1 indicator ! Annunciator: 12 212,6,6,7 5,268 5,275 # Skin 2 indicator ! Annunciator: 13 219,6,6,7 10,268 10,275 # Skin 3 indicator ! Annunciator: 14 226,6,6,7 15,268 15,275 # Graph indicator ! Annunciator: 15 170,6,7,7 139,268 139,275 # Var list indicator ! Annunciator: 16 178,6,6,7 145,268 145,275 # User fct list indicator ! Annunciator: 17 185,6,6,7 150,268 150,275 # Calc fct list indicator ! Annunciator: 18 226,26,7,7 127,268 127,275 # Result Menu indicator ! Annunciator: 19 226,34,7,7 133,268 133,275 # History Menu indicator # Keys on the calculator gif: # num[, shifted_num] x1_sel,y1_sel,l_sel,h_sel (selection zone) x1_off,y1_off,l,h x1_on,y1_on # with num and shifted_num as follows: ! # -5 -> shift // Note: practice is to put -4,-4 to ensure the same shift key can toggle on/off the shift state # -4 -> dot // decimal dot # -3 -> EXE // run evaluation --- 9,36 ---- # Active elements: num x1,y1,l,h (on screen) x1_off,y1_off x1_on,y1_on (in the gif) ! Annunciator: 1 8,6,22,7 70,274 -1,-1 # Shift indicator (no selection) ! Annunciator: 2 34,0,16,13 20,268 20,281 # Degree indicator ! Annunciator: 3 53,0,16,13 35,268 35,281 # Radian indicator ! Annunciator: 4 72,0,21,13 50,268 50,281 # Gradian indicator ! Annunciator: 5 97,0,16,13 91,268 91,281 # Decimal indicator ! Annunciator: 6 116,0,15,13 106,268 106,281 # Octal indicator ! Annunciator: 7 134,0,13,13 120,268 120,281 # Binary indicator ! Annunciator: 8 150,0,16,13 132,268 132,281 # Hexadecimal indicator ! Annunciator: 9 0,16,10,7 178,274 178,287 # Result scroll left indicator ! Annunciator: 10 227,16,12,7 187,274 187,287 # Result scroll right indicator ! Annunciator: 11 205,0,6,13 0,268 0,281 # Skin 1 indicator ! Annunciator: 12 212,0,6,13 5,268 5,281 # Skin 2 indicator ! Annunciator: 13 219,0,6,13 10,268 10,281 # Skin 3 indicator ! Annunciator: 14 226,0,6,13 15,268 15,281 # Graph indicator ! Annunciator: 15 170,0,7,13 147,268 147,281 # Var list indicator ! Annunciator: 16 178,0,6,13 153,268 153,281 # User fct list indicator ! Annunciator: 17 185,0,6,13 158,268 158,281 # Calc fct list indicator ! Annunciator: 18 226,26,13,7 164,268 164,281 # Result Menu indicator ! Annunciator: 19 226,34,13,7 164,274 164,287 # History Menu indicator # Keys on the calculator gif: # num[, shifted_num] x1_sel,y1_sel,l_sel,h_sel (selection zone) x1_off,y1_off,l,h x1_on,y1_on # with num and shifted_num as follows: ! # -16 -> shift // Note: practice is to put -16,-16 to ensure the same shift key can toggle on/off the shift state # -4 -> dot // decimal dot # -3 -> EXE // run evaluation *************** *** 228,232 **** # shift isprime CLR # shift % n! angle & bckspc ! key: -5,-5 6,70,32,22 11,75,22,12 11,74 key: 151,123 45,70,32,22 50,75,22,12 50,74 key: 61 84,70,32,22 89,75,22,12 89,74 --- 228,232 ---- # shift isprime CLR # shift % n! angle & bckspc ! key: -16,-16 6,70,32,22 11,75,22,12 11,74 key: 151,123 45,70,32,22 50,75,22,12 50,74 key: 61 84,70,32,22 89,75,22,12 89,74 Index: EasyCalc.layout =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.layout,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** EasyCalc.layout 24 Dec 2009 16:40:25 -0000 1.10 --- EasyCalc.layout 28 Feb 2011 22:13:55 -0000 1.11 *************** *** 3,7 **** # Skin rectangle coordinates x1,y1,x2,y2 Skin: 0,0,240,268 ! # Description of the display area: x1,y1 xscale yscale fg_color bg_color # With xscale = 0, screen width is 216 dots (only value used for now). # Do not touch yscale either for now. --- 3,7 ---- # Skin rectangle coordinates x1,y1,x2,y2 Skin: 0,0,240,268 ! # Description of the display area: x1,y1 xscale yscale bg_color fg_color # With xscale = 0, screen width is 216 dots (only value used for now). # Do not touch yscale either for now. *************** *** 9,36 **** # Active elements: num x1,y1,l,h (on screen) x1_off,y1_off x1_on,y1_on (in the gif) ! Annunciator: 1 8,6,22,7 50,268 -1,-1 # Shift indicator (no selection) ! Annunciator: 2 34,6,16,7 20,268 20,275 # Degree indicator ! Annunciator: 3 53,6,16,7 35,268 35,275 # Radian indicator ! Annunciator: 4 72,6,21,7 30,268 30,275 # Gradian indicator ! Annunciator: 5 97,6,16,7 71,268 71,275 # Decimal indicator ! Annunc... [truncated message content] |