Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi Albert,

On Wed, 2012-01-25 at 21:48 +0100, Albert Thuswaldner wrote:
Can you give me any pointers on how to intercept a input value change
event. I've done some digging (looking for an event listener) but
haven't found it quite yet.

        Let me help de-tangle a bit (if I can). It rather depends on the widget
that is being used, and who is sub-classing it to do whatever madness on
the way. Anyhow; assuming it is the 'rename' context menu on a tab; the
code goes:

source/ui/view/tabvwshf.cxx-                    AbstractScStringInputDlg* pDlg = 
pFact->CreateScStringInputDlg(
source/ui/view/tabvwshf.cxx-                        GetDialogParent(), aDlgTitle, 
String(ScResId(SCSTR_NAME)),

        Which ends up with a generic string input:

sc/source/ui/inc/strindlg.hxx:class ScStringInputDlg : public ModalDialog
...
    Edit            aEdInput;

        So we have an 'Edit' being used.

        vcl/inc/vcl/edit.hxx

        Shows a number of likely candidates; connecting to the 'ModifyHdl'
and running the validator on the name, removing characters if it not valid
might work; but of course.

        git grep SetModifyHdl

        for some instances of that; possibly we don't want to stop user input,
but have a FixedLine that says "invalid entry, last valid name was
'foo'" or whatever (?).

        Anyhow - thanks for polishing this ! :-)

        HTH,

                Michael.

-- 
michael.meeks@suse.com  <><, Pseudo Engineer, itinerant idiot


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.