ياسرهتهت
18-08-2014, 05:55 PM
بسم الله الرحمن الرحيم
السلام عليكم ورحمة الله وبركاته
:abc_152: أخــــــواني الكرام :abc_152:
هــل يمكن وضــع شريط تمرير للصفحات؟
أي تكون مقاس الصفحة المعروض في المشروع
هو 600*800
والمقاس الحقيقي
600*1600
ويوجد شريط تمرير يظهر الباقي من المقاس
--------------------------------------------
مثل صفحات النت , والــ pdf
ولكن هذه المرة للصفحة كاكل
-------------------------------------------
شـكــ وبارك الله فيك ـــرا لك ... لك مني أجمل تحية .
:abc_152::abc_152::abc_152:
ثامر أبو بلقيس
18-08-2014, 07:19 PM
السلام عليكم ورحمة الله وبركاته
في global functions:
MainPageEvents = 0;
VirtualPageHeight =600;
VirtualPageWidth = 1600;
LastVPosition = 0;
LastHPosition = 0;
--################################################## #################################################
-- callback functions
function PageScroller.OnVScroll(pos) -- called when vertical scrollbar was scrolled
LastVPosition = pos;
if (pos > 0 ) then
PageScroller.MoveY(Application.GetCurrentPage(),-pos);
end
end
function PageScroller.OnHScroll(pos) -- called when horizontal scrollbar was scrolled
LastHPosition = pos;
if (pos > 0 ) then
PageScroller.MoveX(Application.GetCurrentPage(),-pos);
end
end
-- eof callback functions
--################################################## #################################################
local tbObjectType = {}
tbObjectType[OBJECT_BUTTON] = Button;
tbObjectType[OBJECT_LABEL] = Label;
tbObjectType[OBJECT_PARAGRAPH] = Paragraph;
tbObjectType[OBJECT_IMAGE] = Image;
tbObjectType[OBJECT_FLASH] = Flash;
tbObjectType[OBJECT_VIDEO] = Video;
tbObjectType[OBJECT_WEB] = Web;
tbObjectType[OBJECT_INPUT] = Input;
tbObjectType[OBJECT_HOTSPOT] = Hotspot;
tbObjectType[OBJECT_LISTBOX] = ListBox;
tbObjectType[OBJECT_COMBOBOX] = ComboBox;
tbObjectType[OBJECT_PROGRESS] = Progress;
tbObjectType[OBJECT_TREE] = Tree;
tbObjectType[OBJECT_RADIOBUTTON] = RadioButton;
tbObjectType[OBJECT_RICHTEXT] = RichText;
tbObjectType[OBJECT_CHECKBOX] = CheckBox;
tbObjectType[OBJECT_SLIDESHOW] = SlideShow;
tbObjectType[OBJECT_GRID] = Grid;
tbObjectType[OBJECT_PLUGIN] = Plugin;
tbObjectType[OBJECT_PDF] = PDF;
tbObjectType[OBJECT_QUICKTIME] = QuickTime;
tbObjectType[OBJECT_XBUTTON] = xButton;
local m_tblGroup = {};
--################################################## #################################################
PageScroller.AddItem = function (sObjectName,sGroupName)
local nIndex = Table.Count(m_tblGroup) + 1;
Table.Insert(m_tblGroup, nIndex, {})
m_tblGroup[nIndex].Group = sGroupName;
m_tblGroup[nIndex].Object = sObjectName;
m_tblGroup[nIndex].ObjectType = Page.GetObjectType(sObjectName);
m_tblGroup[nIndex].InitialY = tbObjectType[Page.GetObjectType(sObjectName)].GetPos(sObjectName).Y;
m_tblGroup[nIndex].InitialX = tbObjectType[Page.GetObjectType(sObjectName)].GetPos(sObjectName).X;
end
--################################################## #################################################
PageScroller.RemoveAll = function (sGroupName)
m_tblGroup[sGroupName] = {};
end
--################################################## #################################################
PageScroller.MoveX = function (sGroupName,xDiff)
Application.SetRedraw(false)
for i in pairs(m_tblGroup) do
if m_tblGroup[i].Group == sGroupName then
local Object = tbObjectType[m_tblGroup[i].ObjectType];
local Name = m_tblGroup[i].Object
if Object.SetPos then
Object.SetPos(Name,xDiff+m_tblGroup[i].InitialX, Object.GetPos(Name).Y)
end
end
end
Application.SetRedraw(true)
end
--################################################## #################################################
PageScroller.MoveY = function (sGroupName,yDiff)
Application.SetRedraw(false)
for i in pairs(m_tblGroup) do
if m_tblGroup[i].Group == sGroupName then
local Object = tbObjectType[m_tblGroup[i].ObjectType];
local Name = m_tblGroup[i].Object
if Object.SetPos then
Object.SetPos(Name, Object.GetPos(Name).X, yDiff+m_tblGroup[i].InitialY)
end
end
end
Application.SetRedraw(true)
end
--################################################## #################################################
PageScroller.RollBack = function (sGroupName)
Application.SetRedraw(false)
for i in pairs(m_tblGroup) do
if m_tblGroup[i].Group == sGroupName then
local Object = tbObjectType[m_tblGroup[i].ObjectType];
local Name = m_tblGroup[i].Object
if Object.SetPos then
Object.SetPos(Name, m_tblGroup[i].InitialX, m_tblGroup[i].InitialY)
end
end
end
local CurrentPage = Application.GetCurrentPage();
PageScroller.RemoveAll(CurrentPage);
Application.SetRedraw(true)
end
--################################################## #################################################
function PageScroller.SetupObjects()
local tblObjects = Page.EnumerateObjects();
local CurrentPage = Application.GetCurrentPage();
if (tblObjects ~= nil) then
for j, obj_name in pairs(tblObjects) do
PageScroller.AddItem(obj_name,CurrentPage);
end
end
end
في on show
Window.SetSize(Application.GetWndHandle(), 800, 600);
PageScroller.SetRange(SB_VERT, 0, VirtualPageHeight, Page.GetSize().Height, Application.GetWndHandle());
PageScroller.SetRange(SB_HORZ, 0, VirtualPageWidth , Page.GetSize().Width, Application.GetWndHandle());
MainPageEvents = PageScroller.InitEvents(Application.GetWndHandle() );
PageScroller.SetupObjects();
في on close
PageScroller.UninitEvents(Application.GetWndHandle (), MainPageEvents);
PageScroller.RollBack(Application.GetCurrentPage() );
وطبعا يوجد إضافة لهذا الكلام تفعل
http://im62.gulfup.com/mNk6Yo.png (http://www.gulfup.com/?psC2ne)
فقط اضبط المطلوب حسب مشروعك
موفق :abc_138:
ياسرهتهت
18-08-2014, 11:17 PM
وعليكم السلام ورحمة الله وبركاته
شكراً لك استاذي الكريم
وجازك الله الف خير
علي هذا العطاء الذي ليس له حدود
http://im73.gulfup.com/u56B7X.gif
شـكــ وبارك الله فيك ـــرا لك ... لك مني أجمل تحية .
:abc_138::abc_138::abc_138: