Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
FontSample.Application Class Reference

List of all members.

Public Member Functions

def __init__
def statusbarUpdate
def initialiseWidgets

Public Attributes

 listbox_frame
 leftListbox_frame
 leftLabel
 yScroll1
 xScroll1
 listbox1
 midbutton_frame
 rsingleButton
 rdoubleButton
 itemupButton
 itemdownButton
 lsingleButton
 ldoubleButton
 rightListbox_frame
 rightLabel
 yScroll2
 xScroll2
 listbox2
 preview_frame
 previewPanel
 controls_frame
 button_frame1
 pagenumSelect
 button_frame2
 tocSelect
 btnPageOneOnFirst
 button_frame3
 bindingoffsetSelect
 doublesidedSelect
 cancelButton
 okButton
 status_frame
 status0
 status1
 status2
 status3
 statusPaperSize

Private Member Functions

def __listSelectionToRight
def __listSelectionToLeft
def __listAllToRight
def __listAllToLeft
def __setSelButtonsActive
def __setAllButtonsActive
def __setButtonsState
def __itemUp
def __itemDown
def __setUpDownActive
def __testUpDownState
def __curSelectedItem
def __rsingleButtonClick
def __rdoubleButtonClick
def __lsingleButtonClick
def __ldoubleButtonClick
def __itemupButtonClick
def __itemdownButtonClick
def __tocSelectButtonClick
def __pageNumberSelectButtonClick
def __bindingoffsetSelectButtonClick
def __doubleSidedSelectButtonClick
def __wantPageOneOnFirstClick
def __cancelButtonClick
def __okButtonClick
def __configurationDlgShow
def __saveCurrentSettingsAsDefaults
def __restoreCurrentSettingsFromDefault
def __aboutDlgShow

Private Attributes

 __wantPageNum
 __wantToc
 __wantPageOneOnFirst
 __wantBindingOffset
 __wantDoubleSided

Detailed Description

Definition at line 965 of file FontSample.py.


Constructor & Destructor Documentation

def FontSample.Application.__init__ (   self,
  master = None 
)

Definition at line 967 of file FontSample.py.

00967 
00968     def __init__(self, master = None):
00969         Frame.__init__(self, master)
00970 
00971         self.grid()
00972 
00973         # Remove maximise button and resize. Not good to allow resizable window
00974         # because the listboxes are fixed width...
00975         self.master.resizable(0, 0)
00976 
00977         # build the menu...
00978         menubar = Menu(self)
00979         settingsmenu = Menu(menubar, tearoff=0)
00980         settingsmenu.add_command(label='Configuration', command=self.__configurationDlgShow)
00981         settingsmenu.add_separator()
00982         settingsmenu.add_command(label='Save current settings', command=self.__saveCurrentSettingsAsDefaults)
00983         settingsmenu.add_command(label='Load saved settings', command=self.__restoreCurrentSettingsFromDefault)
00984 
00985         menubar.add_cascade(label='Settings', menu=settingsmenu)
00986         helpmenu = Menu(menubar, tearoff=0)
00987         helpmenu.add_command(label='About', command=self.__aboutDlgShow)
00988         menubar.add_cascade(label='Help', menu=helpmenu)
00989         # display menu...
00990         self.master.config(menu=menubar)
00991 
00992         # now start adding our widgets starting with the top frame...
00993         self.listbox_frame = Frame(self)
00994         self.listbox_frame.grid(row=0, column=0, sticky=EW)
00995 
00996         # left hand listbox assembly
00997         self.leftListbox_frame = Frame(self.listbox_frame, borderwidth=1, relief=SUNKEN)
00998         self.leftListbox_frame.grid(row=1, column=0)
00999 
01000         self.leftLabel = Label(self.listbox_frame, text='Available Fonts')
01001         self.leftLabel.grid(row=0, column=0, sticky=NS)
01002 
01003         self.yScroll1 = Scrollbar(self.leftListbox_frame, orient=VERTICAL)
01004         self.yScroll1.grid(row=0, column=1, sticky=NS)
01005         self.xScroll1 = Scrollbar(self.leftListbox_frame, orient=HORIZONTAL)
01006         self.xScroll1.grid(row=1, column=0, sticky=EW)
01007 
01008         self.listbox1 = Listbox(self.leftListbox_frame,
01009             xscrollcommand=self.xScroll1.set,
01010             yscrollcommand=self.yScroll1.set,
01011             selectmode=EXTENDED,
01012             height=20, width=40)
01013         self.listbox1.grid(row=0, column=0, sticky=NSEW)
01014         self.xScroll1['command'] = self.listbox1.xview
01015         self.yScroll1['command'] = self.listbox1.yview
01016 
01017         def __listbox1KeyRelease(event):
01018             """Check if an Up or Down key has been pressed and released and
01019             if so the preview panel is refreshed. If the keys are held down
01020             the file system slows the scroll. Need a timer here to delay
01021             updates."""
01022             if (event.keysym == 'Down' or event.keysym == 'Up'):
01023                 __listbox1DoLogicCallback(self)
01024 
01025         def __listbox1SingleClick(event):
01026             """Call this first when listbox1 is clicked with mouse to put focus
01027             into the listbox. Note we call when mouse click is released, not pressed,
01028             due to the fact that the listbox does not change the selection until the button
01029             is released."""
01030             self.listbox1.focus_set()
01031             __listbox1DoLogicCallback(self)
01032         self.listbox1.bind('<ButtonRelease-1>', __listbox1SingleClick)
01033 
01034         def __listbox1DoLogicCallback(event):
01035             """Decides if current selection should be previewed.
01036 
01037             Start by counting items in selection list and if equal to one then
01038             show selected font, ignoring if more or less than one. Then also
01039             set up buttons logic depending on selection. We bind the FocusIn
01040             to this too so button logic and preview gets updated when focus
01041             enters the listbox.
01042             """
01043             # note we are not making use of "self.listbox1.get(ACTIVE)" due to
01044             # it not getting the real active name. Always one selection behind
01045             # even though we are doing all this in the ButtonRelease event.
01046             # Have made a change here. If more than one font name is selected
01047             # then we just empty the preview.
01048             names = self.listbox1.curselection()
01049             if len(names) == 1:
01050                 selectedFont = self.listbox1.get(names[0])
01051                 self.__curSelectedItem(selectedFont)
01052             else:
01053                 try:
01054                     app.previewPanel.delete(previewId)
01055                 except:
01056                     pass
01057             #else:
01058                 #selectedFont = self.listbox1.get(ACTIVE)
01059                 #print selectedFont  # for testing
01060                 #if selectedFont != "":
01061                     #self.__curSelectedItem(selectedFont)
01062 
01063             # Now do the button logic...
01064             self.listbox2.selection_clear(0,END)
01065             self.__setUpDownActive(0, 0)    # Force a disable if in other box
01066             if self.listbox1.size() > 0:
01067                 self.__setSelButtonsActive(0, 1)
01068             else:
01069                 self.__setSelButtonsActive(0, 0)
01070 
01071         self.listbox1.bind('<FocusIn>', __listbox1DoLogicCallback)
01072         self.listbox1.bind('<Any-KeyRelease>', __listbox1KeyRelease)
01073 
01074         def __listbox1DoubleClickCallback(event):
01075             """The single click event will fire also when left listbox
01076             is double clicked but we are detecting the single click button up event."""
01077             self.__listSelectionToRight()
01078 
01079         self.listbox1.bind('<Double-Button-1>', __listbox1DoubleClickCallback)
01080 
01081         # middle button frame assembly
01082         self.midbutton_frame = Frame(self.listbox_frame)
01083         self.midbutton_frame.grid(row=0, rowspan=2, column=1, sticky=NSEW)
01084 
01085         self.rsingleButton = Button(self.midbutton_frame, state='disabled', text='>', command=self.__rsingleButtonClick)
01086         self.rsingleButton.grid(row=0, column=0, padx=5, pady=5, sticky=EW)
01087         self.rdoubleButton = Button(self.midbutton_frame, text='>>', command=self.__rdoubleButtonClick)
01088         self.rdoubleButton.grid(row=1, column=0, padx=5, pady=5, sticky=EW)
01089 
01090         self.itemupButton = Button(self.midbutton_frame, state='disabled', text='Up', command=self.__itemupButtonClick)
01091         self.itemupButton.grid(row=2, column=0, padx=5, pady=5, sticky=EW)
01092         self.itemdownButton = Button(self.midbutton_frame, state='disabled', text='Down', command=self.__itemdownButtonClick)
01093         self.itemdownButton.grid(row=3, column=0, padx=5, pady=5, sticky=EW)
01094 
01095         self.lsingleButton = Button(self.midbutton_frame, state='disabled', text='<', command=self.__lsingleButtonClick)
01096         self.lsingleButton.grid(row=4, column=0, padx=5, pady=5, sticky=EW)
01097         self.ldoubleButton = Button(self.midbutton_frame, state='disabled', text='<<', command=self.__ldoubleButtonClick)
01098         self.ldoubleButton.grid(row=5, column=0, padx=5, pady=5, sticky=EW)
01099 
01100         # Right hand listbox assembly
01101         self.rightListbox_frame = Frame(self.listbox_frame, borderwidth=1, relief=SUNKEN)
01102         self.rightListbox_frame.grid(row=1, column=2)
01103 
01104         self.rightLabel = Label(self.listbox_frame, text='Selected Fonts')
01105         self.rightLabel.grid(row=0, column=2, sticky=NS)
01106 
01107         self.yScroll2 = Scrollbar(self.rightListbox_frame, orient=VERTICAL)
01108         self.yScroll2.grid(row=0, column=1, sticky=NS)
01109         self.xScroll2 = Scrollbar(self.rightListbox_frame, orient=HORIZONTAL)
01110         self.xScroll2.grid(row=1, column=0, sticky=EW)
01111 
01112         self.listbox2 = Listbox(self.rightListbox_frame,
01113             xscrollcommand=self.xScroll2.set,
01114             yscrollcommand=self.yScroll2.set,
01115             selectmode=EXTENDED,
01116             height=20, width=40)
01117         self.listbox2.grid(row=0, column=0, sticky=NSEW)
01118         self.xScroll2['command'] = self.listbox2.xview
01119         self.yScroll2['command'] = self.listbox2.yview
01120 
01121         def __listbox2SingleClick(event):
01122             """Similar to __listbox1SingleClick()."""
01123             self.listbox2.focus_set()
01124             __listbox2DoLogicCallback(self)
01125         self.listbox2.bind('<ButtonRelease-1>', __listbox2SingleClick)
01126 
01127         def __listbox2KeyRelease(event):
01128             if (event.keysym == 'Down' or event.keysym == 'Up'):
01129                 __listbox2DoLogicCallback(self)
01130 
01131         def __listbox2DoLogicCallback(event):
01132             """Similar to __listbox1DoLogicCallback()."""
01133             names = self.listbox2.curselection()
01134             if len(names) == 1:
01135                 selectedFont = self.listbox2.get(names[0])
01136                 self.__curSelectedItem(selectedFont)
01137             else:
01138                 try:
01139                     app.previewPanel.delete(previewId)
01140                 except:
01141                     pass
01142 
01143             # Now do the button logic...
01144             self.listbox1.selection_clear(0,END)
01145             self.__testUpDownState()
01146             if self.listbox2.size() > 0:
01147                 self.__setSelButtonsActive(1, 0)
01148             else:
01149                 self.__setSelButtonsActive(0, 0)
01150         self.listbox2.bind('<FocusIn>', __listbox2DoLogicCallback)
01151         self.listbox2.bind('<Any-KeyRelease>', __listbox2KeyRelease)
01152 
01153         def __listbox2DoubleClickCallback(event):
01154             """Similar to __listbox1DoubleClickCallback()."""
01155             self.__listSelectionToLeft()
01156         self.listbox2.bind('<Double-Button-1>', __listbox2DoubleClickCallback)
01157 
01158         # now draw the bottom font preview frame if required...
01159         if showPreviewPanel:
01160             self.preview_frame = Frame(self)
01161             self.preview_frame.grid(row=1, column=0, sticky=EW)
01162             self.previewPanel = Canvas(self.preview_frame, height=60, bg='white', bd=2, relief=SUNKEN)
01163             self.previewPanel.pack(fill=X)
01164 
01165         # now draw the bottom controls frame...
01166         self.controls_frame = Frame(self)
01167         self.controls_frame.grid(row=2, column=0, sticky=EW)
01168 
01169         # create a container...
01170         self.button_frame1 = Frame(self.controls_frame, bd=1, relief=RIDGE)
01171         self.button_frame1.grid(row=0, column=0, padx=10, pady=2)
01172         # create and add page number selection button...
01173         self.__wantPageNum = IntVar()
01174         self.pagenumSelect = Checkbutton(self.button_frame1, text='Print page numbers', variable=self.__wantPageNum, offvalue=0, onvalue=1, command=self.__pageNumberSelectButtonClick)
01175         self.pagenumSelect.grid(row=0, column=0, padx=0, sticky=W)
01176 
01177         # create a container...
01178         self.button_frame2 = Frame(self.controls_frame, bd=1, relief=RIDGE)
01179         self.button_frame2.grid(row=0, column=1, padx=10, pady=2)
01180         # create and add the TOC selector...
01181         self.__wantToc = IntVar()
01182         self.tocSelect = Checkbutton(self.button_frame2, text='Print table of contents', variable=self.__wantToc, offvalue=0, onvalue=1, command=self.__tocSelectButtonClick)
01183         self.tocSelect.grid(row=0, column=0, padx=0, sticky=W)
01184         # create and add page one on first selector...
01185         self.__wantPageOneOnFirst = IntVar()
01186         self.btnPageOneOnFirst = Checkbutton(self.button_frame2, text='Page count includes TOC', variable=self.__wantPageOneOnFirst, offvalue=0, onvalue=1, command=self.__wantPageOneOnFirstClick)
01187         self.btnPageOneOnFirst.grid(row=1, column=0, padx=0, sticky=W)
01188 
01189         # create a container...
01190         self.button_frame3 = Frame(self.controls_frame, bd=1, relief=RIDGE)
01191         self.button_frame3.grid(row=0, column=2, padx=10, pady=2)
01192         # create and add the binding offset...
01193         self.__wantBindingOffset = IntVar()
01194         self.bindingoffsetSelect = Checkbutton(self.button_frame3, text='Extra offset for binding', variable=self.__wantBindingOffset, offvalue=0, onvalue=1, command=self.__bindingoffsetSelectButtonClick)
01195         self.bindingoffsetSelect.grid(row=0, column=0, sticky=W)
01196         # create and add the double sided selection buttons...
01197         self.__wantDoubleSided = IntVar()
01198         self.doublesidedSelect = Checkbutton(self.button_frame3, text='Double sided pages', variable=self.__wantDoubleSided, offvalue=0, onvalue=1, command=self.__doubleSidedSelectButtonClick)
01199         self.doublesidedSelect.grid(row=1, column=0, rowspan=2, sticky=W)
01200 
01201         # now the ok and cancel buttons...
01202         self.cancelButton = Button(self.controls_frame, text='Cancel', command=self.__cancelButtonClick)
01203         self.cancelButton.grid(row=0, column=3, padx=5)
01204         self.okButton = Button(self.controls_frame, text='OK', state='disabled', command=self.__okButtonClick)
01205         self.okButton.grid(row=0, column=4, padx=5)
01206 
01207         # now create the bottom status bar frame and contents...
01208         self.status_frame = Frame(self)
01209         self.status_frame.grid(row=3, column=0, sticky=E+W)
01210         self.status0 = Label(self.status_frame, bd=1, relief=SUNKEN, anchor=W)
01211         self.status0.pack(side=LEFT)
01212         self.status1 = Label(self.status_frame, bd=1, relief=SUNKEN, anchor=W)
01213         self.status1.pack(side=LEFT)
01214         self.status2 = Label(self.status_frame, bd=1, relief=SUNKEN, anchor=W)
01215         self.status2.pack(side=LEFT)
01216         self.status3 = Label(self.status_frame, bd=1, relief=SUNKEN, anchor=W)
01217         self.status3.pack(side=LEFT)
01218         self.statusPaperSize = Label(self.status_frame, bd=1, relief=SUNKEN, anchor=W)
01219         self.statusPaperSize.pack(fill=X)

Here is the call graph for this function:


Member Function Documentation

def FontSample.Application.__aboutDlgShow (   self) [private]
Brings up a dialog with support url etc.

Definition at line 1505 of file FontSample.py.

01505 
01506     def __aboutDlgShow(self):
01507         """Brings up a dialog with support url etc."""
01508         about = AboutDialog(self)
01509 

Here is the caller graph for this function:

Definition at line 1445 of file FontSample.py.

01445 
01446     def __bindingoffsetSelectButtonClick(self):
01447         userPrefs['wantBindingOffset'] = self.__wantBindingOffset.get()
01448         dD.update(set_page_geometry(dD, geometriesList, userPrefs['paperSize'], userPrefs['wantBindingOffset']))

Here is the call graph for this function:

We exit the app here if user presses cancel.

Definition at line 1455 of file FontSample.py.

01455 
01456     def __cancelButtonClick(self):
01457         """We exit the app here if user presses cancel."""
01458         self.master.destroy()

Opens the configuration dialog where user can set up the options

Definition at line 1465 of file FontSample.py.

01465 
01466     def __configurationDlgShow(self):
01467         """Opens the configuration dialog where user can set up the options"""
01468         configs = ConfigurationDialog(self)
01469         self.statusbarUpdate()

Here is the call graph for this function:

Here is the caller graph for this function:

def FontSample.Application.__curSelectedItem (   self,
  selectedFont 
) [private]
Send the selected font to the preview function if preview available.

Definition at line 1409 of file FontSample.py.

01409 
01410     def __curSelectedItem(self, selectedFont):
01411         """Send the selected font to the preview function if preview available."""
01412         if showPreviewPanel:
01413             preview_font(self, selectedFont)

Here is the call graph for this function:

Definition at line 1449 of file FontSample.py.

01449 
01450     def __doubleSidedSelectButtonClick(self):
01451         userPrefs['wantDoubleSided'] = self.__wantDoubleSided.get()

def FontSample.Application.__itemDown (   self) [private]
Test if one item is selected then move it down one position.

Definition at line 1348 of file FontSample.py.

01348 
01349     def __itemDown(self):
01350         """Test if one item is selected then move it down one position."""
01351         limit = self.listbox2.size()
01352         selection = self.listbox2.curselection()
01353         if len(selection) == 1:
01354             indexId = IntType(selection[0])
01355             if indexId < limit - 1:
01356                 fontString = self.listbox2.get(indexId)
01357                 self.listbox2.delete(indexId)
01358                 newPos = indexId + 1
01359                 self.listbox2.selection_clear(0, END)
01360                 self.listbox2.insert(newPos, fontString)
01361                 self.listbox2.see(newPos + 10)
01362                 self.listbox2.selection_set(newPos)
01363                 self.listbox2.activate(newPos)  # make focus follow selection
01364                 self.__testUpDownState()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1432 of file FontSample.py.

01432 
01433     def __itemdownButtonClick(self):
01434         self.__itemDown()

Here is the call graph for this function:

def FontSample.Application.__itemUp (   self) [private]
Test if one item is selected then move it up one position.

Definition at line 1332 of file FontSample.py.

01332 
01333     def __itemUp(self):
01334         """Test if one item is selected then move it up one position."""
01335         selection = self.listbox2.curselection()
01336         if len(selection) == 1:
01337             indexId = IntType(selection[0]) # Get the first (only) item as integer type
01338             if indexId > 0:
01339                 fontString = self.listbox2.get(indexId)
01340                 self.listbox2.delete(indexId)
01341                 newPos = indexId - 1
01342                 self.listbox2.selection_clear(0, END)
01343                 self.listbox2.insert(newPos, fontString)
01344                 self.listbox2.see(newPos - 10)  # Scrolls listbox automatically into view if req.
01345                 self.listbox2.selection_set(newPos)
01346                 self.listbox2.activate(newPos)  # make focus follow selection
01347                 self.__testUpDownState()  # note tests only after an item has been moved

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1429 of file FontSample.py.

01429 
01430     def __itemupButtonClick(self):
01431         self.__itemUp()

Here is the call graph for this function:

Definition at line 1425 of file FontSample.py.

01425 
01426     def __ldoubleButtonClick(self):
01427         self.__listAllToLeft()
01428         self.__testUpDownState()

Here is the call graph for this function:

def FontSample.Application.__listAllToLeft (   self) [private]
Moves all selected fonts back to the left hand pane.

Note we just clear both panes then reload the left listbox in correct
order from scratch as this is probably quicker than moving each
item individually.

Definition at line 1282 of file FontSample.py.

01282 
01283     def __listAllToLeft(self):
01284         """Moves all selected fonts back to the left hand pane.
01285 
01286         Note we just clear both panes then reload the left listbox in correct
01287         order from scratch as this is probably quicker than moving each
01288         item individually.
01289         """
01290         self.listbox1.delete(0, END)
01291         fontList = scribus.getFontNames()
01292         fontList.sort()
01293         for i in fontList:
01294             self.listbox1.insert(END, i)
01295         self.listbox2.delete(0, END)
01296         self.__setButtonsState()
01297         self.__setSelButtonsActive(0, 0)
01298         self.statusbarUpdate()

Here is the call graph for this function:

Here is the caller graph for this function:

def FontSample.Application.__listAllToRight (   self) [private]

Definition at line 1273 of file FontSample.py.

01273 
01274     def __listAllToRight(self):
01275         fontList = self.listbox1.get(0, END)    # Get each font name into a list
01276         for i in fontList:
01277             self.listbox2.insert(END, i)        # Copy each one
01278         self.listbox1.delete(0, END)            # All done so empty the left listbox
01279         self.__setButtonsState()
01280         self.__setSelButtonsActive(0, 0)
01281         self.statusbarUpdate()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1257 of file FontSample.py.

01257 
01258     def __listSelectionToLeft(self):
01259         toMoveLeft = ListType(self.listbox2.curselection())
01260         toMoveLeft.reverse()
01261         self.listbox2.selection_clear(0,END)
01262         for i in toMoveLeft:
01263             self.listbox1.insert(END, self.listbox2.get(i)) # Insert it at the end
01264             self.listbox2.delete(i)
01265         fontList = ListType(self.listbox1.get(0, END))      # Copy contents to a list type
01266         self.listbox1.delete(0, END)                        # Remove all contents
01267         fontList.sort()                                     # Use sort method of list
01268         for j in fontList:
01269             self.listbox1.insert(END, j)                    # Replace with sorted version
01270         self.__setButtonsState()
01271         self.__setSelButtonsActive(0, 0)
01272         self.statusbarUpdate()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1243 of file FontSample.py.

01243 
01244     def __listSelectionToRight(self):
01245         toMoveRight = ListType(self.listbox1.curselection())
01246         self.listbox1.selection_clear(0,END)
01247         toMoveRight.reverse()   # reverse list so we delete from bottom of listbox first
01248         tempList = []
01249         for i in toMoveRight:
01250             tempList.insert(0,self.listbox1.get(i)) # gets the actual strings (reverse again)
01251             self.listbox1.delete(i)
01252         for j in tempList:
01253             self.listbox2.insert(END, j)
01254         self.__setButtonsState()
01255         self.__setSelButtonsActive(0, 0)
01256         self.statusbarUpdate()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1421 of file FontSample.py.

01421 
01422     def __lsingleButtonClick(self):
01423         self.__listSelectionToLeft()
01424         self.__testUpDownState()

Here is the call graph for this function:

def FontSample.Application.__okButtonClick (   self) [private]
User presses ok, so lets create the pages.

Definition at line 1459 of file FontSample.py.

01459 
01460     def __okButtonClick(self):
01461         """User presses ok, so lets create the pages."""
01462         save_user_conf(CONFIG_PATH)
01463         draw_selection(self.listbox2.get(0, END), 0)
01464         self.master.destroy()

Here is the call graph for this function:

Definition at line 1442 of file FontSample.py.

01442 
01443     def __pageNumberSelectButtonClick(self):
01444         userPrefs['wantPageNumbers'] = self.__wantPageNum.get()

Definition at line 1418 of file FontSample.py.

01418 
01419     def __rdoubleButtonClick(self):
01420         self.__listAllToRight()

Here is the call graph for this function:

Restores current settings from defaults.

Definition at line 1475 of file FontSample.py.

01475 
01476     def __restoreCurrentSettingsFromDefault(self):
01477         """Restores current settings from defaults."""
01478         userPrefs.update(defaultPrefs)
01479         self.initialiseWidgets()
01480         self.statusbarUpdate()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1415 of file FontSample.py.

01415 
01416     def __rsingleButtonClick(self):
01417         self.__listSelectionToRight()

Here is the call graph for this function:

Stores current settings as defaults.

Definition at line 1470 of file FontSample.py.

01470 
01471     def __saveCurrentSettingsAsDefaults(self):
01472         """Stores current settings as defaults."""
01473         defaultPrefs.update(userPrefs)
01474         save_user_conf(CONFIG_PATH)

Here is the call graph for this function:

Here is the caller graph for this function:

def FontSample.Application.__setAllButtonsActive (   self,
  allToRight,
  allToLeft 
) [private]

Definition at line 1310 of file FontSample.py.

01310 
01311     def __setAllButtonsActive(self, allToRight, allToLeft):
01312         # The "all" buttons are the ones with ">>"  and "<<"  on them
01313         if allToRight == 1:
01314             self.rdoubleButton['state'] = NORMAL
01315         else:
01316             self.rdoubleButton['state'] = DISABLED
01317         if allToLeft == 1:
01318             self.ldoubleButton['state'] = NORMAL
01319         else:
01320             self.ldoubleButton['state'] = DISABLED

Here is the caller graph for this function:

def FontSample.Application.__setButtonsState (   self) [private]

Definition at line 1321 of file FontSample.py.

01321 
01322     def __setButtonsState(self):
01323         if self.listbox2.size() > 0 and self.listbox1.size() > 0:
01324             self.__setAllButtonsActive(1, 1)
01325             self.okButton['state'] = NORMAL
01326         elif self.listbox2.size() == 0:
01327             self.__setAllButtonsActive(1, 0)
01328             self.okButton['state'] = DISABLED
01329         elif self.listbox1.size() == 0:
01330             self.__setAllButtonsActive(0, 1)
01331             self.okButton['state'] = NORMAL

Here is the call graph for this function:

Here is the caller graph for this function:

def FontSample.Application.__setSelButtonsActive (   self,
  selToRight,
  selToLeft 
) [private]

Definition at line 1299 of file FontSample.py.

01299 
01300     def __setSelButtonsActive(self, selToRight, selToLeft):
01301         # The "selection" buttons are the ones with ">"  and "<"  on them
01302         if selToRight == 1:
01303             self.lsingleButton['state'] = NORMAL
01304         else:
01305             self.lsingleButton['state'] = DISABLED
01306         if selToLeft == 1:
01307             self.rsingleButton['state'] = NORMAL
01308         else:
01309             self.rsingleButton['state'] = DISABLED

Here is the caller graph for this function:

def FontSample.Application.__setUpDownActive (   self,
  up,
  down 
) [private]
Just sets the buttons active or inactive.

See testUpDown() for the actual evaluation

Definition at line 1365 of file FontSample.py.

01365 
01366     def __setUpDownActive(self, up, down):
01367         """Just sets the buttons active or inactive.
01368 
01369         See testUpDown() for the actual evaluation
01370         """
01371         if up == 1:
01372             self.itemupButton['state'] = NORMAL
01373         else:
01374             self.itemupButton['state'] = DISABLED
01375         if down == 1:
01376             self.itemdownButton['state'] = NORMAL
01377         else:
01378             self.itemdownButton['state'] = DISABLED

Here is the caller graph for this function:

def FontSample.Application.__testUpDownState (   self) [private]
Only enable the up and down buttons when just a single item is selected.

Enable should be applied to up, down or both depending on its
position in the listbox. At all other times disable both.

Definition at line 1379 of file FontSample.py.

01379 
01380     def __testUpDownState(self):
01381         """Only enable the up and down buttons when just a single item is selected.
01382 
01383         Enable should be applied to up, down or both depending on its
01384         position in the listbox. At all other times disable both.
01385         """
01386         # Get a count of how many items are currently selected...
01387         selection = list(self.listbox2.curselection())
01388         tcount = 0
01389         for sel in selection:
01390             tcount = tcount + 1
01391 
01392         position = 0
01393         if tcount == 1:
01394             position = IntType(selection[0])
01395 
01396         # If one selected and there is more than one item in the listbox then ok...
01397         if tcount == 1 and self.listbox2.size() > 1:
01398             # Now test the position of the selected line...
01399             if position > 0 and position < self.listbox2.size() - 1:    # Both
01400                 self.__setUpDownActive(1, 1)
01401             # If not one less or lesser from the bottom (listbox.count-1?) then gray the down button.
01402             elif position == self.listbox2.size() - 1:                  # Up only
01403                 self.__setUpDownActive(1, 0)
01404             # If not one or more from the top then gray up button.
01405             elif position == 0:                                         # Down only
01406                 self.__setUpDownActive(0, 1)
01407         else:
01408             self.__setUpDownActive(0, 0)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1435 of file FontSample.py.

01435 
01436     def __tocSelectButtonClick(self):
01437         userPrefs['wantTOC'] = self.__wantToc.get()
01438         if userPrefs['wantTOC']:
01439             self.btnPageOneOnFirst['state'] = NORMAL
01440         else:
01441             self.btnPageOneOnFirst['state'] = DISABLED

Definition at line 1452 of file FontSample.py.

01452 
01453     def __wantPageOneOnFirstClick(self):
01454         userPrefs['wantPageOneOnFirst'] = self.__wantPageOneOnFirst.get()

Definition at line 1481 of file FontSample.py.

01481 
01482     def initialiseWidgets(self):
01483         if userPrefs['wantPageNumbers']:
01484             self.pagenumSelect.select()
01485         else:
01486             self.pagenumSelect.deselect()
01487         if userPrefs['wantTOC']:
01488             self.tocSelect.select()
01489             self.btnPageOneOnFirst['state'] = NORMAL
01490         else:
01491             self.tocSelect.deselect()
01492             self.btnPageOneOnFirst['state'] = DISABLED
01493         if userPrefs['wantBindingOffset']:
01494             self.bindingoffsetSelect.select()
01495         else:
01496             self.bindingoffsetSelect.deselect()
01497         if userPrefs['wantDoubleSided']:
01498             self.doublesidedSelect.select()
01499         else:
01500             self.doublesidedSelect.deselect()
01501         if userPrefs['wantPageOneOnFirst']:
01502             self.btnPageOneOnFirst.select()
01503         else:
01504             self.btnPageOneOnFirst.deselect()

Here is the caller graph for this function:

Draws the status bar contents.

Note "draw_selection()" does a dummy run to count the amount of sample
blocks on a sheet.
TODO: Statusbar setting and recalculation should be separated. Just recalc
and refresh panels as required instead of all of them each time.

Definition at line 1220 of file FontSample.py.

01220 
01221     def statusbarUpdate(self):
01222         """Draws the status bar contents.
01223 
01224         Note "draw_selection()" does a dummy run to count the amount of sample
01225         blocks on a sheet.
01226         TODO: Statusbar setting and recalculation should be separated. Just recalc
01227         and refresh panels as required instead of all of them each time.
01228         """
01229         available = self.listbox1.size()
01230         selected = self.listbox2.size()
01231         size = FloatType(selected)
01232         blocksPerSheet = draw_selection(scribus.getFontNames(), 1)
01233         value = size / blocksPerSheet
01234         pages = IntType(value)                  # Get whole part of number
01235         value = value - pages                   # Remove whole number part
01236         if value > 0:                           # Test remainder
01237             pages = pages + 1                   # Had remainder so add a page
01238         self.status0['text'] = 'Fonts available: %s   ' % (available + selected)
01239         self.status1['text'] = 'Fonts selected: %s   ' % selected
01240         self.status2['text'] = 'Sheets required: %s   ' % pages
01241         self.status3['text'] = 'Fonts per sheet: %s   ' % blocksPerSheet
01242         self.statusPaperSize['text'] = 'Paper size: %s   ' % userPrefs['paperSize']

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1192 of file FontSample.py.

Definition at line 1196 of file FontSample.py.

Definition at line 1172 of file FontSample.py.

Definition at line 1184 of file FontSample.py.

Definition at line 1180 of file FontSample.py.

Definition at line 1193 of file FontSample.py.

Definition at line 1185 of file FontSample.py.

Definition at line 1169 of file FontSample.py.

Definition at line 1177 of file FontSample.py.

Definition at line 1189 of file FontSample.py.

Definition at line 1201 of file FontSample.py.

Definition at line 1165 of file FontSample.py.

Definition at line 1197 of file FontSample.py.

Definition at line 1091 of file FontSample.py.

Definition at line 1089 of file FontSample.py.

Definition at line 1096 of file FontSample.py.

Definition at line 999 of file FontSample.py.

Definition at line 996 of file FontSample.py.

Definition at line 1007 of file FontSample.py.

Definition at line 1111 of file FontSample.py.

Definition at line 992 of file FontSample.py.

Definition at line 1094 of file FontSample.py.

Definition at line 1081 of file FontSample.py.

Definition at line 1203 of file FontSample.py.

Definition at line 1173 of file FontSample.py.

Definition at line 1159 of file FontSample.py.

Definition at line 1161 of file FontSample.py.

Definition at line 1086 of file FontSample.py.

Definition at line 1103 of file FontSample.py.

Definition at line 1100 of file FontSample.py.

Definition at line 1084 of file FontSample.py.

Definition at line 1209 of file FontSample.py.

Definition at line 1211 of file FontSample.py.

Definition at line 1213 of file FontSample.py.

Definition at line 1215 of file FontSample.py.

Definition at line 1207 of file FontSample.py.

Definition at line 1217 of file FontSample.py.

Definition at line 1181 of file FontSample.py.

Definition at line 1004 of file FontSample.py.

Definition at line 1108 of file FontSample.py.

Definition at line 1002 of file FontSample.py.

Definition at line 1106 of file FontSample.py.


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