Skip to content

Commit

Permalink
selection bg color fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewirts committed Feb 5, 2015
1 parent d4339c5 commit 249c40a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
9 changes: 4 additions & 5 deletions behaviors/fin-hypergrid-behavior-qtree.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,11 @@
if (config.y === 1)
{
//make it look like a normal main area cell

config.font = config.properties.font;
config.fgColor = config.properties.color;
config.bgColor = config.properties.backgroundColor;
config.fgSelColor = config.properties.foregroundSelColor;
config.bgSelColor = config.properties.backgroundSelColor;
config.fgColor = config.fgSelColor = config.properties.color;
config.bgColor = config.bgSelColor = config.properties.backgroundColor;
//config.fgSelColor = config.properties.foregroundSelColor;
//config.bgSelColor = config.properties.backgroundSelColor;
}
return label;
};
Expand Down
10 changes: 5 additions & 5 deletions fin-hypergrid-cell-provider.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,17 @@
var indent = this.config.value.indent;
var icon = this.config.value.icon;

if (!val || !val.length) {
return;
}
var valignOffset = Math.ceil(height / 2);

//fill background only if our bgColor is populated or we are a selected cell
if (this.config.bgColor || this.config.isSelected) {
gc.fillStyle = this.config.isSelected ? this.config.bgSelColor : this.config.bgColor;
gc.fillRect(x, y, width, height);
}

if (!val || !val.length) {
return;
}
var valignOffset = Math.ceil(height / 2);

gc.fillStyle = this.config.isSelected ? this.config.fgSelColor : this.config.fgColor;
gc.fillText(icon + val, x + indent, y + valignOffset);

Expand Down
2 changes: 1 addition & 1 deletion fin-hypergrid.min.html

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions q/t.q
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
cons:{[t;g;p;a;s;h]cons_[csub[t]g,h;g;p;a;s]h}

cons_:{[t;g;p;a;s;h]
d:dat[t;g;p;rollups[t]a]h;
d:dat[t;g;p;rollups[t;g]a]h;
d:1!(0!d)tsort[d]s;
z:get d;z_:ctl[d;g]p;
(z;z_)}
Expand Down Expand Up @@ -120,20 +120,26 @@ msort:{[t;c;o;i]i{x y z x}/[til count i;o;flip[t i]c]}
/ mesh nest of paths
pmesh:{i:1+x?-1_first y;(i#x),y,i _ x}

/ first if 1=count else null (for syms, non-summable nums)
nul:{first$[1=count distinct x,();x;0#x]}

/ discard invalid paths
valid:{[p;g]
n:key each exec n from p;
i:where til[count g]{(count[y]#x)~y}/:g?/:n;
1!(0!p)i}

/ cast <- type
qtype:{exec c!t from meta x}
/ first if 1=count else null (for syms, non-summable nums)
nul:{first$[1=count distinct x,();x;0#x]}

/ count
cnt:{`$"N=[",string[count x],"]"}

/ type -> rollup
A:" bgxhijefcspmdznuvt"!(cnt;all;cnt;cnt;sum;sum;sum;sum;sum;nul;cnt;max;max;max;max;max;max;max;max)

/ default rollups
rollups:{[t;a]@[a;k;:;((.tt.nul;sum)qtype[t][k]in"HIJEFhijef"),'k:cols[t]except key a]}
rollups:{[t;g;a]@[@[a;k;:;A[lower qtype[t]k],'k:cols[t]except g,key a];g;:;nul,'g]}

/ cast <- type
qtype:{exec c!t from meta x}

\d .

Expand Down Expand Up @@ -172,7 +178,7 @@ $[.z.K<3.3;
G:0#`

/ visible order
H::cols[T]except G
H::cols[T]except G,keys T

/ rollups
A:()!()
Expand Down Expand Up @@ -210,7 +216,4 @@ T:([tradeId:til n]
time:09:30:00.0+n?23000000)

G:`sector`trader`strategy
H:cols[T]except G,keys T
A[`price]:(avg;`price)

/ show .js.set()!();

0 comments on commit 249c40a

Please sign in to comment.