Clock: Load license text from resources.

This commit is contained in:
Mike McCormack 2006-02-04 16:59:19 +01:00 committed by Alexandre Julliard
parent 3f2e9681a6
commit cbe8ea0517
7 changed files with 46 additions and 137 deletions

View File

@ -47,3 +47,27 @@ STRINGTABLE DISCARDABLE
{
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."
}

View File

@ -1,29 +0,0 @@
#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};

View File

@ -6,13 +6,9 @@ MODULE = clock.exe
APPMODE = -mwindows
IMPORTS = comdlg32 shell32 user32 gdi32 kernel32
LICENSELANG = En
C_SRCS = \
license.c \
main.c \
winclock.c \
$(LICENSELANG:%=License_%.c)
winclock.c
RC_SRCS = rsrc.rc

View File

@ -31,3 +31,8 @@
#define IDM_ONTOP 0x113
#define IDS_CLOCK 0x10C
#define IDS_LICENSE_CAPTION 0x120
#define IDS_LICENSE 0x121
#define IDS_WARRANTY_CAPTION 0x122
#define IDS_WARRANTY 0x123

View File

@ -1,40 +0,0 @@
/*
* 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);
}

View File

@ -1,62 +0,0 @@
/*
* 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;
*/

View File

@ -29,7 +29,6 @@
#include "commdlg.h"
#include "main.h"
#include "license.h"
#include "winclock.h"
#define INITIAL_WINDOW_SIZE 200
@ -37,6 +36,22 @@
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)
{
HMENU hPropertiesMenu;