Back to index

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

List of all members.

Public Member Functions

def __init__
def setupDocVariables
def createMonthCalendar
def createHeader
def createImage
def goldenMean
def applyTextToFrame
def createCalendar
def createLayout
def createPage

Public Attributes

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

Detailed Description

Calendar matrix creator itself. I suggest PORTRAIT orientation.
    One month per page.

Definition at line 279 of file CalendarWizard.py.


Constructor & Destructor Documentation

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

Reimplemented from CalendarWizard.ScCalendar.

Definition at line 283 of file CalendarWizard.py.

00283 
00284     def __init__(self, year, months = {}, dayOrder = [], firstDay = calendar.SUNDAY, drawSauce=True):
00285         ScCalendar.__init__(self, year, months, dayOrder, firstDay, drawSauce)


Member Function Documentation

def CalendarWizard.ScCalendar.applyTextToFrame (   self,
  aText,
  aFrame 
) [inherited]
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:

def CalendarWizard.ScCalendar.createCalendar (   self) [inherited]
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:

def CalendarWizard.ScClassicCalendar.createHeader (   self,
  monthName 
)
Draw calendar header. Month name and days of the week 

Definition at line 317 of file CalendarWizard.py.

00317 
00318     def createHeader(self, monthName):
00319         """ Draw calendar header. Month name and days of the week """
00320         header = createText(self.marginl, self.calHeight, self.width, self.rowSize)
00321         self.applyTextToFrame(monthName, header)
00322         colCnt = 0
00323         for i in self.dayOrder:
00324             cel = createText(self.marginl + colCnt * self.colSize,
00325                              self.calHeight + self.rowSize,
00326                              self.colSize, self.rowSize)
00327             self.applyTextToFrame(i, cel)
00328             colCnt += 1

Here is the call graph for this function:

Here is the caller graph for this function:

Wrapper for everytime-the-same image frame. 

Definition at line 329 of file CalendarWizard.py.

00329 
00330     def createImage(self):
00331         """ Wrapper for everytime-the-same image frame. """
00332         if self.drawSauce:
00333             createImage(self.marginl, self.margint,
00334                         self.width, self.calHeight - self.margint)
00335 

Here is the caller graph for this function:

def CalendarWizard.ScCalendar.createLayout (   self) [inherited]
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:

Draw one month calendar per page 

Definition at line 299 of file CalendarWizard.py.

00299 
00300     def createMonthCalendar(self, month):
00301         """ Draw one month calendar per page """
00302         cal = calendar.monthcalendar(self.year, month + 1)
00303         self.createLayout()
00304         self.createHeader(self.months[month])
00305         # weeks
00306         rowCnt = 2
00307         for i in cal:
00308             colCnt = 0
00309             for j in i: # days
00310                 cel = createText(self.marginl + colCnt * self.colSize,
00311                                  self.calHeight + rowCnt * self.rowSize,
00312                                  self.colSize, self.rowSize)
00313                 colCnt += 1
00314                 if j != 0:
00315                     self.applyTextToFrame(str(j), cel)
00316             rowCnt += 1

Here is the call graph for this function:

Here is the caller graph for this function:

def CalendarWizard.ScCalendar.createPage (   self) [inherited]
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 
) [inherited]
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 from CalendarWizard.ScCalendar.

Definition at line 286 of file CalendarWizard.py.

00286 
00287     def setupDocVariables(self):
00288         """ Compute base metrics here. Page layout is bordered by margins and
00289         virtually divided by golden mean 'cut' in the bottom. The calendar is
00290         in the bottom part - top is occupied with empty image frame. """
00291         # gloden mean
00292         ScCalendar.setupDocVariables(self)
00293         self.gmean = self.height - self.goldenMean(self.height) + self.margint
00294         # calendar size
00295         self.calHeight = self.height - self.gmean + self.margint
00296         # rows and cols
00297         self.rowSize = self.gmean / 8
00298         self.colSize = self.width / 7


Member Data Documentation

Definition at line 294 of file CalendarWizard.py.

Definition at line 297 of file CalendarWizard.py.

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 292 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 296 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: