Class: WR::Printer

Inherits:
RWin::Printer show all
Defined in:
lib/wrb/components/printer.rb

Overview

Provides an interface that allows an application to access the printer.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RWin::Printer

GetDefaultPrinter, #_devmode, #_hdc, #close, #open, #print

Constructor Details

#initialize(device) ⇒ Printer

Returns a new instance of Printer.



28
29
30
31
# File 'lib/wrb/components/printer.rb', line 28

def initialize(device)
  super
  @_devmode = self._devmode if self._hdc==0
end

Class Method Details

.open(dev) ⇒ Object

Following methods are defined at the super class. :singleton_methods

self.GetDefaultPrinter()

:instance_methods

_devmode()
_hdc()
close()
open()
print()


22
23
24
25
26
# File 'lib/wrb/components/printer.rb', line 22

def self.open(dev)
  return nil unless dev
  prt = self.new(dev)
  prt.open
end

Instance Method Details

#copiesObject



72
73
74
# File 'lib/wrb/components/printer.rb', line 72

def copies()
  @_devmode.dmCopies
end

#copies=(n) ⇒ Object



75
76
77
# File 'lib/wrb/components/printer.rb', line 75

def copies=(n)
  @_devmode.dmCopies = n
end

#devicenameObject



33
34
35
# File 'lib/wrb/components/printer.rb', line 33

def devicename()
  @_devmode.dmDeviceName.to_s
end

#orientation(o) ⇒ Object



44
45
46
# File 'lib/wrb/components/printer.rb', line 44

def orientation()
  @_devmode.dmOrientation
end

#paperlengthObject



58
59
60
# File 'lib/wrb/components/printer.rb', line 58

def paperlength()
  @_devmode.dmPaperLength
end

#paperlength=(l) ⇒ Object



61
62
63
# File 'lib/wrb/components/printer.rb', line 61

def paperlength=(l)
  @_devmode.dmPaperLength = l
end

#papersizeObject



51
52
53
# File 'lib/wrb/components/printer.rb', line 51

def papersize()
  @_devmode.dmPaperSize
end

#papersize=(s) ⇒ Object



54
55
56
# File 'lib/wrb/components/printer.rb', line 54

def papersize=(s)
  @_devmode.dmPaperSize = s
end

#paperwidthObject



65
66
67
# File 'lib/wrb/components/printer.rb', line 65

def paperwidth()
  @_devmode.dmPaperWidth
end

#paperwidth=(w) ⇒ Object



68
69
70
# File 'lib/wrb/components/printer.rb', line 68

def paperwidth=(w)
  @_devmode.dmPaperWidth = w
end

#scaleObject



37
38
39
# File 'lib/wrb/components/printer.rb', line 37

def scale()
  @_devmode.dmScale
end

#scale=(s) ⇒ Object



40
41
42
# File 'lib/wrb/components/printer.rb', line 40

def scale=(s)
  @_devmode.dmScale = s
end