Kaydet (Commit) f9aab8ff authored tarafından Caolán McNamara's avatar Caolán McNamara

Convert break point dialog to .ui format

Change-Id: I750133b673e135399ab9c04953550bea1db3a9e8
üst ab3e7ca7
......@@ -41,7 +41,6 @@ $(eval $(call gb_SrsTarget_set_include,basctl/res,\
$(eval $(call gb_SrsTarget_add_files,basctl/res,\
basctl/source/basicide/basicprint.src \
basctl/source/basicide/basidesh.src \
basctl/source/basicide/brkdlg.src \
basctl/source/basicide/macrodlg.src \
basctl/source/basicide/moduldlg.src \
basctl/source/basicide/objdlg.src \
......
......@@ -32,6 +32,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/BasicIDE,\
basctl/uiconfig/basicide/ui/basicmacrodialog \
basctl/uiconfig/basicide/ui/gotolinedialog \
basctl/uiconfig/basicide/ui/exportdialog \
basctl/uiconfig/basicide/ui/managebreakpoints \
basctl/uiconfig/basicide/ui/newlibdialog \
basctl/uiconfig/basicide/ui/organizedialog \
))
......
......@@ -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;
}
......
/* -*- 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: */
......@@ -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;
......
/* -*- 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: */
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment