Home > Community > Forums > Custom IC SKILL > Is it possible to add a new tab to an existing tab field

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Is it possible to add a new tab to an existing tab field 

Last post Mon, Nov 4 2013 3:25 AM by Andrew Beckett. 2 replies.
Started by FrncsJRClement 29 Oct 2013 06:14 AM. Topic has 2 replies and 2959 views
Page 1 of 1 (3 items)
Sort Posts:
  • Tue, Oct 29 2013 6:14 AM

    • FrncsJRClement
    • Not Ranked
    • Joined on Tue, Oct 29 2013
    • <?xml version="1.0" encoding="utf-16"?><string>Moirans, Isere</string>
    • Posts 1
    • Points 20
    Is it possible to add a new tab to an existing tab field Reply

     Hello,

     Does anyone know whether it is possible to add a new tab page to an existing tab field?

    Could find an answer neither in skuiref.pdf, nor on this forum.

    Here is what was tried to no avail:

    1) Initial form creation:

    Code example (stored in file "tabTest.il"):

     procedure( cwsFx(x_pageNumber)
      hiCreateFloatField(
        ?name       concat('float_ x_pageNumber)
        ?prompt     "Scaling"
        ?value      1.0
        ?range      '(1e-30 1e30)
      )
    ) ; procecure cwsFx


    let( (tabField)
      unless( boundp('CWSTestForm)
        tabField = hiCreateTabField(
          ?name     'CWSTestTab
          ?fields   list(
                      list(
                        list( cwsFx(1) 0:0 400:30 80 )
                      )
                      list(
                        list( cwsFx(2) 0:0 400:30 80 )
                      )
                    )
        ) ; hiCreateTabField

        CWSTestForm = hiCreateAppForm(
          ?name             'CWSTestForm
          ?formTitle        "CWS Test Form"
          ?fields           list(
                              list(tabField 0:0 600:200)
                            )
          ?dontBlock        t
        ) ; hiCreateAppForm
        hiInstantiateForm(CWSTestForm)
      ) ; unless boundp CWSTestForm

      hiDisplayForm(CWSTestForm)
      printf("form handle is CWSTestForm\n")
      printf("CWSTestForm->CWSTestTab->page1->fieldType is '%L'.\n" CWSTestForm->CWSTestTab->page1->fieldType)
    ) ; let

    Execution in CIW:

    load("tabTest.il")

    Result:

    form handle is CWSTestForm
    CWSTestForm->CWSTestTab->page1->fieldType is 'scrollRegion'.
    t

    2) Attempt #1:

    Code example:

    procedure( addTabPageAttempt1()
      let( (pageCount newPageNumber newPageSymbol newPage)
        pageCount = if( listp(CWSTestForm->CWSTestTab->fieldList) length(CWSTestForm->CWSTestTab->fieldList) 1)
        newPageNumber = add1(pageCount)
        newPageSymbol = concat('page newPageNumber)
        newPage = hiCreateScrollRegion(
          ?name       newPageSymbol
          ?fields     list(
                        list( cwsFx(newPageNumber) 0:0 400:30 80 )
                      )
        ) ; hiCreateScrollRegion
        putprop(CWSTestForm->CWSTestTab newPage newPageSymbol)
        if( pageCount > 1
        then
          append(CWSTestForm->CWSTestTab->fieldList list(newPage))
        else
          CWSTestForm->CWSTestTab->fieldList = list(CWSTestForm->CWSTestTab->fieldList newPage)
        ) ; if pageCount > 1
        hiDisplayForm(CWSTestForm) ; form refresh
      ) ; let
    ) ; procedure addTabPageAttempt1

    Execution in CIW:

     addTabPageAttempt1()

    Result:

     t (no change in displayed form...)

    3) Attempt #2:

    Code example:

    procedure( addTabPageAttempt2()
      let( (pageCount newPageNumber newPageSymbol newPage)
        pageCount = if( listp(CWSTestForm->CWSTestTabNumber) length(CWSTestForm->CWSTestTabNumber) 1)
        newPageNumber = add1(pageCount)
        newPageSymbol = concat('page newPageNumber)
        newPage = hiCreateScrollRegion(
          ?name       newPageSymbol
          ?fields     list(
                        list( cwsFx(newPageNumber) 0:0 400:30 80 )
                      )
        ) ; hiCreateScrollRegion
        hiAddField(CWSTestForm->CWSTestTab newPage)
        hiDisplayForm(CWSTestForm) ; form refresh
      ) ; let
    ) ; procedure addTabPageAttempt2

    Execution in CIW:

    addTabPageAttempt2()

    Result:

    p, li { white-space: pre-wra

    *WARNING* Illegal 2D field description:

    *WARNING* scrollRegionStruct@0x15a05980

    *WARNING* hiAddField: invalid 2D field description

    t (no change in displayed form...)

     

    Many thanks for your help

    Fran├žois CLEMENT
    S.A. Coupling Wave Solutions (CWS)
    Grenoble area - FRANCE
    • Post Points: 20
  • Wed, Oct 30 2013 5:55 AM

    • TaherKotb
    • Top 500 Contributor
    • Joined on Wed, Apr 24 2013
    • Posts 27
    • Points 375
    Re: Is it possible to add a new tab to an existing tab field Reply

    Hello, 

    Have you checked the status of the tab field ?, it may be disabled.

    To enable the entire field:

    form->tabField->enabled = t 

    To enable a specific page of the tab field:

    form->tabField->page->enabled = t  

     

    Hope that helps 

    Best regards

    Taher 

    • Post Points: 20
  • Mon, Nov 4 2013 3:25 AM

    Re: Is it possible to add a new tab to an existing tab field Reply

    There's no mechanism for doing this right now - tab pages cannot be added (or removed) dynamically other than enabling or disabling them dynamically.

    The alternative is to recreate the tab field completely, adding a new page on, and then replace the original tab field on the form. That would be easy enough to implement.

    Regards,

    Andrew.

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by FrncsJRClement at 29 Oct 2013 06:14 AM. Topic has 2 replies.