Re: [MSEide-MSEgui-talk] TDBstringLookupLb

2016-10-21 Thread Martin Schreiber
On Friday 21 October 2016 17:50:54 mohamed hamza wrote:
> Hi Martin,
>
> I have a TDBStringLookupLb column inside a tdbwidgetGrid. I set this
> because I want to sort on that column
>
>  TDBLookupBuffer contains  1 integer field
>  and  1  text field which is  the
> wanted sort field.
>
>  1/  sortcol=sortcoldefault:=7;
>  2/  row-1 item 7 options dco_colsort:=true;
>  3/  I can not set og_sorted to true it always reset to false?
>  4/  TDBwidgetgrid datasource is dso1  and TDBLookupBuffer datasource
> is dso2.
>
> What is missing?
>
TDBWidgetGrid has rows for the visible range of records only -> sorting must 
be done in dataset. Please set according local indices where 
tmsesqlquery.indexlocal[n].fields[0] is the sortfield.
If sorting should be based on a lookup value a field of FieldKind fkLookup 
must be used. Do *not* activate LookupCache, set a local index on the 
keyfield in lookup-dataset so directdata-access can be used.
IIRC sorting of lookup fields is supported in git master version only.

Martin

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Transparent twidgetgrid

2016-10-21 Thread Krzysztof
4. Why did you changed params order in drawimage virtual method? Just
wondering what was a reason from technical view
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Transparent twidgetgrid

2016-10-21 Thread Krzysztof
Great! With your changes in drawimage() now it is working perfect, even
better than with second column because caption ellipsis appear exactly when
it meet my extra text.
But still have few questions:
1. Root node has bold font and when I select that row then my extra text
also is drawed with bold style. Maybe I wrongly assign bold font? I copied
it from treeview sample demo:

constructor TRootNode.create(const aowner: tcustomitemlist;
  const aparent: ttreelistitem);
begin
  ffont:= tfont.create();
  ffont.bold:= true;
  inherited create(aowner, aparent);
end;

destructor TRootNode.destroy;
begin
  inherited destroy;
  ffont.free;
end;

procedure TRootNode.updatecaption(const acanvas: tcanvas;
  var alayoutinfo: listitemlayoutinfoty; var ainfo: drawtextinfoty);
var i1: int32;
begin
  inherited updatecaption(acanvas, alayoutinfo, ainfo);

  ainfo.font:= ffont;

  i1:= acanvas.getstringwidth('abc');
   dec(ainfo.dest.cx,i1);
   dec(ainfo.clip.cx,i1);
end;


2. You wrote that this change is not *so* expensive. The goal for this
treeview is to store around 10k records. Could this change slow down
managing such count of items or your change is only related to paint
"visible area"?
3. Possibly I'll need to show extra icon before standard icon but I'm not
sure yet. Is it possible to do that without your changes in source code?
I'm not afraid to redraw whole row by my self from beginning.

Regards. Dibo
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


[MSEide-MSEgui-talk] TDBstringLookupLb

2016-10-21 Thread mohamed hamza
Hi Martin,
  
I have a TDBStringLookupLb column inside a tdbwidgetGrid. I set this 
because I want to sort on that column

 TDBLookupBuffer contains  1 integer field 
 and  1  text field which is  the wanted 
sort field.

 1/  sortcol=sortcoldefault:=7;
 2/  row-1 item 7 options dco_colsort:=true;
 3/  I can not set og_sorted to true it always reset to false? 
 4/  TDBwidgetgrid datasource is dso1  and TDBLookupBuffer datasource is 
dso2. 

What is missing?

Best Regards.

Med.



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Transparent twidgetgrid

2016-10-21 Thread Martin Schreiber
On Friday 21 October 2016 13:47:53 Martin Schreiber wrote:
> > 4. I would need to draw icon (in root and subnode) but don't see any
> >
> > > imagelist and imagenr in ttreeitemedit or twidgetgrid
>
> They are in ttreeitemedit.itemlist property.
>
The imagelist-index is in TListItem.ImageNr.

Martin



--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Transparent twidgetgrid

2016-10-21 Thread Martin Schreiber
On Friday 21 October 2016 13:11:18 Krzysztof wrote:
> 2016-10-21 13:02 GMT+02:00 Krzysztof :
> > 1. Can't turn off auto text select on row click. I would like even
> > disable text selecting totally
> > 2. Can't turn off focus rect. It is drawed even if co_drawfocus is false
> > (globaly and localy for column)
> > 3. How to disable auto text select when expanding root node?
>
> This 3 issues solved by disabling oe_autoselect, oe_autoselectonfirstclick
> and oe_focusrectonreadonly in optionsedit. But I'm still curious if I can
> turn off text selection at all
>
Marking of selected text can be switched off by setting 
.textflags* tf_noselect.

> 4. I would need to draw icon (in root and subnode) but don't see any
>
> > imagelist and imagenr in ttreeitemedit or twidgetgrid
>
They are in ttreeitemedit.itemlist property.

Martin

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Transparent twidgetgrid

2016-10-21 Thread Krzysztof
2016-10-21 13:02 GMT+02:00 Krzysztof :
>
> 1. Can't turn off auto text select on row click. I would like even disable
> text selecting totally
> 2. Can't turn off focus rect. It is drawed even if co_drawfocus is false
> (globaly and localy for column)
> 3. How to disable auto text select when expanding root node?
>

This 3 issues solved by disabling oe_autoselect, oe_autoselectonfirstclick
and oe_focusrectonreadonly in optionsedit. But I'm still curious if I can
turn off text selection at all

4. I would need to draw icon (in root and subnode) but don't see any
> imagelist and imagenr in ttreeitemedit or twidgetgrid
>
Not solved yet
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Transparent twidgetgrid

2016-10-21 Thread Krzysztof
2016-10-21 13:02 GMT+02:00 Krzysztof :
>
> 1. Can't turn off auto text select on row click. I would like even disable
> text selecting totally
> 2. Can't turn off focus rect. It is drawed even if co_drawfocus is false
> (globaly and localy for column)
> 3. How to disable auto text select when expanding root node?
>

This 3 issues solved by disabling oe_autoselect, oe_autoselectonfirstclick
and oe_focusrectonreadonly in optionsedit. But I'm still curious if I can
turn off text selection at all

4. I would need to draw icon (in root and subnode) but don't see any
> imagelist and imagenr in ttreeitemedit or twidgetgrid
>
Not solved yet
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] Transparent twidgetgrid

2016-10-21 Thread Martin Schreiber
On Thursday 20 October 2016 18:25:08 Martin Schreiber wrote:

> It is possible to add dynamic position and size correction to
> ListItemLayoutInfoTy like ListItemLayoutInfoTy.Variable.Extra.Image but it
> is not cheap. I still don't really understand the purpose, please explain
> again.
>
I did it anyway, it is not *so* expensive, git master 
087ec4683f11938ddd22259cf48662c2931250ae

"
procedure trootnode.drawimage(var alayoutinfo: listitemlayoutinfoty;
   const acanvas: tcanvas);
var
 info1: drawtextinfoty;
begin
 inherited;
 with alayoutinfo do begin
  if variable.calcautocellsize then begin
   variable.extra.caption.cx:= -acanvas.getstringwidth('abc');
  end
  else begin
   fillchar(info1,sizeof(info1),#0);
   info1.text.text:= 'abc';
   info1.dest:= captioninnerrect;
   info1.clip:= captionrect;
   info1.flags:= [tf_ycentered,tf_right,tf_clipo];
   drawtext(acanvas,info1);
   variable.extra.caption.cx:= info1.res.x - (captionrect.x + captionrect.cx);
  end;
 end;
end;
"

And while implementing I remembered "updatecaption()". ;-)

So another solution is:
"
procedure trootnode.drawimage(const acanvas: tcanvas;
  var alayoutinfo: listitemlayoutinfoty);
begin
 inherited;
 if not alayoutinfo.variable.calcautocellsize then begin
  with alayoutinfo do begin
   drawtext(acanvas,'abc',captionrect,captioninnerrect,
 [tf_clipo,tf_ycentered,tf_right]);
  end;
 end;
end;

procedure trootnode.updatecaption(const canvas: tcanvas;
 var alayoutinfo: listitemlayoutinfoty; var ainfo: 
drawtextinfoty);
var
 i1: int32;
begin
 inherited;
 i1:= canvas.getstringwidth('abc');
 dec(ainfo.dest.cx,i1);
 dec(ainfo.clip.cx,i1);
end;
"

Martin

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] default message window width

2016-10-21 Thread solomon243
>> use TIntegerEdit.OnSetValue in order to do the rangecheck and to show a 
>> custom error-message window.

 I plan this in future versions... ok

Пользователь Martin Schreiber  писал:

>On Thursday 20 October 2016 23:45:56 Solomon Hierrussalimsky wrote:
>>
>> but caption lenght...
>>
>> how to set default message window width?
>
>If you call "showmessage()" yourself there is a "minwidth" parameter. This is 
>not possible for internally generated messages, but users can enlarge the 
>message window by mouse. Remember my comment against fixed window sizes? ;-)
>
>In case of TIntegerEdit it is also possible to set min = minint and max = 
>maxint and to use TIntegerEdit.OnSetValue in order to do the rangecheck and 
>to show a custom error-message window.
>
>Martin
>
>
>
>--
>Check out the vibrant tech community on one of the world's most 
>engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>___
>mseide-msegui-talk mailing list
>mseide-msegui-talk@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
>
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk