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


Advertisements

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


Comments [examples]

Add comments to a program to improve its readability and maintainability
&&
&& open the table
use patrons index names && view in name order

https://www.lianja.com/doc/index.php/%26%26


Comment line
*
*open the table
use patrons index names

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


Comment block
/*   */
/* open the table
and view in name order */
use patrons index names

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


Comment line
//
// open the table
use patrons index names  // view in name order

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


// declare variables
private x,y,z

Single line comments

// allows comment lines to be inserted in programs to enhance their readability and maintainability. The // command allows all characters following it on a line, to be treated as a comment and to be ignored by Lianja. The // command can be placed anywhere on a line, even following an executable command.

/* the following lines
     are multi
     line comments */
private x,y,z

Multi line comments

/* and */ denote block comments. These can be inserted in programs to enhance their readability and maintainability.

The /* denotes the start of the comment block, the */ the end of the comment block.

All characters between the two comment block delimiters are treated as comments and ignored by Lianja.

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


Comments

Single line comments

// allows comment lines to be inserted in programs to enhance their readability and maintainability. The // command allows all characters following it on a line, to be treated as a comment and to be ignored by Lianja. The // command can be placed anywhere on a line, even following an executable command.

// declare variables
private x,y,z

Multi line comments

/* and */ denote block comments. These can be inserted in programs to enhance their readability and maintainability.

The /* denotes the start of the comment block, the */ the end of the comment block.

All characters between the two comment block delimiters are treated as comments and ignored by Lianja.

/* the following lines
     are multi
     line comments */
private x,y,z

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


Command window [examples]

Clear the Command Window input and output windows
CLEAR
clear

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


Define a User Defined Command (UDC)
ALIAS
alias lo "list off"
// typing lo will run: list off 
alias lor "list off for region = [%1]"
// typing lor "west"  will run: list off for region = [west]

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


 

In the console of command window you can view the complete documentation page for a command or function like this:

help replace 
help str()

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


COM Activex [examples]

 

The code below will embed Internet Explorer into a Form. You can embed COM/ActiveX controls in any of the containers in the Lianja App Framework e.g. Form, Container, Control, or Page (Tab Page).

myform = createobject("form")
myform.resize(800, 600)
myform.addobject("ax", "{8856F961-340A-11D0-A96B-00C04FD705A2}")
ax.anchor = 15
ax.navigate("http://www.lianja.com")
myform.show()

Creating the COM/ActiveX component

You can specify the ActiveX control in several different formats.

The most efficient way is by using the registered component’s UUID, e.g.

createObject("{8E27C92B-1264-101C-8A2F-040224009C02}")

The second fastest way is to use the registered control’s class name (with or without version number), e.g.

createObject("MSCal.Calendar")

The slowest, but easiest way to use is to use the control’s full name, e.g.

createObject("Calendar Control 9.0")

It is also possible to initialize the object from a file, e.g.

createObject("c:/files/file.doc")

If the component’s UUID is used the following patterns can be used to initialize the control on a remote machine, to initialize a licensed control or to connect to a running object:

To initialize the control on a different machine use the following pattern:

createObject("DOMAIN/user:password@server/{8E27C92B-1264-101C-8A2F-040224009C02}")

To initialize a licensed control use the following pattern:

createObject("{8E27C92B-1264-101C-8A2F-040224009C02}:LicenseKey")

To connect to an already running object use the following pattern:

createObject("{8E27C92B-1264-101C-8A2F-040224009C02}&")

The first two patterns can be combined, e.g. to initialize a licensed control on a remote machine:

createObject("DOMAIN/user:password@server/{8E27C92B-1264-101C-8A2F-040224009C02}:LicenseKey")

Binding to events

Binding to events that are emitted from a COM/ActiveX component is simple. See below.

define class myeventhandler
    // handle the events you are interested in
    proc DownloadBegin()
    endproc

    proc DownloadComplete()
    endproc

    proc ProgressChange(currentvalue, maxvalue)
    endproc

    // The "Special" HandleEvent method can be used to trace events but be sure to remove it in production systems 
    // as it incurs unnecessary performance overhead
    proc HandleEvent(name, arglist)
    endproc
endclass

ie = createObject("{8856F961-340A-11D0-A96B-00C04FD705A2}")
myhandler = createObject("myeventhandler")
eventHandler(ie, myhandler)

https://www.lianja.com/doc/index.php/Using_COM/ActiveX_in_Lianja_on_Windows


 

Choices [examples]

 

Static Lists

Static lists are based on a comma-separated list of choices.

Choices: Buchanan,Callahan,Davolio,Dodsworth,Fuller,King,Leverling,Peacock,Suyama

Dynamic List

A dynamic list is based on the evaluation of an expression from a specified table.

@<table-name>,<expression>

Here the list is based on the current values of the lastname field from the employees table.

Choices: @employees,lastname

SQL Select List

A SQL Select list is generated by the resultset from a SQL Select statement.

Here the list is based on the ordered current values of the lastname field from the employees table.

Choices: select lastname from employees order by lastname

Note: to display a blank value at the top of the choice list, prefix the SQL Select statement with a ‘+’.

Choices: +select lastname from employees order by lastname

User Defined Function

The list can be based on the return value from a user defined function or procedure (Lianja/VFP scripting).

{UserDefinedFunction()}

The return value should be a comma-separated list. Here the list is based on the return value from the ‘getempname’ procedure defined in the App’s custom library.

Choices: {getempname()}

As in the other examples, it returns the lastname field values from the employees table.

proc getempname()
	sqlvalues("select lastname from employees order by lastname")
	creturn = astring(_sqlvalues)
	return creturn
endproc

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