Custom Widget question

Caolán McNamara caolanm at redhat.com
Mon Feb 25 16:01:56 PST 2013


On Sun, 2013-02-24 at 23:05 -0300, Olivier Hallot wrote:
> Hi,
> 
> Following instruction for custom widgets, I tried this implementation
> below. It seems it screwed something related to rResId at construction
> time. Thanks in advance for pointing my mistake.

Yeah, the makeWIDGET calls have to be of form...

extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeWIDGET(Window *,
VclBuilder::stringmap &)

i.e. there is no ResId argument (because the widgets are inside a
"Resource" anymore)

which means that you'll need another FrameDirectionListBox ctor that
doesn't take a RedId

e.g.

FrameDirectionListBox::FrameDirectionListBox( Window* pParent, WinBits
nBits ) :
    ListBox( pParent, nBits )
{
}

commit 3fd9e569d8a4c00020d5ac2db566e1ed7f920a6e is probably *very*
similar to what you need, i.e. the pattern of makeSvxTextEncodingBox and
the addition of the SvxTextEncodingBox::SvxTextEncodingBox( Window*
pParent, WinBits nBits ) ctor

p.s. run ./bin/verify-custom-widgets-libs after you've successfully
gotten it all running under Linux to make sure it'll also work ok under
Windows.

p.p.s. see ffea6fc98fe7137cafd88bc191c850caa9717862 for adding these
custom widgets to the glade catalog, which doesn't "do" anything, but
allows you to modify the custom widget inside glade without it silently
dropping your changes, and cut and paste the custom widget without
crashing.

C.



More information about the LibreOffice mailing list