Commit cbe8ea05 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Clock: Load license text from resources.

parent 3f2e9681
...@@ -47,3 +47,27 @@ STRINGTABLE DISCARDABLE ...@@ -47,3 +47,27 @@ STRINGTABLE DISCARDABLE
{ {
IDS_CLOCK, "Clock" IDS_CLOCK, "Clock"
} }
STRINGTABLE DISCARDABLE LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
{
IDS_LICENSE_CAPTION, "LICENSE"
IDS_LICENSE,
"This library is free software; you can redistribute it and/or \
modify it under the terms of the GNU Lesser General Public \
License as published by the Free Software Foundation; either \
version 2.1 of the License, or (at your option) any later version.\n\
This library is distributed in the hope that it will be useful, \
but WITHOUT ANY WARRANTY; without even the implied warranty of \
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \
Lesser General Public License for more details.\n\
You should have received a copy of the GNU Lesser General Public \
License along with this library; if not, write to the Free Software \
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"
IDS_WARRANTY_CAPTION, "NO WARRANTY"
IDS_WARRANTY,
"This library is distributed in the hope that it will be useful, \
but WITHOUT ANY WARRANTY; without even the implied warranty of \
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \
Lesser General Public License for more details."
}
#include "windows.h"
#include "license.h"
static CHAR LicenseCaption_En[] = "LICENSE";
static CHAR License_En[] =
"This library is free software; you can redistribute it and/or "
"modify it under the terms of the GNU Lesser General Public "
"License as published by the Free Software Foundation; either "
"version 2.1 of the License, or (at your option) any later version.\n"
"This library is distributed in the hope that it will be useful, "
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
"Lesser General Public License for more details.\n"
"You should have received a copy of the GNU Lesser General Public "
"License along with this library; if not, write to the Free Software "
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA";
static CHAR NoWarrantyCaption_En[] = "NO WARRANTY";
static CHAR NoWarranty_En[] =
"This library is distributed in the hope that it will be useful, "
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
"Lesser General Public License for more details.";
LICENSE WineLicense_En = {License_En, LicenseCaption_En,
NoWarranty_En, NoWarrantyCaption_En};
...@@ -6,13 +6,9 @@ MODULE = clock.exe ...@@ -6,13 +6,9 @@ MODULE = clock.exe
APPMODE = -mwindows APPMODE = -mwindows
IMPORTS = comdlg32 shell32 user32 gdi32 kernel32 IMPORTS = comdlg32 shell32 user32 gdi32 kernel32
LICENSELANG = En
C_SRCS = \ C_SRCS = \
license.c \
main.c \ main.c \
winclock.c \ winclock.c
$(LICENSELANG:%=License_%.c)
RC_SRCS = rsrc.rc RC_SRCS = rsrc.rc
......
...@@ -31,3 +31,8 @@ ...@@ -31,3 +31,8 @@
#define IDM_ONTOP 0x113 #define IDM_ONTOP 0x113
#define IDS_CLOCK 0x10C #define IDS_CLOCK 0x10C
#define IDS_LICENSE_CAPTION 0x120
#define IDS_LICENSE 0x121
#define IDS_WARRANTY_CAPTION 0x122
#define IDS_WARRANTY 0x123
/*
* Clock (license.c)
*
* Copyright 1998 by Marcel Baur <mbaur@g26.ethz.ch>
* Adapted from Program Manager (Original by Ulrich Schmied)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windows.h"
#include "license.h"
VOID WineLicense(HWND Wnd)
{
/* FIXME: should load strings from resources */
LICENSE *License = &WineLicense_En;
MessageBox(Wnd, License->License, License->LicenseCaption,
MB_ICONINFORMATION | MB_OK);
}
VOID WineWarranty(HWND Wnd)
{
/* FIXME: should load strings from resources */
LICENSE *License = &WineLicense_En;
MessageBox(Wnd, License->Warranty, License->WarrantyCaption,
MB_ICONEXCLAMATION | MB_OK);
}
/*
* Clock (license.h)
*
* Copyright 1998 by Marcel Baur <mbaur@g26.ethz.ch>
* Adapted from Program Manager (Original by Ulrich Schmied)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* function prototypes */
VOID WineLicense(HWND hWnd);
VOID WineWarranty(HWND hWnd);
/* typedefs */
typedef struct
{
LPCSTR License, LicenseCaption;
LPCSTR Warranty, WarrantyCaption;
} LICENSE;
/* external references */
/*
extern LICENSE WineLicense_Ca;
extern LICENSE WineLicense_Cz;
extern LICENSE WineLicense_Da;
extern LICENSE WineLicense_De;
*/
extern LICENSE WineLicense_En;
/*
extern LICENSE WineLicense_Eo;
extern LICENSE WineLicense_Es;
extern LICENSE WineLicense_Fi;
extern LICENSE WineLicense_Fr;
extern LICENSE WineLicense_Hu;
extern LICENSE WineLicense_It;
extern LICENSE WineLicense_Ko;
extern LICENSE WineLicense_No;
extern LICENSE WineLicense_Pl;
extern LICENSE WineLicense_Po;
extern LICENSE WineLicense_Sw;
extern LICENSE WineLicense_Va;
*/
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "commdlg.h" #include "commdlg.h"
#include "main.h" #include "main.h"
#include "license.h"
#include "winclock.h" #include "winclock.h"
#define INITIAL_WINDOW_SIZE 200 #define INITIAL_WINDOW_SIZE 200
...@@ -37,6 +36,22 @@ ...@@ -37,6 +36,22 @@
CLOCK_GLOBALS Globals; CLOCK_GLOBALS Globals;
static VOID WineLicense(HWND Wnd)
{
char cap[20], text[1024];
LoadString(Globals.hInstance, IDS_LICENSE, text, sizeof text);
LoadString(Globals.hInstance, IDS_LICENSE_CAPTION, cap, sizeof cap);
MessageBox(Wnd, text, cap, MB_ICONINFORMATION | MB_OK);
}
static VOID WineWarranty(HWND Wnd)
{
char cap[20], text[1024];
LoadString(Globals.hInstance, IDS_WARRANTY, text, sizeof text);
LoadString(Globals.hInstance, IDS_WARRANTY_CAPTION, cap, sizeof cap);
MessageBox(Wnd, text, cap, MB_ICONEXCLAMATION | MB_OK);
}
static VOID CLOCK_UpdateMenuCheckmarks(VOID) static VOID CLOCK_UpdateMenuCheckmarks(VOID)
{ {
HMENU hPropertiesMenu; HMENU hPropertiesMenu;
......
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