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

magic menu items.
This commit is contained in:
Francois Boisvert 1999-02-13 09:10:17 +00:00 committed by Alexandre Julliard
parent b67af9cd54
commit 197a8e163e
3 changed files with 31 additions and 15 deletions

View File

@ -22,6 +22,7 @@
#include "sysmetrics.h" #include "sysmetrics.h"
#include "task.h" #include "task.h"
#include "heap.h" #include "heap.h"
#include "menu.h"
#include "module.h" #include "module.h"
#include "neexe.h" #include "neexe.h"
#include "nonclient.h" #include "nonclient.h"
@ -611,9 +612,9 @@ static HBITMAP32 MENU_LoadMagicItem(UINT32 id,BOOL32 hilite)
switch(id) switch(id)
{ {
case 3 : return (hilite ? hBmpMinimizeD : hBmpMinimize); case MAGIC_REDUCE : return (hilite ? hBmpMinimizeD : hBmpMinimize);
case 2 : return (hilite ? hBmpMaximizeD: hBmpMaximize); case MAGIC_RESTORE : return (hilite ? hBmpMaximizeD: hBmpMaximize);
case 5 : return (hilite ? hBmpClose : hBmpClose); case MAGIC_CLOSE : return (hilite ? hBmpClose : hBmpClose);
default : return 0; default : return 0;
} }

View File

@ -5,6 +5,10 @@
#ifndef __WINE_MENU_H #ifndef __WINE_MENU_H
#define __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 BOOL32 MENU_Init(void);
extern HMENU32 MENU_GetSysMenu(HWND32 hWndOwner, HMENU32 hSysPopup); extern HMENU32 MENU_GetSysMenu(HWND32 hWndOwner, HMENU32 hSysPopup);
extern UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth, extern UINT32 MENU_GetMenuBarHeight( HWND32 hwnd, UINT32 menubarWidth,

View File

@ -25,6 +25,7 @@
#include "resource.h" #include "resource.h"
#include "struct32.h" #include "struct32.h"
#include "sysmetrics.h" #include "sysmetrics.h"
#include "tweak.h"
#include "debug.h" #include "debug.h"
#define MDIF_NEEDUPDATE 0x0001 #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", TRACE(mdi,"\tgot popup %04x in sysmenu %04x\n",
hSysPopup, child->hSysMenu); 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, if( !InsertMenu32A(frame->wIDmenu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP,
hSysPopup, (LPSTR)(DWORD)hBmpClose )) hSysPopup, (LPSTR)(DWORD)hBmpClose ))
{ {
TRACE(mdi,"not inserted\n");
DestroyMenu32(hSysPopup); DestroyMenu32(hSysPopup);
return 0; return 0;
} }
// Using the magic menu id's to insert system buttons in the menu bar
AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP, AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP,
SC_MINIMIZE, (LPSTR)(DWORD)3 ) ; SC_CLOSE, (LPSTR)(DWORD)MAGIC_CLOSE );
AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP, }
SC_RESTORE, (LPSTR)(DWORD)2 );
AppendMenu32A(frame->wIDmenu,MF_HELP | MF_BITMAP,
SC_CLOSE, (LPSTR)(DWORD)5 );
EnableMenuItem32(hSysPopup, SC_SIZE, MF_BYCOMMAND | MF_GRAYED); EnableMenuItem32(hSysPopup, SC_SIZE, MF_BYCOMMAND | MF_GRAYED);
EnableMenuItem32(hSysPopup, SC_MOVE, 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 ) static BOOL32 MDI_RestoreFrameMenu( WND *frameWnd, HWND32 hChild )
{ {
INT32 nItems = GetMenuItemCount32(frameWnd->wIDmenu) - 1; 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; return 0;
if(TWEAK_WineLook > WIN31_LOOK)
{
// app button
RemoveMenu32(frameWnd->wIDmenu,0,MF_BYPOSITION); RemoveMenu32(frameWnd->wIDmenu,0,MF_BYPOSITION);
// close
DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION); DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION);
}
// restore
DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION); DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION);
// minimize
DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION); DeleteMenu32(frameWnd->wIDmenu,GetMenuItemCount32(frameWnd->wIDmenu) - 1,MF_BYPOSITION);
DrawMenuBar32(frameWnd->hwndSelf); DrawMenuBar32(frameWnd->hwndSelf);
return 1; return 1;
} }
/********************************************************************** /**********************************************************************
* MDI_UpdateFrameText * MDI_UpdateFrameText
* *