General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › How to edit user settings in "Settings.settings" file from xft form?
biswajitsr June 11, 2010 at 1:12 pm
How to edit user settings in "Settings.settings" file from xft form?June 11, 2010 at 1:12 pmParticipants 0Replies 1Last Activity 12 years, 9 months ago
I need to change some user settings in XMetal from xft form. So how to do that? I also need to read that settings at document load. My requirement is to give user the ability to select font for documents. Thanks in advance…dcramer June 11, 2010 at 3:33 pm
Reply to: How to edit user settings in "Settings.settings" file from xft form?June 11, 2010 at 3:33 pm
I've attached an xft form that reads and writes to an environment variable and a registry value.
Look at the OnInitialize event for the text fields to see them reading from the registry and env variables. Then see the Apply button's OnClick event to see it writing the values if the user has edited them.
When the dialog opens, the fields are prepopulated with the current values (if they exist). Then the user clicks apply, the values are updated (if the user has changed them).
From any other macro you can use RegRead and Environment methods illustrated in the text field's OnInitialize event to read the setting. What I do is read it and if it's not set, I give them an alert telling them they need to set it, then pop up this dialog. I also make the dialog available from a menu.
Hope that helps.
- You must be logged in to reply to this topic.