Kaydet (Commit) 68b58756 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert custom bibliography toolbar to .ui format

Change-Id: I70eb0e2ff96879d1168b241852a0079f540b0319
üst f14e5f5d
......@@ -17,6 +17,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sbibliography,\
extensions/uiconfig/sbibliography/ui/choosedatasourcedialog \
extensions/uiconfig/sbibliography/ui/generalpage \
extensions/uiconfig/sbibliography/ui/mappingdialog \
extensions/uiconfig/sbibliography/ui/toolbar \
))
# vim: set noet sw=4 ts=4:
......@@ -20,11 +20,6 @@
#ifndef EXTENSIONS_BIBLIOGRAPHY_HRC
#define EXTENSIONS_BIBLIOGRAPHY_HRC
#define HID_BIB_CHANGESOURCE "EXTENSIONS_HID_BIB_CHANGESOURCE"
#define HID_BIB_MAPPINGDLG "EXTENSIONS_HID_BIB_MAPPINGDLG"
#define HID_BIB_TBX_TABLE "EXTENSIONS_HID_BIB_TBX_TABLE"
#define HID_BIB_TBX_SEARCH "EXTENSIONS_HID_BIB_TBX_SEARCH"
#define HID_BIB_TBX_AUTOFILTER "EXTENSIONS_HID_BIB_TBX_AUTOFILTER"
#define HID_BIB_IDENTIFIER_POS "EXTENSIONS_HID_BIB_IDENTIFIER_POS"
#define HID_BIB_AUTHORITYTYPE_POS "EXTENSIONS_HID_BIB_AUTHORITYTYPE_POS"
#define HID_BIB_AUTHOR_POS "EXTENSIONS_HID_BIB_AUTHOR_POS"
......@@ -56,7 +51,6 @@
#define HID_BIB_CUSTOM3_POS "EXTENSIONS_HID_BIB_CUSTOM3_POS"
#define HID_BIB_CUSTOM4_POS "EXTENSIONS_HID_BIB_CUSTOM4_POS"
#define HID_BIB_CUSTOM5_POS "EXTENSIONS_HID_BIB_CUSTOM5_POS"
#define HID_BIB_DB_TBX "EXTENSIONS_HID_BIB_DB_TBX"
#define HID_BIB_CONTROL_PARENT "EXTENSIONS_HID_BIB_CONTROL_PARENT"
#define UID_BIB_FRAME_WINDOW "EXTENSIONS_UID_BIB_FRAME_WINDOW"
#define HID_BIB_DB_GRIDCTRL "EXTENSIONS_HID_BIB_DB_GRIDCTRL"
......
......@@ -30,7 +30,6 @@
#include <tools/debug.hxx>
#include "bibbeam.hxx"
#include "bibview.hxx"
#include "toolbar.hrc"
#include "bibresid.hxx"
#include "datman.hxx"
#include "bibtools.hxx"
......@@ -222,7 +221,7 @@ namespace bib
void BibBeamer::createToolBar()
{
pToolBar= VclPtr<BibToolBar>::Create(this, LINK( this, BibBeamer, RecalcLayout_Impl ));
::Size aSize=pToolBar->GetSizePixel();
::Size aSize=pToolBar->get_preferred_size();
InsertItem(ID_TOOLBAR, pToolBar, aSize.Height(), 0, 0, SplitWindowItemFlags::Fixed );
if ( m_xController.is() )
pToolBar->SetXController( m_xController );
......@@ -270,7 +269,7 @@ namespace bib
IMPL_LINK_NOARG_TYPED( BibBeamer, RecalcLayout_Impl, void*, void )
{
long nHeight = pToolBar->GetSizePixel().Height();
long nHeight = pToolBar->get_preferred_size().Height();
SetItemSize( ID_TOOLBAR, nHeight );
}
......
......@@ -64,7 +64,6 @@
#include "bibview.hxx"
#include "bibprop.hrc"
#include "toolbar.hxx"
#include "toolbar.hrc"
#include "bibconfig.hxx"
#include "bibbeam.hxx"
#include "general.hxx"
......@@ -1562,8 +1561,8 @@ OUString BibDataManager::CreateDBChangeDialog(vcl::Window* pParent)
void BibDataManager::DispatchDBChangeDialog()
{
if(pToolbar)
pToolbar->SendDispatch(TBC_BT_CHANGESOURCE, Sequence< PropertyValue >());
if (pToolbar)
pToolbar->SendDispatch(pToolbar->GetChangeSourceId(), Sequence< PropertyValue >());
}
const OUString& BibDataManager::GetIdentifierMapping()
......
......@@ -32,8 +32,8 @@
#include <vcl/mnemonic.hxx>
#include "bibbeam.hxx"
#include "bibview.hxx"
#include "toolbar.hrc"
#include "bibresid.hxx"
#include "bib.hrc"
#include "bibtools.hxx"
#include <osl/mutex.hxx>
......@@ -176,9 +176,9 @@ void BibTBEditListener::statusChanged(const frame::FeatureStateEvent& rEvt)throw
}
}
BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink, WinBits nStyle):
ToolBox(pParent,BibResId(RID_BIB_TOOLBAR)),
aImgLst(BibResId( RID_TOOLBAR_IMGLIST )),
BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink)
: ToolBox(pParent, "toolbar", "modules/sbibliography/ui/toolbar.ui")
, aImgLst(BibResId( RID_TOOLBAR_IMGLIST )),
aBigImgLst(BibResId( RID_TOOLBAR_BIGIMGLIST )),
aFtSource(VclPtr<FixedText>::Create(this,WB_VCENTER)),
aLBSource(VclPtr<ListBox>::Create(this,WB_DROPDOWN)),
......@@ -194,8 +194,6 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink, WinBits nSt
nSymbolsSize = aSvtMiscOptions.GetCurrentSymbolsSize();
nOutStyle = aSvtMiscOptions.GetToolboxStyle();
ApplyImageList();
SetStyle(GetStyle()|nStyle);
SetOutStyle(TOOLBOX_STYLE_FLAT);
Size a2Size(GetOutputSizePixel());
a2Size.Width()=100;
......@@ -215,20 +213,32 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link<void*,void> aLink, WinBits nSt
aEdQuery->SetSizePixel(aLBSource->GetSizePixel());
aEdQuery->Show();
OUString aStr=GetItemText(TBC_FT_SOURCE);
nTBC_FT_SOURCE = GetItemId("TBC_FT_SOURCE");
nTBC_LB_SOURCE = GetItemId(".uno:Bib/source");
nTBC_FT_QUERY = GetItemId("TBC_FT_QUERY");
nTBC_ED_QUERY = GetItemId(".uno:Bib/query");
nTBC_BT_AUTOFILTER = GetItemId(".uno:Bib/autoFilter");
nTBC_BT_COL_ASSIGN = GetItemId("TBC_BT_COL_ASSIGN");
nTBC_BT_CHANGESOURCE = GetItemId(".uno:Bib/sdbsource");
nTBC_BT_FILTERCRIT = GetItemId(".uno:Bib/standardFilter");
nTBC_BT_REMOVEFILTER = GetItemId(".uno:Bib/removeFilter");
OUString aStr = GetItemText(nTBC_FT_SOURCE);
aFtSource->SetText(aStr);
aFtSource->SetSizePixel(aFtSource->get_preferred_size());
aFtSource->SetBackground(Wallpaper( COL_TRANSPARENT ));
aStr=GetItemText(TBC_FT_QUERY);
aStr=GetItemText(nTBC_FT_QUERY);
aFtQuery->SetText(aStr);
aFtQuery->SetSizePixel(aFtQuery->get_preferred_size());
aFtQuery->SetBackground(Wallpaper( COL_TRANSPARENT ));
SetItemWindow(TBC_FT_SOURCE, aFtSource.get());
SetItemWindow(TBC_LB_SOURCE, aLBSource.get());
SetItemWindow(TBC_FT_QUERY , aFtQuery.get());
SetItemWindow(TBC_ED_QUERY , aEdQuery.get());
SetItemWindow(nTBC_FT_SOURCE, aFtSource.get());
SetItemWindow(nTBC_LB_SOURCE, aLBSource.get());
SetItemWindow(nTBC_FT_QUERY , aFtQuery.get());
SetItemWindow(nTBC_ED_QUERY , aEdQuery.get());
ApplyImageList();
::bib::AddToTaskPaneList( this );
}
......@@ -261,13 +271,13 @@ void BibToolBar::InitListener()
util::URL aQueryURL;
aQueryURL.Complete = ".uno:Bib/MenuFilter";
xTrans->parseStrict( aQueryURL);
BibToolBarListener* pQuery=new BibTBQueryMenuListener(this,aQueryURL.Complete,TBC_BT_AUTOFILTER);
BibToolBarListener* pQuery=new BibTBQueryMenuListener(this, aQueryURL.Complete, nTBC_BT_AUTOFILTER);
xDisp->addStatusListener(uno::Reference< frame::XStatusListener > (pQuery),aQueryURL);
for(sal_uInt16 nPos=0;nPos<nCount;nPos++)
{
sal_uInt16 nId=GetItemId(nPos);
if(!nId || nId==TBC_FT_SOURCE || nId==TBC_FT_QUERY)
if(!nId || nId== nTBC_FT_SOURCE || nId == nTBC_FT_QUERY)
continue;
util::URL aURL;
......@@ -278,11 +288,11 @@ void BibToolBar::InitListener()
xTrans->parseStrict( aURL );
css::uno::Reference< css::frame::XStatusListener> xListener;
if(nId==TBC_LB_SOURCE)
if (nId == nTBC_LB_SOURCE)
{
xListener=new BibTBListBoxListener(this,aURL.Complete,nId);
}
else if(nId==TBC_ED_QUERY)
else if (nId == nTBC_ED_QUERY)
{
xListener=new BibTBEditListener(this,aURL.Complete,nId);
}
......@@ -308,7 +318,7 @@ void BibToolBar::Select()
{
sal_uInt16 nId=GetCurItemId();
if(nId!=TBC_BT_AUTOFILTER)
if (nId != nTBC_BT_AUTOFILTER)
{
SendDispatch(nId,Sequence<PropertyValue>() );
}
......@@ -354,15 +364,15 @@ void BibToolBar::SendDispatch(sal_uInt16 nId, const Sequence< PropertyValue >& r
void BibToolBar::Click()
{
sal_uInt16 nId=GetCurItemId();
sal_uInt16 nId = GetCurItemId();
if(nId == TBC_BT_COL_ASSIGN )
if (nId == nTBC_BT_COL_ASSIGN )
{
if(pDatMan)
pDatMan->CreateMappingDialog(GetParent());
CheckItem( nId, false );
}
else if(nId == TBC_BT_CHANGESOURCE)
else if (nId == nTBC_BT_CHANGESOURCE)
{
if(pDatMan)
{
......@@ -449,7 +459,7 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt )
pPropertyVal[0].Value <<= aSelection;
pPropertyVal[1].Name="QueryField";
pPropertyVal[1].Value <<= aQueryField;
SendDispatch(TBC_BT_AUTOFILTER,aPropVal);
SendDispatch(nTBC_BT_AUTOFILTER, aPropVal);
return bResult;
}
......@@ -473,18 +483,18 @@ IMPL_LINK_NOARG_TYPED( BibToolBar, SendSelHdl, Idle*, void )
OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource->GetSelectEntry() ) );
OUString aSelection = aEntry;
pPropertyVal[0].Value <<= aSelection;
SendDispatch(TBC_LB_SOURCE,aPropVal);
SendDispatch(nTBC_LB_SOURCE, aPropVal);
}
IMPL_LINK_NOARG_TYPED( BibToolBar, MenuHdl, ToolBox*, void)
{
sal_uInt16 nId=GetCurItemId();
if(nId==TBC_BT_AUTOFILTER)
if (nId == nTBC_BT_AUTOFILTER)
{
EndSelection(); // vor SetDropMode (SetDropMode ruft SetItemImage)
SetItemDown(TBC_BT_AUTOFILTER,true);
nId = aPopupMenu.Execute(this, GetItemRect(TBC_BT_AUTOFILTER));
SetItemDown(nTBC_BT_AUTOFILTER, true);
nId = aPopupMenu.Execute(this, GetItemRect(nTBC_BT_AUTOFILTER));
if(nId>0)
......@@ -500,13 +510,13 @@ IMPL_LINK_NOARG_TYPED( BibToolBar, MenuHdl, ToolBox*, void)
pPropertyVal[0].Value <<= aSelection;
pPropertyVal[1].Name="QueryField";
pPropertyVal[1].Value <<= aQueryField;
SendDispatch(TBC_BT_AUTOFILTER,aPropVal);
SendDispatch(nTBC_BT_AUTOFILTER, aPropVal);
}
Point aPoint;
MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC );
MouseMove( aLeave );
SetItemDown(TBC_BT_AUTOFILTER,false);
SetItemDown(nTBC_BT_AUTOFILTER, false);
}
......@@ -577,9 +587,9 @@ void BibToolBar::ApplyImageList()
( aImgLst ) :
( aBigImgLst );
SetItemImage(TBC_BT_AUTOFILTER , rList.GetImage(SID_FM_AUTOFILTER));
SetItemImage(TBC_BT_FILTERCRIT , rList.GetImage(SID_FM_FILTERCRIT));
SetItemImage(TBC_BT_REMOVEFILTER, rList.GetImage(SID_FM_REMOVE_FILTER_SORT ));
SetItemImage(nTBC_BT_AUTOFILTER , rList.GetImage(SID_FM_AUTOFILTER));
SetItemImage(nTBC_BT_FILTERCRIT , rList.GetImage(SID_FM_FILTERCRIT));
SetItemImage(nTBC_BT_REMOVEFILTER, rList.GetImage(SID_FM_REMOVE_FILTER_SORT ));
AdjustToolBox();
}
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "bib.hrc"
#define TBC_FT_SOURCE 1
#define TBC_LB_SOURCE 2
#define TBC_FT_QUERY 3
#define TBC_ED_QUERY 4
#define TBC_BT_AUTOFILTER 5
#define TBC_BT_FILTERCRIT 6
#define TBC_BT_REMOVEFILTER 7
#define TBC_BT_COL_ASSIGN 15
#define TBC_BT_CHANGESOURCE 16
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -124,6 +124,16 @@ class BibToolBar: public ToolBox
sal_Int16 nSymbolsSize;
sal_Int16 nOutStyle;
sal_uInt16 nTBC_FT_SOURCE;
sal_uInt16 nTBC_LB_SOURCE;
sal_uInt16 nTBC_FT_QUERY;
sal_uInt16 nTBC_ED_QUERY;
sal_uInt16 nTBC_BT_AUTOFILTER;
sal_uInt16 nTBC_BT_COL_ASSIGN;
sal_uInt16 nTBC_BT_CHANGESOURCE;
sal_uInt16 nTBC_BT_FILTERCRIT;
sal_uInt16 nTBC_BT_REMOVEFILTER;
BibDataManager* pDatMan;
DECL_LINK_TYPED( SelHdl, ListBox&, void );
DECL_LINK_TYPED( SendSelHdl, Idle*, void );
......@@ -145,10 +155,12 @@ class BibToolBar: public ToolBox
public:
BibToolBar(vcl::Window* pParent, Link<void*,void> aLink, WinBits nStyle = WB_3DLOOK );
BibToolBar(vcl::Window* pParent, Link<void*,void> aLink);
virtual ~BibToolBar();
virtual void dispose() override;
sal_uInt16 GetChangeSourceId() const { return nTBC_BT_CHANGESOURCE; }
void SetXController(const css::uno::Reference< css::frame::XController > &);
void ClearSourceList();
......
......@@ -18,95 +18,11 @@
*/
#include <svx/svxids.hrc>
#include "bibliography.hrc"
#include "toolbar.hrc"
#include "svx/svxcommands.h"
#include "bib.hrc"
#define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; };
ToolBox RID_BIB_TOOLBAR
{
HelpId = HID_BIB_DB_TBX;
Sizeable = TRUE ;
HideWhenDeactivate = TRUE ;
LineSpacing = TRUE ;
Border = TRUE ;
SVLook = TRUE ;
Pos = MAP_APPFONT ( 0 , 0 ) ;
Size = MAP_APPFONT ( 200 , 16 ) ;
ButtonType = BUTTON_SYMBOL ;
ItemList =
{
ToolBoxItem
{
Identifier = TBC_FT_SOURCE;
Text [ en-US ] = "Table";
};
ToolBoxItem
{
Identifier = TBC_LB_SOURCE;
HelpID = HID_BIB_TBX_TABLE;
Command = ".uno:Bib/source" ;
};
ToolBoxItem
{
Type = TOOLBOXITEM_SEPARATOR ;
};
ToolBoxItem
{
Identifier = TBC_FT_QUERY;
Text [ en-US ] = "Search Key";
};
ToolBoxItem
{
Identifier = TBC_ED_QUERY;
HelpID = HID_BIB_TBX_SEARCH;
Command = ".uno:Bib/query" ;
};
ToolBoxItem
{
Type = TOOLBOXITEM_SEPARATOR ;
};
ToolBoxItem
{
Identifier = TBC_BT_AUTOFILTER ;
HelpID = HID_BIB_TBX_AUTOFILTER;
DropDown = TRUE ;
Command = ".uno:Bib/autoFilter" ;
Text [ en-US ] = "AutoFilter";
};
ToolBoxItem
{
Identifier = TBC_BT_FILTERCRIT ;
Command = ".uno:Bib/standardFilter" ;
Text [ en-US ] = "Standard Filter";
};
ToolBoxItem
{
Identifier = TBC_BT_REMOVEFILTER ;
Command = ".uno:Bib/removeFilter" ;
Text [ en-US ] = "Reset Filter";
};
ToolBoxItem
{
Identifier = TBC_BT_COL_ASSIGN ;
HelpId = HID_BIB_MAPPINGDLG;
Text [ en-US ] = "Column Arrangement";
};
ToolBoxItem
{
Identifier = TBC_BT_CHANGESOURCE ;
HelpId = HID_BIB_CHANGESOURCE;
Command = ".uno:Bib/sdbsource" ;
Checkable=TRUE;
Text [ en-US ] = "Data Source";
};
};
Scroll = TRUE ;
};
#define BIB_IMAGES \
IdList = \
{ \
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 -->
<interface>
<requires lib="gtk+" version="3.4"/>
<object class="GtkToolbar" id="toolbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_arrow">False</property>
<child>
<object class="GtkToolButton" id="TBC_FT_SOURCE">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">TBC_FT_SOURCE</property>
<property name="label" translatable="yes">Table</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="TBC_LB_SOURCE">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">.uno:Bib/source</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkSeparatorToolItem" id="toolbutton1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="TBC_FT_QUERY">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">TBC_FT_QUERY</property>
<property name="label" translatable="yes">Search Key</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="TBC_ED_QUERY">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">.uno:Bib/query</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkSeparatorToolItem" id="toolbutton2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkMenuToolButton" id="TBC_BT_AUTOFILTER">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">.uno:Bib/autoFilter</property>
<property name="label" translatable="yes">AutoFilter</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="TBC_BT_FILTERCRIT">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">.uno:Bib/standardFilter</property>
<property name="label" translatable="yes">Standard Filter</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="TBC_BT_REMOVEFILTER">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">.uno:Bib/removeFilter</property>
<property name="label" translatable="yes">Reset Filter</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="TBC_BT_COL_ASSIGN">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">TBC_BT_COL_ASSIGN</property>
<property name="label" translatable="yes">Column Arrangement</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkToolButton" id="TBC_BT_CHANGESOURCE">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">.uno:Bib/sdbsource</property>
<property name="label" translatable="yes">Data Source</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</object>
</interface>
......@@ -247,11 +247,13 @@ private:
mbRollUp:1,
mbDockBtn:1,
mbHideBtn:1,
mbIsDefferedInit:1,
mbIsCalculatingInitialLayoutSize:1,
mbInitialLayoutDone:1;
protected:
bool mbIsDefferedInit;
VclPtr<vcl::Window> mpDialogParent;
private:
SAL_DLLPRIVATE void ImplInitDockingWindowData();
SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox);
......@@ -279,7 +281,7 @@ public:
SAL_DLLPRIVATE bool ImplStartDocking( const Point& rPos );
SAL_DLLPRIVATE bool isDeferredInit() const { return mbIsDefferedInit; }
SAL_DLLPRIVATE bool hasPendingLayout() const { return maLayoutIdle.IsActive(); }
void doDeferredInit(WinBits nBits);
virtual void doDeferredInit(WinBits nBits);
protected:
DockingWindow( WindowType nType );
DockingWindow(vcl::Window* pParent, const ResId& rResId);
......
......@@ -247,8 +247,10 @@ protected:
}
public:
ToolBox( vcl::Window* pParent, WinBits nStyle = 0 );
ToolBox( vcl::Window* pParent, const ResId& rResId );
ToolBox( vcl::Window* pParent, WinBits nStyle = 0 );
ToolBox( vcl::Window* pParent, const ResId& rResId );
ToolBox(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
virtual ~ToolBox();
virtual void dispose() override;
......@@ -283,6 +285,7 @@ public:
virtual void EndDocking( const Rectangle& rRect, bool bFloatMode ) override;
virtual void Resizing( Size& rSize ) override;
virtual Size GetOptimalSize() const override;
virtual void doDeferredInit(WinBits nBits) override;
void InsertItem( const ResId& rResId );
/// Insert a command (like '.uno:Save').
......
......@@ -1593,6 +1593,14 @@ void ToolBox::ImplLoadRes( const ResId& rResId )
}
}
void ToolBox::doDeferredInit(WinBits nBits)
{
VclPtr<vcl::Window> pParent = mpDialogParent;
mpDialogParent = nullptr;
ImplInit(pParent, nBits);
mbIsDefferedInit = false;
}
ToolBox::ToolBox( vcl::Window* pParent, WinBits nStyle ) :
DockingWindow( WINDOW_TOOLBOX )
{
......@@ -1620,6 +1628,23 @@ ToolBox::ToolBox( vcl::Window* pParent, const ResId& rResId ) :
Show();
}
ToolBox::ToolBox(vcl::Window* pParent, const OString& rID,
const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame)
: DockingWindow(WINDOW_TOOLBOX)
{
loadUI(pParent, rID, rUIXMLDescription, rFrame);
// calculate size of floating windows and switch if the
// toolbox is initially in floating mode
if ( ImplIsFloatingMode() )
mbHorz = true;
else
Resize();
if (!(GetStyle() & WB_HIDE))
Show();
}
ToolBox::~ToolBox()
{
disposeOnce();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment