[Iup-users] A problem with IupMatrix

Pierrick Varin Pierrick0.Varin at laposte.net
Wed Apr 30 20:38:04 GMT+2 2008


Hello !

I just subscribed to this list because of a problem I encounter with an 
IupMatrix control.

I'm using freebasic headers (nope not C, nor lua :p ) and .. Well, lets 
me copy the message I sent on the freebasic forums here. I hope someone 
here will know what is happening !

Thanks.

The post :

/Hi !

I'm using IUP for a project i'm working on. To enter and visualize data, 
there's an IupMatrix object (defined in iupcontrols.bi).

Everything was working nice and then, don't know what I did, now, the 
IupMatrix don't "want" to enter in EDIT_MODE (you know, like in excel, 
when you double click on a Cell, it becomes editable). I checked all my 
matrix attributes changes (made with IupSetAttribute) but nothing 
changes the problem.

First, does someone ever used this control ? If yes, does someone have 
any idea of what I could do ?

Posting code ? uh.. I can't post the entire code since it won't be open 
source but I could post some parts, don't know which though .. Here is 
the "Update Matrix" sub, the one in which i'm making the most numerous 
changes on the matrix :

(In the next code, "Cells" is the variable containing the IupMatrix) /

*Sub UpdateListing(List As Listing)
       
        IupSetAttributes(mainDlg,"TITLE=""Listing ["+List.FileName+"]")
       
        If CurrListing.nbStructures<1 Then Exit Sub
       
        '' Combien de lignes par onglet ? --------
       
        Dim As Integer nbStructurePerType=0
       
        For i As Integer = 1 To CurrListing.nbStructures
            If Val(List.Structure(i).StructureType_Int) = Val(ActiveTab) 
Then
               
                nbStructurePerType += 1

            End If
        Next
       
        IupSetAttributes(Cells, "NUMLIN="+Str(nbStructurePerType))
       
        '' Rien a afficher ?
        If nbStructurePerType = 0 Then
            IupSetAttributes(Cells, "REDRAW=ALL" )
            IupSetAttributes(Onglets, "REPAINT=YES") '' Enleve un bug ..
            Exit Sub
        End If
       
        '' -----------------------------------
       
        '' Remplir les lignes -----------
       
        Dim As Integer CurrLine = 0
        For i As Integer = 1 To CurrListing.nbStructures
            If Val(List.Structure(i).StructureType_Int) = Val(ActiveTab) 
Then
                CurrLine+=1
                IupSetAttributes( Cells, 
Str(CurrLine)+":1="""+List.Structure(i).Nom+"""" )
                IupSetAttributes( Cells, 
Str(CurrLine)+":2="""+List.Structure(i).Ville+"""")
                IupSetAttributes( Cells, 
Str(CurrLine)+":3="""+List.Structure(i).SiteWeb+"""" )
                IupSetAttributes( Cells, 
Str(CurrLine)+":4="""+List.Structure(i).Mail+"""" )
                IupSetAttributes( Cells, 
Str(CurrLine)+":5="""+List.Structure(i).Tel+"""" )
                IupSetAttributes( Cells, 
Str(CurrLine)+":6="""+List.Structure(i).Adresse+"""" )
                IupSetAttributes( Cells, 
Str(CurrLine)+":7="""+List.Structure(i).CodePostal+"""" )
            End If
        Next
       
        '' -------------------------------------
       
        IupSetAttributes(Cells, "REDRAW=ALL" )
        IupSetAttributes(Onglets, "REPAINT=YES")*

/Thanks !


btw, i'm using IUP v2.6.0/





Second post :


/Some news ...

Still not working .. And I noticed something really weird ! Now, the 
IupMatrix bugs even if I directly show the GUI without accessing at the 
cells at all.

In fact I'm just rendering the GUI and nothing else, so it could mean 
the bugs comes from the GUI definitions I guess.

BUT ! The thing worked perfectly before I changed *something* in the 
main code (and ONLY in the main code !). So, only showing the GUI 
without any access to the main code should work, no ?!

Maybe is it an iup's bug ? Or headers bug ? Ergh, really don't know.

/And to finish, a last precision :
I just noticed the thing works in ONE precise case : The same IupMatrix 
object is "bounded" in 7 different IupTabs, And it works in the 7th tab 
(?!) but only in the 7th tab.



Sorry for my english ..




More information about the iup-users mailing list