Re: [MSEide-MSEgui-talk] StringGrid and row select

2016-10-17 Thread Martin Schreiber
On Monday 17 October 2016 17:51:19 Martin Schreiber wrote:

> Yes, there are T*Grid.DataCols[n].OnBeforeDrawCell and OnAfterDrawcell
> event properties. Widget columns also have OnDrawCell, I must check why it
> is missing in TStringCol.
>
In TStringCol it is redundant to OnAfterDrawCell. Git master 
d357b3fe77f5b339ece4aae656b2b71a832416ca has it for consistency.

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] StringGrid and row select

2016-10-17 Thread Martin Schreiber
On Monday 17 October 2016 17:20:03 Graeme Geldenhuys wrote:
> On 2016-10-17 16:12, Martin Schreiber wrote:
> > TWidgetGrid has a widget per column not per cell.
>
> Ah, good to know. Thanks for the whole explanation.
>
> > TStringGrid can not show icons by itself.
>
> Does MSEgui's TStringGrid have a OnDrawCell equivalent event handler?

Yes, there are T*Grid.DataCols[n].OnBeforeDrawCell and OnAfterDrawcell event 
properties. Widget columns also have OnDrawCell, I must check why it is 
missing in TStringCol.

> That's what I used in fpGUI's StringGrid to paint the icon in a cell. I
> see there is OnPaint, OnAfterPaint, OnBeforePaint etc. I guess I can use
> OnPaint, and then query the StringGrid (Sender parameter) to find out
> the focused row and column. One possible problem I see, in those event
> handlers, is the ACanvas limited to the cell rectangle, or the whole
> StringGrid canvas?
>
> I'll try and get the basics of Procedure List dialog working with a
> plain StringGrid (I don't need icons to start). Then I'll rework it with
> a TWidgetGrid.
>
Data access is different in TStringGrid and TWidgetGrid. In TWidgetGrid it 
happens via the column widget, .Value for the value of the 
active cell, .GridValue[n] for cell values, 
.GridValues for a dynamic array with the cell values of the 
whole column. GridData returns the instance of the TDataList descendant.

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] StringGrid and row select

2016-10-17 Thread Graeme Geldenhuys
On 2016-10-17 16:12, Martin Schreiber wrote:
> TWidgetGrid has a widget per column not per cell.

Ah, good to know. Thanks for the whole explanation.


> TStringGrid can not show icons by itself.

Does MSEgui's TStringGrid have a OnDrawCell equivalent event handler?
That's what I used in fpGUI's StringGrid to paint the icon in a cell. I
see there is OnPaint, OnAfterPaint, OnBeforePaint etc. I guess I can use
OnPaint, and then query the StringGrid (Sender parameter) to find out
the focused row and column. One possible problem I see, in those event
handlers, is the ACanvas limited to the cell rectangle, or the whole
StringGrid canvas?

I'll try and get the basics of Procedure List dialog working with a
plain StringGrid (I don't need icons to start). Then I'll rework it with
a TWidgetGrid.


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
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] StringGrid and row select

2016-10-17 Thread Martin Schreiber
On Monday 17 October 2016 15:14:08 Graeme Geldenhuys wrote:
> On 2016-10-17 13:02, Martin Schreiber wrote:
> > Hint: in MSEgui in most cases it is preferable to use TWidgetGrid (tab
> > 'Edit') and insert the necessary column editwidgets from tab 'Edit'
> > instead of using TStringGrid.
>
> I read about TWidgetGrid before, but I don't think that will be the most
> efficient solution in this case. The Procedure List dialog triggers
> parsing the current unit in the editor window, then populates the
> StringGrid with a icon, Procedure name, Type (procedure, function,
> constructor, destructor), and lastly the Line number.
>
> As far as I understand with TWidgetGrid, than would mean 4 components
> per row, and there can be thousands of rows - depending on how large the
> *.pas unit is. That's a lot of component that need to be created and
> destroyed (during filtering).
>
TWidgetGrid has a widget per column not per cell. It is comparable with the 
Lazarus cell editor. Every column widget provides a TDataList descendant in 
order to store the column data of the given type, integer for TIntegerEdit, 
msestring for TStringEdit...
For your fields a TDataIcon, a TStringEdit, a TEnumEdit and a TIntegerEdit 
could be used. TStringGrid can not show icons by itself.

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] StringGrid and row select

2016-10-17 Thread Graeme Geldenhuys
On 2016-10-17 13:02, Martin Schreiber wrote:
> Hint: in MSEgui in most cases it is preferable to use TWidgetGrid (tab 
> 'Edit') 
> and insert the necessary column editwidgets from tab 'Edit' instead of using 
> TStringGrid.

I read about TWidgetGrid before, but I don't think that will be the most
efficient solution in this case. The Procedure List dialog triggers
parsing the current unit in the editor window, then populates the
StringGrid with a icon, Procedure name, Type (procedure, function,
constructor, destructor), and lastly the Line number.

As far as I understand with TWidgetGrid, than would mean 4 components
per row, and there can be thousands of rows - depending on how large the
*.pas unit is. That's a lot of component that need to be created and
destroyed (during filtering).

The StringGrid is one widget that simply displays text. Creating and
destroying rows in the grid seems much more efficient than thousands of
individual widgets.

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
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] StringGrid and row select

2016-10-17 Thread Martin Schreiber
On Monday 17 October 2016 13:40:14 Graeme Geldenhuys wrote:
> Hi,
>
> What is the MSEgui's StringGrid equivalent of Delphi's
> TStringGrid.Options goRowSelect?
>
>
> I tried grid.datacols.options co_rowselect but that doesn't seem to have
> any affect on the grid - or at least nothing I can visibly see.
>
If you don't want to select cells but to show the active row in another colour 
set T*Grid.DataCols.ColorActive to the wanted colour.
Hint: in MSEgui in most cases it is preferable to use TWidgetGrid (tab 'Edit') 
and insert the necessary column editwidgets from tab 'Edit' instead of using 
TStringGrid.

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