Objects and Classes [examples]

Display the currently defined System, User, Class Library and API Classes
DISPLAY_CLASSES
display classes

https://www.lianja.com/doc/index.php/DISPLAY_CLASSES


List the currently defined System, User, Class Library and API Classes
LIST_CLASSES
list classes

https://www.lianja.com/doc/index.php/LIST_CLASSES


All Lianja UI Framework Classes provide integrated data binding to the underlying Lianja embedded database (the Controlsource property).

tb = createObject("textbox")
// table.column
tb.controlsource = "customer.lastname"
// a function call
tb.controlsource = "myfunc()"
// a macro expression
tb.controlsource = "{expression}"

https://www.lianja.com/doc/index.php/Understanding_Data_Binding


Create a new object based on a defined class
CREATEOBJECT
myObject = createobject("MyClass")

https://www.lianja.com/doc/index.php/CREATEOBJECT()


Create a new object
NEWOBJECT
// myclasslib.vcp
define class Product as custom
	productname = "Lianja App Builder"
	version = "1.0"
	proc init(arg1)
		? etos(arg1)
	endproc
	proc getver
		? this.version
	endproc
enddefine
// end of myclasslib.vcp
 
oProduct = newobject("Product","myclasslib","Hello World")

https://www.lianja.com/doc/index.php/NEWOBJECT()


Create a new object based on a class
NEW_Operator
define class product as custom
	productname = "Lianja App Builder"
	version = "3.4"
	proc init(arg1)
		? etos(arg1)
	endproc
	proc getver
		? this.version
	endproc
enddefine
 
oProduct = new product("Hello World")
oProduct.getver()
? oProduct.productname

https://www.lianja.com/doc/index.php/NEW_Operator


Check whether a class has been defined
CLASS_EXISTS
set classlib to myclasses1
? set([classlib])
list classes
? class_exists("mybutton1")

https://www.lianja.com/doc/index.php/CLASS_EXISTS()


List of active class libraries with their reference count
LIST_CLASSLIB
set classlib to myclasses
list classlib

https://www.lianja.com/doc/index.php/LIST_CLASSLIB


Open a class library file
SET_CLASSLIB
set classlib to myclasses
currclasslib = set('classlib')

https://www.lianja.com/doc/index.php/SET_CLASSLIB


Place the class name of an object and its ancestors into a variable array
ACLASS
nHierarchy = aclass(aHierarchy,myObject)

https://www.lianja.com/doc/index.php/ACLASS()


Add a property to an existing object
ADDPROPERTY
define class myclass as custom
  myprop = "Hello World"
enddefine
 
myobject = createobject("myclass")
Messagebox(myobject.myprop)
addproperty(myobject, "myprop2", "goodbye")
// Or: myobject.addproperty("myprop2", "goodbye")
Messagebox(myobject.myprop2)
removeproperty(myobject, "myprop2")
// Or: myobject.removeproperty("myprop2")

https://www.lianja.com/doc/index.php/ADDPROPERTY()


Load the properties of an object into an array
AMEMBERS
define class Product as custom
    productname = "Lianja App Builder"
    version = "1.0"
enddefine
 
oProduct = createobject("Product")
 
? amembers(myarray,oProduct)
display memory

https://www.lianja.com/doc/index.php/AMEMBERS()


Create a user-defined class
DEFINE_CLASS
define class myClass as custom
    productname = "Lianja App Builder"
    version = "1.0"
enddefine

https://www.lianja.com/doc/index.php/DEFINE_CLASS


Compare two objects
COMPOBJ
define class myclass1 as custom
  property firstname
  property lastname
enddefine
 
define class myclass2 as custom
  property firstname
  property lastname
enddefine
 
define class myclass3 as custom
  property firstname
  property lastname
  property midinitial
enddefine
 
o1 = new myclass1()
o2 = new myclass2()
o3 = new myclass3()
 
o1.firstname = "John"
o1.lastname = "Johnson"
 
o2.firstname = "Jack"
o2.lastname = "Johnson"
 
o3.firstname = "John"
o3.lastname = "Johnson"
 
? compobj(o1,o2)
// Returns .F. as firstname property has different values
 
o2.firstname = "John"
? compobj(o1,o2)
// Returns .T. as properties and values identical
 
? compobj(o1,o3)
// Returns .F. as although firstname and lastname properties are identical, 
// o3 has a midinitial property and o1 does not

https://www.lianja.com/doc/index.php/COMPOBJ()


Create an anonymous object
OBJECT
customer = object("custname" => "A Buyer Ltd.", ;
  "currentorder" => object("ord_id" => "00001", "ord_date" => date(),"ord_total" => 1599,;
  "orderitems" =>  object("10 reams A4 paper","500 business cards",;
                         "500 black ballpoint pens")))
display memory
 
Memory Variables:
------------------------
private(2):
CUSTOMER   Object (refptr OBJECT, refcnt 1)
.CUSTNAME   Character 'A Buyer Ltd.'
.CURRENTORDER Object (refptr OBJECT, refcnt 0)
 .ORD_ID    Character '00001'
 .ORD_DATE  Date 12/21/2012
 .ORD_TOTAL  Numeric 1599  (1599.000000000)
 .ORDERITEMS Object (refptr OBJECT, refcnt 0)
  [1]      Character '10 reams A4 paper'
  [2]      Character '500 business cards'
  [3]      Character '500 black ballpoint pens'

** Total of ** 10 variables defined and 864 bytes use
** Total of ** 10 variables defined and 864 bytes used.

https://www.lianja.com/doc/index.php/OBJECT()


Load an object or dynamic array from an external .obf file
LOADOBJECT
class myclass
endclass
 
obj1=new myclass()
obj1.save("file1")
obj2=loadobject("file1")
 
// or for an existing object
obj1.load("file1")

https://www.lianja.com/doc/index.php/LOADOBJECT()


Save an object or dynamic array to an external .obf file
SAVEOBJECT
class myclass
...
endclass
 
obj1 = new myclass()
saveobject(obj1,"file1")
// or
obj1.save("file1")

https://www.lianja.com/doc/index.php/SAVEOBJECT()


Remove a property from an existing object
REMOVEPROPERTY
define class myclass as custom
  myprop = "Hello World"
enddefine
 
myobject = createobject("myclass")
Messagebox(myobject.myprop)
addproperty(myobject, "myprop2", "goodbye")
// Or: myobject.addproperty("myprop2", "goodbye")
Messagebox(myobject.myprop2)
removeproperty(myobject, "myprop2")
// Or: myobject.removeproperty("myprop2")

https://www.lianja.com/doc/index.php/REMOVEPROPERTY()


Compare two objects and return the differing properties as an object
DIFFOBJ
scatter name oNewData
scatter oldvalues name oOldData
oChangedData = diffobj(oNewData, oOldData)

https://www.lianja.com/doc/index.php/DIFFOBJ()


Call the parent class method from within a sub-class
DODEFAULT
class Box 
  procedure Draw 
    messagebox("This is the parent Draw Method") 
  endproc && Draw 
endclass 
 
class Dialog1 of Box 
  procedure Draw 
    messagebox("This is the object Draw Method")
    // call the Draw method of the Box parent class
    dodefault() 
  endproc && Draw 
endclass 
 
oDIALOGOK = createobject("Dialog1")
oDIALOGOK.Draw()
release oDIALOGOK

https://www.lianja.com/doc/index.php/DODEFAULT()


Check whether an object has a specified property, method or event
PEMSTATUS
define class Product as custom
	productname = "Lianja App Builder"
	version = "1.0"
	proc getver
		? this.version
	endproc
enddefine
 
oProduct = createobject("Product")
oProduct.getver()
 
? pemstatus(oProduct,"productname",5) // .T.
? pemstatus(oProduct,"getver",5)      // .T.
? pemstatus(oProduct,"notthere",5)    // .F.

https://www.lianja.com/doc/index.php/PEMSTATUS()


Trigger an event
RAISEEVENT
raiseevent(myobj,"click")

https://www.lianja.com/doc/index.php/RAISEEVENT()


Specify multiple properties for an object
WITH
with oProduct
    .productname = "Lianja App Builder"
    .productversion = "1.0"
    .productyear = "2013"
endwith

https://www.lianja.com/doc/index.php/WITH


Check whether an expression is the name of an object
IS_OBJECT
open database southwind
select * from example into object adynamic
? is_object(adynamic)
.T.

https://www.lianja.com/doc/index.php/IS_OBJECT()


Display object information in a readable format
PRINT_R

 

open database southwind
select * from shippers into object shipobj
print_r(shipobj)
Dynarray (refcnt=1)
(
    [row1] => Dynarray (refcnt=1)
        (
            [shipperid] => 1
            [companyname] => Speedy Express
            [phone] => (503) 555-9831
        )
    [row2] => Dynarray (refcnt=1)
        (
            [shipperid] => 2
            [companyname] => United Package
            [phone] => (503) 555-3199
        )
    [row3] => Dynarray (refcnt=1)
        (
            [shipperid] => 3
            [companyname] => Federal Shipping
            [phone] => (503) 555-9931
        )
)
class NullData dynamic
    property mCHARACTER
    property mNUMERIC
endclass
 
oNULLDATA = new NullData()
oNULLDATA.mCHARACTER = ""
oNULLDATA.mNUMERIC = 0
oNULLDATA.mLOGICAL = .F.
print_r(oNULLDATA) // or alternatively just echo oNULLDATA
Object (refcnt=1)
(
    [mcharacter] =>
    [mnumeric] => 0
    [mlogical] => False
)

https://www.lianja.com/doc/index.php/PRINT_R()


define class myclass as custom
  myprop = "Hello World"
enddefine
 
myobject = createobject("myclass")
Messagebox(myobject.myprop)
addproperty(myobject, "myprop2", "goodbye")
// Or: myobject.addproperty("myprop2", "goodbye")
Messagebox(myobject.myprop2)
removeproperty(myobject, "myprop2")
// Or: myobject.removeproperty("myprop2")

https://www.lianja.com/doc/index.php/A_Lianja_Primer


To define a class use the following syntax.

define class myclass
    // class members
enddefine

Then, to create an object based on this class use the following syntax.

myobject = new myclass()

Or alternatively.

myobject = createobject("myclass")

Properties

An object has certain properties, or attributes that are specific to the object. Properties are the equivalent of variables that can only be accessed by referencing them inside an object. By encapsulating the data (variables) and procedures within a class, programming becomes less error prone and applications easier to maintain.

Objects you create in Lianja have properties that are determined by the class the object is based on. As Lianja is a dynamic language, classes in Lianja allow properties and methods to be added at run time.

define class myclass
    myprop = "hello world"
enddefine
 
myobject = new myclass()
echo myobject.myprop    // displays "hello world"

Properties defined within classes can be simple variables, fixed arrays, dynamic arrays or objects.

Methods

Methods are procedures that are associated with objects. Methods are different from normal Lianja procedures in that they are bound with an object and are called differently from the way normal Lianja procedures are called.

define class myclass
    myprop = "hello world"
    procedure mymethod()
        echo myprop
    endproc
enddefine 
 
myobject = new myclass()
myobject.mymethod()    // displays "hello world"

Interface Methods

Interface Methods are template procedure definitions that must be implemented in any derived classes.

define class myclass
    myprop = "hello world"
    public procedure mymethod() interface
enddefine 
 
myobject = new myclass()
myobject.mymethod()    // throws an error "Interface method not defined"
 
define class myclass2 as myclass
    procedure mymethod()
        echo "hello world"
    endproc
enddefine
 
myobject = new myclass2()
myobject.mymethod()  // displays "hello world"

Member access control modifiers

You can ‘hide’ properties and methods using the access control modifiers protected, hidden, private, or static.

define class myclass
    private myprop = "hello world"
    public procedure mymethod()
    return myprop
    public static procedure mystaticmethod()
    endproc
enddefine
 
myobject = new myclass()
// throws an error as "myprop" is private and can only be accessed by methods inside the class
echo myobject.myprop    
myobject = new myclass()
// this will work. displays "hello world"
echo myobject.mymethod()

Constructors and Destructors

Lianja allows developers to declare constructor and destructor methods for classes. Classes which have a constructor method called init call this method on each newly-created object, so it is suitable for any initialization that the object may need before it is used.

define class myclass
    procedure init()
    // insert your own constructor code here
    endproc
enddefine
 
obj = new myclass()    // the init() method is called with no arguments

You can pass arguments to the constructor method when the object is created.

define class myclass
    public name
    public title
    procedure init(pname, ptitle)
        name = pname
        title = ptitle
    endproc
enddefine
 
obj = new myclass("joe", "developer")    // the init() method is called with arguments

Similarly, Lianja uses a destructor concept similar to that of other object-oriented languages, such as Java. The destructor method will be called as soon as all references to a particular object are removed or when the object is explicitly destroyed or in any order in shutdown sequence. The Lianja destuctor method is called destroy.

define class myclass
    procedure destroy()
    // insert your own destructor code here
    endproc
enddefine
 
obj = new myclass()
obj = null        // the destroy() method will be called

Class inheritance and subclassing

There are many benefits of inheritance with Lianja, the most common is simplifying and reducing instances of redundant code. Lianja supports multiple levels of inheritance. A class that inherits a parent class is said to be a ‘subclass’ of the parent.

define class product
    public name
    public price
    procedure init(cName, nPrice)    // constructor
        name = cName
        price = nPrice
    endproc
    procedure display()
        ? "Product name is " + this.name + ", price is " + str(this.price)
    endproc
enddefine
 
define class food extends product
    private weight
enddefine
 
define class car extends product
    private color
enddefine
 
define class motorbike extends product
    private size
enddefine
 
// now define a vehicle class that inherits from multiple classes (car and motorbike)
define class vehicle extends car, motorbike
    public manufacturer = "Ford"
    public yearDesigned
    procedure init(cName, nPrice)    // constructor
        manufacturer = cName
        price = nPrice
    endproc
    procedure display()
        ? "Manufacturer is " + this.manufacturer + ", price is " + str(this.price)
    endproc
enddefine
 
// create a new object
myobject = new vehicle("Ford", 20000)
myobject.display()    // displays "Manufacturer is Ford, price is 20000
 
myobject = new motorbike("Honda", 1500)
myobject.display()    // displays "Product name is Honda, price is 1500

Overriding methods

As can be seen by the above example of class inheritance, you can override methods of parent classes that you inherit. If you want to call the parent class method of the same name from within a subclass, then use the dodefault() method. Note that because Lianja handles multiple inheritance, and because a subclass can only have one ‘parent’ the last class inherited is denoted as the parent and is called by dodefault().

// now define a vehicle class that inherits from multiple classes (car and motorbike)
define class vehicle extends car,motorbike
    public manufacturer = "Ford"
    public yearDesigned
    proc init(cName, nPrice)    // constructor
        manufacturer = cName
        name = cName
        price = nPrice
    endproc
    proc display()
        dodefault()                   // calls the 'display()' method in the parent class 'product'
        ? "Manufacturer is " + this.manufacturer + ", price is " + str(this.price)
    endproc
enddefine

Scope resolution operator

The scope resolution operator :: can be used to reference static methods and properties in classes or those in the super class.

define class myclasslib
    public static mydata = array()
    public static proc display(arg)
        echo arg
    endproc
enddefine

We can call the display method without instantiating an object because it is declared static e.g.

myclasslib::display("hello world")

We can access “mydata” without instantiating an object because it is declared static e.g.

myclasslib::mydata["key"] = "value"

Special variables

There are several special built-in object variables that can be used.

Object Description
this A reference to the currently executing object

Iterating through object properties

You can iterate over the properties of an object using the foreach command like this.

// create a new object
myobject = new myclass()
 
// iterate over its properties
foreach myobject as name => value
    echo "name=" + name + ", value=" + value    // displays "name=MYPROP, value=hello world"
endfor

Dynamically adding and removing properties runtime

As Lianja is a dynamic language, object properties can be added and removed dynamically at runtime.

// create a new object
myobject = new myclass()
 
// extend it by adding a property at runtime
myobject.addproperty("date", date())
 
// now remove it
myobject.removeproperty('date')

Dynamically assigning methods at runtime

As Lianja is a dynamic language, methods can be assigned to objects dynamically at runtime.

// create a new object
myobject = new myclass()
 
// dynamically add a method
procedure mynewmethod()
    echo "hello world"
endproc
 
myobject.newmethod = mynewmethod
myobject.newmethod()    // displays "hello world"

Runtime data-type checking

define class myclass
    public myprop as character = "hello world"
    public procedure mymethod()
    return myprop
    static procedure mystaticmethod()
    endproc
enddefine
 
// create a new object
myobject = new myclass()
myobject.myprop = "this is data"      // works ok
myobject.myprop = 10                      // throws an error because we defined "myprop as character"

The life of an object

Lianja uses object reference counting to handle automatic garbage collection.

When an object is created its reference count is set to 1. All assignments of objects to other variables or procedure/function arguments cause the reference count to be incremented. An object is released from memory (dereferenced) when its reference count reaches zero.

To dereference an object you simply assign another value to it. e.g.

// create a new object (and set its reference count to 1)
myobject = new myclass()
 
// now free up the object. This will decrement the reference count associated with the object.
// When the reference count is 0 then the object will be released from memory (dereferenced).
myobject = null
 
// In this example the object is not released as it is still referenced by 'myvar'
myobject = new myclass()
myvar = myobject
myobject = null
 
// now it will be released
myvar = null

If an object property (variable) is an object reference, when the object containing the property (variable) is released (dereferenced) than the reference count of all object variables is decremented, and when the reference count reaches zero, then that object is released from memory.

Writing and using class libraries

Once you have completed the development of your class library you can use the classes within your programs like this.

require_once("myclasslib")

https://www.lianja.com/doc/index.php/Lianja_Object-Oriented_Programming


define class myclass as custom
  myprop = "Hello World"
enddefine
 
myobject = createobject("myclass")
Messagebox(myobject.myprop)
addproperty(myobject, "myprop2", "goodbye")
// Or: myobject.addproperty("myprop2", "goodbye")
Messagebox(myobject.myprop2)
removeproperty(myobject, "myprop2")
// Or: myobject.removeproperty("myprop2")

https://www.lianja.com/doc/index.php/A_Recital_Primer


Advertisements

Inline delegates [examples]

Desktop:

Prefix the command with a !:

Lianja/VFP

!? "Hello World"

JavaScript

!print("Hello World")

PHP

!echo "Hello World"

Python

!print "Hello World"

 

Call supported Lianja methods with no prefix:

All

Lianja.writeLog("Hello World")

PHP

Lianja::writeLog("Hello World")

? Prefix

Prefix Lianja.showdocument() actions with a ?:

?page:page2

is the equivalent of:

Lianja.showDocument("page:page2")

$ Prefix

Or, prefix Lianja.showdocument() actions (including the parentheses and quotes) with a $:

$("page:page2")

is the equivalent of:

Lianja.showDocument("page:page2")

|| Chaining

As with the full Lianja.showDocument() method or the SHOWDOCUMENT() function, multiple actions can be chained by separating them with ||, e.g.

$("section:section3?action=hide||section:section2?action=hide")

Web/Mobile Apps

Inline delegates must be written in JavaScript.

Commands and supported Lianja methods can be written without any prefix:

window.alert("Hello World")
Lianja.writeLog("Hello World")
Lianja.getElementByID("page1.section1").hide()

? Prefix

Prefix Lianja.showdocument() actions with a ?:

?page:page2

is the equivalent of:

Lianja.showDocument("page:page2")

$ Prefix

Or, prefix Lianja.showdocument() actions (including the parentheses and quotes) with a $:

$("page:page2")

is the equivalent of:

Lianja.showDocument("page:page2")

|| Chaining

As with the full Lianja.showDocument() method or the SHOWDOCUMENT() function, multiple actions can be chained by separating them with ||, e.g.

$("section:section3?action=show||section:section2?action=show")

https://www.lianja.com/doc/index.php/Custom_Delegates


 

Inline Delegates

All delegates can be specified as “inline commands” by prefixing them with a !.

For example:

!Lianja.getElementByID("page1.section1").hide()

The command should be in the scripting language that you have specified for the UI component. This can be used with good effect in manipulating the Lianja Object Model (LOM) with minimum coding. If you prefix the delegate with a (jquery-style) $ rather than a ! character then this provides a shorthand way of calling Lianja.showDocument().

For example:

$("section:section1?action=hide")

Is the same as

Lianja.showDocument("section:section1?action=hide")

When calling Lianja.showDocument() or using “inline delegates”, you can “chain” actions together using || to separate them.

For example:

$("page:customers.section1?action=search&text=value||hidedialogpanel")

https://www.lianja.com/doc/index.php/Inline_Delegates


 

Framework Classes [examples]

Lianja/VFP usage

oCont = createObject("container")
oCont.layout = "Vertical"
oCont.addObject("oLabel", "label")
oLabel.caption = "Hello World!"

JavaScript usage

oCont = createObject("container");
oCont.layout = "Vertical";
oCont.addObject("oLabel", "label");
oLabel.caption = "Hello World!";

Python usage

oCont = Lianja.createObject("container")
oCont.layout = "Vertical"
oCont.addObject("oLabel", "label")
oLabel.caption = "Hello World!"

PHP usage

oCont = Lianja::createObject("container");
oCont->layout = "Vertical";
oCont->addObject("oLabel", "label");
oLabel->caption = "Hello World!";

https://www.lianja.com/doc/index.php/Category:Framework_Classes


 

Form UI class [examples]

To create desktop UI classes in Lianja/VFP:

uiclassesdemoform

myform = createObject("Form")
myform.caption = "This is a demo form"
myform.resize(600, 400)
myform.autocenter = .t.

To add controls to a form (or other containers) we use the addObject() method of the Form class. Now add a MenuBar, Toolbar and Actionbar.

myform.addObject("mymenubar", "MenuBar")
myform.addObject("mytoolbar", "ToolBar")
myform.addObject("myactionbar", "ActionBar")

Now add a Form statusbar and specify a message to be displayed in it.

myform.statusbar = .t.
myform.message = "Double click on a row in the grid to select a customer"

Now that we have a basic form, we will add a container to it which will be used to add controls and possibly other containers.

myform.addObject("mycontainer", "Container")
mycontainer.anchor = 15

Unlike VFP, the Lianja Container class can handle layout management for us. There are four types of layouts that we can set on a container.

  • Horizontal
  • Vertical
  • Form
  • Grid

Let’s set the layout of our container to be “Vertical”. This will cause all controls that are added to it to be automatically adjusted to the width of the container. We use the fixedheight property to establish a fixed height for the controls that we add to the container.

mycontainer.layout = "vertical"
mycontainer.addObject("myheader", "label")
myheader.fixedheight = 40
myheader.caption = "Select a Customer"
myheader.gradient = 1
myheader.forecolor = "gray"
myheader.fontbold = .t.
myheader.fontsize = 18
myheader.alignment = "center"

Now let’s add a Grid to the container but not set any fixedheight property so that that it uses up all remaining vertical space in the container.

mycontainer.addObject("mygrid", "grid")
mygrid.readonly = .t.
mygrid.caption = "Customers"
mygrid.additems("select * from southwind!customers")

We make the form visible (and 1=modal):

myform.show(1)

https://www.lianja.com/doc/index.php/Working_with_UI_classes_in_Lianja/VFP


 

Common Properties – appearance [examples]

Object’s background color
BACKCOLOR
ob.backcolor = 16711935
ob.backcolor = rgb(255,0,255)
ob.backcolor = 0xFF00FF
ob.backcolor = "magenta"
ob.backcolor = "#FF00FF"
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom
public textbox1
define class page1_section1 as section
enddefine
 
define class color_button as CommandButton
	proc click
		textbox1.backcolor = "green"
		messagebox(etos(int(textbox1.backcolor)),0,"Backcolor")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("colorbutton","color_button")
	colorbutton.caption = "Go Green!"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.backcolor = rgb(255,0,255)
 
return page1_section1

https://www.lianja.com/doc/index.php/Backcolor_Property


Object’s CSS style attributes, synonym of stylesheet
CSS
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
define class page1_section1 as section
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "With CSS"
	textbox1.css = "color: rgb(127,0,63);background-color: rgb(255, 255, 241); selection-color:" +;
	 "white; selection-background-color: rgb(191, 31, 127); border: 2px groove gray; border-radius:" +;
	 "10px; padding: 2px 4px;"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Without CSS"
return page1_section1

https://www.lianja.com/doc/index.php/CSS_Property


Object’s background color when disabled
DISABLEDCOLOR
ob.disabledbackcolor = 16711935
ob.disabledbackcolor = rgb(255,0,255)
ob.disabledbackcolor = 0xFF00FF
ob.disabledbackcolor = "magenta"
ob.disabledbackcolor = "#FF00FF"
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom
public textbox1
define class page1_section1 as section
enddefine
 
define class color_button as CommandButton
	proc click
		textbox1.disabledbackcolor = "green"
		messagebox(etos(int(textbox1.disabledbackcolor)),0,"Disabledbackcolor")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("colorbutton","color_button")
	colorbutton.caption = "Go Green!"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.enabled = .F.
 
return page1_section1

https://www.lianja.com/doc/index.php/Disabledbackcolor_Property


Object’s foreground color when disabled
DISABLEDFORECOLOR
ob.disabledforecolor = 16711935
ob.disabledforecolor = rgb(255,0,255)
ob.disabledforecolor = 0xFF00FF
ob.disabledforecolor = "magenta"
ob.disabledforecolor = "#FF00FF"
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom
public textbox1
define class page1_section1 as section
enddefine
 
define class color_button as CommandButton
	proc click
		textbox1.disabledforecolor = "green"
		messagebox(etos(int(textbox1.disabledforecolor)),0,"Disabledforecolor")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("colorbutton","color_button")
	colorbutton.caption = "Go Green!"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.enabled = .F.
 
return page1_section1

https://www.lianja.com/doc/index.php/Disabledforecolor_Property


Set height of the object in pixels
HEIGHT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, label1, label2, label3, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Increase container size
		container1.fixedheight = 600
		// label1 stays at fixedheight (120)
		label1.caption = "Height = " + etos(int(label1.height)) //"Fixed height 120"
		// label2 does not go above its maximum height (200)
		label2.caption = "Height = " + etos(int(label2.height)) //"Max height 200"
		// label3 resizes to fill the container height
		label3.caption = "Height = " + etos(int(label3.height)) //"Resizable"
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.fixedheight = 300
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("label1", "label")
	label1.caption = "Fixed height 120"
	label1.fixedheight = 120
	label1.borderstyle = 1
 
	container1.addobject("label2", "label")
	label2.caption = "Max height 200"
	label2.maxheight = 200
	label2.borderstyle = 1
 
	container1.addobject("label3", "label")
	label3.caption = "Resizable"
	label3.height = 200
	label3.borderstyle = 1
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1

https://www.lianja.com/doc/index.php/Fixedheight_Property


Set width of the object in pixels
WIDTH
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, textbox1, textbox2, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Shrink container size
		container1.fixedwidth = 400
		// Textbox1 stays at fixedwidth
		textbox1.value = "Width = " + etos(int(textbox1.width))
		// Textbox2 does not go below its minimum width
		textbox2.value = "Width = " + etos(int(textbox2.width))
		// Sizebutton resizes to fill the rest of the available container width
		sizebutton.caption = "Width = " + etos(int(sizebutton.width))
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.backcolor = "slategray"
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("textbox1", "Textbox")
	textbox1.value = "Fixed width 120"
	textbox1.fixedwidth = 120
 
	container1.addobject("textbox2", "Textbox")
	textbox2.value = "Min width 200"
	textbox2.minwidth = 200
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1

https://www.lianja.com/doc/index.php/Fixedwidth_Property


Whether the object’s font is bold
FONTBOLD
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class font_button as CommandButton
	proc click
		textbox1.fontbold = not textbox1.fontbold
		textbox2.fontbold = not textbox2.fontbold
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Toggle Bold"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.fontbold = True
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
return page1_section1

https://www.lianja.com/doc/index.php/Fontbold_Property


Character set of the object’s font
FONTCHARSET
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
define class font_button as CommandButton
	proc click
		textbox1.fontcharset = 0
		messagebox(etos(int(textbox1.fontcharset)),0,"Font Character Set")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Query Character Set"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
return page1_section1

https://www.lianja.com/doc/index.php/Fontcharset_Property


Whether the object’s font is fixed pitch
FONTFIXEDPITCH
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class font_button as CommandButton
	proc click
		textbox1.fontfixedpitch = not textbox1.fontfixedpitch
		textbox2.fontfixedpitch = not textbox2.fontfixedpitch
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Toggle FixedPitch"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.fontname = "Monospaced"
	textbox1.fontsize = 18
	textbox1.fontfixedpitch = True
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.fontname = "Monospaced"
	textbox2.fontsize = 18
return page1_section1

https://www.lianja.com/doc/index.php/Fontfixedpitch_Property


Whether the object’s font is italic
FONTITALIC
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
 
define class font_button as CommandButton
	proc click
		textbox1.fontitalic = not textbox1.fontitalic
		textbox2.fontitalic = not textbox2.fontitalic
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Toggle Italic"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.fontitalic = True
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
return page1_section1

https://www.lianja.com/doc/index.php/Fontitalic_Property


Name of the object’s font
FONTNAME
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
 
define class font_button as CommandButton
	proc click
		textbox1.fontname = "Dingbats"
		messagebox(textbox1.fontname,0,"Font")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Change Font"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.fontname = "Helvetica"
return page1_section1

https://www.lianja.com/doc/index.php/Fontname_Property


Size of the object’s font
FONTSIZE
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
define class font_button as CommandButton
	proc click
		textbox1.fontsize = 18
		messagebox(etos(int(textbox1.fontsize)),0,"Font Size")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Change Size"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.fontsize = 12
return page1_section1

https://www.lianja.com/doc/index.php/Fontsize_Property


Amount an object’s font is expanded or compressed
FONTSTRETCH
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
 
define class font_button as CommandButton
	proc click
		textbox1.fontstretch = 200
		messagebox(etos(int(textbox1.fontstretch)),0,"Fontstretch")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Stretch It!"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.fontstretch = 75
return page1_section1

https://www.lianja.com/doc/index.php/Fontstretch_Property


Whether the object’s font is in strikethru style
FONTSTRIKETHRU
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class font_button as CommandButton
	proc click
		textbox1.fontstrikethru = not textbox1.fontstrikethru
		textbox2.fontstrikethru = not textbox2.fontstrikethru
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Toggle Strikethru"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.fontstrikethru = True
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.fontstrikethru = 0
return page1_section1

https://www.lianja.com/doc/index.php/Fontstrikethru_Property

https://www.lianja.com/doc/index.php/Fontstrikethrough_Property


Whether the object’s font is underlined
FONTUNDERLINE
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
 
define class font_button as CommandButton
	proc click
		textbox1.fontunderline = not textbox1.fontunderline
		textbox2.fontunderline = not textbox2.fontunderline
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Toggle Underline"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.fontunderline = True
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
return page1_section1

https://www.lianja.com/doc/index.php/Fontunderline_Property


Thickness of an object’s font
FONTWEIGHT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
 
define class font_button as CommandButton
	proc click
		textbox1.fontweight = 25
		messagebox(etos(int(textbox1.fontweight)),0,"Fontweight")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("fontbutton","font_button")
	fontbutton.caption = "Lose Weight!"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.fontweight = 75
return page1_section1

https://www.lianja.com/doc/index.php/Fontweight_Property


Object’s foreground color
FORECOLOR
ob.forecolor = 16711935
ob.forecolor = rgb(255,0,255)
ob.forecolor = 0xFF00FF
ob.forecolor = "magenta"
ob.forecolor = "#FF00FF"
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom
public textbox1
define class page1_section1 as section
enddefine
 
define class color_button as CommandButton
	proc click
		textbox1.forecolor = "green"
		messagebox(etos(int(textbox1.forecolor)),0,"Forecolor")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("colorbutton","color_button")
	colorbutton.caption = "Go Green!"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.forecolor = rgb(255,0,255)
 
return page1_section1

https://www.lianja.com/doc/index.php/Forecolor_Property


Height of the object in pixels
HEIGHT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, label1, label2, label3, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Increase container size
		container1.fixedheight = 600
		// label1 stays at fixedheight (120)
		label1.caption = "Height = " + etos(int(label1.height)) //"Fixed height 120"
		// label2 does not go above its maximum height (200)
		label2.caption = "Height = " + etos(int(label2.height)) //"Max height 200"
		// label3 resizes to fill the container height
		label3.caption = "Height = " + etos(int(label3.height)) //"Resizable"
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.fixedheight = 300
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("label1", "label")
	label1.caption = "Fixed height 120"
	label1.fixedheight = 120
	label1.borderstyle = 1
 
	container1.addobject("label2", "label")
	label2.caption = "Max height 200"
	label2.maxheight = 200
	label2.borderstyle = 1
 
	container1.addobject("label3", "label")
	label3.caption = "Resizable"
	label3.height = 200
	label3.borderstyle = 1
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1

https://www.lianja.com/doc/index.php/Height_Property


Left column position of the object in pixels
LEFT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, textbox1
define class page1_section1 as section
enddefine
 
 
define class position_button as CommandButton
	proc click
		textbox1.left = textbox1.left + 10
		textbox1.top = textbox1.top + 10
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
	page1_section1.addobject("container1","container")
 
	container1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.left = 1
	textbox1.top = 1
	textbox1.height = 20
	textbox1.width = 100
 
	container1.addobject("positionbutton","position_button")
	positionbutton.caption = "Reposition"
	positionbutton.top = 200
	positionbutton.left = 200
return page1_section1

https://www.lianja.com/doc/index.php/Left_Property


Maximum height of the object in pixels
MAXHEIGHT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, label1, label2, label3, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Increase container size
		container1.fixedheight = 600
		// label1 stays at fixedheight (120)
		label1.caption = "Height = " + etos(int(label1.height)) //"Fixed height 120"
		// label2 does not go above its maximum height (200)
		label2.caption = "Height = " + etos(int(label2.height)) //"Max height 200"
		// label3 resizes to fill the container height
		label3.caption = "Height = " + etos(int(label3.height)) //"Resizable"
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.fixedheight = 300
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("label1", "label")
	label1.caption = "Fixed height 120"
	label1.fixedheight = 120
	label1.borderstyle = 1
 
	container1.addobject("label2", "label")
	label2.caption = "Max height 200"
	label2.maxheight = 200
	label2.borderstyle = 1
 
	container1.addobject("label3", "label")
	label3.caption = "Resizable"
	label3.height = 200
	label3.borderstyle = 1
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1

https://www.lianja.com/doc/index.php/Maxheight_Property


Maximum width of the object in pixels
MAXWIDTH
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, textbox1, textbox2, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Increase container size
		container1.fixedwidth = 600
		// Textbox1 stays at fixedwidth
		textbox1.value = "Width = " + etos(int(textbox1.width))
		// Textbox2 does not go above its maximum width
		textbox2.value = "Width = " + etos(int(textbox2.width))
		// Sizebutton resizes to fill the rest of the available container width
		sizebutton.caption = "Width = " + etos(int(sizebutton.width))
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.backcolor = "slategray"
	container1.fixedwidth = 400
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("textbox1", "Textbox")
	textbox1.value = "Fixed width 120"
	textbox1.fixedwidth = 120
 
	container1.addobject("textbox2", "Textbox")
	textbox2.value = "Max width 200"
	textbox2.maxwidth = 200
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1

https://www.lianja.com/doc/index.php/Maxwidth_Property


Minimum height of the object in pixels
MINHEIGHT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom2
public container1, label1, label2, label3, sizebutton
define class page1_section1 as section
 
enddefine
 
define class size_button as CommandButton
	proc click
		// Resize container
		container1.fixedheight = 150
		// label1 stays at fixedheight (120)
		label1.caption = "Height = " + etos(int(label1.height)) //"Fixed height 120"
		// label2 does not go below its minimum height (200), 
                // but is restricted by the container
		label2.caption = "Height = " + etos(int(label2.height)) //"Min height 200"
		// label3 resizes
		label3.caption = "Height = " + etos(int(label3.height)) //"Resizable"
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
	page1_section1.addobject("container1","container")
	container1.fixedheight = 500
	container1.layout = 1
 
	container1.addobject("label1", "label")
	label1.caption = "Fixed height 120"
	label1.fixedheight = 120
	label1.borderstyle = 1
 
	container1.addobject("label2", "label")
	label2.caption = "Min height 200"
	label2.height = 120
	label2.minheight = 200
	label2.borderstyle = 1
 
	container1.addobject("label3", "label")
	label3.caption = "Resizable"
	label3.height = 120
	label3.borderstyle = 1
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
return page1_section1

https://www.lianja.com/doc/index.php/Minheight_Property


Minimum width of the object in pixels
MINWIDTH
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, textbox1, textbox2, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Shrink container size
		container1.fixedwidth = 400
		// Textbox1 stays at fixedwidth
		textbox1.value = "Width = " + etos(int(textbox1.width))
		// Textbox2 does not go below its minimum width
		textbox2.value = "Width = " + etos(int(textbox2.width))
		// Sizebutton resizes to fill the rest of the available container width
		sizebutton.caption = "Width = " + etos(int(sizebutton.width))
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.backcolor = "slategray"
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("textbox1", "Textbox")
	textbox1.value = "Fixed width 120"
	textbox1.fixedwidth = 120
 
	container1.addobject("textbox2", "Textbox")
	textbox2.value = "Min width 200"
	textbox2.minwidth = 200
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1

https://www.lianja.com/doc/index.php/Minwidth_Property


Text displayed in the statusbar when you hover over an object or the object has focus
STATUSBARTEXT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
define class statusbartext_button as CommandButton
	proc click
		messagebox(textbox1.statusbartext,0,"Statusbar Text")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("statusbartextbutton","statusbartext_button")
	statusbartextbutton.caption = "Query statusbartext"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.statusbartext = "This is the statusbar text"
return page1_section1

https://www.lianja.com/doc/index.php/Statusbartext_Property


Object’s CSS style attributes, synonym of css
STYLESHEET
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
define class page1_section1 as section
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "With Stylesheet"
	textbox1.stylesheet = "color: rgb(127,0,63);background-color: rgb(255, 255, 241); selection-color:" +;
	 "white; selection-background-color: rgb(191, 31, 127); border: 2px groove gray; border-radius:" +;
	 "10px; padding: 2px 4px;"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Without Stylesheet"
return page1_section1

https://www.lianja.com/doc/index.php/Stylesheet_Property


Text displayed when you hover over an object
TOOLTIPTEXT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
 
define class tooltiptext_button as CommandButton
	proc click
		messagebox(textbox1.tooltiptext,0,"Tooltip")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("tooltiptextbutton","tooltiptext_button")
	tooltiptextbutton.caption = "Query Tooltiptext"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.tooltiptext = "This is a tooltip"
return page1_section1

https://www.lianja.com/doc/index.php/Tooltiptext_Property


Top row position of the object in pixels
TOP
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, textbox1
define class page1_section1 as section
enddefine
 
 
define class position_button as CommandButton
	proc click
		textbox1.left = textbox1.left + 10
		textbox1.top = textbox1.top + 10
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
	page1_section1.addobject("container1","container")
 
	container1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.left = 1
	textbox1.top = 1
	textbox1.height = 20
	textbox1.width = 100
 
	container1.addobject("positionbutton","position_button")
	positionbutton.caption = "Reposition"
	positionbutton.top = 200
	positionbutton.left = 200
return page1_section1

https://www.lianja.com/doc/index.php/Top_Property


Width of the object in pixels
WIDTH

 

//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public container1, textbox1, textbox2, sizebutton
define class page1_section1 as section
enddefine
 
define class size_button as CommandButton
	proc click
		// Shrink container size
		container1.fixedwidth = 400
		// Textbox1 stays at fixedwidth
		textbox1.value = "Width = " + etos(int(textbox1.width))
		// Textbox2 does not go below its minimum width
		textbox2.value = "Width = " + etos(int(textbox2.width))
		// Sizebutton resizes to fill the rest of the available container width
		sizebutton.caption = "Width = " + etos(int(sizebutton.width))
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("container1","container")
	container1.backcolor = "slategray"
	// Arrange objects horizontally in container
	container1.layout = 1
 
	container1.addobject("textbox1", "Textbox")
	textbox1.value = "Fixed width 120"
	textbox1.fixedwidth = 120
 
	container1.addobject("textbox2", "Textbox")
	textbox2.value = "Min width 200"
	textbox2.minwidth = 200
 
	container1.addobject("sizebutton","size_button")
	sizebutton.caption = "Click"
 
return page1_section1

https://www.lianja.com/doc/index.php/Width_Property


Common Properties [examples]

Object’s class
CLASS
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public label1, label2, label3, label4, infobutton
define class page1_section1 as section
enddefine
 
define class info_button as CommandButton
	proc click
		label1.caption = "Button name = " + this.name
		label2.caption = "Button class = " + this.class
		label3.caption = "Button parent name = " + this.parent.name
		label4.caption = "Button parentclass = " + this.parentclass
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("label1", "label")
	label1.caption = "Button name"
 
	page1_section1.addobject("label2", "label")
	label2.caption = "Button class"
 
	page1_section1.addobject("label3", "label")
	label3.caption = "Button parent"
 
	page1_section1.addobject("label4", "label")
	label4.caption = "Button parentclass"
 
	page1_section1.addobject("infobutton","info_button")
	infobutton.caption = "Click for Information"
 
return page1_section1

https://www.lianja.com/doc/index.php/Class_Property


Comment associated with an object
COMMENT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
 
define class comment_button as CommandButton
	proc click
		messagebox(textbox1.comment,0,"Comment")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("commentbutton","comment_button")
	commentbutton.caption = "Query Comment"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.comment = "This is a comment, which stores extra information about the object."
return page1_section1

https://www.lianja.com/doc/index.php/Comment_Property


Whether the object is enabled
ENABLED
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class enable_button as CommandButton
	proc click
		textbox1.enabled = not textbox1.enabled
		textbox2.enabled = not textbox2.enabled
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("enablebutton","enable_button")
	enablebutton.caption = "Enable Toggle"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.enabled = False
return page1_section1

https://www.lianja.com/doc/index.php/Enabled_Property


Text displayed in the statusbar when you hover over an object or the object has focus
MESSAGE
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
define class message_button as CommandButton
	proc click
		messagebox(textbox1.message,0,"Message")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("messagebutton","message_button")
	messagebutton.caption = "Query Message"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.message = "This is the message"
return page1_section1

https://www.lianja.com/doc/index.php/Message_Property


Object’s name
NAME
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public label1, label2, label3, label4, infobutton
define class page1_section1 as section
enddefine
 
define class info_button as CommandButton
	proc click
		label1.caption = "Button name = " + this.name
		label2.caption = "Button class = " + this.class
		label3.caption = "Button parent name = " + this.parent.name
		label4.caption = "Button parentclass = " + this.parentclass
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("label1", "label")
	label1.caption = "Button name"
 
	page1_section1.addobject("label2", "label")
	label2.caption = "Button class"
 
	page1_section1.addobject("label3", "label")
	label3.caption = "Button parent"
 
	page1_section1.addobject("label4", "label")
	label4.caption = "Button parentclass"
 
	page1_section1.addobject("infobutton","info_button")
	infobutton.caption = "Click for Information"
 
return page1_section1

https://www.lianja.com/doc/index.php/Name_Property


Object’s parent
PARENT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public label1, label2, label3, label4, infobutton
define class page1_section1 as section
enddefine
 
define class info_button as CommandButton
	proc click
		label1.caption = "Button name = " + this.name
		label2.caption = "Button class = " + this.class
		label3.caption = "Button parent name = " + this.parent.name
		label4.caption = "Button parentclass = " + this.parentclass
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("label1", "label")
	label1.caption = "Button name"
 
	page1_section1.addobject("label2", "label")
	label2.caption = "Button class"
 
	page1_section1.addobject("label3", "label")
	label3.caption = "Button parent"
 
	page1_section1.addobject("label4", "label")
	label4.caption = "Button parentclass"
 
	page1_section1.addobject("infobutton","info_button")
	infobutton.caption = "Click for Information"
 
return page1_section1

https://www.lianja.com/doc/index.php/Parent_Property


Object’s parent’s class
PARENTCLASS
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public label1, label2, label3, label4, infobutton
define class page1_section1 as section
enddefine
 
define class info_button as CommandButton
	proc click
		label1.caption = "Button name = " + this.name
		label2.caption = "Button class = " + this.class
		label3.caption = "Button parent name = " + this.parent.name
		label4.caption = "Button parentclass = " + this.parentclass
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("label1", "label")
	label1.caption = "Button name"
 
	page1_section1.addobject("label2", "label")
	label2.caption = "Button class"
 
	page1_section1.addobject("label3", "label")
	label3.caption = "Button parent"
 
	page1_section1.addobject("label4", "label")
	label4.caption = "Button parentclass"
 
	page1_section1.addobject("infobutton","info_button")
	infobutton.caption = "Click for Information"
 
return page1_section1

https://www.lianja.com/doc/index.php/Parentclass_Property


Tab index order of the object
TABINDEX
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
define class page1_section1 as section
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.text = "Tabindex = 3"
	textbox1.tabindex = 3
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.text = "Tabindex = 2"
	textbox2.tabindex = 1
 
	page1_section1.addobject("textbox3", "Textbox")
	textbox3.text = "Tabindex = 1"
	textbox3.tabindex = 1
return page1_section1

https://www.lianja.com/doc/index.php/Tabindex_Property


Whether the object can be selected with the tab key
TABSTOP
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
define class page1_section1 as section
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.text = "Tabstop = True"
	textbox1.tabstop = True
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.text = "Tabstop = False"
	textbox2.tabstop = False
 
	page1_section1.addobject("textbox3", "Textbox")
	textbox3.text = "Tabstop = True"
	textbox3.tabstop = 1
return page1_section1

https://www.lianja.com/doc/index.php/Tabstop_Property


Tag associated with an object
TAG
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
 
define class tag_button as CommandButton
	proc click
		messagebox(textbox1.tag,0,"Tag")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("tagbutton","tag_button")
	tagbutton.caption = "Query Tag"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox"
	textbox1.tag = "This is a tag, which stores extra information about the object."
 
return page1_section1

https://www.lianja.com/doc/index.php/Tag_Property


Whether the object is visible
VISIBLE

 

//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class visible_button as CommandButton
	proc click
		textbox1.visible = not textbox1.visible
		textbox2.visible = not textbox2.visible
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("visiblebutton","visible_button")
	visiblebutton.caption = "Visibility Toggle"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.visible = False
return page1_section1

https://www.lianja.com/doc/index.php/Visible_Property


Common Methods [examples]

Adds a property to the object
ADDPROPERTY
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1
define class page1_section1 as section
enddefine
 
define class info_button as CommandButton
	proc click
		Messagebox("Textbox created by " + textbox1.createdby;
                 + " at " + textbox1.created,0,"Info")
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("infobutton","info_button")
	infobutton.caption = "Information about Textbox 1"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.text = "Textbox 1"
	textbox1.addproperty("createdby",user())
	textbox1.addproperty("created",time())
return page1_section1

https://www.lianja.com/doc/index.php/Addproperty_Method


Changes the size of the object to fit its contents
ADDJUSTIZE
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class moveright_button as CommandButton
	proc click
		textbox1.move(textbox1.left+10)
		textbox2.move(textbox2.left+10)
	endproc
enddefine
 
define class moveleft_button as CommandButton
	proc click
		textbox1.move(textbox1.left-10)
		textbox2.move(textbox2.left-10)
	endproc
enddefine
 
define class moveup_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top-10)
		textbox2.move(textbox2.left,textbox2.top-10)
	endproc
enddefine
 
define class movedown_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top+10)
		textbox2.move(textbox2.left,textbox2.top+10)
	endproc
enddefine
 
define class moveresize_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top,100,100)
		textbox2.move(textbox2.left,textbox2.top,100,100)
	endproc
enddefine
 
define class resize_button as CommandButton
	proc click
		textbox1.resize(200,50)
		textbox2.resize(200,50)
	endproc
enddefine
 
define class adjustsize_button as CommandButton
	proc click
		textbox1.adjustsize
		textbox2.adjustsize
	endproc
enddefine
 
define class autofit_button as CommandButton
	proc click
		textbox1.autofit
		textbox2.autofit
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("moverightbutton","moveright_button")
	moverightbutton.caption = "Move Right"	
 
	page1_section1.addobject("moveleftbutton","moveleft_button")
	moveleftbutton.caption = "Move Left"
 
	page1_section1.addobject("moveupbutton","moveup_button")
	moveupbutton.caption = "Move Up"	
 
	page1_section1.addobject("movedownbutton","movedown_button")
	movedownbutton.caption = "Move Down"
 
	page1_section1.addobject("moveresizebutton","moveresize_button")
	moveresizebutton.caption = "Resize using move method"
 
	page1_section1.addobject("resizebutton","resize_button")
	resizebutton.caption = "Resize using resize method"
 
	page1_section1.addobject("adjustsizebutton","adjustsize_button")
	adjustsizebutton.caption = "Adjust Size to fit contents (adjustsize)"
 
	page1_section1.addobject("autofitbutton","autofit_button")
	autofitbutton.caption = "Adjust Size to fit contents (autofit)"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.backcolor = "orange"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.backcolor = "gray"
return page1_section1

https://www.lianja.com/doc/index.php/Adjustsize_Method


Changes the size of the object to fit its contents
AUTOFIT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class moveright_button as CommandButton
	proc click
		textbox1.move(textbox1.left+10)
		textbox2.move(textbox2.left+10)
	endproc
enddefine
 
define class moveleft_button as CommandButton
	proc click
		textbox1.move(textbox1.left-10)
		textbox2.move(textbox2.left-10)
	endproc
enddefine
 
define class moveup_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top-10)
		textbox2.move(textbox2.left,textbox2.top-10)
	endproc
enddefine
 
define class movedown_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top+10)
		textbox2.move(textbox2.left,textbox2.top+10)
	endproc
enddefine
 
define class moveresize_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top,100,100)
		textbox2.move(textbox2.left,textbox2.top,100,100)
	endproc
enddefine
 
define class resize_button as CommandButton
	proc click
		textbox1.resize(200,50)
		textbox2.resize(200,50)
	endproc
enddefine
 
define class adjustsize_button as CommandButton
	proc click
		textbox1.adjustsize
		textbox2.adjustsize
	endproc
enddefine
 
define class autofit_button as CommandButton
	proc click
		textbox1.autofit
		textbox2.autofit
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("moverightbutton","moveright_button")
	moverightbutton.caption = "Move Right"	
 
	page1_section1.addobject("moveleftbutton","moveleft_button")
	moveleftbutton.caption = "Move Left"
 
	page1_section1.addobject("moveupbutton","moveup_button")
	moveupbutton.caption = "Move Up"	
 
	page1_section1.addobject("movedownbutton","movedown_button")
	movedownbutton.caption = "Move Down"
 
	page1_section1.addobject("moveresizebutton","moveresize_button")
	moveresizebutton.caption = "Resize using move method"
 
	page1_section1.addobject("resizebutton","resize_button")
	resizebutton.caption = "Resize using resize method"
 
	page1_section1.addobject("adjustsizebutton","adjustsize_button")
	adjustsizebutton.caption = "Adjust Size to fit contents (adjustsize)"
 
	page1_section1.addobject("autofitbutton","autofit_button")
	autofitbutton.caption = "Adjust Size to fit contents (autofit)"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.backcolor = "orange"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.backcolor = "gray"
return page1_section1

https://www.lianja.com/doc/index.php/Autofit_Method


Defines a delegate procedure of a handler object to handle an event for an object
BINDEVENT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public eventhandlerob, sourceclassbutton
define class page1_section1 as section
enddefine
 
define class eventhandlerclass as CommandButton
	proc delegateproc
		messagebox("Hello from the event handler",0,"Event Handler")
		// Reset event binding for sourceclassbutton.click
		sourceclassbutton.unbindevent(sourceclassbutton,"click",;
                 eventhandlerob,"delegateproc")
	endproc
enddefine
 
define class sourceclass as CommandButton
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("eventhandlerob","eventhandlerclass")
	eventhandlerob.visible = False
 
	page1_section1.addobject("sourceclassbutton","sourceclass")
	sourceclassbutton.caption = "Delegate Click Event"
	sourceclassbutton.bindevent(sourceclassbutton,"click",eventhandlerob,"delegateproc")
return page1_section1

https://www.lianja.com/doc/index.php/Bindevent_Method


Defines a delegate procedure of a handler object to handle an event for an object
BINDEVENTS
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public eventhandlerob, sourceclassbutton
define class page1_section1 as section
enddefine
 
define class eventhandlerclass as CommandButton
	proc delegateproc
		messagebox("Hello from the event handler",0,"Event Handler")
		// Reset event binding for sourceclassbutton.click
		sourceclassbutton.unbindevents(sourceclassbutton,"click",;
                 eventhandlerob,"delegateproc")
	endproc
enddefine
 
define class sourceclass as CommandButton
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("eventhandlerob","eventhandlerclass")
	eventhandlerob.visible = False
 
	page1_section1.addobject("sourceclassbutton","sourceclass")
	sourceclassbutton.caption = "Delegate Click Event"
	sourceclassbutton.bindevents(sourceclassbutton,"click",eventhandlerob,"delegateproc")
return page1_section1

https://www.lianja.com/doc/index.php/Bindevents_Method


Begins, ends or cancels a drag operation
DRAG
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
define class page1_section1 as section
enddefine
 
define class dragMe as commandbutton
 
	top = 38
	left = 350
	height = 23
	fixedWidth = 63
 
	proc mouseUp
		lparameters nButton, nShift, nXCoord, nYCoord
		this.drag(0)
		this.move(this.left + nXCoord,this.top + nYCoord)
	endproc
	proc mouseDown
		this.drag(1)
	endproc
 
 
enddefine
 
proc page1_section1
	page1_section1 = createobject("page1_section1")
	page1_section1.addobject("oDragMe", "dragMe")
	oDragMe.caption = "Drag Me"
return page1_section1

https://www.lianja.com/doc/index.php/Drag_Method


Makes the object invisible
HIDE
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class showhide_button as CommandButton
	proc click
		&(iif(textbox1.visible,"textbox1.hide","textbox1.show"))
		&(iif(textbox2.visible,"textbox2.hide","textbox2.show"))
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("showhidebutton","showhide_button")
	showhidebutton.caption = "Show/Hide Toggle"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.backcolor = "orange"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.backcolor = "gray"
	textbox2.visible = False
return page1_section1

https://www.lianja.com/doc/index.php/Hide_Method


Changes the position or size of the object
MOVE
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class moveright_button as CommandButton
	proc click
		textbox1.move(textbox1.left+10)
		textbox2.move(textbox2.left+10)
	endproc
enddefine
 
define class moveleft_button as CommandButton
	proc click
		textbox1.move(textbox1.left-10)
		textbox2.move(textbox2.left-10)
	endproc
enddefine
 
define class moveup_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top-10)
		textbox2.move(textbox2.left,textbox2.top-10)
	endproc
enddefine
 
define class movedown_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top+10)
		textbox2.move(textbox2.left,textbox2.top+10)
	endproc
enddefine
 
define class moveresize_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top,100,100)
		textbox2.move(textbox2.left,textbox2.top,100,100)
	endproc
enddefine
 
define class resize_button as CommandButton
	proc click
		textbox1.resize(200,50)
		textbox2.resize(200,50)
	endproc
enddefine
 
define class adjustsize_button as CommandButton
	proc click
		textbox1.adjustsize
		textbox2.adjustsize
	endproc
enddefine
 
define class autofit_button as CommandButton
	proc click
		textbox1.autofit
		textbox2.autofit
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("moverightbutton","moveright_button")
	moverightbutton.caption = "Move Right"	
 
	page1_section1.addobject("moveleftbutton","moveleft_button")
	moveleftbutton.caption = "Move Left"
 
	page1_section1.addobject("moveupbutton","moveup_button")
	moveupbutton.caption = "Move Up"	
 
	page1_section1.addobject("movedownbutton","movedown_button")
	movedownbutton.caption = "Move Down"
 
	page1_section1.addobject("moveresizebutton","moveresize_button")
	moveresizebutton.caption = "Resize using move method"
 
	page1_section1.addobject("resizebutton","resize_button")
	resizebutton.caption = "Resize using resize method"
 
	page1_section1.addobject("adjustsizebutton","adjustsize_button")
	adjustsizebutton.caption = "Adjust Size to fit contents (adjustsize)"
 
	page1_section1.addobject("autofitbutton","autofit_button")
	autofitbutton.caption = "Adjust Size to fit contents (autofit)"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.backcolor = "orange"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.backcolor = "gray"
return page1_section1

https://www.lianja.com/doc/index.php/Move_Method


Forces a repaint of the object
REFRESH
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2, textbox3
define class page1_section1 as section
enddefine
 
define class refresh_button as CommandButton
	proc click
		textbox1.text = "Refreshed"
                // Refresh not required
		textbox1.refresh
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("refreshbutton","refresh_button")
	refreshbutton.caption = "Refresh Textbox 1"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.text = "Textbox 1"
 
return page1_section1

https://www.lianja.com/doc/index.php/Refresh_Method


Changes the size of the object
RESIZE
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class moveright_button as CommandButton
	proc click
		textbox1.move(textbox1.left+10)
		textbox2.move(textbox2.left+10)
	endproc
enddefine
 
define class moveleft_button as CommandButton
	proc click
		textbox1.move(textbox1.left-10)
		textbox2.move(textbox2.left-10)
	endproc
enddefine
 
define class moveup_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top-10)
		textbox2.move(textbox2.left,textbox2.top-10)
	endproc
enddefine
 
define class movedown_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top+10)
		textbox2.move(textbox2.left,textbox2.top+10)
	endproc
enddefine
 
define class moveresize_button as CommandButton
	proc click
		textbox1.move(textbox1.left,textbox1.top,100,100)
		textbox2.move(textbox2.left,textbox2.top,100,100)
	endproc
enddefine
 
define class resize_button as CommandButton
	proc click
		textbox1.resize(200,50)
		textbox2.resize(200,50)
	endproc
enddefine
 
define class adjustsize_button as CommandButton
	proc click
		textbox1.adjustsize
		textbox2.adjustsize
	endproc
enddefine
 
define class autofit_button as CommandButton
	proc click
		textbox1.autofit
		textbox2.autofit
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("moverightbutton","moveright_button")
	moverightbutton.caption = "Move Right"	
 
	page1_section1.addobject("moveleftbutton","moveleft_button")
	moveleftbutton.caption = "Move Left"
 
	page1_section1.addobject("moveupbutton","moveup_button")
	moveupbutton.caption = "Move Up"	
 
	page1_section1.addobject("movedownbutton","movedown_button")
	movedownbutton.caption = "Move Down"
 
	page1_section1.addobject("moveresizebutton","moveresize_button")
	moveresizebutton.caption = "Resize using move method"
 
	page1_section1.addobject("resizebutton","resize_button")
	resizebutton.caption = "Resize using resize method"
 
	page1_section1.addobject("adjustsizebutton","adjustsize_button")
	adjustsizebutton.caption = "Adjust Size to fit contents (adjustsize)"
 
	page1_section1.addobject("autofitbutton","autofit_button")
	autofitbutton.caption = "Adjust Size to fit contents (autofit)"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.backcolor = "orange"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.backcolor = "gray"
return page1_section1

https://www.lianja.com/doc/index.php/Resize_Method


Gives focus to the object
SETFOCUS
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2, textbox3
define class page1_section1 as section
enddefine
 
define class focus_button as CommandButton
	proc click
		textbox1.setfocus
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("focusbutton","focus_button")
	focusbutton.caption = "Focus on Textbox 1"
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.text = "Textbox 1"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.text = "Textbox 2"
 
	page1_section1.addobject("textbox3", "Textbox")
	textbox3.text = "Textbox 3"
return page1_section1

https://www.lianja.com/doc/index.php/Setfocus_Method


Makes the object visible
SHOW
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public textbox1, textbox2
define class page1_section1 as section
enddefine
 
define class showhide_button as CommandButton
	proc click
		&(iif(textbox1.visible,"textbox1.hide","textbox1.show"))
		&(iif(textbox2.visible,"textbox2.hide","textbox2.show"))
	endproc
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("showhidebutton","showhide_button")
	showhidebutton.caption = "Show/Hide Toggle"	
 
	page1_section1.addobject("textbox1", "Textbox")
	textbox1.value = "Textbox 1"
	textbox1.backcolor = "orange"
 
	page1_section1.addobject("textbox2", "Textbox")
	textbox2.value = "Textbox 2"
	textbox2.backcolor = "gray"
	textbox2.visible = False
return page1_section1

https://www.lianja.com/doc/index.php/Show_Method


Resets event binding for the specified event
UNBINDEVENT
//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public eventhandlerob, sourceclassbutton
define class page1_section1 as section
enddefine
 
define class eventhandlerclass as CommandButton
	proc delegateproc
		messagebox("Hello from the event handler",0,"Event Handler")
		// Reset event binding for sourceclassbutton.click
		sourceclassbutton.unbindevent(sourceclassbutton,"click",;
                 eventhandlerob,"delegateproc")
	endproc
enddefine
 
define class sourceclass as CommandButton
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("eventhandlerob","eventhandlerclass")
	eventhandlerob.visible = False
 
	page1_section1.addobject("sourceclassbutton","sourceclass")
	sourceclassbutton.caption = "Delegate Click Event"
	sourceclassbutton.bindevent(sourceclassbutton,"click",eventhandlerob,"delegateproc")
return page1_section1

https://www.lianja.com/doc/index.php/Unbindevent_Method


Resets event binding for the specified event
UNBINDEVENTS

 

//
// Lianja custom section for page "page1" section "section1"
//
namespace custom1
public eventhandlerob, sourceclassbutton
define class page1_section1 as section
enddefine
 
define class eventhandlerclass as CommandButton
	proc delegateproc
		messagebox("Hello from the event handler",0,"Event Handler")
		// Reset event binding for sourceclassbutton.click
		sourceclassbutton.unbindevents(sourceclassbutton,"click",;
                eventhandlerob,"delegateproc")
	endproc
enddefine
 
define class sourceclass as CommandButton
enddefine
 
proc page1_section1 
	page1_section1 = createobject("page1_section1")
 
	page1_section1.addobject("eventhandlerob","eventhandlerclass")
	eventhandlerob.visible = False
 
	page1_section1.addobject("sourceclassbutton","sourceclass")
	sourceclassbutton.caption = "Delegate Click Event"
	sourceclassbutton.bindevents(sourceclassbutton,"click",eventhandlerob,"delegateproc")
return page1_section1

https://www.lianja.com/doc/index.php/Unbindevents_Method