DAS  3.1.6 - 18/09/2017
Functions
D_print.c File Reference

DAS printer tool. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mgui.h"
#include "bil.h"
#include "DAS_Spatram.h"
+ Include dependency graph for D_print.c:

Go to the source code of this file.

Functions

int PrintObject (MOBJECT obj, int mode, int x, int y)
 
void SetupPrinter (void)
 

Detailed Description

DAS printer tool.

Author
Daniele Bortoli (09/09/2003)

Definition in file D_print.c.

Function Documentation

§ PrintObject()

int PrintObject ( MOBJECT  obj,
int  mode,
int  x,
int  y 
)

Definition at line 37 of file D_print.c.

References False, MMessageDialog(), MObjectGetHeight(), MObjectGetWidth(), MObjectRedraw(), and MShellRaise().

Referenced by D_PButt_CB(), and MenuToolsOLP_CB().

38 {
39 
40  MPRINT_OPTIONS pe ;
41  DOC_ID did;
42  MPAGE_OPTIONS pages;
43 
44 
45  pages.startPage = pages.minPage = 1;
46  pages.endPage = pages.maxPage = 1;
47  did = MOpenPrintDoc("Print Test", False, PO_PORTRAIT, &pages);
48  if (did == NULL)
49  {
50  MMessageDialog("", "Print aborted", "Ok", NULL);
51  return 1;
52  }
53 
54  pe.mode = mode;
55  pe.x = x;
56  pe.y = y;
57  pe.w = MObjectGetWidth(obj);
58  pe.h = MObjectGetHeight(obj);
59 
60  MObjectRedraw(obj);
61  MPrintObject(obj, did, &pe);
62  MClosePrintDoc(did);
63 
64  MShellRaise(obj);
65 
66  return 0;
67 }
int MObjectGetHeight(MOBJECT obj)
#define False
Definition: Mguidefs.h:236
int MObjectGetWidth(MOBJECT obj)
void MObjectRedraw(MOBJECT obj)
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
void MShellRaise(MOBJECT obj)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ SetupPrinter()

void SetupPrinter ( void  )

Definition at line 14 of file D_print.c.

References MMessageDialog().

Referenced by D_PButt_CB(), and MenuToolsOLP_CB().

15 {
16  int MPrintSetup(int po, int *xres, int *yres, int *pwidth, int *pheight, int *nplanes);
17  int xres, yres, pwidth, plength, nplanes;
18 
19  if (MPrintSetup(PO_DEFAULT, &xres, &yres, &pwidth, &plength, &nplanes))
20  {
21  char buf[128];
22 
23  sprintf(buf,
24  "Setup options:\n\
25  Paper width: %d (mm)\n\
26  Paper length: %d (mm)\n\
27  X res: %d (pixels)\n\
28  Y res: %d (pixels)\n\
29  Planes: %d",
30  pwidth, plength, xres, yres, nplanes);
31 
32  MMessageDialog("", buf, "Ok", NULL);
33  }
34 }
int MMessageDialog(const char *t, const char *msg, const char *btn1, const char *btn2,...)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:
______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:27 for DAS - Rel. 3.1.6 - 18/09/2017.