Inherits From:
NSObject
Declared In:
TSPreferences.h
position | value |
0 | version number |
1 | textView's font |
2 | pdfView's slider value |
3-6 | textWindow's frame |
7-10 | pdfWindow's frame |
11 | TeX command |
12 | LaTeX command |
13 | display method (Apple or GS) |
14 | GS color |
15 | preferred TeX command |
_prefsWindow
;_documentFontTextField
;_sourceWindowPosMatrix
;_syntaxColorButton
;_parensMatchButton
;_pdfWindowPosMatrix
;_gsColorMatrix
;_pdfDisplayMatrix
;_texCommandTextField
;_latexCommandTextField
;_defaultCommandMatrix
;_undoManager
;_documentFont
;_prefsWindow | connected to the window |
_documentFontTextField | connected to "Document Font" |
_sourceWindowPosMatrix | connected to "Source Window Position" |
_syntaxColorButton | connected to "Syntax Coloring" |
_parensMatchButton | connected to "Parens Matching |
_pdfWindowPosMatrix | connected to "PDF Window Position" |
_gsColorMatrix | connected to "Ghostscript colors" |
_pdfDisplayMatrix | connected to "PDF Display" |
_texCommandTextField | connected to "TeX program" |
_latexCommandTextField | connected to "Latex program" |
_defaultCommandMatrix | connected to "Default Program" |
_undoManager | used for discarding all changes when the cancel button was pressed |
_documentFont | used to track the font that the user has selected for the document window |
sharedInstance
This class is implemented as singleton, i.e. there is only one single instance in the runtime. This is the designated accessor method to get the shared instance of the Preferences class.
allTemplateNames
This method looks in ~/Library/TeXShop/Templates and returns the filenames minus the extensions of all of the templates found.
cancelButtonPressed:
sender
This method is connected to the Cancel button.
changeDocumentFont:
sender
This method is connected to the 'Set...' button on the 'Document' pane.
Clicking this button will bring up the font panel.
copyToTemplateDirectory:
(NSString *)fileName
This method is not to be called from outside of this class.
Copies fileName to ~/Library/TeXShop/Templates. This method takes care that no files are overwritten.
createDirectoryAtPath:
(NSString *)path
This method is not to be called from outside of this class.
Creates the directory at path making sure that path does not already exist (which is no problem) and if it exists it is a directory (throws an exception if not).
currentDocumentWindowPosDefault:
sender
This method is connected to the 'use current pos as default' button on the 'Document' pane.
currentPdfMagDefault:
sender
This method is connected to the 'Use current mag as default' button on the Preview pane'.
currentPdfWindowPosDefault:
sender
This method is connected to the 'use current pos as default' button.
defaultProgramChanged:
sender
This method is connected to the "Default Program" matrix on the TeX pane.
A tag of 0 means use TeX, a tag of 1 means use LaTeX.
ghostscriptColorChanged:
sender
This method is connected to the "Ghostscript Colors" matrix on the Preview pane.
tag | meaning |
0 | Grayscale |
1 | 256 Colors |
2 | Thousands of Colors |
latexProgramChanged:
sender
This method is connected to the textField that holds the LaTeX command. It is located on the TeX pane.
okButtonPressed:
sender
This method is connected to the OK button.
parensMatchPressed:
sender
This method is connected to the 'parens matching' checkbox.
pdfDisplayMethodChanged:
sender
This method is connected to the "PDF Display" Matrix.
A tag of 0 means use Apple's NSPDFImageRep, a tag of 1 means use Ghostscript.
pdfWindowPosChanged:
sender
This method is connected to the "PDF Window Position" Matrix.
A tag of 0 means don't save the window position, a tag of 1 to save the setting. This should only flag the request to save the position, the actual saving of position and size can be left to [NSWindow setAutoSaveFrameName].
registerFactoryDefaults
This method is not to be called from outside of this class.
This method will be called when no defaults were registered so far. Since this is the first time that TeXShop runs, we register a standard defaults set (from the FactorDefaults.plist) and fill ~/Library/TeXShop/Templates with our templates.
showPreferences:
sender
Connected to the "Preferences..." menu item in Application's main menu.
Loads the .nib file if necessary, fills all the controls with the values from the user defaults and makes the window visible.
sourceWindowPosChanged:
sender
This method is connected to the "Source Window Position" Matrix.
This method will be called when the matrix changes. Target 0 means 'all windows start at a fixed position', target 1 means 'remember window position'.
syntaxColorPressed:
sender
This method is connected to the 'syntax coloring' checkbox.
texProgramChanged:
sender
This method is connected to the textField that holds the TeX command. It is located on the TeX pane.
updateControlsFromUserDefaults:
(NSUserDefaults *)defaults
This method is not to be called from outside of this class.
This method retrieves the application preferences from the defaults object and sets the controls in the window accordingly.
updateDocumentFontTextField
This method is not to be called from outside of this class
This method updates the textField that represents the name of the selected font in the Document pane.