Commit 43ac3d6b authored by Klaas van Gend's avatar Klaas van Gend Committed by Alexandre Julliard

- added Collate/NoCollate Icons to Print32 dialog (unfortunately they

don't display yet). - added status strings. - added string table for internationalisation of several internal message boxes.
parent 4e40dc0e
......@@ -195,6 +195,7 @@ FONT 8, "Helv"
}
/* NOTE: Please, do not translate the PRINT32 dialog box yet! */
PRINT32 DIALOG LOADONCALL MOVEABLE DISCARDABLE 32, 32, 288, 186
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU |
DS_CONTEXTHELP | DS_3DLOOK
......@@ -356,3 +357,38 @@ aa aa a2 00 43 02'}
/* NOTE: Please, do not translate these texts yet! */
STRINGTABLE DISCARDABLE
{
PD32_PRINT_ALL_X_PAGES "&All %d pages"
PD32_PRINT_TITLE "Print"
PD32_INVALID_PAGE_RANGE "This value lies not within Page range\n\
Please enter a value between %d and %d"
PRINTER_STATUS_PAUSED "Paused"
PRINTER_STATUS_ERROR "Error"
PRINTER_STATUS_PENDING_DELETION "Pending deletion"
PRINTER_STATUS_PAPER_JAM "Paper jam"
PRINTER_STATUS_PAPER_OUT "Out of paper"
PRINTER_STATUS_MANUAL_FEED "Feed paper manual"
PRINTER_STATUS_PAPER_PROBLEM "Paper problem"
PRINTER_STATUS_OFFLINE "Printer offline"
PRINTER_STATUS_IO_ACTIVE "I/O Active"
PRINTER_STATUS_BUSY "Busy"
PRINTER_STATUS_PRINTING "Printing"
PRINTER_STATUS_OUTPUT_BIN_FULL "Output tray is full"
PRINTER_STATUS_NOT_AVAILABLE "Not available"
PRINTER_STATUS_WAITING "Waiting"
PRINTER_STATUS_PROCESSING "Processing"
PRINTER_STATUS_INITIALIZING "Initialising"
PRINTER_STATUS_WARMING_UP "Warming up"
PRINTER_STATUS_TONER_LOW "Toner low"
PRINTER_STATUS_NO_TONER "No toner"
PRINTER_STATUS_PAGE_PUNT "Page punt"
PRINTER_STATUS_USER_INTERVENTION "User intervention required"
PRINTER_STATUS_OUT_OF_MEMORY "Out of memory"
PRINTER_STATUS_DOOR_OPEN "The printer door is open"
PRINTER_STATUS_SERVER_UNKNOWN "Print server unknown"
PRINTER_STATUS_POWER_SAVE "Power safe mode"
}
......@@ -85,6 +85,8 @@ typedef struct
DWORD NrOfPrinterInfoEntries;
LPPRINTDLGA lpPrintDlg;
UINT HelpMessageID;
HICON hCollateIcon;
HICON hNoCollateIcon;
} PRINT_PTRA;
/***********************************************************************
......@@ -104,6 +106,7 @@ typedef struct
* BUGS
* The function is a stub only, returning TRUE to allow more programs
* to function.
* The Collate Icons do not display, even though they are in the code.
*/
BOOL WINAPI PrintDlgA(
LPPRINTDLGA lppd /* ptr to PRINTDLG32 struct */
......@@ -133,6 +136,7 @@ BOOL WINAPI PrintDlgA(
FIXME("KVG (%p): stub\n", lppd);
PrintStructures.lpPrintDlg = lppd;
/* load Dialog */
if (!(hResInfo = FindResourceA(COMDLG32_hInstance, "PRINT32", RT_DIALOGA)))
{
COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
......@@ -145,6 +149,18 @@ BOOL WINAPI PrintDlgA(
return FALSE;
}
/* load Collate ICON */
PrintStructures.hCollateIcon =
LoadIconA(COMDLG32_hInstance, "PD32_COLLATE");
PrintStructures.hNoCollateIcon =
LoadIconA(COMDLG32_hInstance, "PD32_NOCOLLATE");
if (PrintStructures.hCollateIcon==0 || PrintStructures.hNoCollateIcon==0)
{
puts("Error: no icon?");
COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
return FALSE;
}
/*
* if lppd->Flags PD_SHOWHELP is specified, a HELPMESGSTRING message
* must be registered and the Help button must be shown.
......@@ -223,6 +239,8 @@ BOOL WINAPI PrintDlgA(
bRet = DIALOG_DoDialogBox(hwndDialog, lppd->hwndOwner);
free(PrintStructures.lpPrinterInfo);
DeleteObject(PrintStructures.hCollateIcon);
DeleteObject(PrintStructures.hNoCollateIcon);
return bRet;
}
......@@ -246,6 +264,7 @@ static void PRINTDLG_UpdatePrinterInfoTexts(HWND hDlg, PRINT_PTRA* PrintStructur
{
char PrinterName[256];
char StatusMsg[256];
char ResourceString[256];
int i;
LPPRINTER_INFO_2A lpPi = NULL;
GetDlgItemTextA(hDlg, cmb4, PrinterName, 255);
......@@ -257,9 +276,25 @@ static void PRINTDLG_UpdatePrinterInfoTexts(HWND hDlg, PRINT_PTRA* PrintStructur
if (strcmp(lpPi->pPrinterName, PrinterName)==0)
break;
}
/* FIXME: the status byte must be converted to user-understandable text...*/
sprintf(StatusMsg,"%ld = 0x%08lx", lpPi->Status, lpPi->Status);
/* Status Message */
StatusMsg[0]='\0';
for (i=0; i< 25; i++)
{
if (lpPi->Status & (1<<i))
{
LoadStringA(COMDLG32_hInstance, (1<<i),
ResourceString, 255);
if (StatusMsg[0]!='\0') /* append ; before next item */
lstrcatA(StatusMsg, "; ");
lstrcatA(StatusMsg,ResourceString);
}
}
if (StatusMsg[0]=='\0') /* no Status ??? */
LoadStringA(COMDLG32_hInstance, PRINTER_STATUS_NOT_AVAILABLE,
StatusMsg, 255);
SendDlgItemMessageA(hDlg, stc12, WM_SETTEXT, 0, (LPARAM)StatusMsg);
SendDlgItemMessageA(hDlg, stc11, WM_SETTEXT, 0, (LPARAM)lpPi->pDriverName);
if (lpPi->pLocation != NULL && lpPi->pLocation[0]!='\0')
SendDlgItemMessageA(hDlg, stc14, WM_SETTEXT, 0,(LPARAM)lpPi->pLocation);
......@@ -340,13 +375,33 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
if (lppd->Flags & PD_PAGENUMS)
CheckRadioButton(hDlg, rad1, rad3, rad3);
}
/* FIXME: in Win95, the radiobutton "All" is displayed as
* "Print all xxx pages"... This is not done here (yet?)
*/
/* "All xxx pages"... */
{
char resourcestr[64];
char result[64];
LoadStringA(COMDLG32_hInstance, PD32_PRINT_ALL_X_PAGES,
resourcestr, 49);
sprintf(result,resourcestr,lppd->nMaxPage-lppd->nMinPage);
SendDlgItemMessageA(hDlg, rad1, WM_SETTEXT, 0,
(LPARAM) result);
}
/* Collate pages */
/* Collate pages
*
* FIXME: The ico3 is not displayed for some reason. I don't know why.
*/
if (lppd->Flags & PD_COLLATE)
FIXME("PD_COLLATE not implemented yet\n");
{
SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)PrintStructures->hCollateIcon);
CheckDlgButton(hDlg, chx2, 1);
}
else
{
SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)PrintStructures->hNoCollateIcon);
CheckDlgButton(hDlg, chx2, 0);
}
/* print to file */
CheckDlgButton(hDlg, chx1, (lppd->Flags & PD_PRINTTOFILE) ? 1 : 0);
......@@ -355,15 +410,12 @@ static LRESULT PRINTDLG_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam,
if (lppd->Flags & PD_HIDEPRINTTOFILE)
ShowWindow(GetDlgItem(hDlg, chx1), SW_HIDE);
/* status */
/* help button */
if ((lppd->Flags & PD_SHOWHELP)==0)
{ /* hide if PD_SHOWHELP not specified */
ShowWindow(GetDlgItem(hDlg, pshHelp), SW_HIDE);
}
TRACE("succesful!\n");
return TRUE;
}
......@@ -394,13 +446,15 @@ static BOOL PRINTDLG_ValidateAndDuplicateSettings(HWND hDlg,
if (nFromPage < lppd->nMinPage || nFromPage > lppd->nMaxPage ||
nToPage < lppd->nMinPage || nToPage > lppd->nMaxPage)
{
char TempBuffer[256];
FIXME("This MessageBox is not internationalised.");
sprintf(TempBuffer, "This value lies not within Page range\n"
"Please enter a value between %d and %d",
lppd->nMinPage, lppd->nMaxPage);
MessageBoxA(hDlg, TempBuffer, "Print", MB_OK | MB_ICONWARNING);
return(FALSE);
char resourcestr[256];
char resultstr[256];
LoadStringA(COMDLG32_hInstance, PD32_INVALID_PAGE_RANGE,
resourcestr, 255);
sprintf(resultstr,resourcestr, lppd->nMinPage, lppd->nMaxPage);
LoadStringA(COMDLG32_hInstance, PD32_PRINT_TITLE,
resourcestr, 255);
MessageBoxA(hDlg, resultstr, resourcestr, MB_OK | MB_ICONWARNING);
return(FALSE);
}
lppd->nFromPage = nFromPage;
lppd->nToPage = nToPage;
......@@ -410,7 +464,12 @@ static BOOL PRINTDLG_ValidateAndDuplicateSettings(HWND hDlg,
{
lppd->Flags |= PD_PRINTTOFILE;
/* FIXME: insert code to set "FILE:" in DEVNAMES structure */
}
}
if (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED)
{
FIXME("Collate lppd not yet implemented as output\n");
}
return(TRUE);
}
......@@ -441,8 +500,16 @@ static LRESULT PRINTDLG_WMCommand(HWND hDlg, WPARAM wParam,
SendMessageA(lppd->hwndOwner, PrintStructures->HelpMessageID,
(WPARAM) hDlg, (LPARAM) lppd);
break;
case edt1: /* from page nr editbox */
case edt2: /* to page nr editbox */
case chx2: /* collate pages checkbox */
if (IsDlgButtonChecked(hDlg, chx2) == BST_CHECKED)
SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)PrintStructures->hCollateIcon);
else
SendDlgItemMessageA(hDlg, ico3, STM_SETIMAGE, (WPARAM) IMAGE_ICON,
(LPARAM)PrintStructures->hNoCollateIcon);
break;
case edt1: /* from page nr editbox */
case edt2: /* to page nr editbox */
if (HIWORD(wParam)==EN_CHANGE)
{
WORD nToPage;
......@@ -453,7 +520,7 @@ static LRESULT PRINTDLG_WMCommand(HWND hDlg, WPARAM wParam,
CheckRadioButton(hDlg, rad1, rad3, rad3);
}
break;
case psh2: /* Properties button */
case psh2: /* Properties button */
{
HANDLE hPrinter;
char PrinterName[256];
......@@ -467,7 +534,7 @@ static LRESULT PRINTDLG_WMCommand(HWND hDlg, WPARAM wParam,
WARN(" Call to OpenPrinter did not succeed!\n");
break;
}
case cmb4: /* Printer combobox */
case cmb4: /* Printer combobox */
if (HIWORD(wParam)==CBN_SELCHANGE)
PRINTDLG_UpdatePrinterInfoTexts(hDlg, PrintStructures);
break;
......
......@@ -6,6 +6,8 @@
#include "winuser.h"
#include "winnls.h"
#include "dlgs.h"
#include "cdlg.h"
#include "winspool.h"
/*
* Everything that does not depend on language,
......
......@@ -55,6 +55,34 @@ extern "C" {
#define PRINTER_ENUM_ICON7 0x00400000
#define PRINTER_ENUM_ICON8 0x00800000
/* various printer statuses */
#define PRINTER_STATUS_PAUSED 0x00000001
#define PRINTER_STATUS_ERROR 0x00000002
#define PRINTER_STATUS_PENDING_DELETION 0x00000004
#define PRINTER_STATUS_PAPER_JAM 0x00000008
#define PRINTER_STATUS_PAPER_OUT 0x00000010
#define PRINTER_STATUS_MANUAL_FEED 0x00000020
#define PRINTER_STATUS_PAPER_PROBLEM 0x00000040
#define PRINTER_STATUS_OFFLINE 0x00000080
#define PRINTER_STATUS_IO_ACTIVE 0x00000100
#define PRINTER_STATUS_BUSY 0x00000200
#define PRINTER_STATUS_PRINTING 0x00000400
#define PRINTER_STATUS_OUTPUT_BIN_FULL 0x00000800
#define PRINTER_STATUS_NOT_AVAILABLE 0x00001000
#define PRINTER_STATUS_WAITING 0x00002000
#define PRINTER_STATUS_PROCESSING 0x00004000
#define PRINTER_STATUS_INITIALIZING 0x00008000
#define PRINTER_STATUS_WARMING_UP 0x00010000
#define PRINTER_STATUS_TONER_LOW 0x00020000
#define PRINTER_STATUS_NO_TONER 0x00040000
#define PRINTER_STATUS_PAGE_PUNT 0x00080000
#define PRINTER_STATUS_USER_INTERVENTION 0x00100000
#define PRINTER_STATUS_OUT_OF_MEMORY 0x00200000
#define PRINTER_STATUS_DOOR_OPEN 0x00400000
#define PRINTER_STATUS_SERVER_UNKNOWN 0x00800000
#define PRINTER_STATUS_POWER_SAVE 0x01000000
/* TYPES */
typedef struct _PRINTER_DEFAULTSA {
LPSTR pDatatype;
......
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