Kaydet (Commit) 0867207f authored tarafından Caolán McNamara's avatar Caolán McNamara

tell the options dialog to relayout if a pane queue-resizes

Change-Id: I44686ea724873181018bf00253a08afa58c9a10b
üst b0f4052c
......@@ -140,6 +140,11 @@ typedef std::vector< ExtensionsTabPage* > VectorOfPages;
class OfaTreeOptionsDialog : public SfxModalDialog
{
private:
SvTreeListEntry* pCurrentPageEntry;
Timer maTreeLayoutTimer;
DECL_DLLPRIVATE_LINK( ImplHandleTreeLayoutTimerHdl, void* );
bool hasTreePendingLayout() const;
OKButton aOkPB;
CancelButton aCancelPB;
HelpButton aHelpPB;
......@@ -152,8 +157,6 @@ private:
String sTitle;
String sNotLoadedError;
SvTreeListEntry* pCurrentPageEntry;
// for the ColorTabPage
SfxItemSet* pColorPageItemSet;
SvxColorTabPage *mpColorPage;
......@@ -183,6 +186,7 @@ private:
VectorOfNodes LoadNodes( Module* pModule, const rtl::OUString& rExtensionId );
void InsertNodes( const VectorOfNodes& rNodeList );
virtual void queue_layout();
void SetPaneSize(Window *pPane);
protected:
......
......@@ -484,6 +484,7 @@ struct OptionsGroupInfo
// -----------------------------------------------------------------------
#define INI_LIST() \
pCurrentPageEntry ( NULL ),\
aOkPB ( this, CUI_RES( PB_OK ) ),\
aCancelPB ( this, CUI_RES( PB_CANCEL ) ),\
aHelpPB ( this, CUI_RES( PB_HELP ) ),\
......@@ -492,7 +493,6 @@ struct OptionsGroupInfo
aTreeLB ( this, CUI_RES( TLB_PAGES ) ),\
sTitle ( GetText() ),\
sNotLoadedError ( CUI_RES( ST_LOAD_ERROR ) ),\
pCurrentPageEntry ( NULL ),\
pColorPageItemSet ( NULL ),\
mpColorPage ( NULL ),\
bForgetSelection ( sal_False ),\
......@@ -539,6 +539,8 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog( Window* pParent, const rtl::OUString
OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
{
maTreeLayoutTimer.Stop();
pCurrentPageEntry = NULL;
SvTreeListEntry* pEntry = aTreeLB.First();
// first children
while(pEntry)
......@@ -759,6 +761,9 @@ void OfaTreeOptionsDialog::ApplyItemSets()
void OfaTreeOptionsDialog::InitTreeAndHandler()
{
maTreeLayoutTimer.SetTimeout(50);
maTreeLayoutTimer.SetTimeoutHdl( LINK( this, OfaTreeOptionsDialog, ImplHandleTreeLayoutTimerHdl ) );
aTreeLB.SetNodeDefaultImages();
aTreeLB.SetHelpId( HID_OFADLG_TREELISTBOX );
......@@ -915,6 +920,31 @@ long OfaTreeOptionsDialog::Notify( NotifyEvent& rNEvt )
return SfxModalDialog::Notify(rNEvt);
}
bool OfaTreeOptionsDialog::hasTreePendingLayout() const
{
return maTreeLayoutTimer.IsActive();
}
void OfaTreeOptionsDialog::queue_layout()
{
if (hasTreePendingLayout())
return;
if (IsInClose())
return;
maTreeLayoutTimer.Start();
}
IMPL_LINK( OfaTreeOptionsDialog, ImplHandleTreeLayoutTimerHdl, void*, EMPTYARG )
{
if (pCurrentPageEntry && aTreeLB.GetParent(pCurrentPageEntry))
{
OptionsPageInfo* pPageInfo = (OptionsPageInfo*)pCurrentPageEntry->GetUserData();
if (pPageInfo->m_pPage && pPageInfo->m_pPage->isLayoutEnabled())
SetPaneSize(pPageInfo->m_pPage);
}
return 0;
}
// --------------------------------------------------------------------
void OfaTreeOptionsDialog::SetPaneSize(Window *pPane)
{
......
......@@ -34,7 +34,6 @@ class Edit;
class String;
class SfxObjectShell;
class SfxConfigGroupListBox_Impl;
class SfxConfigFunctionListBox_Impl;
class _HeaderTabListBox;
......
......@@ -95,7 +95,7 @@ public:
virtual void Resize();
bool isLayoutEnabled() const;
void setInitialLayoutSize();
void queue_layout();
virtual void queue_layout();
virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue);
VclButtonBox* get_action_area();
VclBox* get_content_area();
......
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