summaryrefslogtreecommitdiff
path: root/basctl
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
parent7db524e5cb572949f1c432b2f4b05c5ef10ad178 (diff)
convert RID_POPUP_BRKPROPS menu to .ui
Change-Id: I2f55f4959249ac45de4a852089256a33e0f24d91
Diffstat (limited to 'basctl')
-rw-r--r--basctl/UIConfig_basicide.mk1
-rw-r--r--basctl/inc/basidesh.hrc2
-rw-r--r--basctl/inc/helpid.hrc3
-rw-r--r--basctl/source/basicide/baside2.hrc7
-rw-r--r--basctl/source/basicide/baside2.hxx2
-rw-r--r--basctl/source/basicide/baside2b.cxx56
-rw-r--r--basctl/source/basicide/basidesh.src38
-rw-r--r--basctl/uiconfig/basicide/ui/breakpointmenus.ui42
8 files changed, 74 insertions, 77 deletions
diff --git a/basctl/UIConfig_basicide.mk b/basctl/UIConfig_basicide.mk
index 31b0334d1fd7..f79d9ce5f39b 100644
--- a/basctl/UIConfig_basicide.mk
+++ b/basctl/UIConfig_basicide.mk
@@ -34,6 +34,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/BasicIDE,\
$(eval $(call gb_UIConfig_add_uifiles,modules/BasicIDE,\
basctl/uiconfig/basicide/ui/basicmacrodialog \
+ basctl/uiconfig/basicide/ui/breakpointmenus \
basctl/uiconfig/basicide/ui/defaultlanguage \
basctl/uiconfig/basicide/ui/deletelangdialog \
basctl/uiconfig/basicide/ui/dialogpage \
diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index 97d8ce12ae35..34f8d3a04ef0 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -23,8 +23,6 @@
#include <svx/svxids.hrc>
#define RID_BASICIDE_OBJECTBAR ( RID_BASICIDE_START + 0 )
-#define RID_POPUP_BRKDLG ( RID_BASICIDE_START + 10 )
-#define RID_POPUP_BRKPROPS ( RID_BASICIDE_START + 11 )
#define RID_POPUP_TABBAR ( RID_BASICIDE_START + 12 )
#define RID_BMP_REMOVEWATCH ( RID_BASICIDE_START + 8 )
diff --git a/basctl/inc/helpid.hrc b/basctl/inc/helpid.hrc
index 86e3d4f58c89..3bafa9769a10 100644
--- a/basctl/inc/helpid.hrc
+++ b/basctl/inc/helpid.hrc
@@ -21,9 +21,6 @@
#define HID_BASICIDE_OBJECTCAT "BASCTL_HID_BASICIDE_OBJECTCAT"
-#define HID_BASICIDE_BRKDLG "BASCTL_HID_BASICIDE_BRKDLG"
-#define HID_BASICIDE_ACTIV "BASCTL_HID_BASICIDE_ACTIV"
-#define HID_BASICIDE_BRKPROPS "BASCTL_HID_BASICIDE_BRKPROPS"
#define HID_BASICIDE_REMOVEWATCH "BASCTL_HID_BASICIDE_REMOVEWATCH"
#define HID_BASICIDE_MODULWINDOW "BASCTL_HID_BASICIDE_MODULWINDOW"
diff --git a/basctl/source/basicide/baside2.hrc b/basctl/source/basicide/baside2.hrc
index e208d0f2ebed..038b35ca7228 100644
--- a/basctl/source/basicide/baside2.hrc
+++ b/basctl/source/basicide/baside2.hrc
@@ -23,13 +23,6 @@
// Diese Dateien enthaelt nur die lokalen ID's.
-// RID_POPUP_BRKPROPS
-#define RID_BRKPROPS 1
-#define RID_ACTIV 2
-
-// RID_POPUP_BRKDLG
-#define RID_BRKDLG 1
-
// RID_POPUP_TABBAR
#define RID_INSERT 1
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 35ffe34c125c..4deb7db00221 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -168,6 +168,7 @@ private:
sal_uInt16 nMarkerPos;
BreakPointList aBreakPointList;
bool bErrorMarker;
+ std::unique_ptr<VclBuilder> mpUIBuilder;
virtual void DataChanged(DataChangedEvent const & rDCEvt) override;
@@ -184,6 +185,7 @@ protected:
public:
BreakPointWindow (vcl::Window* pParent, ModulWindow*);
+ virtual void dispose() override;
void SetMarkerPos( sal_uInt16 nLine, bool bErrorMarker = false );
void SetNoMarker ();
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;
diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src
index d1c8e565ea08..5775b6b98d4f 100644
--- a/basctl/source/basicide/basidesh.src
+++ b/basctl/source/basicide/basidesh.src
@@ -326,44 +326,6 @@ String RID_STR_SHAREMACROSDIALOGS
Text [ en-US ] = "%PRODUCTNAME Macros & Dialogs" ;
};
-Menu RID_POPUP_BRKPROPS
-{
- Text [ en-US ] = "Properties" ;
- ItemList =
- {
- MenuItem
- {
- Identifier = RID_ACTIV ;
- HelpId = HID_BASICIDE_ACTIV ;
- Text [ en-US ] = "Active" ;
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = RID_BRKPROPS ;
- HelpId = HID_BASICIDE_BRKPROPS ;
- Text [ en-US ] = "Properties..." ;
- };
- };
-};
-
-Menu RID_POPUP_BRKDLG
-{
- Text [ en-US ] = "Manage Breakpoints" ;
- ItemList =
- {
- MenuItem
- {
- Identifier = RID_BRKDLG ;
- HelpId = HID_BASICIDE_BRKDLG ;
- Text [ en-US ] = "Manage Breakpoints..." ;
- };
- };
-};
-
Menu RID_POPUP_TABBAR
{
ItemList =
diff --git a/basctl/uiconfig/basicide/ui/breakpointmenus.ui b/basctl/uiconfig/basicide/ui/breakpointmenus.ui
new file mode 100644
index 000000000000..710ab214ea3c
--- /dev/null
+++ b/basctl/uiconfig/basicide/ui/breakpointmenus.ui
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+ <requires lib="gtk+" version="3.10"/>
+ <object class="GtkMenu" id="breaklistmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuItem" id="manage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Manage Breakpoints...</property>
+ </object>
+ </child>
+ </object>
+ <object class="GtkMenu" id="breakmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckMenuItem" id="active">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Active</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="menuitem1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="properties">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Properties...</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+</interface>