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