widget layout status

Olivier Hallot olivier.hallot at documentfoundation.org
Mon Oct 8 08:55:36 PDT 2012

Thanks Caolán

I added these lines in the wiki under Q&A, if you don't mind

2012/10/8 Caolán McNamara <caolanm at redhat.com>

> On Mon, 2012-10-08 at 07:52 -0300, Olivier Hallot wrote:
> > Hi Caolán
> >
> > What is the recomendation to convert to a .ui file? That is, for all the
> > existing scr/hrc pairs, is there a tool to convert them to .ui?
> There's no tool. A tool might be helpful but I've put that on the long
> finger for now. So it's currently
> a) fire up glade and draw something similar to the existing dialog and
> cut and paste in the strings from the .src.
> b) Follow the basic guidelines from
> https://wiki.documentfoundation.org/Development/WidgetLayout e.g. ok
> buttons are called "ok" cancel "cancel" and so on
> c) remove from the code any declarations of widgets which only appear in
> the .hxx and once in the .cxx in the member init list (because we don't
> need to explicitly declare them anymore if that's all they were there
> for)
> d) search and replace aWidget. to m_pWidget->
> e) convert aWidget(this, SOMERESID) in the ctor member init list to
> get(m_pWidget, SOMEUIID) in the ctor where SOMEUIID is a human-helpful
> name which you fill into the .ui e.g.
> in .hxx
> PushButton m_aFOO
> in .cxx
> SomeDialog::SomeDialog() :
> ...
>     m_aFOO(this, SwRes(DIALOG_OK_BTN)
> ...
> {
>     m_aFOO.SetClickFoo(something)
> }
> to
> in .hxx
> PushButton* m_pFOO
> in .cxx
> SomeDialog::SomeDialog() :
> {
>     get(m_pFOO, "foo);
>     m_pFOO->SetClickFoo(something)
> }
> If you'd like to get a conversion a shot, then you could just start with
> demoing up converting a dialog in glade first and not worry about the
> code yet and I can convert the code over to use the new .ui
> C.

Olivier Hallot
Founder and Steering Commitee Member
The Document Foundation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20121008/a7e332e2/attachment.html>

More information about the LibreOffice mailing list