[MPlayer-dev-eng] [PATCH rev] windows gui about box
Stephen Sheldon
sfsheldo at gmail.com
Mon Aug 29 01:32:07 CEST 2011
Stephen Sheldon <sfsheldo <at> gmail.com> writes:
Here is another pass on the Windows GUI about box. I got rid of tabs, space,
and used snprintf. I also had to change the Makefile to create a dependency on
version.h
Index: Makefile
===================================================================
--- Makefile (revision 34026)
+++ Makefile (working copy)
@@ -824,7 +824,7 @@
# Make sure all generated header files are created.
codec-cfg.o: codecs.conf.h
$(DEP_FILES) $(MENCODER_DEPS) $(MPLAYER_DEPS): help_mp.h
-mpcommon.o osdep/mplayer-rc.o: version.h
+mpcommon.o osdep/mplayer-rc.o gui/win32/gui.o: version.h
osdep/mplayer-rc.o: osdep/mplayer.exe.manifest
Index: gui/win32/gui.c
===================================================================
--- gui/win32/gui.c (revision 34026)
+++ gui/win32/gui.c (working copy)
@@ -46,6 +46,7 @@
#include "gui/util/mem.h"
#include "gui.h"
#include "dialogs.h"
+#include "version.h"
// HACK around bug in old mingw
#undef INVALID_FILE_ATTRIBUTES
@@ -128,6 +129,12 @@
filename[i] = tolower(filename[i]);
}
}
+static void display_about_box(HWND hWnd)
+{
+ char about_msg[512];
+ snprintf(about_msg, sizeof(about_msg), MP_TITLE, "MPlayer");
+ MessageBox(hWnd, about_msg, "About", MB_OK);
+}
static image *get_drawground(HWND hwnd)
{
@@ -202,7 +209,7 @@
display_eqwindow(gui);
break;
case evAbout:
- MessageBox(hWnd, COPYRIGHT, "About", MB_OK);
+ display_about_box(hWnd);
break;
case evIconify:
ShowWindow(hWnd, SW_MINIMIZE);
@@ -989,6 +996,9 @@
case ID_ONLINEHELP:
ShellExecute(NULL, "open", ONLINE_HELP_URL, NULL, NULL,
SW_SHOWNORMAL);
break;
+ case IDHELP_ABOUT:
+ handlemsg(hWnd, evAbout);
+ break;
}
if((IDPLAYDISK <= LOWORD(wParam)) && (LOWORD(wParam) < (IDPLAYDISK
+ 100)))
{
@@ -1158,6 +1168,7 @@
AppendMenu(gui->menu, MF_STRING, ID_PREFS, "Preferences");
AppendMenu(gui->menu, MF_STRING, ID_CONSOLE, "Debug Console");
AppendMenu(gui->menu, MF_STRING, ID_ONLINEHELP, "Online Help");
+ AppendMenu(gui->menu, MF_STRING, IDHELP_ABOUT, "About");
AppendMenu(gui->menu, MF_SEPARATOR, 0, 0);
AppendMenu(gui->menu, MF_STRING, IDEXIT, "&Exit");
}
@@ -1186,6 +1197,7 @@
AppendMenu(gui->traymenu, MF_STRING, ID_PREFS, "Preferences");
AppendMenu(gui->traymenu, MF_STRING, ID_CONSOLE, "Debug Console");
AppendMenu(gui->traymenu, MF_STRING, ID_ONLINEHELP, "Online Help");
+ AppendMenu(gui->traymenu, MF_STRING, IDHELP_ABOUT, "About");
AppendMenu(gui->traymenu, MF_SEPARATOR, 0, 0);
AppendMenu(gui->traymenu, MF_STRING, IDEXIT, "&Exit");
}
More information about the MPlayer-dev-eng
mailing list