HBRUSH *brushes;
HPEN *pens;
HRGN clip;
- HMENU typemenu;
+ HMENU gamemenu, typemenu;
UINT timer;
DWORD timer_last_tickcount;
int npresets;
};
static void update_type_menu_tick(frontend *fe);
+static void update_copy_menu_greying(frontend *fe);
void fatal(char *fmt, ...)
{
* Work out what that comes to in pixels.
*/
pox = (int)(mmox * (float)ppw / mmpw);
- poy = (int)(mmoy * (float)ppw / mmpw);
+ poy = (int)(mmoy * (float)pph / mmph);
/*
* And determine the scale.
HMENU menu = SHGetSubMenu(SHFindMenuBar(fe->hwnd), ID_GAME);
DeleteMenu(menu, 0, MF_BYPOSITION);
#endif
+ fe->gamemenu = menu;
AppendMenu(menu, MF_ENABLED, IDM_NEW, TEXT("&New"));
AppendMenu(menu, MF_ENABLED, IDM_RESTART, TEXT("&Restart"));
#ifndef _WIN32_WCE
AppendMenu(menu, MF_ENABLED, IDM_UNDO, TEXT("Undo"));
AppendMenu(menu, MF_ENABLED, IDM_REDO, TEXT("Redo"));
#ifndef _WIN32_WCE
- if (thegame.can_format_as_text) {
+ if (thegame.can_format_as_text_ever) {
AppendMenu(menu, MF_SEPARATOR, 0, 0);
AppendMenu(menu, MF_ENABLED, IDM_COPY, TEXT("&Copy"));
}
SetForegroundWindow(fe->hwnd);
update_type_menu_tick(fe);
+ update_copy_menu_greying(fe);
midend_redraw(fe->me);
DrawMenuBar(fe->hwnd);
}
+static void update_copy_menu_greying(frontend *fe)
+{
+ UINT enable = (midend_can_format_as_text_now(fe->me) ?
+ MF_ENABLED : MF_GRAYED);
+ EnableMenuItem(fe->gamemenu, IDM_COPY, MF_BYCOMMAND | enable);
+}
+
static void new_game_type(frontend *fe)
{
midend_new_game(fe->me);
new_game_size(fe);
update_type_menu_tick(fe);
+ update_copy_menu_greying(fe);
}
static int is_alt_pressed(void)