Commit 33ef9df6 authored by mse1's avatar mse1

+ 64 Bit watches.

* Fixed init of tcustomintegergraphdataedit.fdatalist.

git-svn-id: https://mseide-msegui.svn.sourceforge.net/svnroot/mseide-msegui/trunk@3213 56ecf5fe-6917-0410-8ac6-ca8e178bccbf
parent f912f48e
......@@ -114,11 +114,13 @@ object watchfo: twatchfo
width = 13
options = [co_drawfocus, co_savestate, co_rowcolor, co_zebracolor]
widgetname = 'watchon'
dataclass = tgridintegerdatalist
end
item
width = 152
options = [co_savevalue, co_savestate]
widgetname = 'expression'
dataclass = tgridmsestringdatalist
end
item
width = 82
......@@ -126,17 +128,20 @@ object watchfo: twatchfo
widthmin = 50
oncellevent = resultcellevent
widgetname = 'expresult'
dataclass = tgridmsestringdatalist
end
item
color = -2147483646
coloractive = -1879048185
width = 12
widgetname = 'formatcode'
dataclass = tgridintegerdatalist
end
item
width = 13
options = [co_invisible, co_savevalue, co_savestate, co_rowfont, co_rowcolor, co_zebracolor, co_mousescrollrow]
widgetname = 'sizecode'
dataclass = tgridintegerdatalist
end>
datarowheight = 16
statfile = mainfo.projectstatfile
......@@ -244,7 +249,7 @@ object watchfo: twatchfo
end
object gripopup: tpopupmenu
onupdate = popupdate
menu.submenu.count = 19
menu.submenu.count = 20
menu.submenu.items = <
item
caption = 'Delete all'
......@@ -351,6 +356,15 @@ object watchfo: twatchfo
group = 1
onexecute = sizeexecute
end
item
caption = '&64 Bit'
name = '&64 Bit'
state = [as_localcaption, as_localtag, as_localgroup, as_localonexecute]
options = [mao_radiobutton, mao_shortcutcaption]
tag = 4
group = 1
onexecute = sizeexecute
end
item
options = [mao_separator, mao_shortcutcaption]
end
......
......@@ -66,7 +66,7 @@ uses
mseguiglob,mseformatstr,msebits,sysutils,watchpointsform,memoryform;
type
numformatty = (nf_default,nf_bin,nf_decs,nf_decu,nf_hex);
numsizety = (ns_default,ns_8,ns_16,ns_32);
numsizety = (ns_default,ns_8,ns_16,ns_32,ns_64);
{ twatchfo }
......@@ -116,16 +116,16 @@ var
mstr1: msestring;
fc: numformatty;
fs: numsizety;
int1,int2: integer;
int641: int64;
int2: integer;
begin
if (index >= 0) and gdb.cancommand then begin
if watcheson.value and watchon[index] then begin
gdb.readpascalvariable(expression[index],mstr1);
fc:= numformatty(formatcode[index]);
if fc <> nf_default then begin
try
int1:= strtointvalue(mstr1);
int2:= highestbit(int1);
if trystrtointvalue64(mstr1,qword(int641)) then begin
int2:= highestbit64(int641);
if int2 <= 0 then begin
int2:= 1;
end;
......@@ -137,14 +137,15 @@ begin
ns_8: int2:= 8;
ns_16: int2:= 16;
ns_32: int2:= 32;
ns_64: int2:= 64;
end;
mstr1:= '%'+bintostr(longword(int1),int2);
mstr1:= '%'+bintostr(qword(int641),int2);
end;
nf_decs: begin
mstr1:= inttostr(int1);
mstr1:= inttostr(int641);
end;
nf_decu: begin
mstr1:= inttostr(longword(int1));
mstr1:= inttostr(qword(int641));
end;
nf_hex: begin
int2:= int2 div 4 + 1; //nibble count
......@@ -152,11 +153,11 @@ begin
ns_8: int2:= 2;
ns_16: int2:= 4;
ns_32: int2:= 8;
ns_64: int2:= 16;
end;
mstr1:= '0x'+hextostr(longword(int1),int2);
mstr1:= '0x'+hextostr(qword(int641),int2);
end;
end;
except
end;
end;
if (expresult[index] <> mstr1) then begin
......
This diff is collapsed.
......@@ -596,6 +596,7 @@ type
function getgridvalues: integerarty;
procedure setgridvalues(const Value: integerarty);
protected
procedure setgridintf(const intf: iwidgetgrid); override;
function createdatalist(const sender: twidgetcol): tdatalist; override;
function getdatatype: listdatatypety; override;
function getdefaultvalue: pointer; override;
......@@ -2397,12 +2398,25 @@ end;
function tcustomintegergraphdataedit.getgridvalues: integerarty;
begin
result:= tintegerdatalist(fgridintf.getcol.datalist).asarray;
checkgrid;
result:= fdatalist.asarray;
end;
procedure tcustomintegergraphdataedit.setgridvalues(const Value: integerarty);
begin
tintegerdatalist(fgridintf.getcol.datalist).asarray:= value;
checkgrid;
fdatalist.asarray:= value;
end;
procedure tcustomintegergraphdataedit.setgridintf(const intf: iwidgetgrid);
begin
if intf <> nil then begin
fdatalist:= tintegerdatalist(intf.getcol.datalist);
end
else begin
fdatalist:= nil;
end;
inherited;
end;
{ tvaluefacearrayprop }
......
......@@ -76,6 +76,11 @@ function highestbit(value: cardinal): integer;
function lowestbit(value: cardinal): integer;
//0-> first, 31-> last($80000000), -1-> none ($00000000)
function highestbit64(value: qword): integer;
//0-> first, 63-> last($8000000000000000), -1-> none ($0000000000000000)
function lowestbit64(value: qword): integer;
//0-> first, 63-> last($8000000000000000), -1-> none ($0000000000000000)
function replacebits(const new,old,mask: byte): byte; overload;
function replacebits(const new,old,mask: word): word; overload;
function replacebits(const new,old,mask: longword): longword; overload;
......@@ -638,6 +643,29 @@ begin
end;
end;
function highestbit64(value: qword): integer;
//0-> first, 63-> last($8000000000000000), -1-> none ($0000000000000000)
begin
result:= -1;
while value <> 0 do begin
inc(result);
value:= value shr 1;
end;
end;
function lowestbit64(value: qword): integer;
//0-> first, 63-> last($8000000000000000), -1-> none ($0000000000000000)
begin
result:= -1;
if value <> 0 then begin
result:= 64;
while value <> 0 do begin
dec(result);
value:= value shl 1;
end;
end;
end;
function getmask(const mask: array of bitnumty): cardinal;
var
int1: integer;
......
......@@ -105,11 +105,11 @@ function dectostr(const inp: int64; digits: integer): string; overload;
//leading zeroes if digits < 0
function bintostr(inp: longword; digits: integer): string; overload;
//convert longword to binstring, digits = bit count
function bintostr(inp: uint64; digits: integer): string; overload;
function bintostr(inp: qword; digits: integer): string; overload;
//convert longword to binstring, digits = bit count
function octtostr(inp: longword; digits: integer): string; overload;
//convert longword to octaltring, digits = octet count
function octtostr(inp: uint64; digits: integer): string; overload;
function octtostr(inp: qword; digits: integer): string; overload;
//convert longword to octaltring, digits = octet count
function hextostr(inp: longword; digits: integer): string; overload;
//convert longword to hexstring, digits = nibble count
......@@ -2116,7 +2116,7 @@ begin
end;
end;
function bintostr(inp: uint64; digits: integer): string;
function bintostr(inp: qword; digits: integer): string;
//convert longword to binstring, digits = bit count
var
int1: integer;
......@@ -2140,7 +2140,7 @@ begin
end;
end;
function octtostr(inp: uint64; digits: integer): string;
function octtostr(inp: qword; digits: integer): string;
//convert longword to octaltring, digits = octet count
var
int1: integer;
......
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