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, <thecolumnwidget>.Value for the value of the 
active cell, <thecolumnwidget>.GridValue[n] for cell values, 
<thecolumnwidget>.GridValues for a dynamic array with the cell values of the 
whole column. GridData returns the instance of the TDataList descendant.


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

Reply via email to