On 3/4/10 2:34 PM, eric b wrote:
Hello,


I'd like to implement a feature into the Tools -> Options dialog (
svx/source/cui/treeopt.* connected to optgdlg.* )

The idea is to protect the prefs with a password. Shortly : prefs
protected mean the are in read oonly mode. Not protected : can be
modified as usual.

It works already well, but there is a missing feature, and I'm a bit
wondering on how to add that ...


Basically the missing feature is a button + an image included in it + an
action associated to change the image :

- feature enabled, we'll display one green open padlock (a .png )
- feature disabled, we'll display a red closed one ( a .png too )


What is the right way to achieve that ? More precisely, what type if
image use ? ( ImageButton ? Image ? other ? ) .. and shall I implement
the drawing, and the rendering myself ? (that's what I saw in
backingwindow.cxx)

Actually that's not what you saw, the ImageButtons in backingwindow.cxx are regular image buttons. The BitmapEx drawn there is the background for the window, not the buttons.

I'd say, yes, use an ImageButton. Add the necessary png files to default_images in the appropriate directory (probably svx/res or nowadays cui/res). The load the images from a resource file; actually for this you can take backingwindow.cxx as an Example.

On that ImageButton you can use SetModeImage to set the image to be displayed (which you should change when transitioning between locked/unlocked state).

Just my 2 cents, pl

--
Sanity is just a bad excuse for a lack of imagination.
     -- Author unknown

Registered Office: Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Commercial register of the Local Court of Munich: HRB 161028
Managing Directors: Thomas Schröder, Wolfgang Engels
Chairman of the Supervisory Board: Martin Häring

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@gsl.openoffice.org
For additional commands, e-mail: dev-h...@gsl.openoffice.org

Reply via email to