[Gambas-user] TableView Problem

jose.santos at ...1197... jose.santos at ...1197...
Wed Nov 2 01:48:27 CET 2005


Hi Nando. I'm not very sure about your problem.

I'm working in a database application and I've got TableViews that show
perfectly more than 5.000 rows.

This is the code of the _Data event.

' EVENTS.
' ================================================
PUBLIC SUB Table_Data(Row AS Integer, Column AS Integer)
  DIM objColumn AS DYGridColumn

  objColumn = m_columns[Column]

  SELECT CASE m_bytMode
  CASE DYGridModesEnum.DYGridModeBound
    m_rsData.MoveTo(Row)
    m_table.Data.Text = m_rsData[objColumn.DataField]
  CASE DYGridModesEnum.DYGridModeAddItem
    m_table.Data.Text = Split(m_itemList[Row], m_strFieldSeparator)[Column]
  END SELECT

  ' In Boolean Columns, An Icon is shown instead text values.
  IF objColumn.DataType = DYDataTypes.DYBoolean THEN
    IF CBool(CInt(m_table.Data.Text)) THEN
      m_table.Data.Picture = UtilLib.IconOK()
    ELSE
      m_table.Data.Picture = UtilLib.IconCancel()
    ENDIF
    m_table.Data.Text = ""
  ENDIF
END

It can be a bit confussing but it's very simple:
- FIRST SELECT: There are two working states: bounded to a database or AddItem
mode (an Array suplies the info to the TableView).
- Aditionally, For boolean values of the database, the TableView only 
show icons
instead of -1 or 0.

That's all. Hope you find it useful.

Regards.

Quoting nando <nando_f at ...951...>:

> Benoit,
>
> After much investigation, I have it appears that
> TableView is not implemented correctly.
> The example referred to originally (below) works, but
> is not the correct way it is supposed to work.
> The data in the table is 'deleted' every event '_data'
> and an array is used to populate.
> A control like this is supposed to hold data 'unchanged'
> within the cells - even when scrolled or clicked.
> 5000 events while scrolling to repopulate is unreal and is unnecessary.
> The control/class is supposed to maintain the data - even when scrolling.
> It is wrong.
> The number of rows/columns at design time cannot be specified.
> I cannot code something like...
> TableView1[4,4].Text = "This is 4,4"
> If TableView is the QT 'Table View' then it is incomplete
>
> Please help me understand this problem.
> -Fernando
>
>
> ---------- Original Message -----------
> From: "nando" <nando_f at ...951...>
> To: "Benoit" <gambas-user at lists.sourceforge.net>
> Sent: Mon, 31 Oct 2005 17:49:31 -0500
> Subject: [Gambas-user] TableView Question
>
>> I looked at the 'HOW TO PUT VALUES IN A TABLEVIEW WIDGET'
>> located at 'www.gambasforge.net/code.php?id=31#notes'
>>
>> Can someone please inform me as to what makes
>> SUB TableView1_Data  event fire?
>>
>> It is not evident to me.
>>
>> I single stepped through it - No code invokes it
>> so it must be an event.
>>
>> -Fernando
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by the JBoss Inc.
>> Get Certified Today * Register for a JBoss Training Course
>> Free Certification Exam for All Training Attendees Through End of
>> 2005 Visit http://www.jboss.com/services/certification for more information
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
> ------- End of Original Message -------
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.






More information about the User mailing list