Ignore:
Timestamp:
Jul 20, 1999, 9:42:36 AM (26 years ago)
Author:
sandervl
Message:

Accelerator support (not working) + bugfixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/winaccel.cpp

    r332 r342  
    1 /* $Id: winaccel.cpp,v 1.2 1999-07-18 18:04:30 sandervl Exp $ */
     1/* $Id: winaccel.cpp,v 1.3 1999-07-20 07:42:36 sandervl Exp $ */
    22/*
    33 * Win32 accelartor key functions for OS/2
     
    1111#include <os2win.h>
    1212#include <misc.h>
     13#include <win32wnd.h>
    1314
     15//******************************************************************************
     16//******************************************************************************
     17HACCEL WIN32API LoadAcceleratorsA(HINSTANCE hinst, LPCSTR lpszAcc)
     18{
     19 HACCEL rc;
     20
     21    rc = (HACCEL)FindResourceA(hinst, lpszAcc, RT_ACCELERATORA);
     22
     23    dprintf(("LoadAcceleratorsA returned %d\n", rc));
     24    return(rc);
     25}
     26//******************************************************************************
     27//******************************************************************************
     28HACCEL WIN32API LoadAcceleratorsW(HINSTANCE hinst, LPCWSTR lpszAccel)
     29{
     30 HACCEL rc;
     31
     32    rc = (HACCEL)FindResourceW(hinst, lpszAccel, RT_ACCELERATORW);
     33
     34    dprintf(("LoadAcceleratorsW returned %d\n", rc));
     35    return(rc);
     36}
     37//******************************************************************************
     38//******************************************************************************
     39BOOL WIN32API DestroyAcceleratorTable( HACCEL haccel)
     40{
     41 Win32Resource *winres;
     42
     43    if(HIWORD(haccel) == 0) {
     44        dprintf(("DestroyAcceleratorTable: invalid haccel %x", haccel));
     45        SetLastError(ERROR_INVALID_PARAMETER);
     46        return FALSE;
     47    }
     48    dprintf(("DestroyAcceleratorTable %x\n", haccel));
     49    winres = (Win32Resource *)haccel;
     50    delete winres;
     51    return TRUE;
     52}
    1453//******************************************************************************
    1554//TODO: Do more than just return?
     
    1756int WIN32API TranslateAcceleratorA(HWND hwnd, HACCEL haccel, LPMSG lpmsg)
    1857{
    19     //CB: needs more work
    20     //WinTranslateAccel();
    21     //get hab, translate
     58 Win32Window *window;
     59
     60    window = Win32Window::GetWindowFromHandle(hwnd);
     61    if(!window) {
     62//Msg for (non-client) child of our frame window
     63//      dprintf(("TranslateAcceleratorA, window %x not found", hwnd));
     64        return FALSE;
     65    }
     66    if(window->GetAccelTable() != haccel) {
     67        dprintf(("TranslateAcceleratorA %X %X %X", hwnd, haccel, lpmsg->hwnd));
     68        window->SetAccelTable(haccel);
     69    }
     70
    2271    //SvL: OS/2 automatically translates accelerator keys
    2372    return FALSE;
     
    2574//******************************************************************************
    2675//******************************************************************************
    27 int WIN32API TranslateAccelerator( HWND arg1, HACCEL arg2, LPMSG  arg3)
     76int WIN32API TranslateAcceleratorW( HWND hwnd, HACCEL hAccel, LPMSG lpMsg)
    2877{
    29     //SvL: OS/2 automatically translates accelerator keys
    30     return FALSE;
    31 }
    32 //******************************************************************************
    33 //******************************************************************************
    34 int WIN32API TranslateAcceleratorW( HWND arg1, HACCEL arg2, LPMSG  arg3)
    35 {
    36     //SvL: OS/2 automatically translates accelerator keys
    37     return FALSE;
     78    return TranslateAcceleratorA(hwnd, hAccel, lpMsg);
    3879}
    3980//******************************************************************************
     
    67108//******************************************************************************
    68109//******************************************************************************
    69 BOOL WIN32API DestroyAcceleratorTable( HACCEL arg1)
    70 {
    71 #ifdef DEBUG
    72     WriteLog("USER32:  DestroyAcceleratorTable\n");
    73 #endif
    74     return O32_DestroyAcceleratorTable(arg1);
    75 }
    76 //******************************************************************************
    77 //******************************************************************************
    78110int WIN32API CopyAcceleratorTableA(HACCEL hAccelSrc, LPACCEL lpAccelDest,
    79111                      int cAccelEntries)
Note: See TracChangeset for help on using the changeset viewer.