ide: Debugger scrolls to see long values #785

git-svn-id: svn://ultimatepp.org/upp/trunk@7431 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-06-09 16:49:25 +00:00
parent aa62d02f87
commit bf670aa5a1
3 changed files with 36 additions and 18 deletions

View file

@ -32,6 +32,8 @@ void Gdb_MI2::FillPane(ArrayCtrl &pane, Index<String> const &nam, Vector<String>
}
for(int i = oldCount; i < newCount; i++)
pane.Add(nam[i], val[i]);
SyncWidth(pane);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -322,6 +324,27 @@ void Gdb_MI2::Periodic()
Stop();
}
void Gdb_MI2::Setup(ArrayCtrl& a, int x)
{
a.NoHeader();
a.AddColumn("", GetStdFontCy() * x * 3);
a.AddColumn("", 10000);
a.EvenRowColor();
a.OddRowColor();
a.HeaderObject().Absolute();
}
void Gdb_MI2::SyncWidth(ArrayCtrl& a)
{
GuiLock __;
int mx = a.GetSize().cx - a.HeaderObject().GetTabWidth(0);
for(int i = 0; i < a.GetCount(); i++) {
String h = a.GetConvertedColumn(i, 1);
mx = max(mx, a.GetDisplay(i, 1).GetStdSize(a.GetConvertedColumn(i, 1)).cx + a.HeaderTab(0).GetMargin() * 2);
}
a.HeaderObject().SetTabWidth(1, mx);
}
Gdb_MI2::Gdb_MI2()
{
CtrlLayout(regs);
@ -348,34 +371,23 @@ Gdb_MI2::Gdb_MI2()
regs.AddFrame(TopSeparatorFrame());
regs.AddFrame(RightSeparatorFrame());
autos.NoHeader();
autos.AddColumn("", 1);
autos.AddColumn("", 10);
Setup(autos);
autos.WhenLeftDouble = THISBACK1(onExploreExpr, &autos);
autos.EvenRowColor();
autos.OddRowColor();
locals.NoHeader();
locals.AddColumn("", 1);
locals.AddColumn("", 10);
Setup(locals);
locals.WhenLeftDouble = THISBACK1(onExploreExpr, &locals);
locals.EvenRowColor();
locals.OddRowColor();
members.NoHeader();
members.AddColumn("", 3);
members.AddColumn("", 10);
Setup(members);
members.WhenLeftDouble = THISBACK1(onExploreExpr, &members);
members.EvenRowColor();
members.OddRowColor();
watches.NoHeader();
watches.AddColumn("", 1).Edit(watchedit);
watches.AddColumn("", 10);
watches.Inserting().Removing();
watches.WhenLeftDouble = THISBACK1(onExploreExpr, &watches);
watches.EvenRowColor();
watches.OddRowColor();
watches.HeaderObject().Absolute();
watches.Inserting().Removing();
watches.WhenLeftDouble = THISBACK1(onExploreExpr, &watches);
int c = EditField::GetStdHeight();
explorer.AddColumn("", 1);
@ -1361,6 +1373,7 @@ void Gdb_MI2::SyncAutos()
p.SkipTerm();
}
autos.Sort();
SyncWidth(autos);
}
}
@ -1419,6 +1432,8 @@ void Gdb_MI2::SyncWatches()
watches.Set(iWatch, 1, v.value);
}
}
SyncWidth(watches);
// when finished, mark changed values
MarkChanged(prev, watches);

View file

@ -293,6 +293,9 @@ class Gdb_MI2 : public Debugger, public ParentCtrl
// (avoid re-painting and resetting scroll if not needed)
void FillPane(ArrayCtrl &pane, Index<String> const &nam, Vector<String> const &val);
void Setup(ArrayCtrl& a, int x = 1);
void SyncWidth(ArrayCtrl& a);
protected:
public :

View file

@ -3,7 +3,7 @@
#include "ide\Common/init"
#include "plugin\ndisasm/init"
#include "HexView/init"
#define BLITZ_INDEX__ Fa2117e771964dad617cdd6a1792596ea
#define BLITZ_INDEX__ F2300ec0d3d2de4bde7af30102b728c5d
#include "UppSimplifiers.icpp"
#undef BLITZ_INDEX__
#endif