60 if ( it->mbOwnButton )
61 it->mpPushButton.disposeAndClear();
101 nSepSize += nLastSepSize;
103 tools::Long nTxtWidth = it->mpPushButton->GetOutDev()->GetCtrlTextWidth(it->mpPushButton->GetText());
109 tools::Long nTxtHeight = it->mpPushButton->GetTextHeight();
115 nSepSize += it->mnSepSize;
123 size_t const nButtonCount =
m_ItemList.size();
183 it->mpPushButton->Show();
199 for (
const auto & it : m_ItemList)
201 if ( it->mpPushButton == pBtn )
203 mnCurButtonId = it->mnId;
217 if (
nType == StateChangedType::InitShow )
222 if ( it->mpPushButton && it->mbOwnButton )
223 it->mpPushButton->SetZOrder(
nullptr, ZOrderFlags::Last);
233 if (it->mpPushButton->IsVisible())
234 it->mpPushButton->GrabFocus();
251 pItem->mbOwnButton =
true;
252 pItem->mnSepSize = nSepPixel;
254 if (
eType == StandardButtonType::OK )
256 else if (
eType == StandardButtonType::Help )
258 else if ( (
eType == StandardButtonType::Cancel) || (
eType == StandardButtonType::Close) )
263 if ( !((
eType == StandardButtonType::OK && pItem->mpPushButton->GetType() == WindowType::OKBUTTON) ||
264 (
eType == StandardButtonType::Cancel && pItem->mpPushButton->GetType() == WindowType::CANCELBUTTON) ||
265 (
eType == StandardButtonType::Help && pItem->mpPushButton->GetType() == WindowType::HELPBUTTON)) )
267 std::map<StandardButtonType, OUString> mapButtonTypeToID = {{StandardButtonType::Yes,
"yes"},
268 {StandardButtonType::No,
"no"}, {StandardButtonType::Retry,
"retry"},
269 {StandardButtonType::Close,
"close"}, {StandardButtonType::More,
"more"},
270 {StandardButtonType::Ignore,
"ignore"}, {StandardButtonType::Abort,
"abort"},
271 {StandardButtonType::Less,
"less"}, {StandardButtonType::Count,
"count"}};
272 auto itr = mapButtonTypeToID.find(
eType);
273 if (itr != mapButtonTypeToID.end())
274 pItem->mpPushButton->set_id(itr->second);
289 [&
nId](
const std::unique_ptr<ImplBtnDlgItem>& rItem) { return rItem->mnId == nId; });
292 (*it)->mpPushButton->Hide();
293 if ((*it)->mbOwnButton)
294 (*it)->mpPushButton.disposeAndClear();
296 (*it)->mpPushButton.clear();
301 SAL_WARN(
"vcl.window",
"ButtonDialog::RemoveButton(): ButtonId invalid" );
IMPL_LINK(ButtonDialog, ImplClickHdl, Button *, pBtn, void)
#define BUTTONDIALOG_BUTTON_NOTFOUND
virtual void dispose() override
virtual void StateChanged(StateChangedType nStateChange) override
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetMinOutputSizePixel(const Size &rSize)
static VclPtr< reference_type > Create(Arg &&... arg)
virtual void SetOutputSizePixel(const Size &rNewSize)
virtual void EndDialog(sal_Int32 nResult) override
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)
OUString VCL_DLLPUBLIC GetStandardText(StandardButtonType eButton)
VclPtr< PushButton > mpPushButton
#define IMPL_SEP_BUTTON_X
#define IMPL_MINSIZE_BUTTON_HEIGHT
#define IMPL_EXTRA_BUTTON_WIDTH
#define IMPL_EXTRA_BUTTON_HEIGHT
#define IMPL_SEP_BUTTON_Y
#define IMPL_MINSIZE_BUTTON_WIDTH
#define IMPL_DIALOG_OFFSET
WinBits const WB_DEFBUTTON