Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Public Attributes
CalendarWizard.ScCalendar Class Reference
Inheritance diagram for CalendarWizard.ScCalendar:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def setupDocVariables
def goldenMean
def applyTextToFrame
def createCalendar
def createLayout
def createPage

Public Attributes

 drawSauce
 year
 months
 dayOrder
 layerImg
 layerCal
 pStyle
 firstPage
 pagex
 pagey
 marginl
 marginr
 margint
 marginb
 width
 height

Detailed Description

Parent class for all calendar types 

Definition at line 156 of file CalendarWizard.py.


Constructor & Destructor Documentation

def CalendarWizard.ScCalendar.__init__ (   self,
  year,
  months = {},
  dayOrder = [],
  firstDay = calendar.SUNDAY,
  drawSauce = True 
)
Setup base things 

Reimplemented in CalendarWizard.ScClassicCalendar, and CalendarWizard.ScEventCalendar.

Definition at line 159 of file CalendarWizard.py.

00159 
00160     def __init__(self, year, months={}, dayOrder=[], firstDay=calendar.SUNDAY, drawSauce=True):
00161         """ Setup base things """
00162         # params
00163         self.drawSauce = drawSauce # draw supplementary image?
00164         self.year = year
00165         self.months = months
00166         self.dayOrder = dayOrder
00167         self.layerImg = 'Calendar image'
00168         self.layerCal = 'Calendar'
00169         self.pStyle = None # paragraph style
00170         # settings
00171         self.firstPage = True # create only 2nd 3rd ... pages. No 1st one.
00172         calendar.setfirstweekday(firstDay)
00173         progressTotal(len(months))


Member Function Documentation

def CalendarWizard.ScCalendar.applyTextToFrame (   self,
  aText,
  aFrame 
)
Insert the text with style. 

Definition at line 193 of file CalendarWizard.py.

00193 
00194     def applyTextToFrame(self, aText, aFrame):
00195         """ Insert the text with style. """
00196         setText(aText, aFrame)
00197         setStyle(self.pStyle, aFrame)

Here is the caller graph for this function:

Walk throudh months dict and calls monthly sheet 

Definition at line 198 of file CalendarWizard.py.

00198 
00199     def createCalendar(self):
00200         """ Walk throudh months dict and calls monthly sheet """
00201         if not newDocDialog():
00202             return 'Create a new document first, please'
00203         self.pStyle = newStyleDialog()
00204         if  self.pStyle == None:
00205             closeDoc()
00206             return 'Create a default paragraph style, please'
00207         originalUnit = getUnit()
00208         setUnit(UNIT_POINTS)
00209         self.setupDocVariables()
00210         if self.drawSauce:
00211             createLayer(self.layerImg)
00212         createLayer(self.layerCal)
00213         run = 0
00214         for i in self.months:
00215             run += 1
00216             progressSet(run)
00217             self.createMonthCalendar(i)
00218         setUnit(originalUnit)
00219         return None

Here is the call graph for this function:

Create the page and optional bells and whistless around 

Definition at line 220 of file CalendarWizard.py.

00220 
00221     def createLayout(self):
00222         """ Create the page and optional bells and whistless around """
00223         self.createPage()
00224         if self.drawSauce:
00225             setActiveLayer(self.layerImg)
00226             self.createImage()
00227         setActiveLayer(self.layerCal)

Here is the call graph for this function:

Here is the caller graph for this function:

Wrapper to the new page with layers 

Definition at line 228 of file CalendarWizard.py.

00228 
00229     def createPage(self):
00230         """ Wrapper to the new page with layers """
00231         if self.firstPage:
00232             self.firstPage = False
00233             gotoPage(1)
00234             return
00235         newPage(-1)
00236 

Here is the caller graph for this function:

def CalendarWizard.ScCalendar.goldenMean (   self,
  aSize 
)
Taken from samples/golden-mean.py.

Definition at line 189 of file CalendarWizard.py.

00189 
00190     def goldenMean(self, aSize):
00191         """ Taken from samples/golden-mean.py."""
00192         return aSize * ((sqrt(5) - 1)/2)

Compute base metrics here. Page layout is bordered by margins and
virtually divided by golden mean 'cut' in the bottom. The calendar is
in the bottom part - top is occupied with empty image frame. 

Reimplemented in CalendarWizard.ScClassicCalendar, and CalendarWizard.ScEventCalendar.

Definition at line 174 of file CalendarWizard.py.

00174 
00175     def setupDocVariables(self):
00176         """ Compute base metrics here. Page layout is bordered by margins and
00177         virtually divided by golden mean 'cut' in the bottom. The calendar is
00178         in the bottom part - top is occupied with empty image frame. """
00179         page = getPageSize()
00180         self.pagex = page[0]
00181         self.pagey = page[1]
00182         marg = getPageMargins()
00183         self.marginl = marg[0]
00184         self.marginr = marg[1]
00185         self.margint = marg[2]
00186         self.marginb = marg[3]
00187         self.width = self.pagex - self.marginl - self.marginr
00188         self.height = self.pagey - self.margint - self.marginb

Here is the caller graph for this function:


Member Data Documentation

Definition at line 165 of file CalendarWizard.py.

Definition at line 162 of file CalendarWizard.py.

Definition at line 170 of file CalendarWizard.py.

Definition at line 187 of file CalendarWizard.py.

Definition at line 167 of file CalendarWizard.py.

Definition at line 166 of file CalendarWizard.py.

Definition at line 185 of file CalendarWizard.py.

Definition at line 182 of file CalendarWizard.py.

Definition at line 183 of file CalendarWizard.py.

Definition at line 184 of file CalendarWizard.py.

Definition at line 164 of file CalendarWizard.py.

Definition at line 179 of file CalendarWizard.py.

Definition at line 180 of file CalendarWizard.py.

Definition at line 168 of file CalendarWizard.py.

Definition at line 186 of file CalendarWizard.py.

Definition at line 163 of file CalendarWizard.py.


The documentation for this class was generated from the following file: