Mastering PowerBuilder

HomePrevious Lesson: Course 3:: Session 24 :: Page 410
Next Lesson: Course 3:: Session 24 :: Page 430
Preferences Service

This service allows you to save the user window size, window position, toolbar settings and restore them whenever you need to. To use this service, you need to turn on the service:

this.of_SetPreference(TRUE)
// We wrote in the Window Open event.

Call of_Save() function to save the settings. Window’s close event is the good place for this code.

this.inv_preference.of_Save &
(gnv_app.of_GetUserINIFile(), "WindowSettings" )

To restore the settings, call of_Restore() function. Window open event is a good candidate for this script.

You can control the settings that you want to save by calling the following functions. Call only those functions that you want save the settings.
of_SetToolbarItemOrder()
of_SetToolbarItemSpace()
of_SetToolbarItemVisible()
of_SetToolbars()
of_SetToolbarTitles()
of_SetWindow()

HomePrevious Lesson: Course 3:: Session 24 :: Page 410
Next Lesson: Course 3:: Session 24 :: Page 430