route wizards child queue_resize requests to preexisting layout
As an interim measure, until wizards can only be constructed from .ui and then always contain layout widgets, implement listening for layout widget children announcing layout change requests and route that to pre-existing original positioning code. That allows e.g. the mail merge output page in writer to show/hide the alternative descriptions on selecting letter/email. Change-Id: I086921f4d46b29756cf4f4fccdf3bdf632ea70b8
This commit is contained in:
@@ -210,6 +210,7 @@ IMPL_LINK( MyWizardDlg, ImplNextHdl, PushButton*, pBtn )
|
|||||||
class SVT_DLLPUBLIC WizardDialog : public ModalDialog
|
class SVT_DLLPUBLIC WizardDialog : public ModalDialog
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
Timer maWizardLayoutTimer;
|
||||||
Size maPageSize;
|
Size maPageSize;
|
||||||
ImplWizPageData* mpFirstPage;
|
ImplWizPageData* mpFirstPage;
|
||||||
ImplWizButtonData* mpFirstBtn;
|
ImplWizButtonData* mpFirstBtn;
|
||||||
@@ -225,6 +226,9 @@ private:
|
|||||||
sal_Int16 mnLeftAlignCount;
|
sal_Int16 mnLeftAlignCount;
|
||||||
bool mbEmptyViewMargin;
|
bool mbEmptyViewMargin;
|
||||||
|
|
||||||
|
DECL_DLLPRIVATE_LINK( ImplHandleWizardLayoutTimerHdl, void* );
|
||||||
|
bool hasWizardPendingLayout() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
long LogicalCoordinateToPixel(int iCoordinate);
|
long LogicalCoordinateToPixel(int iCoordinate);
|
||||||
/**sets the number of buttons which should be left-aligned. Normally, buttons are right-aligned.
|
/**sets the number of buttons which should be left-aligned. Normally, buttons are right-aligned.
|
||||||
@@ -248,9 +252,9 @@ private:
|
|||||||
SVT_DLLPRIVATE TabPage* ImplGetPage( sal_uInt16 nLevel ) const;
|
SVT_DLLPRIVATE TabPage* ImplGetPage( sal_uInt16 nLevel ) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WizardDialog( Window* pParent, WinBits nStyle = WB_STDTABDIALOG );
|
WizardDialog( Window* pParent, WinBits nStyle = WB_STDTABDIALOG );
|
||||||
WizardDialog( Window* pParent, const ResId& rResId );
|
WizardDialog( Window* pParent, const ResId& rResId );
|
||||||
~WizardDialog();
|
~WizardDialog();
|
||||||
|
|
||||||
virtual void Resize();
|
virtual void Resize();
|
||||||
virtual void StateChanged( StateChangedType nStateChange );
|
virtual void StateChanged( StateChangedType nStateChange );
|
||||||
@@ -259,11 +263,13 @@ public:
|
|||||||
virtual void ActivatePage();
|
virtual void ActivatePage();
|
||||||
virtual long DeactivatePage();
|
virtual long DeactivatePage();
|
||||||
|
|
||||||
sal_Bool ShowPrevPage();
|
virtual void queue_layout();
|
||||||
sal_Bool ShowNextPage();
|
|
||||||
sal_Bool ShowPage( sal_uInt16 nLevel );
|
sal_Bool ShowPrevPage();
|
||||||
sal_Bool Finnish( long nResult = 0 );
|
sal_Bool ShowNextPage();
|
||||||
sal_uInt16 GetCurLevel() const { return mnCurLevel; }
|
sal_Bool ShowPage( sal_uInt16 nLevel );
|
||||||
|
sal_Bool Finnish( long nResult = 0 );
|
||||||
|
sal_uInt16 GetCurLevel() const { return mnCurLevel; }
|
||||||
|
|
||||||
void AddPage( TabPage* pPage );
|
void AddPage( TabPage* pPage );
|
||||||
void RemovePage( TabPage* pPage );
|
void RemovePage( TabPage* pPage );
|
||||||
|
@@ -61,6 +61,9 @@ void WizardDialog::ImplInitData()
|
|||||||
meViewAlign = WINDOWALIGN_LEFT;
|
meViewAlign = WINDOWALIGN_LEFT;
|
||||||
mbEmptyViewMargin = false;
|
mbEmptyViewMargin = false;
|
||||||
mnLeftAlignCount = 0;
|
mnLeftAlignCount = 0;
|
||||||
|
|
||||||
|
maWizardLayoutTimer.SetTimeout(50);
|
||||||
|
maWizardLayoutTimer.SetTimeoutHdl( LINK( this, WizardDialog, ImplHandleWizardLayoutTimerHdl ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
@@ -111,7 +114,26 @@ void WizardDialog::ImplCalcSize( Size& rSize )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
bool WizardDialog::hasWizardPendingLayout() const
|
||||||
|
{
|
||||||
|
return maWizardLayoutTimer.IsActive();
|
||||||
|
}
|
||||||
|
|
||||||
|
void WizardDialog::queue_layout()
|
||||||
|
{
|
||||||
|
if (hasWizardPendingLayout())
|
||||||
|
return;
|
||||||
|
if (IsInClose())
|
||||||
|
return;
|
||||||
|
maWizardLayoutTimer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
IMPL_LINK( WizardDialog, ImplHandleWizardLayoutTimerHdl, void*, EMPTYARG )
|
||||||
|
{
|
||||||
|
ImplPosCtrls();
|
||||||
|
ImplPosTabPage();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void WizardDialog::ImplPosCtrls()
|
void WizardDialog::ImplPosCtrls()
|
||||||
{
|
{
|
||||||
@@ -357,8 +379,9 @@ WizardDialog::WizardDialog( Window* pParent, const ResId& rResId ) :
|
|||||||
|
|
||||||
WizardDialog::~WizardDialog()
|
WizardDialog::~WizardDialog()
|
||||||
{
|
{
|
||||||
if ( mpFixedLine )
|
maWizardLayoutTimer.Stop();
|
||||||
delete mpFixedLine;
|
|
||||||
|
delete mpFixedLine;
|
||||||
|
|
||||||
// Remove all buttons
|
// Remove all buttons
|
||||||
while ( mpFirstBtn )
|
while ( mpFirstBtn )
|
||||||
|
Reference in New Issue
Block a user