


مكن توضيح أكثر لخيط واحد .....
first_name = Application.LoadValue("samer2", "Key2");
list = Page.EnumerateObjects();
if first_name == "1" then
xButton.SetText("xButton1" , "on");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_XBUTTON) then
xButton.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = true});
end
end
elseif first_name == "0" then
xButton.SetText("xButton1" , "off");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_XBUTTON) then
if n ~= "xButton1" then
xButton.SetProperties(n, {Enabled = false});
end
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = false});
end
end
end
confirm = Dialog.Input("mot de passe", "Password ???", "");
if confirm == "abcd" then
if xButton.GetText(this) == "off" then
xButton.SetText(this , "on");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_XBUTTON) then
xButton.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = true});
end
end
elseif xButton.GetText(this) == "on" then
xButton.SetText(this , "off");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_XBUTTON) then
if n ~= "xButton1" then
xButton.SetProperties(n, {Enabled = false});
end
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = false});
end
end
end
else
Dialog.Message("Notice"," انت سريع النسيان ");
end
-----------------------------------------------------
if xButton.GetText("xButton1")=="off" then
Application.SaveValue("samer2", "Key2", "0");
else
Application.SaveValue("samer2", "Key2", "1");
end
----------------------
first_name = Application.LoadValue("samer2", "Key2");
second_name = Application.LoadValue("samer3", "Key3");
third_name = Application.LoadValue("samer4", "Key4");
fourth_name = Application.LoadValue("samer5", "Key5");
fifth_name = Application.LoadValue("samer6", "Key6");
sixth_name = Application.LoadValue("samer7", "Key7");
list = Page.EnumerateObjects();
if first_name == "1" then
xButton.SetText("xButton1" , "on");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_XBUTTON) then
xButton.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = true});
end
end
elseif first_name == "0" then
xButton.SetText("xButton1" , "off");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_XBUTTON) then
if n ~= "xButton1" then
xButton.SetProperties(n, {Enabled = false});
end
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = false});
end
end
end
list = Page.EnumerateObjects();
if second_name == "1" then
xButton.SetText("xButton1" , "on");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_XBUTTON) then
xButton.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = true});
end
end
elseif second_name == "0" then
xButton.SetText("xButton1" , "off");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_XBUTTON) then
if n ~= "xButton1" then
xButton.SetProperties(n, {Enabled = false});
end
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = false});
end
end
end
confirm = Dialog.Input("mot de passe", "Password ???", "");
if confirm == "55555" then
if xButton.GetText(this) == "off" then
xButton.SetText(this , "on");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_XBUTTON) then
xButton.SetProperties(n, {Enabled = true});
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = true});
end
end
elseif xButton.GetText(this) == "on" then
xButton.SetText(this , "off");
for i, n in pairs(list) do
type = Page.GetObjectType(n);
if (type == OBJECT_INPUT) then
Input.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_LISTBOX) then
ListBox.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_BUTTON) then
Button.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_IMAGE) then
Image.SetProperties(n, {Enabled = false});
end
if (type == OBJECT_XBUTTON) then
if n ~= "xButton1" then
xButton.SetProperties(n, {Enabled = false});
end
end
if (type == OBJECT_LABEL) then
Label.SetProperties(n, {Enabled = false});
end
end
end
else
Dialog.Message("Notice"," انت سريع النسيان ");
end
-----------------------------------------------------
if xButton.GetText("xButton1")=="off" then
Application.SaveValue("samer2", "Key2", "0");
else
Application.SaveValue("samer2", "Key2", "1");
end
----------------------
("samer2", "Key2", "0");
("samer2", "Key2", "1");
تعليق