@Caolán: help in widget UI.

Caolán McNamara caolanm at redhat.com
Thu Jun 6 02:34:09 PDT 2013


On Mon, 2013-06-03 at 21:35 -0300, Olivier Hallot wrote:
> Hi Caolán
> 
> I am trying to convert the paragraph drop caps tab page into the new
> widgets UI, but I found a code layout that does not fit into the usual
> scheme.
> 
> In other situations, the custom widget is defined in another file and
> they go to the dll. But here the picture SwDropCapsPict belongs to the
> same file and I don't know how to connect to the widget.
>
> -------------------%<----------------------------
> SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
> 
>     SfxTabPage(pParent,
> "DropCapPage","modules/swriter/ui/dropcappage.ui", rSet),
> 
>     //pPict         (new SwDropCapsPict(this, SW_RES(CNT_PICT))),
>     bModified(sal_False),
>     bFormat(sal_True),
>     rSh(::GetActiveView()->GetWrtShell())
> {
>     get(m_pDropCapsBox,"checkCB_SWITCH");

one thing you can do is something like....

{
   get(m_pDropCapsBox,"checkCB_SWITCH");
   pPict = new SwDropCapsPict(get<VclContainer>("parent_in_ui"),
WB_BORDER)
   ....
}

if container is a grid then use pPict->set_grid_top/left_attach to put
it into the right place

Either way you'll probably have to adapt SwDropCapsPict to have a
GetOptimalSize to return something sensible, e.g.
LogicToPixel(size_in_old_src, MapMode(MAP_APPFONT)); 

C.



More information about the LibreOffice mailing list