Update of /cvsroot/easycalc/PPCport/system - UI In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29694 Modified Files: EasyCalc.cpp EasyCalc.gif EasyCalc.layout EasyCalcppc.aps EasyCalcppc.rc resourceppc.h Skin.cpp Skin.h Log Message: Functional, not much bugs should be left, still limited in function (no list, no matrix, no graph ..) Index: EasyCalcppc.aps =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalcppc.aps,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsFt8VnF and /tmp/cvsoMKnwS differ Index: EasyCalc.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EasyCalc.cpp 21 Oct 2009 20:56:12 -0000 1.4 --- EasyCalc.cpp 25 Oct 2009 17:53:49 -0000 1.5 *************** *** 45,48 **** --- 45,50 ---- #include "core/mlib/fp.h" #include "core/ansops.h" + #include "core/mlib/calcDB.h" + #include "core/mlib/history.h" *************** *** 56,59 **** --- 58,62 ---- #define WM_APP_ENDFMENU (WM_APP+2) #define WM_APP_ENDFCMENU (WM_APP+3) + #define WM_APP_EXEBUTTON (WM_APP+4) *************** *** 206,209 **** --- 209,218 ---- break; + case WM_CHAR: + if (wParam == 13) { // Enter pressed on keyboard, or ok button on PDA / Phone + SendMessage(pCEdit2->parentWnd, WM_APP_EXEBUTTON, (WPARAM) 0, (LPARAM) builtinFctPopup_name); + return (0); + } + break; } return (CallWindowProc(CEdit_fnWndProc, hWnd, Msg, wParam, lParam)); *************** *** 331,338 **** mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$EXIT")); // Force "const" off rc = SetMenuItemInfo(hmmb_sub, IDM_FILE_EXIT, FALSE, &mii); - hmmb_sub = (HMENU) SendMessage(g_hWndMenuBar, SHCMBM_GETSUBMENU, (WPARAM) 0, (LPARAM) IDM_EDIT); mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$OPTIONS")); // Force "const" off ! rc = SetMenuItemInfo(hmmb_sub, IDM_EDIT_OPTIONS, FALSE, &mii); ! hmmb_sub = (HMENU) SendMessage(g_hWndMenuBar, SHCMBM_GETSUBMENU, (WPARAM) 0, (LPARAM) IDM_HELP); mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$ABOUT...")); // Force "const" off rc = SetMenuItemInfo(hmmb_sub, IDM_HELP_ABOUT, FALSE, &mii); --- 340,357 ---- mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$EXIT")); // Force "const" off rc = SetMenuItemInfo(hmmb_sub, IDM_FILE_EXIT, FALSE, &mii); mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$OPTIONS")); // Force "const" off ! rc = SetMenuItemInfo(hmmb_sub, IDM_FILE_OPTIONS, FALSE, &mii); ! hmmb_sub = (HMENU) SendMessage(g_hWndMenuBar, SHCMBM_GETSUBMENU, (WPARAM) 0, ! (LPARAM) IDM_EDIT); ! mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$COPY")); // Force "const" off ! rc = SetMenuItemInfo(hmmb_sub, IDM_EDIT_CLIPCOPY, FALSE, &mii); ! mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$CUT")); // Force "const" off ! rc = SetMenuItemInfo(hmmb_sub, IDM_EDIT_CLIPCUT, FALSE, &mii); ! mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$PASTE")); // Force "const" off ! rc = SetMenuItemInfo(hmmb_sub, IDM_EDIT_CLIPPASTE, FALSE, &mii); ! mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$CLEAR HISTORY")); // Force "const" off ! rc = SetMenuItemInfo(hmmb_sub, IDM_EDIT_CLEARHISTORY, FALSE, &mii); ! hmmb_sub = (HMENU) SendMessage(g_hWndMenuBar, SHCMBM_GETSUBMENU, (WPARAM) 0, ! (LPARAM) IDM_HELP); mii.dwTypeData = (TCHAR *) libLang->translate(_T("$$ABOUT...")); // Force "const" off rc = SetMenuItemInfo(hmmb_sub, IDM_HELP_ABOUT, FALSE, &mii); *************** *** 340,343 **** --- 359,394 ---- // rc = DrawMenuBar(g_hWndMenuBar); + // Prepare options panels + #define DEF_NUM_OF_PAGES 3 + propPages = new PROPSHEETPAGE[DEF_NUM_OF_PAGES]; + memset(propPages, 0, sizeof(PROPSHEETPAGE) * DEF_NUM_OF_PAGES); + + propPages[0].dwSize = sizeof(PROPSHEETPAGE); + propPages[0].dwFlags = PSP_DEFAULT | PSP_USETITLE; + propPages[0].pszTemplate = MAKEINTRESOURCE(IDD_OPT_GENERAL); + propPages[0].pfnDlgProc = (DLGPROC)WndOptionsGen; + propPages[0].hInstance = g_hInst; + propPages[0].pszIcon = NULL; + propPages[0].pszTitle = libLang->translate(_T("$$GENERAL")); + propPages[0].lParam = (LPARAM) NULL; + + propPages[1].dwSize = sizeof(PROPSHEETPAGE); + propPages[1].dwFlags = PSP_DEFAULT | PSP_USETITLE; + propPages[1].pszTemplate = MAKEINTRESOURCE(IDD_OPT_SKINS); + propPages[1].pfnDlgProc = (DLGPROC)WndOptionsSkins; + propPages[1].hInstance = g_hInst; + propPages[1].pszIcon = NULL; + propPages[1].pszTitle = libLang->translate(_T("$$SKINS")); + propPages[1].lParam = (LPARAM) NULL; + + propPages[2].dwSize = sizeof(PROPSHEETPAGE); + propPages[2].dwFlags = PSP_DEFAULT | PSP_USETITLE; + propPages[2].pszTemplate = MAKEINTRESOURCE(IDD_OPT_PREFS); + propPages[2].pfnDlgProc = (DLGPROC)WndOptionsCalcPrefs; + propPages[2].hInstance = g_hInst; + propPages[2].pszIcon = NULL; + propPages[2].pszTitle = libLang->translate(_T("$$PREFERENCES TITLE")); + propPages[2].lParam = (LPARAM) NULL; + // Set skin cur_skin = loaded_skins + state->cur_skin_nb; *************** *** 378,413 **** ann_state[ANN_S1 + state->cur_skin_nb] = true; - // Prepare options panels - #define DEF_NUM_OF_PAGES 3 - propPages = new PROPSHEETPAGE[DEF_NUM_OF_PAGES]; - memset(propPages, 0, sizeof(PROPSHEETPAGE) * DEF_NUM_OF_PAGES); - - propPages[0].dwSize = sizeof(PROPSHEETPAGE); - propPages[0].dwFlags = PSP_DEFAULT | PSP_USETITLE; - propPages[0].pszTemplate = MAKEINTRESOURCE(IDD_OPT_GENERAL); - propPages[0].pfnDlgProc = (DLGPROC)WndOptionsGen; - propPages[0].hInstance = g_hInst; - propPages[0].pszIcon = NULL; - propPages[0].pszTitle = libLang->translate(_T("$$GENERAL")); - propPages[0].lParam = (LPARAM) NULL; - - propPages[1].dwSize = sizeof(PROPSHEETPAGE); - propPages[1].dwFlags = PSP_DEFAULT | PSP_USETITLE; - propPages[1].pszTemplate = MAKEINTRESOURCE(IDD_OPT_SKINS); - propPages[1].pfnDlgProc = (DLGPROC)WndOptionsSkins; - propPages[1].hInstance = g_hInst; - propPages[1].pszIcon = NULL; - propPages[1].pszTitle = libLang->translate(_T("$$SKINS")); - propPages[1].lParam = (LPARAM) NULL; - - propPages[2].dwSize = sizeof(PROPSHEETPAGE); - propPages[2].dwFlags = PSP_DEFAULT | PSP_USETITLE; - propPages[2].pszTemplate = MAKEINTRESOURCE(IDD_OPT_PREFS); - propPages[2].pfnDlgProc = (DLGPROC)WndOptionsCalcPrefs; - propPages[2].hInstance = g_hInst; - propPages[2].pszIcon = NULL; - propPages[2].pszTitle = libLang->translate(_T("$$PREFERENCES TITLE")); - propPages[2].lParam = (LPARAM) NULL; - // Prepare the painting brush for the input area Edit control editBgBrush = CreateSolidBrush(cur_skin->getDisplayBgColor()); --- 429,432 ---- *************** *** 645,650 **** if (timer != 0) { ! KillTimer(NULL, timer); ! timer = 0; } --- 664,669 ---- if (timer != 0) { ! KillTimer(NULL, timer); ! timer = 0; } *************** *** 1168,1175 **** // Parse the menu selections: switch (wmId) { ! case IDM_HELP_ABOUT: ! DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, WndAbout); ! break; ! case IDM_EDIT_OPTIONS: PROPSHEETHEADER psh; psh.dwSize = sizeof(PROPSHEETHEADER); --- 1187,1191 ---- // Parse the menu selections: switch (wmId) { ! case IDM_FILE_OPTIONS: PROPSHEETHEADER psh; psh.dwSize = sizeof(PROPSHEETHEADER); *************** *** 1200,1203 **** --- 1216,1234 ---- break; #endif // WIN32_PLATFORM_PSPC + case IDM_EDIT_CLIPCOPY: + cur_skin->clipboardAction(NULL, WM_COPY); + break; + case IDM_EDIT_CLIPCUT: + cur_skin->clipboardAction(NULL, WM_CUT); + break; + case IDM_EDIT_CLIPPASTE: + cur_skin->clipboardAction(NULL, WM_PASTE); + break; + case IDM_EDIT_CLEARHISTORY: + history_shrink(0); + break; + case IDM_HELP_ABOUT: + DialogBox(g_hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, WndAbout); + break; default: return (DefWindowProc(hWnd, message, wParam, lParam)); *************** *** 1314,1484 **** break; - case WM_KEYDOWN: - case WM_CHAR: - case WM_SYSKEYDOWN: - case WM_SYSCHAR: { - static int virtKey = 0; - int keyChar; - if ((lParam & (1 << 30)) != 0) - // Auto-repeat event; ignore. - break; - if (message == WM_KEYDOWN || message == WM_SYSKEYDOWN) { - keyChar = 0; - virtKey = (int) wParam; - } else - keyChar = (int) wParam; - just_pressed_shift = false; - if (virtKey == 17) { - ctrl_down = true; - goto do_default; - } else if (virtKey == 18) { - alt_down = true; - goto do_default; - } else if (virtKey == 16) { - shift_down = true; - just_pressed_shift = true; - goto do_default; - } - if ((message == WM_KEYDOWN || message == WM_SYSKEYDOWN) - && !ctrl_down - && (virtKey == 8 // Backspace - || virtKey == 9 // Tab - || virtKey == 13 // Enter - || (virtKey == 27 && !shift_down) // Escape - || virtKey == 32 // Space - || (virtKey >= 48 && virtKey < 112) - || (virtKey >= 0xB0 && virtKey < 0xF0))) - // Keystrokes that will be followed by a WM_CHAR - // message; we defer handling them until then. - break; - - if (ckey == KEY_NONE || !mouse_key) { - int i; - bool printable = keyChar >= 32 && keyChar <= 126; - if (ckey != KEY_NONE) { - shell_keyup(true, hWnd); - active_keycode = 0; - } - if (printable && core_alpha_menu()) { - if (keyChar >= _T('a') && keyChar <= _T('z')) - keyChar = keyChar + _T('A') - _T('a'); - else if (keyChar >= _T('A') && keyChar <= _T('Z')) - keyChar = keyChar + _T('a') - _T('A'); - ckey = 1024 + keyChar; - skey = -1; - macro = NULL; - shell_keydown(); - mouse_key = false; - active_keycode = virtKey; - break; - } else if (core_hex_menu() && ((keyChar >= _T('a') && keyChar <= _T('f')) - || (keyChar >= _T('A') && keyChar <= _T('F')))) { - if (keyChar >= _T('a') && keyChar <= _T('f')) - ckey = keyChar - _T('a') + 1; - else - ckey = keyChar - _T('A') + 1; - skey = -1; - macro = NULL; - shell_keydown(); - mouse_key = false; - active_keycode = virtKey; - break; - } - - bool exact; - bool cshift_down = (ann_state[ANN_SHIFT] != 0); - unsigned char *key_macro = cur_skin->keymap_lookup(virtKey, ctrl_down, alt_down, shift_down, cshift_down, &exact); - if (key_macro == NULL || !exact) { - for (i = 0; i < keymap_length; i++) { - keymap_entry *entry = keymap + i; - if (ctrl_down == entry->ctrl - && alt_down == entry->alt - && shift_down == entry->shift - && virtKey == entry->keycode) { - if (cshift_down == entry->cshift) { - key_macro = entry->macro; - break; - } else { - if (key_macro == NULL) - key_macro = entry->macro; - } - } - } - } - if (key_macro != NULL) { - // A keymap entry is a sequence of zero or more calculator - // keystrokes (1..NB_KEYS) and/or macros (NB_KEYS+1..255). We expand - // macros here before invoking shell_keydown(). - // If the keymap entry is one key, or two keys with the - // first being 'shift', we highlight the key in question - // by setting ckey; otherwise, we set ckey to -10, which - // means no skin key will be highlighted. - ckey = -10; - skey = -1; - if (key_macro[0] != 0) - if (key_macro[1] == 0) - ckey = key_macro[0]; - else if (key_macro[2] == 0 && key_macro[0] == 28) - ckey = key_macro[1]; - bool needs_expansion = false; - for (int j = 0; key_macro[j] != 0; j++) - if (key_macro[j] > NB_KEYS) { - needs_expansion = true; - break; - } - if (needs_expansion) { - static unsigned char macrobuf[1024]; - int p = 0; - for (int j = 0; key_macro[j] != 0 && p < 1023; j++) { - int c = key_macro[j]; - if (c <= NB_KEYS) - macrobuf[p++] = c; - else { - unsigned char *m = cur_skin->find_macro(c); - if (m != NULL) - while (*m != 0 && p < 1023) - macrobuf[p++] = *m++; - } - } - macrobuf[p] = 0; - macro = macrobuf; - } else - macro = key_macro; - shell_keydown(); - mouse_key = false; - active_keycode = virtKey; - break; - } - } - goto do_default; - } - - case WM_KEYUP: - case WM_SYSKEYUP: { - int virtKey = (int) wParam; - if (virtKey == 17) { - ctrl_down = false; - goto do_default; - } else if (virtKey == 18) { - alt_down = false; - goto do_default; - } else if (virtKey == 16) { - shift_down = false; - if (ckey == KEY_NONE && just_pressed_shift) { - ckey = 28; - skey = 1; - macro = NULL; - shell_keydown(); - shell_keyup(true, hWnd); - } - goto do_default; - } - if (ckey != KEY_NONE && !mouse_key && virtKey == active_keycode) { - shell_keyup(true, hWnd); - active_keycode = 0; - } - goto do_default; - } - case WM_APP_ENDVMENU: cur_skin->insert_input_text(NULL, (TCHAR *) lParam); --- 1345,1348 ---- *************** *** 1493,1496 **** --- 1357,1369 ---- break; + case WM_APP_EXEBUTTON: // User pressed the enter key or the OK button PDA / Phone + { + ckey = KEY_EXE; + int repeat; + running = core_keydown(ckey, &enqueued, &repeat); + running = core_keyup(cur_skin, g_hWnd); + } + break; + case WM_DESTROY: #ifdef SHELL_AYGSHELL *************** *** 1511,1515 **** case WM_CTLCOLOREDIT: {// Notification sent by an Edit control // when about to be drawn = the input area. ! // Use that modify the drawing colors. // Note that this message is sent each time the control is repainted, // not just the first time, and all this needs to b done each time !! --- 1384,1388 ---- case WM_CTLCOLOREDIT: {// Notification sent by an Edit control // when about to be drawn = the input area. ! // Use that to modify drawing colors. // Note that this message is sent each time the control is repainted, // not just the first time, and all this needs to b done each time !! *************** *** 1526,1530 **** default: ! do_default: return (DefWindowProc(hWnd, message, wParam, lParam)); } --- 1399,1403 ---- default: ! // do_default: return (DefWindowProc(hWnd, message, wParam, lParam)); } *************** *** 1533,1766 **** } - // case keyDownEvent: - // formid = FrmGetActiveFormID(); - // if (TxtGlueCharIsValid(event->data.keyDown.chr) && - // TxtGlueCharIsCntrl(event->data.keyDown.chr) && - // event->data.keyDown.chr != chrBackspace && - // event->data.keyDown.chr != chrDelete && - // event->data.keyDown.chr != pageUpChr && - // event->data.keyDown.chr != pageDownChr) { - // /* Swallow control chars except Backspace, Delete and page up/down */ - // handled = true; - // } else if (event->data.keyDown.chr=='\n') { - // main_input_exec(); - // handled=true; - // } else if (event->data.keyDown.chr==')' || event->data.keyDown.chr=='(') { - // calc_nil_timeout(0); - // BrH=2; - // } else if (formid == frmScientific - // && event->data.keyDown.chr == pageDownChr) { - // lst = GetObjectPtr(lstMainBtnRow); - // calcPrefs.btnRow++; - // if (calcPrefs.btnRow >= LstGetNumberOfItems(lst)) - // calcPrefs.btnRow = 0; - // main_btnrow_set(calcPrefs.btnRow); - // handled = true; - // } else if (formid == frmScientific - // && event->data.keyDown.chr == pageUpChr) { - // lst = GetObjectPtr(lstMainBtnRow); - // if (calcPrefs.btnRow == 0) - // calcPrefs.btnRow = LstGetNumberOfItems(lst) - 1; - // else - // calcPrefs.btnRow--; - // main_btnrow_set(calcPrefs.btnRow); - // handled = true; - // } - // break; - // case frmCloseEvent: - // formid=event->data.frmClose.formID; - // - // field = GetObjectPtr(tdInput); - // calcPrefs.insertPos = FldGetInsPtPosition(field); - // FldGetSelection(field, &calcPrefs.selPosStart, - // &calcPrefs.selPosEnd); - // if (FldGetTextPtr(field)) - // StrCopy(calcPrefs.input,FldGetTextPtr(field)); - // - // handled=false; /* This is important - let the - // * FrmHandleEvent handle this - // * itself */ - // break; - // case ctlRepeatEvent: - // frm = FrmGetActiveForm(); - // controlID=event->data.ctlSelect.controlID; - // switch (controlID) { - // case btnMainBksp: - // //EvtEnqueueKey(chrLeftArrow,0,0); - // field = GetObjectPtr(tdInput); - // insptr = FldGetInsPtPosition(field); - // FldSetSelection(field,insptr,insptr); - // FldSetInsPtPosition(field,insptr-1); - // /* Make sure cursor is on. Needed in PalmOS > 5.4.0 */ - // FrmSetFocus(frm, FrmGetObjectIndex(frm, tdInput)); - // handled = false; - // break; - // case btnMainFwsp: - // //EvtEnqueueKey(chrRightArrow,0,0); - // field = GetObjectPtr(tdInput); - // insptr = FldGetInsPtPosition(field); - // if (insptr == FldGetTextLength(field)) { - // FldSetSelection(field,insptr,insptr); - // FldSetInsPtPosition(field,0); - // handled = false; - // break; - // } - // else - // FldSetSelection(field,insptr,insptr); - // FldSetInsPtPosition(field,insptr+1); - // /* Make sure cursor is on. Needed in PalmOS > 5.4.0 */ - // FrmSetFocus(frm, FrmGetObjectIndex(frm, tdInput)); - // handled = false; - // break; - // } - // break; - // case ctlSelectEvent: - // controlID=event->data.ctlSelect.controlID; - // - // if (chooseForm(controlID)) { - // handled=true; - // break; - // } - // - // handled=true; - // switch (controlID) { - // case varFuncListButton: - // case varBuiltinListButton: - // if (controlID == varFuncListButton) - // text = varmgr_popup(function); - // else - // text = varmgr_popup_builtin(); - // if (text) { - // main_insert(tdInput,text,false,true,false,NULL); - // MemPtrFree(text); - // } - // break; - // case varListButton: - // if (controlID==varListButton) - // text = varmgr_popup(variable); - // else - // text = history_popup(); - // if (text) { - // field = GetObjectPtr(tdInput); - // FldInsert(field, text, StrLen(text)); - // MemPtrFree(text); - // } - // break; - // case btnMainSel: - // LstSetSelection(GetObjectPtr(lstMainBtnRow), calcPrefs.btnRow); - // i = LstPopupList(GetObjectPtr(lstMainBtnRow)); - // if (i != noListSelection && i != calcPrefs.btnRow) { - // calcPrefs.btnRow = i; - // main_btnrow_set(i); - // } - // break; - // default: - // if(calcPrefs.matchParenth) { - // handled=false; - // break; - // } - // case btnMainClBr: - // BrH=2; - // calc_nil_timeout(0); - // handled=false; - // break; - // } - // - // if (main_btnrow_click(controlID)) - // handled = true; - // - // if (handled) - // break; - // - // /* If we are in Octal mode and user tries to use decimal - // * keys, warn him. This is the most frequent problem - // * I got and this should solve it. - // */ - // if (dispPrefs.base == disp_octal && - // (controlID == btnMain8 || controlID == btnMain9)) { - // FrmCustomAlert(altOctalMode,_T("Octal"),NULL,NULL); - // handled = true; - // break; - // } - // else if (dispPrefs.base == disp_binary && - // controlID >= btnMain2 && controlID <=btnMain9) { - // FrmCustomAlert(altOctalMode,_T("Binary"),NULL,NULL); - // handled = true; - // break; - // } - // - // for (i=0;buttonString[i].id;i++) - // if (buttonString[i].id == controlID) { - // main_insert(tdInput,buttonString[i].string,buttonString[i].operatr, - // buttonString[i].func,buttonString[i].nostartparen,NULL); - // FrmSetFocus(FrmGetActiveForm(), - // FrmGetObjectIndex(FrmGetActiveForm(), - // tdInput)); - // handled=true; - // break; - // } - // break; - // case menuEvent: - // case mitClearHistory: - // history_shrink(0); - // handled = true; - // break; - // break; - // case fldEnterEvent: - // if(event->data.fldEnter.fieldID==tdInput){ - // BrH=2; - // calc_nil_timeout(0); - // } - // break; - // case nilEvent: - // if(BrH==2){ - // UInt16 j,k=1,end; - // TCHAR char1,char2; - // - // field=GetObjectPtr(tdInput); - // FldGetSelection(field,&start,&end); - // - // if(start!=end || end==0){ - // goto exit; - // } - // - // j=start-1; - // text = FldGetTextPtr(field); - // if(text[j]==')'){ - // char1=')'; char2='('; - // i=-1; end=0; - // }else if(text[j]=='('){ - // char1='('; char2=')'; - // i=1; end=StrLen(text); - // }else{ - // goto exit; - // } - // - // while(j!=end && k){ - // j+=i; - // if(text[j]==char1) k++; - // else if(text[j]==char2) k--; - // } - // - // if(k) goto exit; - // else{ - // FldSetSelection(field,j,j+1); - // calc_nil_timeout(40); - // BrH=1; - // } - // } - // else if(BrH==1) - // { - // FldSetSelection(GetObjectPtr(tdInput),start,start); - // exit: - // calc_nil_timeout(evtWaitForever); - // BrH=0; - // } - // handled=true; - // break; - // } - // - // return handled; - /******************************************************************************** * FUNCTION: WndAbout(HWND, UINT, WPARAM, LPARAM) * --- 1406,1409 ---- *************** *** 1903,1913 **** case CBN_CLOSEUP: int cur_sel = (int) SendMessage(hWnd, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0); - dispPrefs.mode = ((cur_sel == 0) - ? disp_normal - : ((cur_sel == 1) - ? disp_sci - : disp_eng - ) - ); // Set chosen language, and tell WndProc to modify menus // and propSheets accordingly. --- 1546,1549 ---- *************** *** 2031,2034 **** --- 1667,1682 ---- /******************************************************************************** + * Function + ********************************************************************************/ + void addPrecValues(HWND hWnd, int maxPrec) { + TCHAR text[10]; + + for (int i=0 ; i<=maxPrec ; i++) { + _stprintf(text, _T("%d"), i); + SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) text); + } + } + + /******************************************************************************** * FUNCTION: WndOptionsCalcPrefs(HWND, UINT, WPARAM, LPARAM) * * Message handler for the Calculation Preferences page of Options. * *************** *** 2086,2093 **** SetWindowText(GetDlgItem(hDlg, IDC_CALCGROUP), libLang->translate(_T("$$CALCULATIONS"))); hWnd = GetDlgItem(hDlg, IDC_TRUNCPREC); ! SetWindowText(hWnd, libLang->translate(_T("$$REDUCE PRECISION"))); if (calcPrefs.reducePrecision) { SendMessage(hWnd, BM_SETCHECK, (WPARAM) BST_CHECKED, (LPARAM) 0); } hWnd = GetDlgItem(hDlg, IDC_INTEGERS); SetWindowText(hWnd, libLang->translate(_T("$$FORCE INTEGER"))); --- 1734,1747 ---- SetWindowText(GetDlgItem(hDlg, IDC_CALCGROUP), libLang->translate(_T("$$CALCULATIONS"))); hWnd = GetDlgItem(hDlg, IDC_TRUNCPREC); ! TCHAR text1[40], text2[10]; ! _tcscpy(text1, libLang->translate(_T("$$REDUCE PRECISION"))); ! _stprintf(text2, _T(" (%d)"), ROUND_OFFSET); ! _tcscat(text1, text2); ! SetWindowText(hWnd, text1); if (calcPrefs.reducePrecision) { SendMessage(hWnd, BM_SETCHECK, (WPARAM) BST_CHECKED, (LPARAM) 0); } + // Enable the option if not in force integer, else disable it + EnableWindow (hWnd, !dispPrefs.forceInteger); hWnd = GetDlgItem(hDlg, IDC_INTEGERS); SetWindowText(hWnd, libLang->translate(_T("$$FORCE INTEGER"))); *************** *** 2111,2131 **** SetWindowText(GetDlgItem(hDlg, IDC_PRECISION), libLang->translate(_T("$$PRECISION"))); hWnd = GetDlgItem(hDlg, IDC_PRECVAL); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("0")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("1")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("2")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("3")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("4")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("5")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("6")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("7")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("8")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("9")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("10")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("11")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("12")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("13")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("14")); ! SendMessage(hWnd, CB_ADDSTRING, (WPARAM) 0, (LPARAM) _T("15")); SendMessage(hWnd, CB_SETCURSEL, (WPARAM) dispPrefs.decPoints, (LPARAM) 0); SetWindowText(GetDlgItem(hDlg, IDC_FORMATGROUP), libLang->translate(_T("$$FORMAT NUMBERS"))); hWnd = GetDlgItem(hDlg, IDC_STRIP_0); --- 1765,1775 ---- SetWindowText(GetDlgItem(hDlg, IDC_PRECISION), libLang->translate(_T("$$PRECISION"))); hWnd = GetDlgItem(hDlg, IDC_PRECVAL); ! addPrecValues(hWnd, (calcPrefs.reducePrecision ? ROUND_OFFSET : 15)); ! if (calcPrefs.reducePrecision && (dispPrefs.decPoints > ROUND_OFFSET)) { ! dispPrefs.decPoints = ROUND_OFFSET; ! } SendMessage(hWnd, CB_SETCURSEL, (WPARAM) dispPrefs.decPoints, (LPARAM) 0); + // Enable the option if not in force integer, else disable it + EnableWindow (hWnd, !dispPrefs.forceInteger); SetWindowText(GetDlgItem(hDlg, IDC_FORMATGROUP), libLang->translate(_T("$$FORMAT NUMBERS"))); hWnd = GetDlgItem(hDlg, IDC_STRIP_0); *************** *** 2134,2137 **** --- 1778,1783 ---- SendMessage(hWnd, BM_SETCHECK, (WPARAM) BST_CHECKED, (LPARAM) 0); } + // Enable the option if not in force integer, else disable it + EnableWindow (hWnd, !dispPrefs.forceInteger); hWnd = GetDlgItem(hDlg, IDC_SHOW_UNITS); SetWindowText(hWnd, libLang->translate(_T("$$SHOW UNITS"))); *************** *** 2139,2143 **** SendMessage(hWnd, BM_SETCHECK, (WPARAM) BST_CHECKED, (LPARAM) 0); } ! // Enable the option, else disable it EnableWindow (hWnd, (dispPrefs.mode == disp_eng)); hWnd = GetDlgItem(hDlg, IDC_OS_NUMPREFS); --- 1785,1789 ---- SendMessage(hWnd, BM_SETCHECK, (WPARAM) BST_CHECKED, (LPARAM) 0); } ! // Enable the option if in Engineer mode, else disable it EnableWindow (hWnd, (dispPrefs.mode == disp_eng)); hWnd = GetDlgItem(hDlg, IDC_OS_NUMPREFS); *************** *** 2165,2168 **** --- 1811,1815 ---- NMHDR* pnmh = (NMHDR*)lParam; if (pnmh->code == PSN_APPLY) { + fp_set_prefs(dispPrefs); return (TRUE); } *************** *** 2252,2255 **** --- 1899,1910 ---- int sel = (int) SendMessage(hWnd, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0); calcPrefs.reducePrecision = (sel == BST_CHECKED); + // Modify contents of PRECVAL according to this option + HWND hWnd_tmp = GetDlgItem(hDlg, IDC_PRECVAL); + SendMessage(hWnd_tmp, CB_RESETCONTENT, (WPARAM) 0, (LPARAM) 0); + addPrecValues(hWnd_tmp, (calcPrefs.reducePrecision ? ROUND_OFFSET : 15)); + if (calcPrefs.reducePrecision && (dispPrefs.decPoints > ROUND_OFFSET)) { + dispPrefs.decPoints = ROUND_OFFSET; + } + SendMessage(hWnd_tmp, CB_SETCURSEL, (WPARAM) dispPrefs.decPoints, (LPARAM) 0); res = TRUE; break; *************** *** 2262,2265 **** --- 1917,1927 ---- dispPrefs.forceInteger = (sel == BST_CHECKED); res = TRUE; + // Enable / disable precision options depending on the value + HWND hWnd_tmp = GetDlgItem(hDlg, IDC_TRUNCPREC); + EnableWindow (hWnd_tmp, !dispPrefs.forceInteger); + hWnd_tmp = GetDlgItem(hDlg, IDC_PRECVAL); + EnableWindow (hWnd_tmp, !dispPrefs.forceInteger); + hWnd_tmp = GetDlgItem(hDlg, IDC_STRIP_0); + EnableWindow (hWnd_tmp, !dispPrefs.forceInteger); break; } *************** *** 2305,2309 **** switch (notify_msg) { case BN_CLICKED: ! int sel = (int) SendMessage(hWnd, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0); dispPrefs.cvtUnits = (sel == BST_CHECKED); res = TRUE; --- 1967,1971 ---- switch (notify_msg) { case BN_CLICKED: ! int sel = (int) SendMessage(hWnd, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0); dispPrefs.cvtUnits = (sel == BST_CHECKED); res = TRUE; *************** *** 2314,2318 **** switch (notify_msg) { case BN_CLICKED: ! int sel = (int) SendMessage(hWnd, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0); calcPrefs.acceptOSPref = (sel == BST_CHECKED); res = TRUE; --- 1976,1980 ---- switch (notify_msg) { case BN_CLICKED: ! int sel = (int) SendMessage(hWnd, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0); calcPrefs.acceptOSPref = (sel == BST_CHECKED); res = TRUE; *************** *** 2323,2327 **** switch (notify_msg) { case BN_CLICKED: ! int sel = (int) SendMessage(hWnd, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0); calcPrefs.matchParenth = (sel == BST_CHECKED); res = TRUE; --- 1985,1989 ---- switch (notify_msg) { case BN_CLICKED: ! int sel = (int) SendMessage(hWnd, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0); calcPrefs.matchParenth = (sel == BST_CHECKED); res = TRUE; *************** *** 2332,2336 **** switch (notify_msg) { case BN_CLICKED: ! int sel = (int) SendMessage(hWnd, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0); calcPrefs.insertHelp = (sel == BST_CHECKED); res = TRUE; --- 1994,1998 ---- switch (notify_msg) { case BN_CLICKED: ! int sel = (int) SendMessage(hWnd, BM_GETCHECK, (WPARAM) 0, (LPARAM) 0); calcPrefs.insertHelp = (sel == BST_CHECKED); res = TRUE; *************** *** 2547,2552 **** SendMessage(hLst, WM_GETTEXT, (WPARAM) siz, (LPARAM) text); // Then call the action ! varmgr_listVar_action(text, g_hWnd, true, (cur_sel != CB_ERR)); ! EndDialog(hDlg, 1); res = TRUE; } --- 2209,2214 ---- SendMessage(hLst, WM_GETTEXT, (WPARAM) siz, (LPARAM) text); // Then call the action ! if (varmgr_listVar_action(text, g_hWnd, true, (cur_sel != CB_ERR))) ! EndDialog(hDlg, 1); res = TRUE; } Index: Skin.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Skin.h 21 Oct 2009 20:56:50 -0000 1.6 --- Skin.h 25 Oct 2009 17:53:50 -0000 1.7 *************** *** 172,175 **** --- 172,176 ---- COLORREF getDisplayBgColor(); void create_input_area(HWND hwnd, HINSTANCE hinst); + void clipboardAction (void *hwnd, int action); void select_input_text(void *hwnd); void select_input_text(void *hwnd, unsigned long start, unsigned long end); Index: EasyCalcppc.rc =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalcppc.rc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EasyCalcppc.rc 21 Oct 2009 20:56:25 -0000 1.4 --- EasyCalcppc.rc 25 Oct 2009 17:53:50 -0000 1.5 *************** *** 281,289 **** POPUP "File" BEGIN MENUITEM "Exit", IDM_FILE_EXIT END POPUP "Edit" BEGIN ! MENUITEM "Options", IDM_EDIT_OPTIONS END POPUP "Help" --- 281,294 ---- POPUP "File" BEGIN + MENUITEM "Options", IDM_FILE_OPTIONS MENUITEM "Exit", IDM_FILE_EXIT END POPUP "Edit" BEGIN ! MENUITEM "Copy", IDM_EDIT_CLIPCOPY ! MENUITEM "Cut", IDM_EDIT_CLIPCUT ! MENUITEM "Paste", IDM_EDIT_CLIPPASTE ! MENUITEM SEPARATOR ! MENUITEM "Clear history", IDM_EDIT_CLEARHISTORY END POPUP "Help" Index: EasyCalc.layout =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.layout,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EasyCalc.layout 21 Oct 2009 20:56:25 -0000 1.4 --- EasyCalc.layout 25 Oct 2009 17:53:50 -0000 1.5 *************** *** 4,10 **** Skin: 0,0,240,268 # Description of the display area: x1,y1 xscale yscale fg_color bg_color ! # With xscale = 0, screen width is 217 dots (only value used for now). # Do not touch yscale either for now. ! Display: 9,13 0 3 a3b39d 0b2327 # Active elements: num x1,y1,l,h (on screen) x1_off,y1_off x1_on,y1_on (in the gif) --- 4,10 ---- 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. ! Display: 10,13 0 3 a3b39d 0b2327 # Active elements: num x1,y1,l,h (on screen) x1_off,y1_off x1_on,y1_on (in the gif) *************** *** 17,22 **** 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,5,7 155,268 155,275 # Result scroll left indicator ! Annunciator: 10 227,16,5,7 159,268 159,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 --- 17,22 ---- 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 *************** *** 35,39 **** # -4 -> dot // decimal dot # -3 -> EXE // run evaluation ! # -2 -> bckspc // back space # -1 -> clr // clear input and result fields # 0 -> 0,"0" --- 35,39 ---- # -4 -> dot // decimal dot # -3 -> EXE // run evaluation ! # -2 -> bckspc // back space. Note: if accessed through shift, will leave shift on to be able to do several in a row # -1 -> clr // clear input and result fields # 0 -> 0,"0" *************** *** 83,220 **** # 44 -> Angle,"angle" # 45 -> complex_i,"i" ! # 46 -> Coln,":" ! # 47 -> ClBr,")" ! # 48 -> EE,"E" ! # 49 -> asin ! # 50 -> acos ! # 51 -> atan ! # 52 -> sinh ! # 53 -> cosh ! # 54 -> tanh ! # 55 -> asinh ! # 56 -> acosh ! # 57 -> atanh ! # 58 -> log ! # 59 -> 10^ ! # 60 -> log2 ! # 61 -> 2^ ! # 62 -> fact ! # 63 -> ncr ! # 64 -> npr ! # 65 -> round ! # 66 -> trunc ! # 67 -> floor ! # 68 -> gamma ! # 69 -> beta ! # 70 -> rand ! # 71 -> rNorm ! # 72 -> real ! # 73 -> imag ! # 74 -> conj ! # 75 -> exp(i* ! # 76 -> fzero ! # 77 -> fvalue ! # 78 -> fmin ! # 79 -> fmax ! # 80 -> fd_dx // d/dx ! # 81 -> fromberg // integ ! # 82 -> fd2_dx // d2/dx ! # 83 -> ()=" ! # 84 -> " ! # 85 -> x ! # 86 -> list ! # 87 -> median ! # 88 -> mean ! # 89 -> sum ! # 90 -> lmin // min ! # 91 -> lmax // max ! # 92 -> prod ! # 93 -> variance ! # 94 -> stddev ! # 95 -> dim ! # 96 -> [ ! # 97 -> matrix ! # 98 -> identity ! # 99 -> det ! # 100 -> qrs ! # 101 -> rref ! # 102 -> qrq ! # 103 -> qrr ! # 104 -> [ // x[] ! # 105 -> ] ! # 106 -> qBinomial ! # 107 -> qBeta ! # 108 -> qChiSq ! # 109 -> qF ! # 110 -> qPoisson ! # 111 -> qStudentt ! # 112 -> qWeibull ! # 113 -> qNormal ! # 114 -> range ! # 115 -> rNorm ! # 116 -> find ! # 117 -> sample ! # 118 -> filter ! # 119 -> conv ! # 120 -> fft ! # 121 -> ifft ! # 122 -> prevprime ! # 123 -> isprime ! # 124 -> nextprime ! # 125 -> gcd ! # 126 -> lcm ! # 127 -> phi ! # 128 -> gcdex ! # 129 -> chinese ! # 130 -> modinv ! # 131 -> modpow ! # 132 -> factor ! # 133 -> besseli ! # 134 -> besselj ! # 135 -> besselk ! # 136 -> bessely ! # 137 -> ellc1 ! # 138 -> ellc2 ! # 139 -> elli1 ! # 140 -> elli2 ! # 141 -> euler ! # 142 -> cn ! # 143 -> dn ! # 144 -> sn ! # 145 -> igamma ! # 146 -> ibeta ! # 147 -> erf ! # 148 -> erfc # key: -5,-5 6,70,32,22 11,75,22,12 11,74 ! key: 34 45,70,32,22 50,75,22,12 50,74 ! key: 33 84,70,32,22 89,75,22,12 89,74 ! Key: 28 123,70,32,22 128,75,22,12 128,74 ! Key: -2 162,70,32,22 167,75,22,12 167,74 ! Key: -1 201,70,32,22 206,75,22,12 206,74 ! Key: 48 6,97,32,22 11,102,22,12 11,101 ! Key: 31 45,97,32,22 50,102,22,12 50,101 ! Key: 30 84,97,32,22 89,102,22,12 89,101 ! Key: 29 123,97,32,22 128,102,22,12 128,101 ! Key: 27 162,97,32,22 167,102,22,12 167,101 ! Key: 47 201,97,32,22 206,102,22,12 206,101 ! Key: 7 6,127,40,29 11,132,30,19 11,131 ! Key: 8 53,127,40,29 58,132,30,19 58,131 ! Key: 9 101,127,40,29 106,132,30,19 106,131 ! Key: 25 148,127,40,29 153,132,30,19 153,131 ! Key: 35 196,127,40,29 201,132,30,19 201,131 ! Key: 4 6,163,40,29 11,168,30,19 11,167 ! Key: 5 53,163,40,29 58,168,30,19 58,167 ! Key: 6 101,163,40,29 106,168,30,19 106,167 ! Key: 24 148,163,40,29 153,168,30,19 153,167 ! Key: 26 196,163,40,29 201,168,30,19 201,167 ! Key: 1 6,199,40,29 11,204,30,19 11,203 ! Key: 2 53,199,40,29 58,204,30,19 58,203 ! Key: 3 101,199,40,29 106,204,30,19 106,203 Key: 22 148,199,40,29 153,204,30,19 153,203 ! Key: 36 196,199,40,29 201,204,30,19 201,203 ! Key: 0 6,236,40,29 11,241,30,19 11,240 ! Key: 23 53,236,40,29 58,241,30,19 58,240 ! Key: -4 101,236,40,29 106,241,30,19 106,240 Key: 21 148,236,40,29 153,241,30,19 153,240 Key: -3 196,236,40,29 201,241,30,19 201,240 --- 83,245 ---- # 44 -> Angle,"angle" # 45 -> complex_i,"i" ! # 46 -> e,"e" ! # 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 -> ceil ! # 69 -> floor ! # 70 -> gamma ! # 71 -> beta ! # 72 -> rand ! # 73 -> rNorm ! # 74 -> real ! # 75 -> imag ! # 76 -> conj ! # 77 -> exp(i* ! # 78 -> fzero ! # 79 -> fvalue ! # 80 -> fmin ! # 81 -> fmax ! # 82 -> fd_dx // d/dx ! # 83 -> fromberg // integ ! # 84 -> fd2_dx // d2/dx ! # 85 -> ()=" ! # 86 -> " ! # 87 -> x ! # 88 -> list ! # 89 -> median ! # 90 -> mean ! # 91 -> sum ! # 92 -> lmin // min ! # 93 -> lmax // max ! # 94 -> prod ! # 95 -> variance ! # 96 -> stddev ! # 97 -> dim ! # 98 -> [ ! # 99 -> matrix ! # 100 -> identity ! # 101 -> det ! # 102 -> qrs ! # 103 -> rref ! # 104 -> qrq ! # 105 -> qrr ! # 106 -> [ // x[] ! # 107 -> ] ! # 108 -> qBinomial ! # 109 -> qBeta ! # 110 -> qChiSq ! # 111 -> qF ! # 112 -> qPoisson ! # 113 -> qStudentt ! # 114 -> qWeibull ! # 115 -> qNormal ! # 116 -> range ! # 117 -> rNorm ! # 118 -> find ! # 119 -> sample ! # 120 -> filter ! # 121 -> conv ! # 122 -> fft ! # 123 -> ifft ! # 124 -> prevprime ! # 125 -> isprime ! # 126 -> nextprime ! # 127 -> gcd ! # 128 -> lcm ! # 129 -> phi ! # 130 -> gcdex ! # 131 -> chinese ! # 132 -> modinv ! # 133 -> modpow ! # 134 -> factor ! # 135 -> besseli ! # 136 -> besselj ! # 137 -> besselk ! # 138 -> bessely ! # 139 -> ellc1 ! # 140 -> ellc2 ! # 141 -> elli1 ! # 142 -> elli2 ! # 143 -> euler ! # 144 -> cn ! # 145 -> dn ! # 146 -> sn ! # 147 -> igamma ! # 148 -> ibeta ! # 149 -> erf ! # 150 -> erfc ! # 151 -> Inf // Infinity constant # + # 1st row + # shift sqr x_pow_y abs z_conj CLR + # shift sqrt sqrt_yth real imag bckspc key: -5,-5 6,70,32,22 11,75,22,12 11,74 ! key: 34,33 45,70,32,22 50,75,22,12 50,74 ! key: 32,28 84,70,32,22 89,75,22,12 89,74 ! Key: 74,43 123,70,32,22 128,75,22,12 128,74 ! Key: 75,76 162,70,32,22 167,75,22,12 167,74 ! Key: -2,-1 201,70,32,22 206,75,22,12 206,74 ! # 2nd row ! # e^(ix) 2^x e^x 10^x [ ] ! # EE log2 ln log ( ) ! Key: 48,77 6,97,32,22 11,102,22,12 11,101 ! Key: 61,62 45,97,32,22 50,102,22,12 50,101 ! Key: 30,38 84,97,32,22 89,102,22,12 89,101 ! Key: 29,60 123,97,32,22 128,102,22,12 128,101 ! Key: 27,106 162,97,32,22 167,102,22,12 167,101 ! Key: 47,107 201,97,32,22 206,102,22,12 206,101 ! # 3rd row ! # D E F 1/x atan ! # 7 8 9 / tan ! Key: 7,13 6,127,40,29 11,132,30,19 11,131 ! Key: 8,14 53,127,40,29 58,132,30,19 58,131 ! Key: 9,15 101,127,40,29 106,132,30,19 106,131 ! Key: 25,31 148,127,40,29 153,132,30,19 153,131 ! Key: 37,52 201,124,32,22 206,129,22,12 206,128 ! # 3.5 row ! # asin ! # sin ! Key: 35,50 201,149,32,22 206,154,22,12 206,153 ! # 4th row ! # A B C acos ! # 4 5 6 x cos ! Key: 4,10 6,163,40,29 11,168,30,19 11,167 ! Key: 5,11 53,163,40,29 58,168,30,19 58,167 ! Key: 6,12 101,163,40,29 106,168,30,19 106,167 ! Key: 24 148,163,40,29 153,168,30,19 153,167 ! Key: 36,51 201,174,32,22 201,179,22,12 201,178 ! # 5th row ! # i e pi ! # 1 2 3 - ANS ! Key: 1,45 6,199,40,29 11,204,30,19 11,203 ! Key: 2,46 53,199,40,29 58,204,30,19 58,203 ! Key: 3,40 101,199,40,29 106,204,30,19 106,203 Key: 22 148,199,40,29 153,204,30,19 153,203 ! Key: 26 196,199,40,29 201,204,30,19 201,203 ! # 6th row ! # +Inf x : ! # 0 -/+ . + = ! Key: 0,151 6,236,40,29 11,241,30,19 11,240 ! Key: 23,87 53,236,40,29 58,241,30,19 58,240 ! Key: -4,47 101,236,40,29 106,241,30,19 106,240 Key: 21 148,236,40,29 153,241,30,19 153,240 Key: -3 196,236,40,29 201,241,30,19 201,240 Index: EasyCalc.gif =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.gif,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsA6AoEH and /tmp/cvsyUkpSU differ Index: resourceppc.h =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/resourceppc.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** resourceppc.h 21 Oct 2009 20:56:36 -0000 1.4 --- resourceppc.h 25 Oct 2009 17:53:50 -0000 1.5 *************** *** 80,89 **** #define IDC_LANGUAGE_CB 1093 #define IDC_LANGUAGE 1094 - #define ID_TEST_TEST 32771 - #define ID_EDIT_CANCEL 32772 #define IDM_EXIT 32774 - #define IDM_OPTIONS 32775 - #define IDM_EDIT_OPTIONS 32776 #define IDM_FILE_EXIT 32777 #define IDM_OK 40000 #define IDM_HELP 40001 --- 80,90 ---- #define IDC_LANGUAGE_CB 1093 #define IDC_LANGUAGE 1094 #define IDM_EXIT 32774 #define IDM_FILE_EXIT 32777 + #define IDM_EDIT_CLEARHISTORY 32782 + #define IDM_EDIT_CLIPCUT 32784 + #define IDM_EDIT_CLIPPASTE 32785 + #define IDM_FILE_OPTIONS 32786 + #define IDM_EDIT_CLIPCOPY 32787 #define IDM_OK 40000 #define IDM_HELP 40001 *************** *** 98,102 **** #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 149 ! #define _APS_NEXT_COMMAND_VALUE 32778 #define _APS_NEXT_CONTROL_VALUE 1095 #define _APS_NEXT_SYMED_VALUE 112 --- 99,103 ---- #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 149 ! #define _APS_NEXT_COMMAND_VALUE 32788 #define _APS_NEXT_CONTROL_VALUE 1095 #define _APS_NEXT_SYMED_VALUE 112 Index: Skin.cpp =================================================================== RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Skin.cpp 21 Oct 2009 20:56:50 -0000 1.6 --- Skin.cpp 25 Oct 2009 17:53:50 -0000 1.7 *************** *** 463,467 **** if (display_scale.x == 0) ! landscape = false; this->close(); --- 463,467 ---- if (display_scale.x == 0) ! landscape = false; this->close(); *************** *** 528,532 **** } else { if (display_scale.x == 0) ! display_w = 217; else display_w = 131 * display_scale.x; --- 528,532 ---- } else { if (display_scale.x == 0) ! display_w = 216; else display_w = 131 * display_scale.x; *************** *** 1134,1140 **** 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); --- 1134,1146 ---- void Skin::create_input_area(HWND hWnd_p, HINSTANCE hinst) { DWORD dwStyle = WS_VISIBLE | WS_CHILD | ES_MULTILINE | ES_AUTOVSCROLL | ES_LEFT; ! 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, ! 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); *************** *** 1160,1163 **** --- 1166,1183 ---- /******************************************************************************** + * OS specific: interaction between the Edit Control passed as parameter and * + * clipboard. * + * If parameter is NULL, this is the input area Edit Control. * + * action is one of WM_OPY, WM_CU, WM_PASTE. * + ********************************************************************************/ + void Skin::clipboardAction (void *hwnd, int action) { + HWND hwnd_edit = (HWND) hwnd; + if (hwnd_edit == NULL) + hwnd_edit = hwndE; + long res = SendMessage (hwnd_edit, action, (WPARAM) 0, (LPARAM) -1); + res = SendMessage (hwnd_edit, EM_SCROLLCARET, (WPARAM) 0, (LPARAM) 0); + } + + /******************************************************************************** * OS specific: selects all the text in the Edit Control passed as parameter. * * If parameter is NULL, this is the input area Edit Control. * |