Thanks Caolán
I added these lines in the wiki under Q&A, if you don't mind
Regards
Olivier
2012/10/8 Caolán McNamara <caolanm@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
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.