diff options
-rw-r--r-- | sw/UIConfig_swriter.mk | 3 | ||||
-rw-r--r-- | sw/inc/helpid.h | 8 | ||||
-rw-r--r-- | sw/source/ui/envelp/envelp.src | 4 | ||||
-rw-r--r-- | sw/source/ui/envelp/envprt.cxx | 133 | ||||
-rw-r--r-- | sw/source/ui/envelp/envprt.hrc | 21 | ||||
-rw-r--r-- | sw/source/ui/envelp/envprt.hxx | 23 | ||||
-rw-r--r-- | sw/source/ui/envelp/envprt.src | 143 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/envprinterpage.ui | 321 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 20 |
9 files changed, 418 insertions, 258 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 96447e489df3..020df2daa986 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -82,9 +82,10 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/datasourcesunavailabledialog \ sw/uiconfig/swriter/ui/dropcapspage \ sw/uiconfig/swriter/ui/dropdownfielddialog \ - sw/uiconfig/swriter/ui/endnotepage \ sw/uiconfig/swriter/ui/editcategories \ sw/uiconfig/swriter/ui/editsectiondialog \ + sw/uiconfig/swriter/ui/endnotepage \ + sw/uiconfig/swriter/ui/envprinterpage \ sw/uiconfig/swriter/ui/exchangedatabases \ sw/uiconfig/swriter/ui/formatsectiondialog \ sw/uiconfig/swriter/ui/formattablepage \ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 918bba2f74a7..ddad116ff642 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -144,7 +144,6 @@ #define HID_FRM_STD "SW_HID_FRM_STD" #define HID_GRF_EXT "SW_HID_GRF_EXT" -#define HID_ENV_PRT "SW_HID_ENV_PRT" #define HID_ENV_ENV "SW_HID_ENV_ENV" #define HID_ENV_FMT "SW_HID_ENV_FMT" #define HID_COND_COLL "SW_HID_COND_COLL" @@ -509,13 +508,6 @@ #define HID_MM_HEADER_12 "SW_HID_MM_HEADER_12" #define HID_MM_HEADER_13 "SW_HID_MM_HEADER_13" -#define HID_ITM_HOR_LEFT "SW_HID_ITM_HOR_LEFT" -#define HID_ITM_HOR_CNTR "SW_HID_ITM_HOR_CNTR" -#define HID_ITM_HOR_RGHT "SW_HID_ITM_HOR_RGHT" -#define HID_ITM_VER_LEFT "SW_HID_ITM_VER_LEFT" -#define HID_ITM_VER_CNTR "SW_HID_ITM_VER_CNTR" -#define HID_ITM_VER_RGHT "SW_HID_ITM_VER_RGHT" - #define HID_TBX_FORMULA_CALC "SW_HID_TBX_FORMULA_CALC" #define HID_TBX_FORMULA_CANCEL "SW_HID_TBX_FORMULA_CANCEL" #define HID_TBX_FORMULA_APPLY "SW_HID_TBX_FORMULA_APPLY" diff --git a/sw/source/ui/envelp/envelp.src b/sw/source/ui/envelp/envelp.src index 9ad5ed2d821b..86fa51f3b4bb 100644 --- a/sw/source/ui/envelp/envelp.src +++ b/sw/source/ui/envelp/envelp.src @@ -19,7 +19,9 @@ #include "envelp.hrc" #include "globals.hrc" - // Strings ****************************************************************** + +// Strings ****************************************************************** + String STR_DATABASE_NOT_OPENED { Text [ en-US ] = "Database could not be opened." ; diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx index 1562fa9341e0..7fc870d13d64 100644 --- a/sw/source/ui/envelp/envprt.cxx +++ b/sw/source/ui/envelp/envprt.cxx @@ -28,78 +28,71 @@ #include "envprt.hrc" -SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet) : - - SfxTabPage(pParent, SW_RES(TP_ENV_PRT), rSet), - - aAlignBox (this, SW_RES(BOX_ALIGN )), - aTopButton (this, SW_RES(BTN_TOP )), - aBottomButton(this, SW_RES(BTN_BOTTOM )), - aRightText (this, SW_RES(TXT_RIGHT )), - aRightField (this, SW_RES(FLD_RIGHT )), - aDownText (this, SW_RES(TXT_DOWN )), - aDownField (this, SW_RES(FLD_DOWN )), - aPrinterInfo (this, SW_RES(TXT_PRINTER)), - aNoNameFL (this, SW_RES(FL_NONAME )), - aPrinterFL (this, SW_RES(FL_PRINTER )), - aPrtSetup (this, SW_RES(BTN_PRTSETUP)) - +SwEnvPrtPage::SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet) + : SfxTabPage(pParent, "EnvPrinterPage", + "modules/swriter/ui/envprinterpage.ui", rSet) { - FreeResource(); + get(m_pAlignBox, "alignbox"); + get(m_pTopButton, "top"); + get(m_pBottomButton, "bottom"); + get(m_pRightField, "right"); + get(m_pDownField, "down"); + get(m_pPrinterInfo, "printername"); + get(m_pPrtSetup, "setup"); SetExchangeSupport(); // Metrics FieldUnit eUnit = ::GetDfltMetric(sal_False); - SetMetric(aRightField, eUnit); - SetMetric(aDownField , eUnit); + SetMetric(*m_pRightField, eUnit); + SetMetric(*m_pDownField, eUnit); // Install handlers - aTopButton .SetClickHdl(LINK(this, SwEnvPrtPage, ClickHdl)); - aBottomButton.SetClickHdl(LINK(this, SwEnvPrtPage, ClickHdl)); + m_pTopButton->SetClickHdl(LINK(this, SwEnvPrtPage, ClickHdl)); + m_pBottomButton->SetClickHdl(LINK(this, SwEnvPrtPage, ClickHdl)); - aPrtSetup .SetClickHdl(LINK(this, SwEnvPrtPage, ButtonHdl)); + m_pPrtSetup->SetClickHdl(LINK(this, SwEnvPrtPage, ButtonHdl)); // Bitmaps - aBottomButton.GetClickHdl().Call(&aBottomButton); + m_pBottomButton->GetClickHdl().Call(m_pBottomButton); // ToolBox - Size aSz = aAlignBox.CalcWindowSizePixel(); - aAlignBox.SetSizePixel(aSz); - aAlignBox.SetClickHdl(LINK(this, SwEnvPrtPage, AlignHdl)); -} - -SwEnvPrtPage::~SwEnvPrtPage() -{ + m_pAlignBox->SetClickHdl(LINK(this, SwEnvPrtPage, AlignHdl)); + m_aIds[ENV_HOR_LEFT] = m_pAlignBox->GetItemId("horileft"); + m_aIds[ENV_HOR_CNTR] = m_pAlignBox->GetItemId("horicenter"); + m_aIds[ENV_HOR_RGHT] = m_pAlignBox->GetItemId("horiright"); + m_aIds[ENV_VER_LEFT] = m_pAlignBox->GetItemId("vertleft"); + m_aIds[ENV_VER_CNTR] = m_pAlignBox->GetItemId("vertcenter"); + m_aIds[ENV_VER_RGHT] = m_pAlignBox->GetItemId("vertright"); } IMPL_LINK_NOARG(SwEnvPrtPage, ClickHdl) { - if (aBottomButton.IsChecked()) + if (m_pBottomButton->IsChecked()) { // Envelope from botton - aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(BMP_HOR_LEFT_LOWER))); - aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(BMP_HOR_CNTR_LOWER))); - aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(BMP_HOR_RGHT_LOWER))); - aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(BMP_VER_LEFT_LOWER))); - aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(BMP_VER_CNTR_LOWER))); - aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(BMP_VER_RGHT_LOWER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_HOR_LEFT], Bitmap(SW_RES(BMP_HOR_LEFT_LOWER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_HOR_CNTR], Bitmap(SW_RES(BMP_HOR_CNTR_LOWER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_HOR_RGHT], Bitmap(SW_RES(BMP_HOR_RGHT_LOWER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_VER_LEFT], Bitmap(SW_RES(BMP_VER_LEFT_LOWER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_VER_CNTR], Bitmap(SW_RES(BMP_VER_CNTR_LOWER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_VER_RGHT], Bitmap(SW_RES(BMP_VER_RGHT_LOWER))); } else { // Envelope from top - aAlignBox.SetItemImage(ITM_HOR_LEFT, Bitmap(SW_RES(BMP_HOR_LEFT_UPPER))); - aAlignBox.SetItemImage(ITM_HOR_CNTR, Bitmap(SW_RES(BMP_HOR_CNTR_UPPER))); - aAlignBox.SetItemImage(ITM_HOR_RGHT, Bitmap(SW_RES(BMP_HOR_RGHT_UPPER))); - aAlignBox.SetItemImage(ITM_VER_LEFT, Bitmap(SW_RES(BMP_VER_LEFT_UPPER))); - aAlignBox.SetItemImage(ITM_VER_CNTR, Bitmap(SW_RES(BMP_VER_CNTR_UPPER))); - aAlignBox.SetItemImage(ITM_VER_RGHT, Bitmap(SW_RES(BMP_VER_RGHT_UPPER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_HOR_LEFT], Bitmap(SW_RES(BMP_HOR_LEFT_UPPER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_HOR_CNTR], Bitmap(SW_RES(BMP_HOR_CNTR_UPPER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_HOR_RGHT], Bitmap(SW_RES(BMP_HOR_RGHT_UPPER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_VER_LEFT], Bitmap(SW_RES(BMP_VER_LEFT_UPPER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_VER_CNTR], Bitmap(SW_RES(BMP_VER_CNTR_UPPER))); + m_pAlignBox->SetItemImage(m_aIds[ENV_VER_RGHT], Bitmap(SW_RES(BMP_VER_RGHT_UPPER))); } return 0; } IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn ) { - if (pBtn == &aPrtSetup) + if (pBtn == m_pPrtSetup) { // Call printer setup if (pPrt) @@ -109,7 +102,7 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn ) pDlg->Execute(); delete pDlg; GrabFocus(); - aPrinterInfo.SetText(pPrt->GetName()); + m_pPrinterInfo->SetText(pPrt->GetName()); } } return 0; @@ -117,17 +110,17 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn ) IMPL_LINK_NOARG(SwEnvPrtPage, AlignHdl) { - if (aAlignBox.GetCurItemId()) + if (m_pAlignBox->GetCurItemId()) { - for (sal_uInt16 i = ITM_HOR_LEFT; i <= ITM_VER_RGHT; i++) - aAlignBox.CheckItem(i, sal_False); - aAlignBox.CheckItem(aAlignBox.GetCurItemId(), sal_True); + for (sal_uInt16 i = ENV_HOR_LEFT; i <= ENV_VER_RGHT; ++i) + m_pAlignBox->CheckItem(m_aIds[i], false); + m_pAlignBox->CheckItem(m_pAlignBox->GetCurItemId(), true); } else { // GetCurItemId() == 0 is possible! const SwEnvItem& rItem = (const SwEnvItem&) GetItemSet().Get(FN_ENVELOP); - aAlignBox.CheckItem((sal_uInt16) rItem.eAlign + ITM_HOR_LEFT, sal_True); + m_pAlignBox->CheckItem(m_aIds[rItem.eAlign], true); } return 0; } @@ -140,7 +133,7 @@ SfxTabPage* SwEnvPrtPage::Create(Window* pParent, const SfxItemSet& rSet) void SwEnvPrtPage::ActivatePage(const SfxItemSet&) { if (pPrt) - aPrinterInfo.SetText(pPrt->GetName()); + m_pPrinterInfo->SetText(pPrt->GetName()); } int SwEnvPrtPage::DeactivatePage(SfxItemSet* _pSet) @@ -152,15 +145,20 @@ int SwEnvPrtPage::DeactivatePage(SfxItemSet* _pSet) void SwEnvPrtPage::FillItem(SwEnvItem& rItem) { - sal_uInt16 nID = 0; - for (sal_uInt16 i = ITM_HOR_LEFT; i <= ITM_VER_RGHT && !nID; i++) - if (aAlignBox.IsItemChecked(i)) - nID = i; - - rItem.eAlign = (SwEnvAlign) (nID - ITM_HOR_LEFT); - rItem.bPrintFromAbove = aTopButton.IsChecked(); - rItem.lShiftRight = static_cast< sal_Int32 >(GetFldVal(aRightField)); - rItem.lShiftDown = static_cast< sal_Int32 >(GetFldVal(aDownField )); + sal_uInt16 nOrient = 0; + for (sal_uInt16 i = ENV_HOR_LEFT; i <= ENV_VER_RGHT; ++i) + { + if (m_pAlignBox->IsItemChecked(m_aIds[i])) + { + nOrient = i; + break; + } + } + + rItem.eAlign = (SwEnvAlign) (nOrient); + rItem.bPrintFromAbove = m_pTopButton->IsChecked(); + rItem.lShiftRight = static_cast< sal_Int32 >(GetFldVal(*m_pRightField)); + rItem.lShiftDown = static_cast< sal_Int32 >(GetFldVal(*m_pDownField )); } sal_Bool SwEnvPrtPage::FillItemSet(SfxItemSet& rSet) @@ -174,21 +172,18 @@ void SwEnvPrtPage::Reset(const SfxItemSet& rSet) { // Read item const SwEnvItem& rItem = (const SwEnvItem&) rSet.Get(FN_ENVELOP); - aAlignBox.CheckItem((sal_uInt16) rItem.eAlign + ITM_HOR_LEFT); + m_pAlignBox->CheckItem(m_aIds[rItem.eAlign]); if (rItem.bPrintFromAbove) - aTopButton .Check(); + m_pTopButton->Check(); else - aBottomButton.Check(); + m_pBottomButton->Check(); - SetFldVal(aRightField, rItem.lShiftRight); - SetFldVal(aDownField , rItem.lShiftDown ); + SetFldVal(*m_pRightField, rItem.lShiftRight); + SetFldVal(*m_pDownField , rItem.lShiftDown ); ActivatePage(rSet); - ClickHdl(&aTopButton); + ClickHdl(m_pTopButton); } - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/envelp/envprt.hrc b/sw/source/ui/envelp/envprt.hrc index ec33c357138b..cd852b9122b0 100644 --- a/sw/source/ui/envelp/envprt.hrc +++ b/sw/source/ui/envelp/envprt.hrc @@ -22,20 +22,6 @@ #include "envelp.hrc" -// local resources ********************************************************* - -#define BOX_ALIGN 1 -#define BTN_TOP 7 -#define BTN_BOTTOM 8 -#define TXT_RIGHT 9 -#define FLD_RIGHT 10 -#define TXT_DOWN 11 -#define FLD_DOWN 12 -#define TXT_PRINTER 13 -#define FL_NONAME 14 -#define BTN_PRTSETUP 15 -#define FL_PRINTER 16 - // global resources ******************************************************** #define BMP_HOR_LEFT_LOWER (RC_ENVPRT_BEGIN ) @@ -52,13 +38,6 @@ #define BMP_VER_RGHT_LOWER (RC_ENVPRT_BEGIN + 10) #define BMP_VER_RGHT_UPPER (RC_ENVPRT_BEGIN + 11) -#define ITM_HOR_LEFT (RC_ENVPRT_BEGIN + 12) -#define ITM_HOR_CNTR (RC_ENVPRT_BEGIN + 13) -#define ITM_HOR_RGHT (RC_ENVPRT_BEGIN + 14) -#define ITM_VER_LEFT (RC_ENVPRT_BEGIN + 15) -#define ITM_VER_CNTR (RC_ENVPRT_BEGIN + 16) -#define ITM_VER_RGHT (RC_ENVPRT_BEGIN + 17) - // overflow check ******************************************************** #define ENVPRT_ACT_END ITM_VER_RGHT diff --git a/sw/source/ui/envelp/envprt.hxx b/sw/source/ui/envelp/envprt.hxx index d0b227329a73..70dc8df10cc3 100644 --- a/sw/source/ui/envelp/envprt.hxx +++ b/sw/source/ui/envelp/envprt.hxx @@ -39,22 +39,19 @@ class SwEnvDlg; class SwEnvPrtPage : public SfxTabPage { - ToolBox aAlignBox; - RadioButton aTopButton; - RadioButton aBottomButton; - FixedText aRightText; - MetricField aRightField; - FixedText aDownText; - MetricField aDownField; - FixedInfo aPrinterInfo; - FixedLine aNoNameFL; - FixedLine aPrinterFL; - PushButton aPrtSetup; + ToolBox* m_pAlignBox; + RadioButton* m_pTopButton; + RadioButton* m_pBottomButton; + MetricField* m_pRightField; + MetricField* m_pDownField; + FixedText* m_pPrinterInfo; + PushButton* m_pPrtSetup; + + sal_uInt16 m_aIds[6]; Printer* pPrt; - SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet); - ~SwEnvPrtPage(); + SwEnvPrtPage(Window* pParent, const SfxItemSet& rSet); DECL_LINK(ClickHdl, void *); DECL_LINK(AlignHdl, void *); diff --git a/sw/source/ui/envelp/envprt.src b/sw/source/ui/envelp/envprt.src index 656ee631f94d..b7f9ac3ed5dc 100644 --- a/sw/source/ui/envelp/envprt.src +++ b/sw/source/ui/envelp/envprt.src @@ -19,146 +19,9 @@ #include "envprt.hrc" #include "helpid.h" - // TP_ENV_PRT --------------------------------------------------------------- -TabPage TP_ENV_PRT -{ - HelpID = HID_ENV_PRT ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - Hide = TRUE ; - FixedLine FL_NONAME - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Envelope orientation"; - }; - ToolBox BOX_ALIGN - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - ItemList = - { - ToolBoxItem - { - Identifier = ITM_HOR_LEFT ; - HelpID = HID_ITM_HOR_LEFT ; - }; - ToolBoxItem - { - Identifier = ITM_HOR_CNTR ; - HelpID = HID_ITM_HOR_CNTR ; - }; - ToolBoxItem - { - Identifier = ITM_HOR_RGHT ; - HelpID = HID_ITM_HOR_RGHT ; - }; - ToolBoxItem - { - Identifier = ITM_VER_LEFT ; - HelpID = HID_ITM_VER_LEFT ; - }; - ToolBoxItem - { - Identifier = ITM_VER_CNTR ; - HelpID = HID_ITM_VER_CNTR ; - }; - ToolBoxItem - { - Identifier = ITM_VER_RGHT ; - HelpID = HID_ITM_VER_RGHT ; - }; - }; - }; - RadioButton BTN_TOP - { - HelpID = "sw:RadioButton:TP_ENV_PRT:BTN_TOP"; - Pos = MAP_APPFONT ( 18 , 42 ) ; - Size = MAP_APPFONT ( 179 , 10 ) ; - Text [ en-US ] = "~Print from top" ; - TabStop = TRUE ; - Group = TRUE ; - Check = TRUE ; - }; - RadioButton BTN_BOTTOM - { - HelpID = "sw:RadioButton:TP_ENV_PRT:BTN_BOTTOM"; - Pos = MAP_APPFONT ( 18 , 56 ) ; - Size = MAP_APPFONT ( 179 , 10 ) ; - Text [ en-US ] = "Print from ~bottom" ; - TabStop = TRUE ; - }; - FixedText TXT_RIGHT - { - Pos = MAP_APPFONT ( 12 , 74 ) ; - Size = MAP_APPFONT ( 72 , 8 ) ; - Text [ en-US ] = "~Shift right" ; - Left = TRUE ; - }; - MetricField FLD_RIGHT - { - HelpID = "sw:MetricField:TP_ENV_PRT:FLD_RIGHT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 86 , 72 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 10000 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText TXT_DOWN - { - Pos = MAP_APPFONT ( 12 , 90 ) ; - Size = MAP_APPFONT ( 72 , 8 ) ; - Text [ en-US ] = "Shift ~down" ; - Left = TRUE ; - }; - MetricField FLD_DOWN - { - HelpID = "sw:MetricField:TP_ENV_PRT:FLD_DOWN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 86 , 88 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 10000 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedLine FL_PRINTER - { - Pos = MAP_APPFONT ( 3 , 103 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Current printer"; - }; - FixedText TXT_PRINTER - { - Pos = MAP_APPFONT ( 12 , 116 ) ; - Size = MAP_APPFONT ( 179 , 8 ) ; - Text [ en-US ] = "- No printer installed -" ; - Left = TRUE ; - }; - PushButton BTN_PRTSETUP - { - HelpID = "sw:PushButton:TP_ENV_PRT:BTN_PRTSETUP"; - Pos = MAP_APPFONT ( 198 , 114 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Setup..." ; - }; -}; - // Bitmaps ****************************************************************** + +// Bitmaps ****************************************************************** + Bitmap BMP_HOR_LEFT_LOWER { File = "envhl_l.bmp" ; diff --git a/sw/uiconfig/swriter/ui/envprinterpage.ui b/sw/uiconfig/swriter/ui/envprinterpage.ui new file mode 100644 index 000000000000..db7440e05538 --- /dev/null +++ b/sw/uiconfig/swriter/ui/envprinterpage.ui @@ -0,0 +1,321 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="upper">100</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkBox" id="EnvPrinterPage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkRadioButton" id="top"> + <property name="label" translatable="yes">_Print from top</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">bottom</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="bottom"> + <property name="label" translatable="yes">Print from _bottom</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">top</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Shift right</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Shift _down</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="right:0.00cm"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">•</property> + <property name="digits">2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="down:0.00cm1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">•</property> + <property name="invisible_char_set">True</property> + <property name="adjustment">adjustment1</property> + <property name="digits">2</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkToolbar" id="alignbox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkToolButton" id="horileft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Horizontal Left</property> + <property name="action_name">horileft</property> + <property name="label" translatable="yes">Horizontal Left</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="horicenter"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Horizontal Center</property> + <property name="action_name">horicenter</property> + <property name="label" translatable="yes">Horizontal Center</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="horiright"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Horizontal Right</property> + <property name="action_name">horiright</property> + <property name="label" translatable="yes">Horizontal Right</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="vertleft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Vertical Left</property> + <property name="action_name">vertleft</property> + <property name="label" translatable="yes">Vertical Left</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="vertcenter"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Vertical Center</property> + <property name="action_name">vertcenter</property> + <property name="label" translatable="yes">Vertical Center</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="vertright"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Vertical Right</property> + <property name="action_name">vertright</property> + <property name="label" translatable="yes">Vertical Right</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label">Envelope orientation</property> + <attributes> + <attribute name="weight" value="semibold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="printerframe"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkButton" id="setup"> + <property name="label" translatable="yes">Setup...</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="printername"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Printer Name</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">setup</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label">Current Printer</property> + <attributes> + <attribute name="weight" value="semibold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> +</interface> diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 7295c318fdda..9d31230c28d1 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1430,18 +1430,28 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri { OUString aCommand(OStringToOUString(extractActionName(rMap), RTL_TEXTENCODING_UTF8)); + sal_uInt16 nItemId = 0; ToolBoxItemBits nBits = 0; if (name == "GtkMenuToolButton") nBits |= TIB_DROPDOWN; - if (!aCommand.isEmpty()) + if (!aCommand.isEmpty() && m_xFrame.is()) { pToolBox->InsertItem(aCommand, m_xFrame, nBits, extractSizeRequest(rMap)); - - OUString aTooltip(OStringToOUString(extractTooltipText(rMap), RTL_TEXTENCODING_UTF8)); - if (!aTooltip.isEmpty()) - pToolBox->SetQuickHelpText(pToolBox->GetItemId(aCommand), aTooltip); + nItemId = pToolBox->GetItemId(aCommand); } + else + { + const sal_uInt16 COMMAND_ITEMID_START = 30000; + nItemId = COMMAND_ITEMID_START + pToolBox->GetItemCount(); + pToolBox->InsertItem(nItemId, + OStringToOUString(extractLabel(rMap), RTL_TEXTENCODING_UTF8), nBits); + pToolBox->SetItemCommand(nItemId, aCommand); + } + + OUString sTooltip(OStringToOUString(extractTooltipText(rMap), RTL_TEXTENCODING_UTF8)); + if (!sTooltip.isEmpty()) + pToolBox->SetQuickHelpText(nItemId, sTooltip); return NULL; // no widget to be created } |