diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 40 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.hrc | 5 | ||||
-rw-r--r-- | sfx2/source/dialog/dinfdlg.src | 14 |
3 files changed, 22 insertions, 37 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 3d28a70c59ce..62176bf44a16 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -17,17 +17,18 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <svl/eitem.hxx> +#include <svl/urihelper.hxx> +#include <tools/datetime.hxx> #include <tools/urlobj.hxx> #include <vcl/layout.hxx> -#include <svl/eitem.hxx> +#include <vcl/mnemonic.hxx> #include <vcl/svapp.hxx> #include <unotools/localedatawrapper.hxx> #include <unotools/cmdoptions.hxx> #include <comphelper/processfactory.hxx> -#include <svl/urihelper.hxx> #include <unotools/useroptions.hxx> #include <svtools/imagemgr.hxx> -#include <tools/datetime.hxx> #include <memory> @@ -1230,12 +1231,16 @@ void SfxDocumentInfoDialog::AddFontTabPage() // class CustomPropertiesYesNoButton ------------------------------------- -CustomPropertiesYesNoButton::CustomPropertiesYesNoButton( vcl::Window* pParent, const ResId& rResId ) : - Control( pParent, rResId ), - m_aYesButton( VclPtr<RadioButton>::Create(this, ResId( RB_PROPERTY_YES, *rResId.GetResMgr() )) ), - m_aNoButton ( VclPtr<RadioButton>::Create(this, ResId( RB_PROPERTY_NO, *rResId.GetResMgr() )) ) +CustomPropertiesYesNoButton::CustomPropertiesYesNoButton(vcl::Window* pParent, const ResId& rResId) + : Control(pParent, rResId) + , m_aYesButton(VclPtr<RadioButton>::Create(this, WB_TABSTOP)) + , m_aNoButton(VclPtr<RadioButton>::Create(this, WB_TABSTOP)) { FreeResource(); + m_aYesButton->SetText(MnemonicGenerator::EraseAllMnemonicChars(Button::GetStandardText(StandardButtonType::Yes))); + m_aYesButton->Show(); + m_aNoButton->SetText(MnemonicGenerator::EraseAllMnemonicChars(Button::GetStandardText(StandardButtonType::No))); + m_aNoButton->Show(); SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFieldColor() ) ); SetBorderStyle( WindowBorderStyle::MONO ); CheckNo(); @@ -1244,7 +1249,6 @@ CustomPropertiesYesNoButton::CustomPropertiesYesNoButton( vcl::Window* pParent, m_aNoButton->SetBackground( aWall ); } - CustomPropertiesYesNoButton::~CustomPropertiesYesNoButton() { disposeOnce(); @@ -1386,16 +1390,16 @@ IMPL_LINK_NOARG(CustomPropertiesEditButton, ClickHdl, Button*, void) void CustomPropertiesYesNoButton::Resize() { - const long nWidth = GetSizePixel().Width(); - const long n3Width = LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ).Width(); - const long nNewWidth = ( nWidth / 2 ) - n3Width - 2; - Size aSize = m_aYesButton->GetSizePixel(); - const long nDelta = aSize.Width() - nNewWidth; - aSize.Width() = nNewWidth; - m_aYesButton->SetSizePixel( aSize ); - Point aPos = m_aNoButton->GetPosPixel(); - aPos.X() -= nDelta; - m_aNoButton->SetPosSizePixel( aPos, aSize ); + Size aParentSize(GetSizePixel()); + const long nWidth = aParentSize.Width(); + Size a1Size = LogicToPixel(Size(1, 1), MapUnit::MapAppFont); + const long n3Width = LogicToPixel(Size(3, 3), MapUnit::MapAppFont).Width(); + const long nNewWidth = (nWidth / 2) - n3Width - 2; + Size aSize(nNewWidth, aParentSize.Height() - 2 * a1Size.Height()); + Point aPos(a1Size.Width(), a1Size.Height()); + m_aYesButton->SetPosSizePixel(aPos, aSize); + aPos.X() += aSize.Width() + n3Width; + m_aNoButton->SetPosSizePixel(aPos, aSize); } // struct CustomPropertyLine --------------------------------------------- diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc index 615aa4d8d80c..5d0e85528822 100644 --- a/sfx2/source/dialog/dinfdlg.hrc +++ b/sfx2/source/dialog/dinfdlg.hrc @@ -37,11 +37,6 @@ #define CMIS_TYPE_DATETIME "Datetime" #define CMIS_TYPE_BOOL "Bool" -// defines --------------------------------------------------------------- - -#define RB_PROPERTY_YES 100 -#define RB_PROPERTY_NO 101 - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src index f98158901589..2a92900e90f3 100644 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -108,20 +108,6 @@ Control SFX_WIN_PROPERTY_YESNO Size = MAP_APPFONT ( 61 , RSC_CD_TEXTBOX_HEIGHT ) ; Border = TRUE ; DialogControl = TRUE ; - RadioButton RB_PROPERTY_YES - { - TabStop = TRUE ; - Pos = MAP_APPFONT( 1 , 1 ) ; - Size = MAP_APPFONT( 28 , RSC_CD_RADIOBUTTON_HEIGHT ) ; - Text [ en-US ] = "Yes" ; - }; - RadioButton RB_PROPERTY_NO - { - TabStop = TRUE ; - Pos = MAP_APPFONT( 32 , 1 ) ; - Size = MAP_APPFONT( 29 , RSC_CD_RADIOBUTTON_HEIGHT ) ; - Text [ en-US ] = "No" ; - }; }; String STR_SFX_REMOVE_PROPERTY |