Update of /cvsroot/easycalc/PPCport/system - UI In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv14983 Modified Files: EasyCalc.cpp EasyCalc.gif EasyCalc.h EasyCalc.layout EasyCalcppc.rc resourceppc.h Skin.cpp Skin.h Added Files: EasyCalcppc.aps Log Message: Subset of the code, compiling, but not yet linking Index: EasyCalc.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EasyCalc.h 22 Jun 2009 22:13:35 -0000 1.1 --- EasyCalc.h 24 Sep 2009 21:19:19 -0000 1.2 *************** *** 123,129 **** --- 123,152 ---- #define EASYCALC_VERSION 1 + /* Forms .. */ + #define varEntryForm 1 + #define defForm 2 + #define altAnsProblem 3 + #define altGuessNotFound 4 + #define altBadVariableName 5 + #define altConfirmDelete 6 + #define altConfirmOverwrite 7 + #define altCompute 8 + #define altBadParameter 9 + #define FrmAlert FrmPopupForm + int FrmPopupForm(int formNb, void *hWnd_p); + int FrmCustomAlert(int formNb, const TCHAR *s1, const TCHAR *s2, const TCHAR *s3, void *hWnd_p); + + #ifndef _EASYCALC_C_ + #include "compat/Lang.h" + extern LibLang *libLang; + #endif + + #include "compat/PalmOS.h" + #include "core/mlib/konvert.h" void shell_beeper(int frequency, int duration); void shell_annunciators(int skin, int shf, int angle_mode, int int_mode, int run) SHELL1_SECT; void shell_powerdown() SHELL1_SECT; + void alertErrorMessage(CError err); + void ErrFatalDisplayIf(int cond, TCHAR *msg); #endif --- NEW FILE: EasyCalcppc.aps --- (This appears to be a binary file; contents omitted.) Index: EasyCalc.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EasyCalc.cpp 22 Jun 2009 22:13:35 -0000 1.1 --- EasyCalc.cpp 24 Sep 2009 21:19:19 -0000 1.2 *************** *** 31,41 **** // #include "afxwin.h" #include "compat/PalmOS.h" #include "EasyCalc.h" #include "StateManager.h" #include "system - UI/Skin.h" #include "compat/Lang.h" ! #include "core_main.h" ! #include "core_display.h" #include "defuns.h" [...1889 lines suppressed...] ! } ! } ! return (res); ! } ! ! default: ! return (DefWindowProc(hDlg, message, wParam, lParam)); ! // return (FALSE); } *************** *** 1202,1204 **** core_keytimeout2(); timer = 0; ! } \ No newline at end of file --- 2601,2603 ---- core_keytimeout2(); timer = 0; ! } Index: Skin.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Skin.h 6 Aug 2009 21:42:56 -0000 1.3 --- Skin.h 24 Sep 2009 21:19:19 -0000 1.4 *************** *** 107,112 **** SkinMacro *macrolist; // Array of macros specified in the layout file SkinAnnunciator annunciators[NB_ANNUN]; // Array of annunciators - TCHAR resMenuDesc[SELECTION_COUNT][MAX_RSCLEN]; // Array of translated stings for the result - // actions menu. FILE *external_file; // Handle for external file, if not an internal file --- 107,110 ---- *************** *** 146,150 **** int gets(char *buf, int buflen); int make_dib(HDC hdc); - TCHAR *print_error(CError err); public: --- 144,147 ---- *************** *** 172,187 **** COLORREF getDisplayBgColor(); void create_input_area(HWND hwnd, HINSTANCE hinst); ! void select_input_text(); ! void insert_input_text(TCHAR *text); ! void set_input_text(TCHAR *text); TCHAR *get_input_text(); ! void print_result(HDC hdc, TCHAR *res_text); void print_result(HDC hdc); ! void print_resultpowInit(HDC hdc, TCHAR *res_text); void print_resultpowNext(bool smallf, TCHAR *res_piece, int len); TCHAR *get_result(); ! int resultActionsPopup(resSelection choices[], int length); void display_set_enabled(bool enable); - void alertErrorMessage(CError err); }; --- 169,192 ---- COLORREF getDisplayBgColor(); void create_input_area(HWND hwnd, HINSTANCE hinst); ! void select_input_text(void *hwnd); ! void select_input_text(void *hwnd, unsigned long start, unsigned long end); ! void get_select_text(void *hwnd, unsigned long *start, unsigned long *end); ! unsigned long get_insert_pos(void *hwnd); ! void set_insert_pos(void *hwnd, unsigned long pos); ! void insert_input_text(void *hwnd, const TCHAR *text); ! void set_input_text(void *hwnd, const TCHAR *text); TCHAR *get_input_text(); ! void print_result(void *hWnd_p, TCHAR *res_text); void print_result(HDC hdc); ! void print_resultpowInit(void *hdc, TCHAR *res_text); void print_resultpowNext(bool smallf, TCHAR *res_piece, int len); TCHAR *get_result(); ! void clipCopy_result(); ! void resultActionsPopup(resSelection choices[], int length, void *hWnd_p); ! void historyAddActionPopup(TCHAR *description, void *hWnd); ! void varSavePopup(TCHAR *choices[], int length, void *hWnd); ! void varMgrPopup(TCHAR *choices[], int length, void *hWnd); ! void varDefList(TCHAR *name, TCHAR *deftext, int itemNum, void *hWnd); void display_set_enabled(bool enable); }; Index: EasyCalcppc.rc =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalcppc.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EasyCalcppc.rc 22 Jun 2009 22:13:35 -0000 1.1 --- EasyCalcppc.rc 24 Sep 2009 21:19:19 -0000 1.2 *************** *** 17,25 **** ///////////////////////////////////////////////////////////////////////////// ! // English (U.S.) resources ! #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 ! LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 --- 17,25 ---- ///////////////////////////////////////////////////////////////////////////// ! // Neutral resources ! #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) #ifdef _WIN32 ! LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #pragma code_page(1252) #endif //_WIN32 *************** *** 27,70 **** ///////////////////////////////////////////////////////////////////////////// // ! // Icon // ! // Icon with lowest ID value placed first to ensure application icon ! // remains consistent on all systems. ! IDI_EASYCALC ICON "EasyCalc.ico" ///////////////////////////////////////////////////////////////////////////// // ! // Menu // ! IDR_MENU MENU BEGIN ! POPUP "File" BEGIN ! MENUITEM "Exit", IDM_FILE_EXIT END ! POPUP "Edit" BEGIN ! MENUITEM "Options", IDM_EDIT_OPTIONS END ! POPUP "Help" BEGIN ! MENUITEM "About EasyCalc...", IDM_HELP_ABOUT END - END ///////////////////////////////////////////////////////////////////////////// - // - // Accelerator - // - IDC_EASYCALC ACCELERATORS - BEGIN - "Q", IDM_FILE_EXIT, VIRTKEY, CONTROL, NOINVERT - "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT - END ///////////////////////////////////////////////////////////////////////////// --- 27,180 ---- ///////////////////////////////////////////////////////////////////////////// // ! // Dialog // ! IDD_OPT_GENERAL DIALOG 0, 0, 139, 181 ! STYLE DS_SETFONT | WS_POPUP | WS_CAPTION ! CAPTION "General" ! FONT 8, "System" ! BEGIN ! LTEXT "General",IDC_TITLE,4,3,63,8 ! CONTROL "Dynamic mouse",IDC_CHECK_MOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,42,83,10 ! END ! ! IDD_RES_MENU DIALOG 30, 10, 81, 108 ! STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP ! FONT 8, "MS Shell Dlg" ! BEGIN ! LISTBOX IDC_LIST_RESM,0,0,81,108,NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_DLGMODALFRAME ! END ! ! IDD_VARENTRY DIALOG 0, 0, 230, 79 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Save variable as" ! FONT 8, "MS Shell Dlg" ! BEGIN ! DEFPUSHBUTTON "OK",IDOK,7,58,50,14 ! PUSHBUTTON "Cancel",IDCANCEL,173,58,50,14 ! COMBOBOX IDC_VARCOMBO,7,19,216,34,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! LTEXT "Name:",IDC_VARNAME,7,7,216,12 ! END ! ! IDD_EDITVAR DIALOG 0, 0, 230, 92 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Edit variable" ! FONT 8, "MS Shell Dlg" ! BEGIN ! DEFPUSHBUTTON "OK",IDOK,7,71,50,14 ! PUSHBUTTON "V",IDC_VAR,175,71,16,14 ! PUSHBUTTON "F",IDC_USERF,191,71,16,14 ! PUSHBUTTON "f",IDC_CALCF,207,71,16,14 ! LTEXT "Name:",IDC_VARNAME,7,9,25,8 ! EDITTEXT IDC_EDIT1,34,7,95,14,ES_AUTOHSCROLL ! EDITTEXT IDC_EDIT2,7,24,216,43,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL ! PUSHBUTTON "Cancel",IDCANCEL,61,71,50,14 ! END ! ! IDD_DATAMGR DIALOG 0, 0, 230, 231 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Data manager" ! FONT 8, "MS Shell Dlg" ! BEGIN ! DEFPUSHBUTTON "OK",IDOK,7,210,50,14 ! CONTROL "",IDC_DATALIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,7,216,196 ! PUSHBUTTON "New",IDC_NEW,63,210,50,14 ! PUSHBUTTON "Modify",IDC_MODIFY,118,210,50,14 ! PUSHBUTTON "Delete",IDC_DELETE,173,210,50,14 ! LISTBOX IDC_LIST_FV,63,190,50,20,NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_DLGMODALFRAME ! END ! ! IDD_EDITFCT DIALOG 0, 0, 230, 92 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Edit function" ! FONT 8, "MS Shell Dlg" ! BEGIN ! DEFPUSHBUTTON "OK",IDOK,7,71,50,14 ! PUSHBUTTON "V",IDC_VAR,175,71,16,14 ! PUSHBUTTON "F",IDC_USERF,191,71,16,14 ! PUSHBUTTON "f",IDC_CALCF,207,71,16,14 ! LTEXT "Name:",IDC_VARNAME,7,9,25,8 ! EDITTEXT IDC_EDIT1,34,7,95,14,ES_AUTOHSCROLL ! EDITTEXT IDC_EDIT2,7,24,216,43,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL ! PUSHBUTTON "Cancel",IDCANCEL,61,71,50,14 ! LTEXT "Param:",IDC_PARAM,140,9,24,8 ! EDITTEXT IDC_EDIT3,169,7,54,14,ES_AUTOHSCROLL ! END ! ! IDD_LARGE_MENU DIALOG 30, 10, 144, 116 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP ! FONT 8, "MS Shell Dlg" ! BEGIN ! LISTBOX IDC_LIST_LARGE,0,0,144,116,LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_DLGMODALFRAME ! END ! ! IDD_SLIM_MENU DIALOG 30, 10, 72, 244 ! STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP ! FONT 8, "MS Shell Dlg" ! BEGIN ! LISTBOX IDC_LIST_SLIM,0,0,72,244,LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_DLGMODALFRAME ! END ! ///////////////////////////////////////////////////////////////////////////// // ! // DESIGNINFO // ! #ifdef APSTUDIO_INVOKED ! GUIDELINES DESIGNINFO BEGIN ! IDD_VARENTRY, DIALOG BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 223 ! TOPMARGIN, 7 ! BOTTOMMARGIN, 72 END ! ! IDD_EDITVAR, DIALOG BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 223 ! TOPMARGIN, 7 ! BOTTOMMARGIN, 85 END ! ! IDD_DATAMGR, DIALOG BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 223 ! TOPMARGIN, 7 ! BOTTOMMARGIN, 224 END + IDD_EDITFCT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 223 + TOPMARGIN, 7 + BOTTOMMARGIN, 85 + END + + IDD_LARGE_MENU, DIALOG + BEGIN + RIGHTMARGIN, 81 + BOTTOMMARGIN, 108 + END + END + #endif // APSTUDIO_INVOKED + #endif // Neutral resources ///////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////// + // English (U.S.) resources + + #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) + #ifdef _WIN32 + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + #pragma code_page(1252) + #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// *************** *** 80,85 **** BEGIN ICON IDI_EASYCALC,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE ! LTEXT "EasyCalc Version 1.25",IDC_STATIC_2,12,36,78,8,SS_NOPREFIX ! LTEXT "Copyright (C) 2008",IDC_STATIC_3,12,48,66,8 END --- 190,195 ---- BEGIN ICON IDI_EASYCALC,IDC_STATIC_1,12,12,21,20,SS_REALSIZEIMAGE ! LTEXT "EasyCalc Version 1.25 PPC",IDC_STATIC_2,12,36,100,8,SS_NOPREFIX ! LTEXT "Copyright (C) 2009",IDC_STATIC_3,12,48,66,8 END *************** *** 95,107 **** END - IDD_OPT_GENERAL DIALOG 0, 0, 139, 181 - STYLE DS_SETFONT | WS_POPUP | WS_CAPTION - CAPTION "General" - FONT 8, "System" - BEGIN - LTEXT "General",IDC_TITLE,4,3,63,8 - CONTROL "Dynamic mouse",IDC_CHECK_MOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,42,83,10 - END - IDD_OPT_SKINS DIALOG 0, 0, 139, 181 STYLE DS_SETFONT | WS_POPUP | WS_CAPTION --- 205,208 ---- *************** *** 146,149 **** --- 247,293 ---- + ///////////////////////////////////////////////////////////////////////////// + // + // Icon + // + + // Icon with lowest ID value placed first to ensure application icon + // remains consistent on all systems. + IDI_EASYCALC ICON "EasyCalc.ico" + + ///////////////////////////////////////////////////////////////////////////// + // + // Menu + // + + IDR_MENU MENU + BEGIN + POPUP "File" + BEGIN + MENUITEM "Exit", IDM_FILE_EXIT + END + POPUP "Edit" + BEGIN + MENUITEM "Options", IDM_EDIT_OPTIONS + END + POPUP "Help" + BEGIN + MENUITEM "About EasyCalc...", IDM_HELP_ABOUT + END + END + + + ///////////////////////////////////////////////////////////////////////////// + // + // Accelerator + // + + IDC_EASYCALC ACCELERATORS + BEGIN + "Q", IDM_FILE_EXIT, VIRTKEY, CONTROL, NOINVERT + "A", IDM_HELP_ABOUT, VIRTKEY, CONTROL, NOINVERT + END + + #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// *************** *** 203,233 **** ///////////////////////////////////////////////////////////////////////////// - // 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 - - ///////////////////////////////////////////////////////////////////////////// - // - // Dialog - // - - IDD_RES_MENU DIALOG 30, 10, 82, 112 - STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_BORDER - FONT 8, "MS Shell Dlg" - BEGIN - DEFPUSHBUTTON "OK",IDOK,0,98,28,14 - PUSHBUTTON "Cancel",IDCANCEL,50,98,32,14 - LISTBOX IDC_LIST1,0,0,81,98,LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP - END - - #endif // French (France) resources - ///////////////////////////////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////////////////////////////// // Farsi resources --- 347,350 ---- Index: EasyCalc.layout =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.layout,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EasyCalc.layout 22 Jun 2009 22:13:35 -0000 1.1 --- EasyCalc.layout 24 Sep 2009 21:19:19 -0000 1.2 *************** *** 20,29 **** Annunciator: 12 226,6,6,7 15,268 15,275 # Graph indicator Annunciator: 13 226,26,7,7 127,268 127,275 # Result Menu indicator # Keys on the calculator gif: ! # num x1_sel,y1_sel,l_sel,h_sel (selection zone) x1_off,y1_off,l,h x1_on,y1_on ! Key: 1 6,70,32,22 11,75,22,12 11,74 ! Key: 2 45,70,32,22 50,75,22,12 50,74 ! Key: 3 84,70,32,22 89,75,22,12 89,74 Key: 4 123,70,32,22 128,75,22,12 128,74 Key: 5 162,70,32,22 167,75,22,12 167,74 --- 20,181 ---- Annunciator: 12 226,6,6,7 15,268 15,275 # Graph indicator Annunciator: 13 226,26,7,7 127,268 127,275 # Result Menu indicator + Annunciator: 14 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: ! # 1 -> 0,"0" ! # 2 -> 1,"1" ! # 3 -> 2,"2" ! # 4 -> 3,"3" ! # 5 -> 4,"4" ! # 6 -> 5,"5" ! # 7 -> 6,"6" ! # 8 -> 7,"7" ! # 9 -> 8,"8" ! # 10 -> 9,"9" ! # 11 -> A,"A" ! # 12 -> B,"B" ! # 13 -> C,"C" ! # 14 -> D,"D" ! # 15 -> E,"E" ! # 16 -> F,"F" ! # 17 -> And,"&" ! # 18 -> Or,"|" ! # 19 -> Xor,"^" ! # 20 -> Shl,"<<" ! # 21 -> Shr,">>" ! # 22 -> Plus,"+" ! # 23 -> Minus,"-" ! # 24 -> Neg,"-" ! # 25 -> Mult,"*" ! # 26 -> Divide,"/" ! # 27 -> Ans,"ans" ! # 28 -> OpBr,"" ! # 29 -> Pow,"^" ! # 30 -> Log,"log" ! # 31 -> Ln,"ln" ! # 32 -> Inv,"^(-1)" ! # 33 -> Sq1,"^(1/" ! # 34 -> Sqr,"^2" ! # 35 -> Sqrt,"sqrt" ! # 36 -> Sin,"sin" ! # 37 -> Cos,"cos" ! # 38 -> Tan,"tan" ! # 39 -> Exp,"exp" ! # 40 -> Fact,"fact" ! # 41 -> Pi,"pi" ! # 42 -> Degrees,"°" ! # 43 -> Minutes,"'" ! # 44 -> Magnitude,"abs" ! # 45 -> Angle,"angle" ! # 46 -> complex_i,"i" ! # 47 -> Coln,":" ! # 48 -> ClBr,")" ! # 49 -> EE,"E" ! # 50 -> asin ! # 51 -> acos ! # 52 -> atan ! # 53 -> sinh ! # 54 -> cosh ! # 55 -> tanh ! # 56 -> asinh ! # 57 -> acosh ! # 58 -> atanh ! # 59 -> log ! # 60 -> 10^ ! # 61 -> log2 ! # 62 -> 2^ ! # 63 -> fact ! # 64 -> ncr ! # 65 -> npr ! # 66 -> round ! # 67 -> trunc ! # 68 -> floor ! # 69 -> gamma ! # 70 -> beta ! # 71 -> rand ! # 72 -> rNorm ! # 73 -> real ! # 74 -> imag ! # 75 -> conj ! # 76 -> exp(i* ! # 77 -> fzero ! # 78 -> fvalue ! # 79 -> fmin ! # 80 -> fmax ! # 81 -> fd_dx // d/dx ! # 82 -> fromberg // integ ! # 83 -> fd2_dx // d2/dx ! # 84 -> ()=" ! # 85 -> " ! # 86 -> x ! # 87 -> list ! # 88 -> median ! # 89 -> mean ! # 90 -> sum ! # 91 -> lmin // min ! # 92 -> lmax // max ! # 93 -> prod ! # 94 -> variance ! # 95 -> stddev ! # 96 -> dim ! # 97 -> [ ! # 98 -> matrix ! # 99 -> identity ! # 100 -> det ! # 101 -> qrs ! # 102 -> rref ! # 103 -> qrq ! # 104 -> qrr ! # 105 -> [ // x[] ! # 106 -> ] ! # 107 -> qBinomial ! # 108 -> qBeta ! # 109 -> qChiSq ! # 110 -> qF ! # 111 -> qPoisson ! # 112 -> qStudentt ! # 113 -> qWeibull ! # 114 -> qNormal ! # 115 -> range ! # 116 -> rNorm ! # 117 -> find ! # 118 -> sample ! # 119 -> filter ! # 120 -> conv ! # 121 -> fft ! # 122 -> ifft ! # 123 -> prevprime ! # 124 -> isprime ! # 125 -> nextprime ! # 126 -> gcd ! # 127 -> lcm ! # 128 -> phi ! # 129 -> gcdex ! # 130 -> chinese ! # 131 -> modinv ! # 132 -> modpow ! # 133 -> factor ! # 134 -> besseli ! # 135 -> besselj ! # 136 -> besselk ! # 137 -> bessely ! # 138 -> ellc1 ! # 139 -> ellc2 ! # 140 -> elli1 ! # 141 -> elli2 ! # 142 -> euler ! # 143 -> cn ! # 144 -> dn ! # 145 -> sn ! # 146 -> igamma ! # 147 -> ibeta ! # 148 -> erf ! # 149 -> erfc ! # ! key: 1 6,70,32,22 11,75,22,12 11,74 ! key: 2 45,70,32,22 50,75,22,12 50,74 ! key: 3 84,70,32,22 89,75,22,12 89,74 Key: 4 123,70,32,22 128,75,22,12 128,74 Key: 5 162,70,32,22 167,75,22,12 167,74 Index: EasyCalc.gif =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsxwvs51 and /tmp/cvsWqNTmU differ Index: resourceppc.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/resourceppc.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** resourceppc.h 22 Jun 2009 22:13:35 -0000 1.1 --- resourceppc.h 24 Sep 2009 21:19:19 -0000 1.2 *************** *** 15,18 **** --- 15,25 ---- #define IDD_OPT_SKINS 132 #define IDD_RES_MENU 134 + #define IDD_VARENTRY 137 + #define IDD_EDITVAR 138 + #define IDD_DATAMGR 139 + #define IDD_EDITFCT 140 + #define IDD_RES_MENU1 141 + #define IDD_LARGE_MENU 141 + #define IDD_SLIM_MENU 142 #define IDC_STATIC_1 201 #define IDC_STATIC_2 202 *************** *** 26,29 **** --- 33,53 ---- #define IDC_SKIN1 1022 #define IDC_LIST1 1023 + #define IDC_LIST_FV 1023 + #define IDC_LIST_RESM 1034 + #define IDC_VARCOMBO 1037 + #define IDC_DATALIST 1043 + #define IDC_NEW 1044 + #define IDC_MODIFY 1045 + #define IDC_DELETE 1046 + #define IDC_EDIT1 1047 + #define IDC_EDIT2 1048 + #define IDC_RCL 1053 + #define IDC_USERF 1054 + #define IDC_CALCF 1055 + #define IDC_PARAM 1056 + #define IDC_EDIT3 1057 + #define IDC_LIST_LARGE 1058 + #define IDC_LIST_SLIM 1059 + #define IDC_VAR 1060 #define ID_TEST_TEST 32771 #define ID_EDIT_CANCEL 32772 *************** *** 38,41 **** --- 62,66 ---- #define IDM_EDIT 40004 #define IDC_TITLE -1 + #define IDC_VARNAME -1 // Next default values for new objects *************** *** 44,50 **** #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 ! #define _APS_NEXT_RESOURCE_VALUE 135 #define _APS_NEXT_COMMAND_VALUE 32778 ! #define _APS_NEXT_CONTROL_VALUE 1034 #define _APS_NEXT_SYMED_VALUE 112 #endif --- 69,75 ---- #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 ! #define _APS_NEXT_RESOURCE_VALUE 138 #define _APS_NEXT_COMMAND_VALUE 32778 ! #define _APS_NEXT_CONTROL_VALUE 1061 #define _APS_NEXT_SYMED_VALUE 112 #endif Index: Skin.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Skin.cpp 6 Aug 2009 21:42:56 -0000 1.3 --- Skin.cpp 24 Sep 2009 21:19:19 -0000 1.4 *************** *** 25,31 **** #include <string.h> ! #include "compat\PalmOS.h" #include "Skin.h" #include "shell_loadimage.h" --- 25,33 ---- #include <string.h> ! #include "compat/PalmOS.h" ! #include "compat/Lang.h" #include "Skin.h" #include "shell_loadimage.h" + #include "core/core_display.h" *************** *** 38,41 **** --- 40,48 ---- /**********************************************************/ + /* Language objects, as manipulated by EasyCall.cpp. */ + /**********************************************************/ + extern LibLang *libLang; + + /**********************************************************/ /* Linked-in skins; defined in the skins.c, which in turn */ /* is generated by skin2c.c under control of skin2c.conf */ *************** *** 560,584 **** // TODO - handle memory allocation failure memset(disp_bitmap, 255, size); - - /***************************************/ - /* Load the language resource strings, */ - /* and pick the current ones. */ - /***************************************/ - // For now, all is stored here. Later, I will implement a mechanism - // to read from a text language file, which should be the concatenation - // of the .rcp language files from the original application, and able to - // read their syntax. - // To be done when taking care of multilangual support (need also to - // think about how to rename the resources from the windows resource file). - _tcsncpy(resMenuDesc[COPYRESULT], _T("Copy"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[VARSAVEAS], _T("Save as"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[DEFMGR], _T("DataMgr"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[GUESSIT], _T("GuessIt"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[TODEGREE], _T("->Degree"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[TORADIAN], _T("->Radian"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[TOGONIO], _T("->c()+isin()"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[TOCIS], _T("->e^(ix)"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[ENGDISPLAY], _T("EngDisplay"), MAX_RSCLEN); - _tcsncpy(resMenuDesc[TODEGREE2], _T("->Degree2"), MAX_RSCLEN); } --- 567,570 ---- *************** *** 953,957 **** // Special handling for the skin and menu annunciators, they are always visible or selected ! if ((which >= ANN_S1) && (which <= ANN_SG)) { state += 1; if (state > 2) state = 2; --- 939,943 ---- // Special handling for the skin and menu annunciators, they are always visible or selected ! if ((which >= ANN_S1) && (which <= ANN_HSTMENU)) { state += 1; if (state > 2) state = 2; *************** *** 1132,1140 **** * OS specific: create the result text zone in the display area. * ********************************************************************************/ ! void Skin::create_input_area(HWND hwnd_p, HINSTANCE hinst) { DWORD dwStyle = WS_VISIBLE | WS_CHILD | ES_MULTILINE | ES_AUTOVSCROLL | ES_LEFT; hwndE = CreateWindow(_T("EDIT2"), NULL, dwStyle, display_loc.x, display_loc.y + 18, display_w, 30, ! hwnd_p, NULL, hinst, NULL); Edit_SetExtendedStyle(hwndE, 0xFFFFFFFF, Edit_GetExtendedStyle(hwndE) | ES_EX_FOCUSBORDERDISABLED); --- 1118,1126 ---- * OS specific: create the result text zone in the display area. * ********************************************************************************/ ! void Skin::create_input_area(HWND hWnd_p, HINSTANCE hinst) { DWORD dwStyle = WS_VISIBLE | WS_CHILD | ES_MULTILINE | ES_AUTOVSCROLL | ES_LEFT; hwndE = CreateWindow(_T("EDIT2"), NULL, dwStyle, display_loc.x, display_loc.y + 18, display_w, 30, ! hWnd_p, NULL, hinst, NULL); Edit_SetExtendedStyle(hwndE, 0xFFFFFFFF, Edit_GetExtendedStyle(hwndE) | ES_EX_FOCUSBORDERDISABLED); *************** *** 1152,1157 **** TCHAR buf[100]; int nchar = GetClassName(hwndE, buf, 100); ! HDC hdc = GetDC(hwnd_p); ! print_result(hdc, buf); // return (hwndE); --- 1138,1142 ---- TCHAR buf[100]; int nchar = GetClassName(hwndE, buf, 100); ! print_result(hWnd_p, buf); // return (hwndE); *************** *** 1159,1180 **** /******************************************************************************** ! * OS specific: selects all the text in the input area Edit Control. * ********************************************************************************/ ! void Skin::select_input_text() { ! long res = SendMessage (hwndE, EM_SETSEL, (WPARAM) 0, (LPARAM) -1); } /******************************************************************************** ! * OS specific: inserts text in the input area Edit Control at the cursor. * ********************************************************************************/ ! void Skin::insert_input_text(TCHAR *text) { ! long res = SendMessage (hwndE, EM_REPLACESEL, (WPARAM) TRUE, (LPARAM) text); } /******************************************************************************** ! * OS specific: sets text in the input area Edit Control. * ********************************************************************************/ ! void Skin::set_input_text(TCHAR *text) { ! BOOL res = SetWindowText (hwndE, text); } --- 1144,1230 ---- /******************************************************************************** ! * OS specific: selects all the text in the Edit Control passed as parameter. * ! * If parameter is NULL, this is the input area Edit Control. * ********************************************************************************/ ! void Skin::select_input_text(void *hwnd) { ! HWND hwnd_edit = (HWND) hwnd; ! if (hwnd_edit == NULL) ! hwnd_edit = hwndE; ! long res = SendMessage (hwnd_edit, EM_SETSEL, (WPARAM) 0, (LPARAM) -1); ! res = SendMessage (hwnd_edit, EM_SCROLLCARET, (WPARAM) 0, (LPARAM) 0); } /******************************************************************************** ! * OS specific: selects some text in the the Edit Control passed as parameter. * ! * If parameter is NULL, this is the input area Edit Control. * ********************************************************************************/ ! void Skin::select_input_text(void *hwnd, unsigned long start, unsigned long end) { ! HWND hwnd_edit = (HWND) hwnd; ! if (hwnd_edit == NULL) ! hwnd_edit = hwndE; ! long res = SendMessage (hwnd_edit, EM_SETSEL, (WPARAM) start, (LPARAM) end); ! res = SendMessage (hwnd_edit, EM_SCROLLCARET, (WPARAM) 0, (LPARAM) 0); } /******************************************************************************** ! * OS specific: get boundaries of selected text in the Edit Control passed as * ! * parameter. * ! * If parameter is NULL, this is the input area Edit Control. * ********************************************************************************/ ! void Skin::get_select_text(void *hwnd, unsigned long *start, unsigned long *end) { ! HWND hwnd_edit = (HWND) hwnd; ! if (hwnd_edit == NULL) ! hwnd_edit = hwndE; ! long res = SendMessage (hwnd_edit, EM_GETSEL, (WPARAM) start, (LPARAM) end); ! } ! ! /******************************************************************************** ! * OS specific: get boundaries of selected text in the Edit Control passed as * ! * parameter. * ! * If parameter is NULL, this is the input area Edit Control. * ! ********************************************************************************/ ! unsigned long Skin::get_insert_pos(void *hwnd) { ! HWND hwnd_edit = (HWND) hwnd; ! if (hwnd_edit == NULL) ! hwnd_edit = hwndE; ! ! unsigned long pos; ! long res = SendMessage (hwnd_edit, EM_GETSEL, (WPARAM) &pos, (LPARAM) NULL); ! return (pos); ! } ! ! /******************************************************************************** ! * OS specific: set cursor position in the Edit Control passed as parameter. * ! * If parameter is NULL, this is the input area Edit Control. * ! ********************************************************************************/ ! void Skin::set_insert_pos(void *hwnd, unsigned long pos) { ! HWND hwnd_edit = (HWND) hwnd; ! if (hwnd_edit == NULL) ! hwnd_edit = hwndE; ! ! long res = SendMessage (hwnd_edit, EM_SETSEL, (WPARAM) pos, (LPARAM) pos); ! } ! ! /******************************************************************************** ! * OS specific: inserts text in the Edit Control passed as parameter, at the * ! * cursor (replacing selected text if any). * ! * If parameter is NULL, this is the input area Edit Control. * ! ********************************************************************************/ ! void Skin::insert_input_text(void *hwnd, const TCHAR *text) { ! HWND hwnd_edit = (HWND) hwnd; ! if (hwnd_edit == NULL) ! hwnd_edit = hwndE; ! long res = SendMessage (hwnd_edit, EM_REPLACESEL, (WPARAM) TRUE, (LPARAM) text); ! } ! ! /******************************************************************************** ! * OS specific: sets text in the Edit Control passed as parameter, replacing all* ! * If parameter is NULL, this is the input area Edit Control. * ! ********************************************************************************/ ! void Skin::set_input_text(void *hwnd, const TCHAR *text) { ! HWND hwnd_edit = (HWND) hwnd; ! if (hwnd_edit == NULL) ! hwnd_edit = hwndE; ! BOOL res = SetWindowText (hwnd_edit, text); } *************** *** 1190,1196 **** * OS specific: display the specified result text in the display area. * ********************************************************************************/ ! void Skin::print_result(HDC hdc, TCHAR *res_text) { // Save the text and call the main method _tcscpy (dispResult, res_text); print_result(hdc); } --- 1240,1247 ---- * OS specific: display the specified result text in the display area. * ********************************************************************************/ ! void Skin::print_result(void *hWnd_p, TCHAR *res_text) { // Save the text and call the main method _tcscpy (dispResult, res_text); + HDC hdc = GetDC((HWND) hWnd_p); print_result(hdc); } *************** *** 1223,1230 **** * OS specific: initialize the display of a result with power text. * ********************************************************************************/ ! void Skin::print_resultpowInit(HDC hdc, TCHAR *res_text) { _tcscpy (dispResult, res_text); // Keep the unformatted text in memory for buffer copy pow_pos = 0; ! pow_hdc = hdc; } --- 1274,1281 ---- * OS specific: initialize the display of a result with power text. * ********************************************************************************/ ! void Skin::print_resultpowInit(void *hWnd_p, TCHAR *res_text) { _tcscpy (dispResult, res_text); // Keep the unformatted text in memory for buffer copy pow_pos = 0; ! pow_hdc = GetDC((HWND) hWnd_p); } *************** *** 1240,1245 **** if (smallf) { // Set small colors and font ! oldFg = SetTextColor(hdc, display_fg); ! oldBg = SetBkMode(hdc, TRANSPARENT); // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); --- 1291,1296 ---- if (smallf) { // Set small colors and font ! oldFg = SetTextColor(pow_hdc, display_fg); ! oldBg = SetBkMode(pow_hdc, TRANSPARENT); // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); *************** *** 1248,1255 **** _tcscpy(lf.lfFaceName, _T("Tahoma")); hFontNew = CreateFontIndirect(&lf); ! oldFont = (HFONT)SelectObject(hdc, hFontNew); } else { // Set normal colors and font ! oldFg = SetTextColor(hdc, display_fg); ! oldBg = SetBkMode(hdc, TRANSPARENT); // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); --- 1299,1306 ---- _tcscpy(lf.lfFaceName, _T("Tahoma")); hFontNew = CreateFontIndirect(&lf); ! oldFont = (HFONT)SelectObject(pow_hdc, hFontNew); } else { // Set normal colors and font ! oldFg = SetTextColor(pow_hdc, display_fg); ! oldBg = SetBkMode(pow_hdc, TRANSPARENT); // Clear out the lf structure to use when creating the font. memset(&lf, 0, sizeof(LOGFONT)); *************** *** 1258,1262 **** _tcscpy(lf.lfFaceName, _T("Tahoma")); hFontNew = CreateFontIndirect(&lf); ! oldFont = (HFONT)SelectObject(hdc, hFontNew); } --- 1309,1313 ---- _tcscpy(lf.lfFaceName, _T("Tahoma")); hFontNew = CreateFontIndirect(&lf); ! oldFont = (HFONT)SelectObject(pow_hdc, hFontNew); } *************** *** 1288,1292 **** /******************************************************************************** ! * OS specific: get the result text from the display area. * ********************************************************************************/ TCHAR *Skin::get_result() { --- 1339,1343 ---- /******************************************************************************** ! * Get the result text from the display area. * ********************************************************************************/ TCHAR *Skin::get_result() { *************** *** 1295,1344 **** /******************************************************************************** ! * OS specific: displays the result actions menu and returns selection. * ! * (noListSelection is nothing is selected). * ********************************************************************************/ ! int Skin::resultActionsPopup(resSelection choices[], int length) { ! TCHAR *description[SELECTION_COUNT]; ! ListPtr list; ! int i; for (i=0 ; i<length ; i++) { ! description[i] = (TCHAR *) MemPtrNew(MAX_RSCLEN); ! SysStringByIndex(resMenuDesc+choices[i], ! description[i], ! MAX_RSCLEN-1); } - list = GetObjectPtr(calcResList); - LstSetListChoices(list,description,count); - LstSetHeight(list,count); - for (i=0 ; i<count ; i++) - MemPtrFree(description[i]); - - return (noListSelection); } /******************************************************************************** ! * Enable or disable screen repaints. * ********************************************************************************/ ! void Skin::display_set_enabled(bool enable) { ! display_enabled = enable; } /******************************************************************************** ! * Print a system error on screen. * ********************************************************************************/ ! TCHAR *print_error(CError err) { ! TCHAR *res; ! res = MemPtrNew(MAX_RSCLEN); ! SysStringByIndex(strErrCodes,err,res,MAX_RSCLEN-1); ! return (res); } ! void alertErrorMessage(CError err) { ! Char *txt; ! txt = print_error(err); ! FrmCustomAlert(altErrorMsg, txt, NULL, NULL); ! MemPtrFree(txt); ! } \ No newline at end of file --- 1346,1420 ---- /******************************************************************************** ! * OS specific: put result text from the display area to the clipboard. * ********************************************************************************/ ! void Skin::clipCopy_result() { ! if (*dispResult != 0) { ! // Get the clipboard and put data in there ! EmptyClipboard(); ! HGLOBAL h = GlobalAlloc(GMEM_MOVEABLE, strlen((char *) dispResult)+1); // Using classical form to get real size in bytes ! SetClipboardData(CF_UNICODETEXT ,h); ! } ! } ! ! /******************************************************************************** ! * OS specific: displays the result actions menu. * ! ********************************************************************************/ ! void Skin::resultActionsPopup(resSelection choices[], int length, void *hWnd) { ! const TCHAR *description; ! int i; for (i=0 ; i<length ; i++) { ! description = libLang->translate(resMenuDesc[choices[i]]); ! SendMessage((HWND) hWnd, LB_ADDSTRING, 0, (LPARAM) description); } } /******************************************************************************** ! * OS specific: displays the result actions menu. * ********************************************************************************/ ! void Skin::historyAddActionPopup(TCHAR *description, void *hWnd) { ! SendMessage((HWND) hWnd, LB_ADDSTRING, 0, (LPARAM) description); } /******************************************************************************** ! * OS specific: displays the varSave values menu. * ********************************************************************************/ ! void Skin::varSavePopup(TCHAR *choices[], int length, void *hWnd) { ! for (int i=0 ; i<length ; i++) { ! SendMessage((HWND) hWnd, CB_ADDSTRING, 0, (LPARAM) choices[i]); ! } ! } ! /******************************************************************************** ! * OS specific: displays the varMgr values menu. * ! ********************************************************************************/ ! void Skin::varMgrPopup(TCHAR *choices[], int length, void *hWnd) { ! for (int i=0 ; i<length ; i++) { ! SendMessage((HWND) hWnd, LB_ADDSTRING, 0, (LPARAM) choices[i]); ! } } ! /******************************************************************************** ! * OS specific: displays the varDef list of values. * ! ********************************************************************************/ ! void Skin::varDefList(TCHAR *name, TCHAR *deftext, int itemNum, void *hWnd) { ! LVITEM lvi; ! lvi.mask = LVIF_TEXT; ! lvi.iItem = itemNum; ! lvi.iSubItem = 0; ! lvi.pszText = name; ! int i = SendMessage((HWND) hWnd, LVM_INSERTITEM, 0, (LPARAM) &lvi); ! lvi.mask = LVIF_TEXT; ! lvi.iItem = i; ! lvi.iSubItem = 1; ! lvi.pszText = deftext; ! SendMessage((HWND) hWnd, LVM_SETITEM, 0, (LPARAM) &lvi); ! } ! ! /******************************************************************************** ! * Enable or disable screen repaints. * ! ********************************************************************************/ ! void Skin::display_set_enabled(bool enable) { ! display_enabled = enable; ! } |