-- This brings us the page we want to search in. Is it a page or a dialogue
function GetForm()
FormName = Application.GetCurrentDialog()
if FormName == "" then
FormName = Application.GetCurrentPage()
Form = Page
else
Form = DialogEx
end
return Form , FormName
end
function GetObjectClass(ObjectName)
if type(ObjectName) ~= "string" then error([[ 'GetObjectClass' function The argument (opjectname)Must be of string type (enter the name of an existing object on the page)]],2) end
local TypeObject = {
Label , Paragraph , Image , Flash , Video ,Web , Input ,
Hotspot , ListBox , ComboBox , Progress , Tree , RadioButton , RichText,
CheckBox , SlideShow , Grid , PDF, QuickTime ,xButton ,Button , Plugin
}
Form = GetForm()
local _typee = nil
for i, v in pairs(Form.EnumerateObjects()) do
if v == ObjectName then
_typee = Form.GetObjectType(ObjectName)
if _typee == 0 then -- object button
_typee = TypeObject[21]
elseif _typee == 40 then -- object Plugin
_typee = TypeObject[22]
else -- Other objects
_typee = TypeObject[_typee]
end
break
end
end
return _typee
end
--Example
Button.SetText("Button1", "Hisham")
object = GetObjectClass("Button1")
x= object.GetText("Button1")
Dialog.Message("",x)
function GetForm()
FormName = Application.GetCurrentDialog()
if FormName == "" then
FormName = Application.GetCurrentPage()
Form = Page
else
Form = DialogEx
end
return Form , FormName
end
function GetObjectClass(ObjectName)
if type(ObjectName) ~= "string" then error([[ 'GetObjectClass' function The argument (opjectname)Must be of string type (enter the name of an existing object on the page)]],2) end
local TypeObject = {
Label , Paragraph , Image , Flash , Video ,Web , Input ,
Hotspot , ListBox , ComboBox , Progress , Tree , RadioButton , RichText,
CheckBox , SlideShow , Grid , PDF, QuickTime ,xButton ,Button , Plugin
}
Form = GetForm()
local _typee = nil
for i, v in pairs(Form.EnumerateObjects()) do
if v == ObjectName then
_typee = Form.GetObjectType(ObjectName)
if _typee == 0 then -- object button
_typee = TypeObject[21]
elseif _typee == 40 then -- object Plugin
_typee = TypeObject[22]
else -- Other objects
_typee = TypeObject[_typee]
end
break
end
end
return _typee
end
--Example
Button.SetText("Button1", "Hisham")
object = GetObjectClass("Button1")
x= object.GetText("Button1")
Dialog.Message("",x)
Comment