Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Public Attributes
CalendarWizard.ScEventCalendar Class Reference
Inheritance diagram for CalendarWizard.ScEventCalendar:
Inheritance graph
[legend]
Collaboration diagram for CalendarWizard.ScEventCalendar:
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
 rowSize
 drawSauce
 year
 months
 dayOrder
 layerImg
 layerCal
 pStyle
 firstPage
 pagex
 pagey
 marginl
 marginr
 margint
 marginb
 width
 height

Detailed Description

One day = one row calendar. I suggest LANDSCAPE orientation.\
    One week per page.

Definition at line 237 of file CalendarWizard.py.


Constructor & Destructor Documentation

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

Reimplemented from CalendarWizard.ScCalendar.

Definition at line 241 of file CalendarWizard.py.

00241 
00242     def __init__(self, year, months = {}, dayOrder = [], firstDay = calendar.SUNDAY, drawSauce=True):
00243         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.ScEventCalendar.createHeader (   self,
  monthName 
)

Definition at line 269 of file CalendarWizard.py.

00269 
00270     def createHeader(self, monthName):
00271         cel = createText(self.gmean + self.marginl, self.margint,
00272                             self.width - self.gmean, self.rowSize)
00273         self.applyTextToFrame(monthName, cel)

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 274 of file CalendarWizard.py.

00274 
00275     def createImage(self):
00276         """ Wrapper for everytime-the-same image frame. """
00277         if self.drawSauce:
00278             createImage(self.marginl, self.margint, self.gmean, self.height)

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:

Definition at line 255 of file CalendarWizard.py.

00255 
00256     def createMonthCalendar(self, month):
00257         cal = calendar.monthcalendar(self.year, month + 1)
00258         for i in cal:
00259             self.createLayout()
00260             self.createHeader(self.months[month])
00261             rowCnt = 1
00262             for j in i: # days
00263                 cel = createText(self.gmean + self.marginl,
00264                                  self.margint + rowCnt * self.rowSize,
00265                                  self.width - self.gmean, self.rowSize)
00266                 rowCnt += 1
00267                 if j != 0:
00268                     self.applyTextToFrame(str(j), cel)

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 244 of file CalendarWizard.py.

00244 
00245     def setupDocVariables(self):
00246         """ Compute base metrics here. Page layout is bordered by margins and
00247         virtually divided by golden mean 'cut' in the bottom. The calendar is
00248         in the bottom part - top is occupied with empty image frame. """
00249         # gloden mean
00250         ScCalendar.setupDocVariables(self)
00251         self.gmean = self.width - self.goldenMean(self.width) + self.marginl
00252         # calendar size = gmean
00253         # rows and cols
00254         self.rowSize = self.height / 8


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 250 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 253 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: