summaryrefslogtreecommitdiff
path: root/basctl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-02 16:42:32 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-02 21:33:56 +0000
commitf9aab8ff0e26df747bf50b337ffbcc7ab6559cc2 (patch)
treea26c230e0129f2bfeb4b22b2044eed3336254201 /basctl/source
parentab3e7ca757a89a4522ef6ede3891b873fbcb8458 (diff)
Convert break point dialog to .ui format
Change-Id: I750133b673e135399ab9c04953550bea1db3a9e8
Diffstat (limited to 'basctl/source')
-rw-r--r--basctl/source/basicide/brkdlg.cxx120
-rw-r--r--basctl/source/basicide/brkdlg.hrc38
-rw-r--r--basctl/source/basicide/brkdlg.hxx16
-rw-r--r--basctl/source/basicide/brkdlg.src96
4 files changed, 65 insertions, 205 deletions
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index f8dfe9f31788..f41616f51175 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -21,7 +21,6 @@
#define _SVX_NOIDERESIDS
#include "breakpoint.hxx"
#include "brkdlg.hxx"
-#include "brkdlg.hrc"
#include "basidesh.hxx"
#include "basidesh.hrc"
#include "iderdll.hxx"
@@ -64,47 +63,46 @@ bool lcl_ParseText(OUString const &rText, size_t& rLineNr )
} // namespace
-BreakPointDialog::BreakPointDialog( Window* pParent, BreakPointList& rBrkPntList ) :
- ModalDialog( pParent, IDEResId( RID_BASICIDE_BREAKPOINTDLG ) ),
- aComboBox( this, IDEResId( RID_CB_BRKPOINTS ) ),
- aOKButton( this, IDEResId( RID_PB_OK ) ),
- aCancelButton( this, IDEResId( RID_PB_CANCEL ) ),
- aNewButton( this, IDEResId( RID_PB_NEW ) ),
- aDelButton( this, IDEResId( RID_PB_DEL ) ),
- aCheckBox( this, IDEResId( RID_CHKB_ACTIVE ) ),
- aBrkText( this, IDEResId( RID_FT_BRKPOINTS ) ),
- aPassText( this, IDEResId( RID_FT_PASS ) ),
- aNumericField( this, IDEResId( RID_FLD_PASS ) ),
- m_rOriginalBreakPointList(rBrkPntList),
- m_aModifiedBreakPointList(rBrkPntList)
+BreakPointDialog::BreakPointDialog( Window* pParent, BreakPointList& rBrkPntList )
+ : ModalDialog(pParent, "ManageBreakpointsDialog",
+ "modules/BasicIDE/ui/managebreakpoints.ui")
+ , m_rOriginalBreakPointList(rBrkPntList)
+ , m_aModifiedBreakPointList(rBrkPntList)
{
- FreeResource();
-
- aComboBox.SetUpdateMode(false);
+ get(m_pComboBox, "entries");
+ m_pComboBox->set_height_request(m_pComboBox->GetTextHeight() * 12);
+ m_pComboBox->set_width_request(m_pComboBox->approximate_char_width() * 32);
+ get(m_pOKButton, "ok");
+ get(m_pNewButton, "new");
+ get(m_pDelButton, "delete");
+ get(m_pCheckBox, "active");
+ get(m_pNumericField, "pass-nospin");
+
+ m_pComboBox->SetUpdateMode(false);
for ( size_t i = 0, n = m_aModifiedBreakPointList.size(); i < n; ++i )
{
BreakPoint* pBrk = m_aModifiedBreakPointList.at( i );
OUString aEntryStr( "# " + OUString::number(pBrk->nLine) );
- aComboBox.InsertEntry( aEntryStr, COMBOBOX_APPEND );
+ m_pComboBox->InsertEntry( aEntryStr, COMBOBOX_APPEND );
}
- aComboBox.SetUpdateMode(true);
+ m_pComboBox->SetUpdateMode(true);
- aOKButton.SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
- aNewButton.SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
- aDelButton.SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
+ m_pOKButton->SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
+ m_pNewButton->SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
+ m_pDelButton->SetClickHdl( LINK( this, BreakPointDialog, ButtonHdl ) );
- aCheckBox.SetClickHdl( LINK( this, BreakPointDialog, CheckBoxHdl ) );
- aComboBox.SetSelectHdl( LINK( this, BreakPointDialog, ComboBoxHighlightHdl ) );
- aComboBox.SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) );
- aComboBox.GrabFocus();
+ m_pCheckBox->SetClickHdl( LINK( this, BreakPointDialog, CheckBoxHdl ) );
+ m_pComboBox->SetSelectHdl( LINK( this, BreakPointDialog, ComboBoxHighlightHdl ) );
+ m_pComboBox->SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) );
+ m_pComboBox->GrabFocus();
- aNumericField.SetMin( 0 );
- aNumericField.SetMax( 0x7FFFFFFF );
- aNumericField.SetSpinSize( 1 );
- aNumericField.SetStrictFormat(true);
- aNumericField.SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) );
+ m_pNumericField->SetMin( 0 );
+ m_pNumericField->SetMax( 0x7FFFFFFF );
+ m_pNumericField->SetSpinSize( 1 );
+ m_pNumericField->SetStrictFormat(true);
+ m_pNumericField->SetModifyHdl( LINK( this, BreakPointDialog, EditModifyHdl ) );
- aComboBox.SetText( aComboBox.GetEntry( 0 ) );
+ m_pComboBox->SetText( m_pComboBox->GetEntry( 0 ) );
UpdateFields( m_aModifiedBreakPointList.at( 0 ) );
CheckButtons();
@@ -113,7 +111,7 @@ BreakPointDialog::BreakPointDialog( Window* pParent, BreakPointList& rBrkPntList
void BreakPointDialog::SetCurrentBreakPoint( BreakPoint* pBrk )
{
OUString aStr( "# " + OUString::number(pBrk->nLine) );
- aComboBox.SetText( aStr );
+ m_pComboBox->SetText( aStr );
UpdateFields( pBrk );
}
@@ -123,18 +121,18 @@ void BreakPointDialog::CheckButtons()
// number that is not already present in the combo box list; otherwise
// "OK" and "Delete" buttons are enabled:
size_t nLine;
- if (lcl_ParseText(aComboBox.GetText(), nLine)
+ if (lcl_ParseText(m_pComboBox->GetText(), nLine)
&& m_aModifiedBreakPointList.FindBreakPoint(nLine) == 0)
{
- aNewButton.Enable();
- aOKButton.Disable();
- aDelButton.Disable();
+ m_pNewButton->Enable();
+ m_pOKButton->Disable();
+ m_pDelButton->Disable();
}
else
{
- aNewButton.Disable();
- aOKButton.Enable();
- aDelButton.Enable();
+ m_pNewButton->Disable();
+ m_pOKButton->Enable();
+ m_pDelButton->Enable();
}
}
@@ -152,9 +150,9 @@ IMPL_LINK_INLINE_END( BreakPointDialog, CheckBoxHdl, ::CheckBox *, pChkBx )
IMPL_LINK( BreakPointDialog, ComboBoxHighlightHdl, ComboBox *, pBox )
{
- aNewButton.Disable();
- aOKButton.Enable();
- aDelButton.Enable();
+ m_pNewButton->Disable();
+ m_pOKButton->Enable();
+ m_pDelButton->Enable();
sal_uInt16 nEntry = pBox->GetEntryPos( pBox->GetText() );
BreakPoint* pBrk = m_aModifiedBreakPointList.at( nEntry );
@@ -168,9 +166,9 @@ IMPL_LINK( BreakPointDialog, ComboBoxHighlightHdl, ComboBox *, pBox )
IMPL_LINK( BreakPointDialog, EditModifyHdl, Edit *, pEdit )
{
- if ( pEdit == &aComboBox )
+ if (pEdit == m_pComboBox)
CheckButtons();
- else if ( pEdit == &aNumericField )
+ else if (pEdit == m_pNumericField)
{
BreakPoint* pBrk = GetSelectedBreakPoint();
if ( pBrk )
@@ -183,46 +181,46 @@ IMPL_LINK( BreakPointDialog, EditModifyHdl, Edit *, pEdit )
IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton )
{
- if ( pButton == &aOKButton )
+ if (pButton == m_pOKButton)
{
m_rOriginalBreakPointList.transfer(m_aModifiedBreakPointList);
EndDialog( 1 );
}
- else if ( pButton == &aNewButton )
+ else if (pButton == m_pNewButton)
{
// keep checkbox in mind!
- OUString aText( aComboBox.GetText() );
+ OUString aText( m_pComboBox->GetText() );
size_t nLine;
bool bValid = lcl_ParseText( aText, nLine );
if ( bValid )
{
BreakPoint* pBrk = new BreakPoint( nLine );
- pBrk->bEnabled = aCheckBox.IsChecked();
- pBrk->nStopAfter = (size_t) aNumericField.GetValue();
+ pBrk->bEnabled = m_pCheckBox->IsChecked();
+ pBrk->nStopAfter = (size_t) m_pNumericField->GetValue();
m_aModifiedBreakPointList.InsertSorted( pBrk );
OUString aEntryStr( "# " + OUString::number(pBrk->nLine) );
- aComboBox.InsertEntry( aEntryStr, COMBOBOX_APPEND );
+ m_pComboBox->InsertEntry( aEntryStr, COMBOBOX_APPEND );
if (SfxDispatcher* pDispatcher = GetDispatcher())
pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED );
}
else
{
- aComboBox.SetText( aText );
- aComboBox.GrabFocus();
+ m_pComboBox->SetText( aText );
+ m_pComboBox->GrabFocus();
}
CheckButtons();
}
- else if ( pButton == &aDelButton )
+ else if (pButton == m_pDelButton)
{
- size_t nEntry = aComboBox.GetEntryPos( aComboBox.GetText() );
+ size_t nEntry = m_pComboBox->GetEntryPos( m_pComboBox->GetText() );
BreakPoint* pBrk = m_aModifiedBreakPointList.at( nEntry );
if ( pBrk )
{
delete m_aModifiedBreakPointList.remove( pBrk );
- aComboBox.RemoveEntryAt(nEntry);
- if ( nEntry && !( nEntry < aComboBox.GetEntryCount() ) )
+ m_pComboBox->RemoveEntryAt(nEntry);
+ if ( nEntry && !( nEntry < m_pComboBox->GetEntryCount() ) )
nEntry--;
- aComboBox.SetText( aComboBox.GetEntry( nEntry ) );
+ m_pComboBox->SetText( m_pComboBox->GetEntry( nEntry ) );
if (SfxDispatcher* pDispatcher = GetDispatcher())
pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED );
}
@@ -238,8 +236,8 @@ void BreakPointDialog::UpdateFields( BreakPoint* pBrk )
{
if ( pBrk )
{
- aCheckBox.Check( pBrk->bEnabled );
- aNumericField.SetValue( pBrk->nStopAfter );
+ m_pCheckBox->Check( pBrk->bEnabled );
+ m_pNumericField->SetValue( pBrk->nStopAfter );
}
}
@@ -247,7 +245,7 @@ void BreakPointDialog::UpdateFields( BreakPoint* pBrk )
BreakPoint* BreakPointDialog::GetSelectedBreakPoint()
{
- size_t nEntry = aComboBox.GetEntryPos( aComboBox.GetText() );
+ size_t nEntry = m_pComboBox->GetEntryPos( m_pComboBox->GetText() );
BreakPoint* pBrk = m_aModifiedBreakPointList.at( nEntry );
return pBrk;
}
diff --git a/basctl/source/basicide/brkdlg.hrc b/basctl/source/basicide/brkdlg.hrc
deleted file mode 100644
index 9fa41df973ed..000000000000
--- a/basctl/source/basicide/brkdlg.hrc
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef BASCTL_BRKDLG_HRC
-#define BASCTL_BRKDLG_HRC
-
-#include <svl/solar.hrc>
-
-#define RID_BASICIDE_BREAKPOINTDLG ( RID_BASICIDE_START + 80 )
-
-#define RID_CB_BRKPOINTS 2
-#define RID_PB_OK 3
-#define RID_PB_CANCEL 4
-#define RID_PB_NEW 5
-#define RID_PB_DEL 6
-#define RID_CHKB_ACTIVE 7
-#define RID_FT_PASS 8
-#define RID_FT_BRKPOINTS 9
-#define RID_FLD_PASS 10
-
-#endif // BASCTL_BRKDLG_HRC
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/brkdlg.hxx b/basctl/source/basicide/brkdlg.hxx
index fafbb65e7c17..d98d0a59368f 100644
--- a/basctl/source/basicide/brkdlg.hxx
+++ b/basctl/source/basicide/brkdlg.hxx
@@ -34,16 +34,12 @@ namespace basctl
class BreakPointDialog : public ModalDialog
{
private:
- ComboBox aComboBox;
- OKButton aOKButton;
- CancelButton aCancelButton;
- PushButton aNewButton;
- PushButton aDelButton;
-// PushButton aShowButton;
- ::CheckBox aCheckBox;
- FixedText aBrkText;
- FixedText aPassText;
- NumericField aNumericField;
+ ComboBox* m_pComboBox;
+ OKButton* m_pOKButton;
+ PushButton* m_pNewButton;
+ PushButton* m_pDelButton;
+ ::CheckBox* m_pCheckBox;
+ NumericField* m_pNumericField;
BreakPointList & m_rOriginalBreakPointList;
BreakPointList m_aModifiedBreakPointList;
diff --git a/basctl/source/basicide/brkdlg.src b/basctl/source/basicide/brkdlg.src
deleted file mode 100644
index a14085e94462..000000000000
--- a/basctl/source/basicide/brkdlg.src
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "helpid.hrc"
-#include <brkdlg.hrc>
-ModalDialog RID_BASICIDE_BREAKPOINTDLG
-{
- HelpId = "basctl:RID_BASICIDE_BREAKPOINTDLG" ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 178 , 116 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- ComboBox RID_CB_BRKPOINTS
- {
- HelpID = "basctl:ComboBox:RID_BASICIDE_BREAKPOINTDLG:RID_CB_BRKPOINTS";
- Pos = MAP_APPFONT ( 6 , 14 ) ;
- Size = MAP_APPFONT ( 110 , 70 ) ;
- TabStop = TRUE ;
- };
- OKButton RID_PB_OK
- {
- Pos = MAP_APPFONT ( 122 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- CancelButton RID_PB_CANCEL
- {
- Pos = MAP_APPFONT ( 122 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- PushButton RID_PB_NEW
- {
- HelpID = "basctl:PushButton:RID_BASICIDE_BREAKPOINTDLG:RID_PB_NEW";
- Pos = MAP_APPFONT ( 122 , 57 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "New" ;
- };
- PushButton RID_PB_DEL
- {
- HelpID = "basctl:PushButton:RID_BASICIDE_BREAKPOINTDLG:RID_PB_DEL";
- Pos = MAP_APPFONT ( 122 , 74 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Delete" ;
- };
- CheckBox RID_CHKB_ACTIVE
- {
- HelpID = "basctl:CheckBox:RID_BASICIDE_BREAKPOINTDLG:RID_CHKB_ACTIVE";
- Pos = MAP_APPFONT ( 6 , 87 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Active" ;
- };
- FixedText RID_FT_PASS
- {
- Pos = MAP_APPFONT ( 6 , 102 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "Pass Count:" ;
- };
- FixedText RID_FT_BRKPOINTS
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 110, 10 ) ;
- Text [ en-US ] = "Breakpoints" ;
- };
- NumericField RID_FLD_PASS
- {
- HelpID = "basctl:NumericField:RID_BASICIDE_BREAKPOINTDLG:RID_FLD_PASS";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 81 , 100 ) ;
- Size = MAP_APPFONT ( 35 , 12 ) ;
- TabStop = TRUE ;
- };
- Text [ en-US ] = "Manage Breakpoints" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */