summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-06 11:52:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-06 11:54:17 +0100
commitac5b44c087a9b5f20795875189fe1dc18a12c004 (patch)
tree19fe2c34b4e2128c9bdd04aaf2fa543bd4e5bf4a /sd/source/ui/dlg
parentc77ec4fe42c064adc507caa2760a99e096f8c016 (diff)
tweak custom widget to give an optimal size
+ move accessibility relations into the .ui now that we can + drop unused hids + rework the format/language positions to be less weird + add a custom widget stub to make easy to edit with glade Change-Id: I9607603536f9df2b7cac0074880089adad3b9860
Diffstat (limited to 'sd/source/ui/dlg')
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx89
1 files changed, 34 insertions, 55 deletions
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index d52b8b68e0fe..d3ebed9a6341 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -28,10 +28,11 @@
#include "sdresid.hxx"
-#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
-#include <vcl/edit.hxx>
#include <vcl/combobox.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
#include "helpids.h"
#include "Outliner.hxx"
@@ -79,6 +80,7 @@ public:
~PresLayoutPreview();
virtual void Paint( const Rectangle& rRect );
+ virtual Size GetOptimalSize() const;
void init( SdPage* pMaster );
void update( HeaderFooterSettings& rSettings );
@@ -120,7 +122,7 @@ private:
FixedText* mpFTIncludeOn;
CheckBox* mpCBHeader;
- FixedText* mpFTHeader;
+ VclContainer* mpHeaderBox;
Edit* mpTBHeader;
CheckBox* mpCBDateTime;
@@ -132,7 +134,7 @@ private:
SvxLanguageBox* mpCBDateTimeLanguage;
CheckBox* mpCBFooter;
- FixedText* mpFTFooter;
+ VclContainer* mpFooterBox;
Edit* mpTBFooter;
CheckBox* mpCBSlideNumber;
@@ -182,7 +184,6 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, ::Window* pParent
mpCurrentPage( pCurrentPage ),
mpViewShell( pViewShell )
{
- //FreeResource();
get(mpTabCtrl, "tabs" );
SdPage* pSlide;
@@ -207,12 +208,10 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, ::Window* pParent
}
pDoc->StopWorkStartupDelay();
-// mpTabCtrl.SetHelpId( HID_XML_FILTER_TABPAGE_CTRL );
mpTabCtrl->Show();
mnSlidesId = mpTabCtrl->GetPageId("slides");
mpSlideTabPage = new HeaderFooterTabPage( this, mpTabCtrl, pDoc, pSlide, false );
- //mpSlideTabPage->SetHelpId( HID_SD_TABPAGE_HEADERFOOTER_SLIDE );
mpTabCtrl->SetTabPage( mnSlidesId, mpSlideTabPage );
Size aSiz = mpSlideTabPage->GetSizePixel();
@@ -226,24 +225,14 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, ::Window* pParent
mnNotesId = mpTabCtrl->GetPageId("notes");
mpNotesHandoutsTabPage = new HeaderFooterTabPage( this, mpTabCtrl, pDoc, pNotes, true );
- //mpNotesHandoutsTabPage->SetHelpId( HID_SD_TABPAGE_HEADERFOOTER_NOTESHANDOUT );
mpTabCtrl->SetTabPage( mnNotesId, mpNotesHandoutsTabPage );
get(maPBApplyToAll, "apply_all" );
get(maPBApply, "apply" );
get(maPBCancel, "cancel" );
- /*aSiz = mpNotesHandoutsTabPage->GetSizePixel();
- if ( aCtrlSiz.Width() < aSiz.Width() || aCtrlSiz.Height() < aSiz.Height() )
- {
- mpTabCtrl.SetOutputSizePixel( aSiz );
- aCtrlSiz = aSiz;
- }*/
-
ActivatePageHdl( mpTabCtrl );
- AdjustLayout();
-
mpTabCtrl->SetActivatePageHdl( LINK( this, HeaderFooterDialog, ActivatePageHdl ) );
mpTabCtrl->SetDeactivatePageHdl( LINK( this, HeaderFooterDialog, DeactivatePageHdl ) );
@@ -446,30 +435,30 @@ HeaderFooterTabPage::HeaderFooterTabPage( HeaderFooterDialog* pDialog, ::Window*
mpDialog(pDialog),
mbHandoutMode( bHandoutMode )
{
- get(mpFTIncludeOn, "include_label");
- get(mpCBHeader, "header_cb" );
- get(mpFTHeader, "header_label" );
- get(mpTBHeader, "header_text" );
- get(mpCBDateTime, "datetime_cb" );
- get(mpRBDateTimeFixed, "rb_fixed" );
- get(mpRBDateTimeAutomatic, "rb_auto" );
- get(mpTBDateTimeFixed, "datetime_value" );
- get(mpCBDateTimeFormat, "datetime_format_list" );
- get(mpFTDateTimeLanguage, "language_label" );
- get(mpCBDateTimeLanguage, "language_list" );
+ get(mpFTIncludeOn, "include_label");
+ get(mpCBHeader, "header_cb" );
+ get(mpHeaderBox, "header_box" );
+ get(mpTBHeader, "header_text" );
+ get(mpCBDateTime, "datetime_cb" );
+ get(mpRBDateTimeFixed, "rb_fixed" );
+ get(mpRBDateTimeAutomatic, "rb_auto" );
+ get(mpTBDateTimeFixed, "datetime_value" );
+ get(mpCBDateTimeFormat, "datetime_format_list" );
+ get(mpFTDateTimeLanguage, "language_label" );
+ get(mpCBDateTimeLanguage, "language_list" );
- get(mpCBFooter, "footer_cb" );
- get(mpFTFooter, "footer_label" );
- get(mpTBFooter, "footer_text" );
+ get(mpCBFooter, "footer_cb" );
+ get(mpFooterBox, "footer_box" );
+ get(mpTBFooter, "footer_text" );
- get(mpCBSlideNumber, "slide_number" );
+ get(mpCBSlideNumber, "slide_number" );
- get(mpCBNotOnTitle, "not_on_title" );
+ get(mpCBNotOnTitle, "not_on_title" );
- get(mpCTPreview, "preview");
- mpCTPreview->init( pActualPage ?
- (pActualPage->IsMasterPage() ? pActualPage : (SdPage*)(&(pActualPage->TRG_GetMasterPage()))) :
- (pDoc->GetMasterSdPage( 0, bHandoutMode ? PK_NOTES : PK_STANDARD )) );
+ get(mpCTPreview, "preview");
+ mpCTPreview->init( pActualPage ?
+ (pActualPage->IsMasterPage() ? pActualPage : (SdPage*)(&(pActualPage->TRG_GetMasterPage()))) :
+ (pDoc->GetMasterSdPage( 0, bHandoutMode ? PK_NOTES : PK_STANDARD )) );
if( mbHandoutMode )
{
@@ -481,8 +470,7 @@ HeaderFooterTabPage::HeaderFooterTabPage( HeaderFooterDialog* pDialog, ::Window*
}
mpCBHeader->Show( mbHandoutMode );
- mpFTHeader->Show( mbHandoutMode );
- mpTBHeader->Show( mbHandoutMode );
+ mpHeaderBox->Show( mbHandoutMode );
mpCBNotOnTitle->Show( !mbHandoutMode );
mpCBDateTime->SetClickHdl( LINK( this, HeaderFooterTabPage, UpdateOnClickHdl ) );
@@ -500,18 +488,6 @@ HeaderFooterTabPage::HeaderFooterTabPage( HeaderFooterDialog* pDialog, ::Window*
mpCBDateTimeLanguage->SelectLanguage( meOldLanguage );
FillFormatList(SVXDATEFORMAT_A);
-
- mpTBHeader->SetAccessibleRelationMemberOf(mpCBHeader);
- mpRBDateTimeFixed->SetAccessibleRelationMemberOf(mpCBDateTime);
- mpRBDateTimeAutomatic->SetAccessibleRelationMemberOf(mpCBDateTime);
- mpTBDateTimeFixed->SetAccessibleName(mpRBDateTimeFixed->GetText());
- mpTBDateTimeFixed->SetAccessibleRelationMemberOf(mpCBDateTime);
- mpTBDateTimeFixed->SetAccessibleRelationLabeledBy(mpRBDateTimeFixed);
- mpCBDateTimeFormat->SetAccessibleRelationMemberOf(mpCBDateTime);
- mpCBDateTimeFormat->SetAccessibleName(mpRBDateTimeAutomatic->GetText());
- mpCBDateTimeFormat->SetAccessibleRelationLabeledBy(mpRBDateTimeAutomatic);
- mpCBDateTimeLanguage->SetAccessibleRelationMemberOf(mpCBDateTime);
- mpTBFooter->SetAccessibleRelationMemberOf(mpCBFooter);
}
// -----------------------------------------------------------------------
@@ -626,11 +602,9 @@ void HeaderFooterTabPage::update()
mpFTDateTimeLanguage->Enable( mpCBDateTime->IsChecked() && mpRBDateTimeAutomatic->IsChecked() );
mpCBDateTimeLanguage->Enable( mpCBDateTime->IsChecked() && mpRBDateTimeAutomatic->IsChecked() );
- mpFTFooter->Enable( mpCBFooter->IsChecked() );
- mpTBFooter->Enable( mpCBFooter->IsChecked() );
+ mpFooterBox->Enable( mpCBFooter->IsChecked() );
- mpFTHeader->Enable( mpCBHeader->IsChecked() );
- mpTBHeader->Enable( mpCBHeader->IsChecked() );
+ mpHeaderBox->Enable( mpCBHeader->IsChecked() );
HeaderFooterSettings aSettings;
bool bNotOnTitle;
@@ -775,6 +749,11 @@ PresLayoutPreview::~PresLayoutPreview()
{
}
+Size PresLayoutPreview::GetOptimalSize() const
+{
+ return LogicToPixel(Size(80, 80), MAP_APPFONT);
+}
+
// -----------------------------------------------------------------------
void PresLayoutPreview::init( SdPage *pMaster )