mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Ide/Debuggers/Gdb_MI2 : some cosmetics in Quickwatch
git-svn-id: svn://ultimatepp.org/upp/trunk@4968 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
01c8af0fe0
commit
c8fc20df6e
3 changed files with 28 additions and 8 deletions
|
|
@ -24,6 +24,14 @@ static void MarkChanged2(const VectorMap<String, String>& m, ArrayCtrl& data)
|
|||
}
|
||||
}
|
||||
|
||||
void WatchEdit::HighlightLine(int line, Vector<Highlight>& h, int pos)
|
||||
{
|
||||
Color cEven = Blend(SColorInfo, White, 220);
|
||||
Color cOdd = Blend(SColorInfo, White, 128);
|
||||
for(int i = 0; i < h.GetCount(); i++)
|
||||
h[i].paper = (line % 2 ? cOdd : cEven);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// PUBLIC IDE INTERFACE
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -276,10 +284,13 @@ Gdb_MI2::Gdb_MI2()
|
|||
dlock.NoTransparent();
|
||||
dlock.Hide();
|
||||
|
||||
CtrlLayoutOKCancel(quickwatch, "Quick watch");
|
||||
CtrlLayout(quickwatch, "Quick watch");
|
||||
quickwatch.close.Cancel() <<= quickwatch.Breaker(IDCANCEL);
|
||||
quickwatch.evaluate.Ok() <<= quickwatch.Acceptor(IDOK);
|
||||
quickwatch.WhenClose = quickwatch.Breaker(IDCANCEL);
|
||||
quickwatch.value.SetReadOnly();
|
||||
quickwatch.value.SetFont(Courier(12));
|
||||
quickwatch.value.SetColor(TextCtrl::PAPER_READONLY, White);
|
||||
quickwatch.Sizeable().Zoomable();
|
||||
quickwatch.NoCenter();
|
||||
quickwatch.SetRect(0, 150, 300, 400);
|
||||
|
|
@ -1270,7 +1281,7 @@ String Gdb_MI2::FormatWatchLine(String exp, String const &val, int level)
|
|||
}
|
||||
|
||||
// deep watch current quickwatch variable
|
||||
void Gdb_MI2::WatchDeep(String const &parentExp, String const &var, int level)
|
||||
void Gdb_MI2::WatchDeep(String parentExp, String const &var, int level)
|
||||
{
|
||||
MIValue childInfo = MICmd("var-list-children 1 \"" + var + "\" 0 100");
|
||||
int nChilds = min(atoi(childInfo["numchild"].Get()), 100);
|
||||
|
|
@ -1291,8 +1302,12 @@ void Gdb_MI2::WatchDeep(String const &parentExp, String const &var, int level)
|
|||
}
|
||||
*/
|
||||
if(isdigit(exp[0]))
|
||||
{
|
||||
exp = '[' + exp + ']';
|
||||
else
|
||||
if(parentExp.Mid(parentExp.GetCount() - 1, 1) == ".")
|
||||
parentExp = parentExp.Left(parentExp.GetCount() - 1);
|
||||
}
|
||||
if(exp[0] != '.' && exp[0] != '[')
|
||||
exp = '.' + exp;
|
||||
|
||||
String type = child("type", "");
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@
|
|||
|
||||
#include "MIValue.h"
|
||||
|
||||
class WatchEdit : public LineEdit
|
||||
{
|
||||
virtual void HighlightLine(int line, Vector<Highlight>& h, int pos);
|
||||
};
|
||||
|
||||
#define LAYOUTFILE <ide/Debuggers/Gdb_MI2.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
|
|
@ -192,7 +197,7 @@ class Gdb_MI2 : public Debugger, public ParentCtrl
|
|||
String FormatWatchLine(String exp, String const &val, int level);
|
||||
|
||||
// deep watch current quickwatch variable
|
||||
void WatchDeep(String const &parentExp, String const &name, int level = 0);
|
||||
void WatchDeep(String parentExp, String const &name, int level = 0);
|
||||
|
||||
// copy stack frame list to clipboard
|
||||
void CopyStack(void);
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ LAYOUT(Gdb_MI2Registers64Layout, 220, 68)
|
|||
ITEM(Label, rsp, SetLabel(t_("0000000000000000")).SetFont(MonospaceZ(8)).LeftPosZ(136, 80).TopPosZ(52, 13))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(Gdb_MI2QuickwatchLayout, 400, 200)
|
||||
LAYOUT(Gdb_MI2QuickwatchLayout, 400, 224)
|
||||
ITEM(WithDropChoice<EditString>, expression, HSizePosZ(4, 72).TopPosZ(4, 19))
|
||||
ITEM(Button, ok, SetLabel(t_("Evaluate")).RightPosZ(4, 64).TopPosZ(4, 20))
|
||||
ITEM(LineEdit, value, HSizePosZ(4, 4).VSizePosZ(28, 4))
|
||||
ITEM(Button, cancel, RightPosZ(4, 28).BottomPosZ(-32, 16))
|
||||
ITEM(Button, evaluate, SetLabel(t_("Evaluate")).RightPosZ(4, 64).TopPosZ(4, 20))
|
||||
ITEM(WatchEdit, value, HSizePosZ(4, 4).VSizePosZ(28, 28))
|
||||
ITEM(Button, close, SetLabel(t_("Close")).RightPosZ(4, 64).BottomPosZ(4, 20))
|
||||
END_LAYOUT
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue