Results 1 to 8 of 8

Thread: copy textfields

  1. #1
    Join Date
    May 2012

    copy textfields

    I,m still struggling with the fact that I have to give all the textboxes (and other objects that I use more than once) the same properties.
    I know that classes (copy and use in the app) will there be in the future, but is there a possiblity to click on an object in the section and copy it ? (it's very useful in VFP.)
    This should speed up the building of an app.

    Thanks in advance.

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Croatia, Zagreb
    Hi Snelsoft,

    We will have to wait to more "visual" stuff.
    Uniform appearance is achieved with CSS. And there are templates to use.

    If I need to add say 50 buttons in myapp, I would open myapp.lianja file and copy <formitem> ...</formitem>, then paste 50 times and change ids.
    They will be all in the same xy coordinate if I do not change that too, and need to be dragged later in proper position.

    This is pure XML and you can change there what you want if you know what you are doing. Make copy before.
    What same properties of textboxes are you changing over and over?


  3. #3
    Join Date
    May 2012
    properties I most use are widht and formats sometimes color.
    I know that there are workarounds, but a correct and simple solution will of course be appreciated.

    Another example is an visual form (as in VFP) with height and width that I can fill with visual object without coding.
    I know there is a workaround because you can design a page,save it, and display it with Showdialog().
    But this is not the solution I want, because there are restrictions, if you place code in the PageSection, it will mostly generate an error in the Showdialog.
    Also remove the original page from the app gives a problem, you can't change the page anymore.

  4. #4
    Senior Member
    Join Date
    Feb 2012
    Rome - Italy
    Hi Snelsoft, hi Josip

    I have adopted a other strategy..
    For me, every field, belongs to an EDT (Extended Data Type), inserted in the "Custom attributes".

    Name:  Screenshot - 20_01_2015 , 12_30_33.jpg
Views: 143
Size:  5.1 KB

    In the Load delegates, I added a function (eg. dd_setFieldProperty (this))
    Name:  Screenshot - 20_01_2015 , 12_25_31.jpg
Views: 150
Size:  67.6 KB

    Then I wrote a bit of code, where I set some field property, in my case I've a table where I set some data as:
    caption, relation to other table, ecc.

    If you add a funcion lo load delegate, you can centralize more display property of your field.

    proc dd_SetFieldProperty(psField)
    // imposta i dati del campo: Data mapping, caption, se  un enumerato
    	private m_dataMappingGet, nelements, m_fieldsList
    	private m_field, m_thisSource, m_fields, m_description, m_table
    	private m_referenceField, m_filter, m_thishyperlink, m_enumerated
    	private m_edt, m_virtualTableName, m_EDT
    	m_field_id =
    	m_field = Lianja.GetElementByID(m_field_id)
    		if type("m_field.user_edt") = "C"
    			m_EDT = m_field.user_edt
    		m_EDT = ""
    	m_thisSource = m_field.controlsource
    //	? "m_thisSource = " + m_thisSource
    	m_fieldSetup = dd_FindFieldSetup(m_EDT, m_thisSource)	// retrive information about EDT
    	if type("m_fieldsetup") = "O"
    		if pemstatus(m_fieldSetup, "edt", 5)
    			m_fields 			= rtrim(m_fieldSetup.fields)
    			m_description 		= rtrim(m_fieldSetup.description)
    			m_table 			= rtrim(m_fieldSetup.referencedTable)
    			m_referenceField 	= rtrim(m_fieldSetup.referencedField)
    			m_filter 			= rtrim(m_fieldSetup.filter)
    			m_thishyperlink 	= rtrim(m_fieldSetup.hyperlink)	
    			m_enumerated 		= m_fieldSetup.enumerated
    			m_caption 			= rtrim(m_fieldSetup.caption)
    			if empty(m_edt)
    				m_edt = m_fieldSetup.edt

  5. #5
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Berkshire, UK
    Canvas Section 'Advanced Controls' can be aligned and given the same appearance attributes using 'Align' and 'Format'.

    Form Sections have attributes allowing you to set the size and layout of formitems (field caption+data) section-wide.

    Pages to be used as UI Pages with Lianja.showDialog() and Lianja.showDialogPanel() should be created in a separate App from the one(s) from which they will be called - for example the customerlist UI Page used in the sample lianjademo App is in the ui_mypagelibrary (mypagelibrary in earlier versions) App, so can be modified when required.

    Any problems with code in UI Pages can be discussed on the Forums with fellow developers who may well be able to help, or submitted as tickets if you think it's a bug.



  6. #6
    Lianja MVP
    Join Date
    Dec 2012
    Croatia, Zagreb
    Quote Originally Posted by snelsoft View Post
    properties I most use are widht and formats sometimes color..
    To force same width you can select all texboxes and all will get the width of the first selected one:

    Name:  _SP32-20150120-135528.jpg
Views: 147
Size:  28.5 KB

    After that you get:

    Name:  _SP32-20150120-135606.jpg
Views: 142
Size:  11.8 KB

    Similar for colors (or some other attributes)

    Name:  _SP32-20150120-135632.jpg
Views: 147
Size:  27.7 KB

  7. #7
    Senior Member
    Join Date
    Jul 2013
    Ontario, Canada
    To add to Josip's comments,
    please be aware that if you use 'same width', the caption area usually expands while the textbox area usually becomes smaller.
    Dragging the handles of the control will adjust the textbox area. For the caption size, you must do this manually in the delegates settings.

    Name:  caption width.png
Views: 120
Size:  15.5 KB


  8. #8
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    UK, USA, Thailand
    This is an old post but I think the new MetaDataBuilder API is relevant to this topic. Please see for details.
    Principal developer of Lianja, Recital and other products

    Follow me on:




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Journey into the Cloud
Join us