Commit 197a8e16 authored by Francois Boisvert's avatar Francois Boisvert Committed by Alexandre Julliard

Implemented the WIN31 Look mdi buttons and also some defines for the

magic menu items.
parent b67af9cd
......@@ -22,6 +22,7 @@
#include "sysmetrics.h"
#include "task.h"
#include "heap.h"
#include "menu.h"
#include "module.h"
#include "neexe.h"
#include "nonclient.h"
......@@ -611,9 +612,9 @@ static HBITMAP32 MENU_LoadMagicItem(UINT32 id,BOOL32 hilite)
switch(id)
{
case 3 : return (hilite ? hBmpMinimizeD : hBmpMinimize);
case 2 : return (hilite ? hBmpMaximizeD: hBmpMaximize);
case 5 : return (hilite ? hBmpClose : hBmpClose);
case MAGIC_REDUCE : return (hilite ? hBmpMinimizeD : hBmpMinimize);
case MAGIC_RESTORE : return (hilite ? hBmpMaximizeD: hBmpMaximize);
case MAGIC_CLOSE : return (hilite ? hBmpClose : hBmpClose);
default : return 0;
}
......
......@@ -5,6 +5,10 @@
#ifndef __WINE_MENU_H
#define __WINE_MENU_H
#define MAGIC_REDUCE 3
#define MAGIC_RESTORE 2
#define MAGIC_CLOSE 5
extern BOOL32 MENU_Init(void);
extern HMENU32 MENU_GetSysMenu(HWND32 hWndOwner, HMENU32 hSysPopup);
extern UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth,
......
......@@ -25,6 +25,7 @@
#include "resource.h"
#include "struct32.h"
#include "sysmetrics.h"
#include "tweak.h"
#include "debug.h"
#define MDIF_NEEDUPDATE 0x0001
......@@ -775,20 +776,24 @@ static BOOL32 MDI_AugmentFrameMenu( MDICLIENTINFO* ci, WND *frame,
TRACE(mdi,"\tgot popup %04x in sysmenu %04x\n",
hSysPopup, child->hSysMenu);
AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP,
SC_MINIMIZE, (LPSTR)(DWORD)MAGIC_REDUCE ) ;
AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP,
SC_RESTORE, (LPSTR)(DWORD)MAGIC_RESTORE );
// The close button is only present in Win 95 look
if(TWEAK_WineLook > WIN31_LOOK)
{
if( !InsertMenu32A(frame->wIDmenu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP,
hSysPopup, (LPSTR)(DWORD)hBmpClose ))
{
TRACE(mdi,"not inserted\n");
DestroyMenu32(hSysPopup);
return 0;
}
// Using the magic menu id's to insert system buttons in the menu bar
AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP,
SC_MINIMIZE, (LPSTR)(DWORD)3 ) ;
AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP,
SC_RESTORE, (LPSTR)(DWORD)2 );
AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP,
SC_CLOSE, (LPSTR)(DWORD)5 );
SC_CLOSE, (LPSTR)(DWORD)MAGIC_CLOSE );
}
EnableMenuItem32(hSysPopup, SC_SIZE, MF_BYCOMMAND | MF_GRAYED);
EnableMenuItem32(hSysPopup, SC_MOVE, MF_BYCOMMAND | MF_GRAYED);
......@@ -806,25 +811,31 @@ static BOOL32 MDI_AugmentFrameMenu( MDICLIENTINFO* ci, WND *frame,
static BOOL32 MDI_RestoreFrameMenu( WND *frameWnd, HWND32 hChild )
{
INT32 nItems = GetMenuItemCount32(frameWnd->wIDmenu) - 1;
UINT32 iId = GetMenuItemID32(frameWnd->wIDmenu,nItems) ;
TRACE(mdi,"for child %04x\n",hChild);
TRACE(mdi,"frameWnd %p,child %04x\n",frameWnd,hChild);
if( GetMenuItemID32(frameWnd->wIDmenu,nItems) != SC_CLOSE )
if(!(iId == SC_RESTORE || iId == SC_CLOSE) )
return 0;
if(TWEAK_WineLook > WIN31_LOOK)
{
// app button
RemoveMenu32(frameWnd->wIDmenu,0,MF_BYPOSITION);
// close
DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION);
}
// restore
DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION);
// minimize
DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION);
DrawMenuBar32(frameWnd->hwndSelf);
return 1;
}
/**********************************************************************
* MDI_UpdateFrameText
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment