Changeset 574 for trunk/dll/command.c
- Timestamp:
- Mar 23, 2007, 11:37:07 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/command.c
r552 r574 16 16 18 Sep 06 GKY Add replace command and update okay to add if changed 17 17 17 Feb 07 GKY Move error messages etc to string file 18 22 Mar 07 GKY Use QWL_USER 19 23 Mar 07 GKY Replace doesn't change item position 20 23 Mar 07 GKY Okay fails silently when item not changed 18 21 19 22 ***********************************************************************/ … … 51 54 MRESULT EXPENTRY CommandTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 52 55 { 53 PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, 0);56 PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER); 54 57 static BOOL emphasized = FALSE; 55 58 … … 467 470 MRESULT EXPENTRY CommandDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 468 471 { 469 SHORT x ;472 SHORT x, y; 470 473 LINKCMDS *info; 471 474 … … 500 503 (PFNWP) CommandTextProc); 501 504 if (oldproc) 502 WinSetWindowPtr(WinWindowFromID(hwnd, CMD_CL), 0, (PVOID) oldproc);505 WinSetWindowPtr(WinWindowFromID(hwnd, CMD_CL), QWL_USER, (PVOID) oldproc); 503 506 } 504 507 break; … … 641 644 { 642 645 WinDismissDlg(hwnd, 0); 643 saymsg(MB_ENTER, hwnd,646 /*saymsg(MB_ENTER, hwnd, 644 647 GetPString(IDS_ERRORTEXT), 645 648 GetPString(IDS_CANTADDCOMMANDTEXT), 646 temp.title); 649 temp.title);*/ 647 650 } 648 651 else { … … 778 781 { 779 782 CHAR temp[34]; 780 783 y = (SHORT) WinSendDlgItemMsg(hwnd, 784 CMD_LISTBOX, 785 LM_QUERYSELECTION, 786 MPFROMSHORT(LIT_CURSOR), MPVOID); 781 787 WinQueryDlgItemText(hwnd, CMD_TITLE, 34, temp); 782 788 bstrip(temp); … … 840 846 CMD_LISTBOX, 841 847 LM_INSERTITEM, 842 MPFROM2SHORT( LIT_END, 0),848 MPFROM2SHORT(y, 0), 843 849 MPFROMP(temp.title)); 844 850 if (x >= 0) { … … 850 856 CMD_LISTBOX, 851 857 LM_SELECTITEM, 852 MPFROMSHORT(x), MPFROMSHORT(TRUE)); 858 MPFROMSHORT(x), MPFROMSHORT(TRUE)); 859 { 860 LINKCMDS *temphead = NULL, *info, *last = NULL, *temptail = NULL; 861 SHORT sSelect, numitems; 862 863 sSelect = 0; 864 numitems = (SHORT) WinSendDlgItemMsg(hwnd, CMD_LISTBOX, 865 LM_QUERYITEMCOUNT, 866 MPVOID, MPVOID); 867 while (numitems) { 868 info = (LINKCMDS *) WinSendDlgItemMsg(hwnd, CMD_LISTBOX, 869 LM_QUERYITEMHANDLE, 870 MPFROMSHORT(sSelect++), 871 MPVOID); 872 if (info) { 873 if (!temphead) { 874 temphead = info; 875 info->prev = NULL; 876 } 877 else { 878 last->next = info; 879 info->prev = last; 880 } 881 temptail = info; 882 last = info; 883 info->next = NULL; 884 } 885 numitems--; 886 } 887 } 853 888 save_commands(); 854 889 }
Note:
See TracChangeset
for help on using the changeset viewer.