[Gambas-user] Fwd: PB using tableview object

Olivier Cruilles linuxos at ...1896...
Sun Apr 5 00:16:42 CEST 2009


Benoit,

Sorry for the explications, I'm not really good in english.

So, I used a TableView because I did find in the GridView how o edit a  
single Cell.

Second part, I don't know how to attach for exemple a TextBox inside a  
Cell of an object (like a GridView),
if it's possible of curse.

So, to be more clear:

This is the Tableview in edition mode after double clicking in the  
'FlowIn1' cell:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Panneau_Preferences_Edition.jpg
Type: image/jpeg
Size: 72223 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20090405/765ec374/attachment.jpg>
-------------- next part --------------


This is the TableView problem that I have with the left column  
(normaly locked for edition)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Panneau_Preferences_Erreur.jpg
Type: image/jpeg
Size: 75653 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20090405/765ec374/attachment-0001.jpg>
-------------- next part --------------




This is a part of the code for the Tableview:

PUBLIC SUB Creation_Tableau_Variable_Netflow()

' Tableau Liste des variables associ?es aux groupes de ports

DIM INDEXTABLEAU AS Integer
DIM NewFont AS Font
DIM NOMVARIABLE AS String

TableView1.Clear
TableView2.Clear

NewFont = NEW Font
NewFont = Font["Sans,Bold,9"]

' Tableau des Variables Flow IN
TableView1.Columns.Count = 2
TableView1.Rows.Count = 30
TableView1.Columns[0].Title = ("Groupe Ports")
TableView1.Columns[0].Width = (TableView1.Width / 10) * 4.5
TableView1.Columns[1].Title = ("Variables")
TableView1.Columns[1].Width = (TableView1.Width / 10) * 4

' Tableau des Variables Flow OUT
TableView2.Columns.Count = 2
TableView2.Rows.Count = 30
TableView2.Columns[0].Title = ("Groupe Ports")
TableView2.Columns[0].Width = (TableView2.Width / 10) * 4.5
TableView2.Columns[1].Title = ("Variables")
TableView2.Columns[1].Width = (TableView2.Width / 10) * 4

' Remplissage Tableau FlowIn
FOR EACH NOMVARIABLE IN ClassVariables.VARIABLEFLOWIN

  TableView1[ClassVariables.VARIABLEFLOWIN.key, 0].Text =  
("GroupPortIn") & Str(ClassVariables.VARIABLEFLOWIN.key + 1)
  TableView1[ClassVariables.VARIABLEFLOWIN.key, 0].Font = NewFont
  TableView1[ClassVariables.VARIABLEFLOWIN.key, 0].BackColor =  
Val("&HDFFFEF&")
  TableView1[ClassVariables.VARIABLEFLOWIN.key, 1].Text = NOMVARIABLE

NEXT

' Remplissage Tableau FlowIn
FOR EACH NOMVARIABLE IN ClassVariables.VARIABLEFLOWOUT

  TableView2[ClassVariables.VARIABLEFLOWOUT.key, 0].Text =  
("GroupPortOut") & Str(ClassVariables.VARIABLEFLOWOUT.key + 1)
  TableView2[ClassVariables.VARIABLEFLOWOUT.key, 0].Font = NewFont
  TableView2[ClassVariables.VARIABLEFLOWOUT.key, 0].BackColor =  
Val("&HDFEFFF&")
  TableView2[ClassVariables.VARIABLEFLOWOUT.key, 1].Text = NOMVARIABLE

NEXT

END

PUBLIC SUB TableView1_Activate()

' Procedure quand on click dans le TableView1

IF TableView1.Column = 1 THEN
  TRY TableView1.Edit()
END IF

END

PUBLIC SUB TableView2_Activate()

' Procedure quand on click dans le TableView2

IF TableView2.Column = 1 THEN
  TRY TableView2.Edit()
END IF

END

PUBLIC SUB TableView1_Save(Row1 AS Integer, Column1 AS Integer, Value1  
AS String)

IF Column1 = 1 THEN
  TableView1[row1, Column1].Text = Value1
  TableView1[row1, Column1].BackColor = Val("&HFFFFDF&")
END IF

END

PUBLIC SUB TableView2_Save(Row2 AS Integer, Column2 AS Integer, Value2  
AS String)

IF Column2 = 1 THEN
  TableView2[row2, Column2].Text = Value2
  TableView2[row2, Column2].BackColor = Val("&HFFFFDF&")
END IF

END



Thank you in advance,

Olivier Cruilles
Mail: linuxos at ...1896...


Le 27 mars 09 ?  11:28, Beno??t Minisini a ??crit :

>> Hi,
>>
>> I'm trying to use the Tableview object in a project and I have 2
>> Columns configured.
>>
>> I have configured the TableView to be able to edit each Cell in the
>> right column and lock the left Column
>> but in real, by using the key, in edition mode,  I can always acces  
>> to
>> the left Column that is locked and write text inside.
>>
>>
>> I don't know how to lock completly the left column as in the Gambas
>> IDE => Object Properties Panel ?
>>
>> Does anyone can help me please ?
>>
>> Olivier Cruilles
>> Mail: linuxos at ...1896...
>>
>
> You are not very clear: please provide your source code!
>
> The TableView won't edit any cell unless you explicitely call its  
> Edit (or
> EditWith) method during a Select event. Just don't call Edit() if  
> the current
> column is zero.
>
> And the object properties panel uses a GridView, not a TableView.
>
> Regards,
>
> -- 
> Beno??t
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>


Olivier Cruilles
Mail: linuxos at ...1896...


Olivier Cruilles
Mail: linuxos at ...1896...



More information about the User mailing list