summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/baside2b.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-30 15:31:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-30 15:59:57 +0000
commit65f41e210f2ef3a77209f9ea1f89a17b4b3bffa9 (patch)
treed4ab3b25e9fc13075d901b7bd8b2ee00fb7e2ba2 /basctl/source/basicide/baside2b.cxx
parent7db524e5cb572949f1c432b2f4b05c5ef10ad178 (diff)
convert RID_POPUP_BRKPROPS menu to .ui
Change-Id: I2f55f4959249ac45de4a852089256a33e0f24d91
Diffstat (limited to 'basctl/source/basicide/baside2b.cxx')
-rw-r--r--basctl/source/basicide/baside2b.cxx56
1 files changed, 29 insertions, 27 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 977d827f8230..56e428069e40 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1456,40 +1456,36 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
BreakPoint* pBrk = rCEvt.IsMouseEvent() ? FindBreakPoint( aEventPos ) : nullptr;
if ( pBrk )
{
+ if (!mpUIBuilder)
+ mpUIBuilder.reset(new VclBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/BasicIDE/ui/breakpointmenus.ui", ""));
+
// test if break point is enabled...
- ScopedVclPtrInstance<PopupMenu> aBrkPropMenu( IDEResId( RID_POPUP_BRKPROPS ) );
- aBrkPropMenu->CheckItem( RID_ACTIV, pBrk->bEnabled );
- switch ( aBrkPropMenu->Execute( this, aPos ) )
+ VclPtr<PopupMenu> xBrkPropMenu = mpUIBuilder->get_menu("breakmenu");
+ xBrkPropMenu->CheckItem(xBrkPropMenu->GetItemId("active"), pBrk->bEnabled);
+ OString sCommand = xBrkPropMenu->GetItemIdent(xBrkPropMenu->Execute(this, aPos));
+ if (sCommand == "active")
{
- case RID_ACTIV:
- {
- pBrk->bEnabled = !pBrk->bEnabled;
- rModulWindow.UpdateBreakPoint( *pBrk );
- Invalidate();
- }
- break;
- case RID_BRKPROPS:
- {
- ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( this, GetBreakPoints() );
- aBrkDlg->SetCurrentBreakPoint( pBrk );
- aBrkDlg->Execute();
- Invalidate();
- }
- break;
+ pBrk->bEnabled = !pBrk->bEnabled;
+ rModulWindow.UpdateBreakPoint( *pBrk );
+ Invalidate();
+ }
+ else if (sCommand == "properties")
+ {
+ ScopedVclPtrInstance<BreakPointDialog> aBrkDlg(this, GetBreakPoints());
+ aBrkDlg->SetCurrentBreakPoint( pBrk );
+ aBrkDlg->Execute();
+ Invalidate();
}
}
else
{
- ScopedVclPtrInstance<PopupMenu> aBrkListMenu( IDEResId( RID_POPUP_BRKDLG ) );
- switch ( aBrkListMenu->Execute( this, aPos ) )
+ VclPtr<PopupMenu> xBrkListMenu = mpUIBuilder->get_menu("breaklistmenu");
+ OString sCommand = xBrkListMenu->GetItemIdent(xBrkListMenu->Execute(this, aPos));
+ if (sCommand == "manage")
{
- case RID_BRKDLG:
- {
- ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( this, GetBreakPoints() );
- aBrkDlg->Execute();
- Invalidate();
- }
- break;
+ ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( this, GetBreakPoints() );
+ aBrkDlg->Execute();
+ Invalidate();
}
}
}
@@ -1533,6 +1529,12 @@ void BreakPointWindow::setBackgroundColor(Color aColor)
SetBackground(Wallpaper(aColor));
}
+void BreakPointWindow::dispose()
+{
+ mpUIBuilder.reset();
+ Window::dispose();
+}
+
namespace
{
const sal_uInt16 ITEM_ID_VARIABLE = 1;