|
|
Class: FontPanel
Object
|
+--GraphicsContext
|
+--DeviceGraphicsContext
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--TopView
|
+--StandardSystemView
|
+--ModalBox
|
+--DialogBox
|
+--FontPanel
- Package:
- stx:libwidg
- Category:
- Views-DialogBoxes
- Version:
- rev:
1.105
date: 2010/04/13 14:32:34
- user: cg
- file: FontPanel.st directory: libwidg
- module: stx stc-classLibrary: libwidg
- Author:
- Claus Gittinger
this class implements a font chooser.
Notice:
this is a very old dialog;
it was written before the UI-framework was available and is completely
setup manually (initialize method).
Therefore, it desperately asks to be rewritten using the UIPainter...
Font
FontDescription
View
Dialog
defaults
-
defaultAsciiSampleString
-
-
defaultExtent
-
return the default extent of my instances.
The value returned here is usually ignored, and
the value from preferredExtent taken instead.
-
defaultJIS0201SampleString
-
return the sample jis preview text
-
defaultJISSampleString
-
return the sample jis preview text
-
defaultLatin1SampleString
-
return the sample latin1 preview text
-
defaultSampleStringForEncoding: enc
-
-
defaultUnicodeSampleString
-
return the sample unicode preview text
-
sampleStringWithAllLetters
-
menu specs
-
previewMenu
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
startup
-
fontFromUser
-
open a fontPanel and return the selected font, or nil
if abort is pressed
-
fontFromUserInitial: aFont
-
open a fontPanel showing aFont initially,
and return the selected font, or nil if abort is pressed
-
fontFromUserInitial: aFont title: someTitle
-
open a fontPanel with title and return the selected font,
or nil if abort is pressed
-
fontFromUserInitial: initialFont title: someTitle filter: aFilterBlock
-
open a fontPanel with title and font-filter
and return the selected font, or nil if abort is pressed
-
fontFromUserInitial: initialFont title: someTitle filter: aFilterBlock encoding: encoding
-
open a fontPanel with title and font-filter
and return the selected font, or nil if abort is pressed
-
fontFromUserInitial: initialFont title: someTitle filter: aFilterBlock encoding: encoding enabled: enabled
-
open a fontPanel with title and font-filter
and return the selected font, or nil if abort is pressed
-
openOn: aFont
-
open a fontPanel showing aFont initially.
This panel is for information only - no font selection is possible.
accessing
-
action: aFourArgBlock
-
set the action to be evaluated on ok.
The block will be evaluated with family, face, style, size and encoding.
-
encoding: aPattern
-
set the encoding goal
-
filter: aOneArgBlock
-
set a filter; if non-nil, only fonts for which the filterBlock
returns true will be offered
-
initialFont: aFont
-
set the font to be selected initially
initialization
-
enabled: aBoolean
-
-
initialize
-
-
listOfEncodingsInFilterCombo
-
-
postRealize
-
kludge for sco - xlsfont fails sometimes - try again here
-
previewMenu
-
-
showEncodingFilter
-
private
-
clearPreview
-
clear the preview subview
-
extractFaceAndStyleFrom: aString
-
given a string, extract currentFace and currentStyle
-
fontForPreview
-
get the preview font
-
getFacesForFamily: aFamilyName filtering: filter
-
the list of font faces for a given family
-
getFamilyList
-
the list of font families
-
getSizesInFamily: aFamilyName face: face style: style filtering: filter
-
-
getStylesInFamily: aFamilyName face: aFace filtering: filter
-
the list of font styles for a given family-face
-
showPreview
-
show the preview text
-
showSelectedFont
-
-
updateFamilyList
-
update the list of font families
queries
-
characterSetViewClassAvailable
-
-
characterSetViewClassAvailableOrOSIsUNIX
-
-
osIsUNIX
-
-
preferredExtent
-
return the boxes preferredExtent
user interaction
-
copyFontName
-
-
encodingFilterSelected: anEncodingPattern
-
another encoding was selected; find available fonts and update lists
-
faceSelected: aFaceAndStyleName
-
a fonts face was selected; find available sizes and update lists
-
faceSelected: aFaceAndStyleName showPreview: showPreview
-
a fonts face was selected; find available sizes and update lists
-
familySelected: aFamilyName
-
a fonts family was selected; find available faces and update lists
-
familySelected: aFamilyName showPreview: showPreview
-
a fonts family was selected; find available faces and update lists
-
okPressed
-
ok was pressed; hide myself and evaluate the okAction, passing
family, face, style and size as arguments
-
previewCopySelection
-
-
previewInspectFont
-
-
previewShowCharacterSet
-
-
previewShowCharacterSetUsingXFD
-
-
sizeSelected: aNumberOrString
-
a size was selected; update preview
-
sizeSelected: aNumberOrString showPreview: showPreview
-
a size was selected; update preview
-
sizeUnitSelected: unitSymbol
-
-
updateSizeList
-
very simple:
|font|
font := FontPanel fontFromUser.
Transcript showCR:font
|
with initial font:
|font|
font := FontPanel
fontFromUserInitial:(Font
family:'courier'
size:12).
Transcript showCR:font
|
with initial font & title:
|font|
font := FontPanel
fontFromUserInitial:(Font
family:'courier'
size:12)
title:'select a fooBar font'.
Transcript showCR:font
|
full setup; setting a filter to only present iso fonts
and callBack action:
|panel|
panel := FontPanel new.
panel label:'hi there - which iso font ?'.
panel filter:[:fd | fd encoding notNil
and:[fd encoding startsWith:'iso']].
panel action:[:family :face :style :size |
Transcript showCR:'family:' , family.
Transcript showCR:'face:' , face.
Transcript showCR:'style:' , style.
Transcript showCR:'size:' , size printString.
].
panel open
|
|