how do you make a new glab with btext coming for the inputed value from textpane?

 
  • Values from TEXTPANE gadget are array of strings. How dfo you want them to be put into one line? with word hyphenation?

    setup form !!testform
    textpane .tx1 'text for label' width 10 hei 5
     path down
    button .create 'create label' callback '!this.create()'

    exit
    define method .testform()
    endmethod
    define method .create()
     VIEW
      HANDLE ANY
        !!Alert.Message('Goto VIEW level first')
      RETURN
      ENDHANDLE
      LAYE 1
      !getLaye = !!CE.Name
    !textArray = !this.tx1.Val
    if (!textArray.Size() EQ 0) then
       !!Alert.Message('No text input')
     RETURN
    endif

    !newBtext = !textArray[1]
    do !x from 2 to !textArray.Size()
    !newBtext = !newBtext + '#/' + !textArray[!x]
    enddo

    !!Alert.Message('Identify Design Item for new label')
    VAR !getItem IDEN @
    $!getLaye
     NEW GLAB
     Ddname $!getItem
     !glabCE = !!CE.Name
      Btext |$!newBtext|
    endmethod


    If you want to use specific line then use Line(REAL) gadget method to get line with specific number
  • the code above read values from TEXTPANE and if there are many lines then do next line in label
  • i dont understand what do you mean by set to view..
    Label normally attached to some items. Maybe if you can descrive your task more specific I can offer something else
  • you can do it  like that


    setup form !!testform
    textpane .tx1 'text for label' width 10 hei 5
     path down
    button .create 'create label' callback '!this.create()'

    exit
    define method .testform()
    endmethod
    define method .create()
     VIEW
      HANDLE ANY
        !!Alert.Message('Goto VIEW level first')
      RETURN
      ENDHANDLE
      !viewName = !!Ce.Name
      LAYE 1
      !getLaye = !!CE.Name
    !textArray = !this.tx1.Val
    if (!textArray.Size() EQ 0) then
       !!Alert.Message('No text input')
     RETURN
    endif

    !newBtext = !textArray[1]
    do !x from 2 to !textArray.Size()
    !newBtext = !newBtext + '#/' + !textArray[!x]
    enddo

    $!getLaye
     NEW GLAB
     DDname $!viewName
      Btext |$!newBtext|
    endmethod



    it will attch label to the centre of view
  • Hello.

    Good afternoon.

    I would like to ask if you could me with my problem. with a method to create a glab normally I have already indicated it like btext 'NS/FS'. But how we have the value of Btext be coming for the value type in the textpane?
  • hi Ruav thanks for sharing your code. the form works, but how do I modify it so that I do not have to pick or identify element. The glab does not have to be ddname to any element or can we have it set automatically to the current view? thanks.
  • thank for you reply. on your code we have to connect it to an element. instead of connecting it to an element (sctn, pane etc.) can it be connected automatically to the view or ddname = layer owner. this is so that if there are any changes in the design the glab will not be affected.
  • Hi, Ruav thank you very much for the code. it is working very good.