mApp移动应用程序框架可用于数据网格表单布局吗?

时间:2013-05-28 12:38:28

标签: livecode

Monte的移动应用程序框架(mApp)以表格形式处理数据网格,因为它可以直接扩展各种屏幕尺寸和分辨率。

我们需要做些什么才能让它与datagrid表单布局一起使用?也可以将它用于表单布局内容吗?如果是这样,怎么样?

欢呼,艾伦

1 个答案:

答案 0 :(得分:0)

对于DataGrid表布局,mApp是完全未经测试的,我无法想象这些对于移动设备来说都是有用的。如果它工作那么好。

对于表单布局,您只需要记住布局中的任何固定像素宽度都需要乘以mAppPixelDensity()然后舍入。模板会自动缩放。因此,默认的LayoutControl处理程序应更改为:

on LayoutControl pControlRect
    local theFieldRect

    -- This message is sent when you should layout your template's controls.
    -- This is where you resize the 'Background' graphic, resize fields and 
    -- position objects.
    -- For fixed height data grid forms you can use items 1 through 4 of pControlRect as
    -- boundaries for laying out your controls.
    -- For variable height data grid forms you can use items 1 through 3 of pControlRect as
    -- boundaries, expanding the height of your control as needed.

    -- Example:
    put the rect of field "Label" of me into theFieldRect
    put item 3 of pControlRect - round(5*mAppPixelDensity()) into item 3 of theFieldRect
    set the rect of field "Label" of me to theFieldRect

    set the rect of graphic "Background" of me to pControlRect
end LayoutControl