Ignore:
Timestamp:
Jan 10, 2000, 6:18:13 PM (26 years ago)
Author:
cbratschi
Message:

activated menu code

File:
1 edited

Legend:

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

    r2390 r2396  
    1 /* $Id: win32wbase.cpp,v 1.27 2000-01-09 17:13:39 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.28 2000-01-10 17:18:09 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    3232#include "oslibgdi.h"
    3333#include "oslibres.h"
    34 #include "oslibmenu.h"
    3534#include "oslibdos.h"
    3635#include "syscolor.h"
     
    4544#include <win\hook.h>
    4645#include <shellapi.h>
     46#include <menu.h>
    4747#define INCL_TIMERWIN32
    4848#include "timer.h"
     
    8181    !(style & (WS_CHILD | WS_POPUP))
    8282
    83 #define HAS_MENU(w) (!((w)->getStyle() & WS_CHILD) && ((w)->getWindowId() != 0))
     83#define HAS_MENU() (!(getStyle() & WS_CHILD) && (GetMenu() != 0))
    8484
    8585/* bits in the dwKeyData */
     
    674674  if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )
    675675  {
    676 #if 0 //CB: todo
    677676        if (cs->hMenu) {
    678677            SetMenu(cs->hMenu);
     
    684683                }
    685684        }
    686 #endif
    687685  }
    688686  else
     
    690688        setWindowId((DWORD)cs->hMenu);
    691689  }
     690  hSysMenu = (dwStyle & WS_SYSMENU) ? MENU_GetSysMenu(Win32Hwnd,0):0;
    692691
    693692  // Subclass frame
     
    12571256      return;
    12581257    /* Check if the sysmenu item for minimize is there  */
    1259 #if 0 //CB: todo
    12601258    state = GetMenuState(hSysMenu,SC_MINIMIZE,MF_BYCOMMAND);
    1261 #endif
    12621259  } else
    12631260  {
     
    12661263      return;
    12671264    /* Check if the sysmenu item for maximize is there  */
    1268 #if 0 //CB: todo
    12691265    state = GetMenuState(hSysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
    1270 #endif
    12711266  }
    12721267  SetCapture(Win32Hwnd);
     
    13141309  UINT state;
    13151310
    1316 #if 0 //CB: todo
    13171311  if (hSysMenu == 0)
    13181312    return;
    13191313  state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
    1320 #else
    1321 state = 0;
    1322 #endif
    13231314  /* If the item close of the sysmenu is disabled or not there do nothing */
    13241315  if((state & MF_DISABLED) || (state & MF_GRAYED) || (state == 0xFFFFFFFF))
     
    15321523  if(!(dwStyle & WS_MINIMIZE))
    15331524  {
    1534     AdjustRectOuter(&tmpRect,FALSE); //CB: todo: menu
     1525    AdjustRectOuter(&tmpRect,FALSE);
    15351526
    15361527    clientRect->left   -= tmpRect.left;
     
    15391530    clientRect->bottom -= tmpRect.bottom;
    15401531
    1541     if (HAS_MENU(this))
    1542     {
    1543 #if 0 //CB: todo
    1544       winRect->top +=
     1532    if (HAS_MENU())
     1533    {
     1534      clientRect->top +=
    15451535                MENU_GetMenuBarHeight(Win32Hwnd,
    15461536                                       winRect->right - winRect->left,
    15471537                                       -tmpRect.left, -tmpRect.top ) + 1;
    1548 #endif
    15491538    }
    15501539
     
    16931682  /* Check menu bar */
    16941683
    1695   if (HAS_MENU(this))
     1684  if (HAS_MENU())
    16961685  {
    16971686    if ((pt.y < 0) && (pt.x >= 0) && (pt.x < rect.right))
     
    17951784
    17961785    return (hIcon != 0);
     1786  }
     1787  return FALSE;
     1788}
     1789//******************************************************************************
     1790//******************************************************************************
     1791BOOL Win32BaseWindow::GetSysPopupPos(RECT* rect)
     1792{
     1793  if(hSysMenu)
     1794  {
     1795      if(dwStyle & WS_MINIMIZE )
     1796        *rect = rectWindow;
     1797      else
     1798      {
     1799          GetInsideRect(rect );
     1800          OffsetRect( rect, rectWindow.left, rectWindow.top);
     1801          if ((dwStyle & WS_CHILD) && getParent())
     1802              ClientToScreen(getParent()->getWindowHandle(), (POINT *)rect );
     1803          rect->right = rect->left + GetSystemMetrics(SM_CYCAPTION) - 1;
     1804          rect->bottom = rect->top + GetSystemMetrics(SM_CYCAPTION) - 1;
     1805      }
     1806      return TRUE;
    17971807  }
    17981808  return FALSE;
     
    19381948  char  buffer[256];
    19391949  HPEN  hPrevPen;
    1940   HMENU hSysMenu;
    19411950
    19421951  if (flags & WIN_MANAGED) return;
     
    19471956  SelectObject( hdc, hPrevPen );
    19481957  r.bottom--;
    1949 
    1950   //CB: todo:
    1951    //COLOR_GRADIENTACTIVECAPTION
    1952    //COLOR_GRADIENTINACTIVECAPTION
    1953    //-> end color
    19541958
    19551959  if (SYSCOLOR_GetUseWinColors())
     
    20062010  {
    20072011    UINT state;
    2008 #if 0 //CB: todo
     2012
    20092013    /* Go get the sysmenu */
    20102014    state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
    2011 #else
    2012 state = 0;
    2013 #endif
     2015
    20142016    /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */
    20152017    DrawCloseButton(hdc, FALSE,
     
    21152117    }
    21162118  }
    2117 #if 0 //CB: todo
    2118   if (HAS_MENU(wndPtr))
     2119  if (HAS_MENU())
    21192120  {
    21202121    RECT r = rect;
    21212122    r.bottom = rect.top + GetSystemMetrics(SM_CYMENU);
    21222123
    2123     rect.top += MENU_DrawMenuBar( hdc, &r, hwnd, suppress_menupaint ) + 1;
    2124   }
    2125 #endif
     2124    rect.top += MENU_DrawMenuBar( hdc, &r, Win32Hwnd, suppress_menupaint ) + 1;
     2125  }
    21262126
    21272127  if (dwExStyle & WS_EX_CLIENTEDGE)
     
    23192319        TrackScrollBar(wParam,*pt32);
    23202320        break;
    2321 #if 0
     2321
    23222322    case SC_MOUSEMENU:
    2323         MENU_TrackMouseMenuBar( wndPtr, wParam & 0x000F, pt32 );
     2323        MENU_TrackMouseMenuBar(Win32Hwnd,wParam & 0x000F,*pt32);
    23242324        break;
    23252325
    23262326    case SC_KEYMENU:
    2327         MENU_TrackKbdMenuBar( wndPtr , wParam , pt.x );
     2327        MENU_TrackKbdMenuBar(Win32Hwnd,wParam,pt32->x);
    23282328        break;
    2329 #endif
     2329
    23302330    case SC_TASKLIST:
    23312331        WinExec("taskman.exe",SW_SHOWNORMAL);
     
    25732573          switch(LOWORD(lParam))
    25742574          {
     2575            case HTCLIENT:
     2576              hCursor = windowClass ? windowClass->getCursor():LoadCursorA(0,IDC_ARROWA);
     2577              break;
     2578
    25752579            case HTLEFT:
    25762580            case HTRIGHT:
     
    25942598
    25952599            default:
    2596               hCursor = windowClass ? windowClass->getCursor():LoadCursorA(0,IDC_ARROWA);
     2600              hCursor = LoadCursorA(0,IDC_ARROWA);
    25972601              break;
    25982602          }
     
    27692773
    27702774    case WM_CANCELMODE:
    2771         //if (getParent() == windowDesktop) EndMenu();
     2775        if (getParent() == windowDesktop) EndMenu();
    27722776        if (GetCapture() == Win32Hwnd) ReleaseCapture();
    27732777        return 0;
Note: See TracChangeset for help on using the changeset viewer.