Changeset 574 for trunk/dll/command.c


Ignore:
Timestamp:
Mar 23, 2007, 11:37:07 PM (18 years ago)
Author:
Gregg Young
Message:

Use QWL_USER; Replace doesn't move the command and Okay on cmd dialog removed error on unchanged command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/command.c

    r552 r574  
    1616  18 Sep 06 GKY Add replace command and update okay to add if changed
    1717  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
    1821
    1922***********************************************************************/
     
    5154MRESULT EXPENTRY CommandTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    5255{
    53   PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, 0);
     56  PFNWP oldproc = (PFNWP) WinQueryWindowPtr(hwnd, QWL_USER);
    5457  static BOOL emphasized = FALSE;
    5558
     
    467470MRESULT EXPENTRY CommandDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    468471{
    469   SHORT x;
     472  SHORT x, y;
    470473  LINKCMDS *info;
    471474
     
    500503                                  (PFNWP) CommandTextProc);
    501504      if (oldproc)
    502         WinSetWindowPtr(WinWindowFromID(hwnd, CMD_CL), 0, (PVOID) oldproc);
     505        WinSetWindowPtr(WinWindowFromID(hwnd, CMD_CL), QWL_USER, (PVOID) oldproc);
    503506    }
    504507    break;
     
    641644        {
    642645          WinDismissDlg(hwnd, 0);
    643           saymsg(MB_ENTER, hwnd,
     646          /*saymsg(MB_ENTER, hwnd,
    644647           GetPString(IDS_ERRORTEXT),
    645648                 GetPString(IDS_CANTADDCOMMANDTEXT),
    646                  temp.title);
     649                 temp.title);*/
    647650         }
    648651        else {
     
    778781      {
    779782        CHAR temp[34];
    780 
     783        y = (SHORT) WinSendDlgItemMsg(hwnd,
     784                                        CMD_LISTBOX,
     785                                        LM_QUERYSELECTION,
     786                                        MPFROMSHORT(LIT_CURSOR), MPVOID);
    781787        WinQueryDlgItemText(hwnd, CMD_TITLE, 34, temp);
    782788        bstrip(temp);
     
    840846                                        CMD_LISTBOX,
    841847                                        LM_INSERTITEM,
    842                                         MPFROM2SHORT(LIT_END, 0),
     848                                        MPFROM2SHORT(y, 0),
    843849                                        MPFROMP(temp.title));
    844850          if (x >= 0) {
     
    850856                              CMD_LISTBOX,
    851857                              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            }
    853888            save_commands();
    854889          }
Note: See TracChangeset for help on using the changeset viewer.