<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi, <br>
</p>
<p>Obviously the Preferences carries a lot of things (see code
abstract below). I am contemplating the situation on the
possibility to normalize (like a norm) the Preference behavior so
it can also be edited with a third party GUI, pref save/load/merge
to/from files and easier to understand.<br>
</p>
<p>Observe how hugeFonts is selected for the system: message
#hugeFonts is sent to Preferences (now it is not a preference flag
as some other messages sent to Preferences, a source of
confusion), then huge font applied, then the Preferences set
itself the preference #guiElementSize to #hudgeFont. <br>
</p>
<p>I fell it should be the other way: the user set the
#guiElementSize to #hugeFont, then the Preference system applies
the font change. So we have two things happening: changing the
value of property, then a system reacting to this property change.<br>
</p>
<p>An implementation following the logic we discussed with the newer
Preference system looks like:</p>
<ul>
<li>#guiElementsSize preference of type Array of symbol, when its
value changes, it triggers an event</li>
<li>a third party object listen event from #guiElementSize
preference, at event catch it defaultFontSize: accordingly.</li>
</ul>
<p>The third party object could be the Preference system
(PreferenceNG class) itself. #standardCodeFont, etc will be
preferences in their own #font category. That way we don't need
the Parameter. There will be a bit more work to load preference
set, though.<br>
</p>
<p>Juan, does it sound acceptable implementation?</p>
<p>If so I can resume my work with PreferenceNG on that direction.<br>
</p>
<p>Hilaire<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Preferences>>hugeFonts<br>
"Sets not only fonts but other GUI elements<br>
to fit regular resolution and size screens<br>
Preferences hugeFonts<br>
"<br>
<br>
self defaultFontSize: 32.<br>
self setPreference: #guiElementsSize toValue: #hugeFonts.<br>
</p>
<p><font size="4">Preferences>>defaultFontSize: pointSize<br>
"<br>
Adjust sizes for GUI elements.<br>
<br>
Preferences defaultFontSize: 5<br>
Preferences defaultFontSize: 6<br>
<br>
Preferences defaultFontSize: 7<br>
Preferences defaultFontSize: 9<br>
Preferences defaultFontSize: 11<br>
Preferences defaultFontSize: 14<br>
Preferences defaultFontSize: 18<br>
Preferences defaultFontSize: 24<br>
Preferences defaultFontSize: 32<br>
"<br>
| font titleFont |<br>
font _ FontFamily familyName: FontFamily defaultFamilyName
pointSize: pointSize..<br>
self<br>
setListFontTo: font;<br>
setMenuFontTo: font;<br>
setCodeFontTo: font;<br>
setButtonFontTo: font;<br>
setSystemFontTo: font.<br>
titleFont _ FontFamily familyName: FontFamily
defaultFamilyName pointSize: pointSize * 12//10.<br>
self setWindowTitleFontTo: titleFont.<br>
MorphicCanvas allSubclassesDo: [ :c| c
guiSizePreferenceChanged ].<br>
UISupervisor ui ifNotNil: [ :w | w fontPreferenceChanged ].<br>
pointSize > 14<br>
ifTrue: [ Preferences enable: #biggerCursors ]<br>
ifFalse: [ Preferences disable: #biggerCursors ].<br>
Cursor defaultCursor activateCursor.<br>
^font</font><br>
</p>
<pre class="moz-signature" cols="72">--
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://drgeo.eu">http://drgeo.eu</a>
<a class="moz-txt-link-freetext" href="http://blog.drgeo.eu">http://blog.drgeo.eu</a></pre>
</body>
</html>