• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. Need helps with the form grid table.

Stats

  • Replies 0
  • Subscribers 159
  • Views 12743
  • Members are here 0
More Content

Need helps with the form grid table.

stillfish
stillfish over 14 years ago

Hi all,

I am trying to create a grid table to put my data list that each data has lots of column fields. I have set each field's column width with the total column width is larger than the grid table size I set in the form file. I supposed that there is a horizontal slide bar under the table and I can browse table by moving the slide bar. But it does not work as i figured, the table seems to auto adjust all its fields column width to fit the grid table size.
And then I could not really fix my field width to show datas prettily. Or I have to manually adjust each field every time.

Has anyone also have the same problem?  

Here is brief code:


In form file:
  ...
  GRID gridtable
  FLOC 25 4     
  FSIZE 110 15                   ; grid table has width 110
  OPTIONS HLINES VLINES USERSIZE
  ENDGRID
  ...

Main function:
  ...
  axlFormCreate('Qfm_vios_form G_vios_form '("E" "OUTER") 'QviosViewerFormAct t)
  Q_ViosGridInitHeader()
  ;insert items
  axlFormGridInsertRows(Qfm_vios_form "gridtable" 0 25)
  axlFormGridSetBatch(Qfm_vios_form "gridtable" 'QViosGridInsertRowsCB nil)
  axlFormGridUpdate(Qfm_vios_form "gridtable")
  axlFormDisplay(Qfm_vios_form)
  ...

defun(Q_ViosGridInitHeader ()
  let((default_header)
    default_header=list(
      list("ID" 'LONG 15 15)                          
      list("Module" 'STRING 30 35)                
      list("Type" 'STRING 25 30)    
      list("Name" 'STRING 25 35)           
      list("Sub Name" 'STRING 25 35)           
      list("Class" 'STRING 25 35)     
      list("Sub Class" 'STRING 25 35)            
      list("Expect Value" 'REAL 10 20)        
      list("Actual Value" 'REAL 10 20)      
      list("Delta" 'REAL 10 20)     
      list("Comment" 'STRING 40 80)
    )
    foreach(it default_header
      col = make_formGridCol()
      col->headText = car(it)
      col->fieldType = cadr(it)
      col->colWidth = caddr(it)               ; I want that the display width is exactly equal this value
      col->fieldLength = cadddr(it)     
      axlFormGridInsertCol(Qfm_vios_form "gridtable" col)
    );end for
  )  
)


defun(QViosGridInsertRowsCB (trash)
  let((cell nRows nField)

    ;this is a test data
    G_ViosList=list(list(
      12345678 "this is a test module 30 chars" "1234567890123456789012345"
      "1234567890123456789012345" "1234567890123456789012345" "1234567890123456789012345"
      "1234567890123456789012345" 123456.789 123456.789 123456.789 
      "a long comment"
    ))

    cell = axlFormGridNewCell()
   
    nRows=0    
    foreach(item G_ViosList  
      nRows++
      cell->row=nRows
   
      nField=1
      foreach(item_f item
        cell->col = nField
        cell->value=nth(nField-1 item)
        axlFormGridBatch(cell)
        nField++                     
      )
    )
  )
)
   

     

  • Sign in to reply
  • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information