5E Product Walkthrough Playlist

Thread: Margins

  1. #1
    Varsuuk's Avatar
    Join Date
    Dec 2015
    Location
    New York
    Posts
    2,075

    Margins

    <windowclass name="..." >
    <frame > ... </frame> The bitmap frame resource name used for rendering the window background frame
    <margins > Display margin definition
    <control > ... </control> A comma separated list of four numbers specifying the pixel margins applied to the window before controls are placed. Can be used to offset all controls right and/or down (i.e. left/top margins), or create margins on the right/bottom.
    </margins>
    ...


    So, I assume is no "margins" element is supplied, placing a control offset 0,0 from topleft means it would be offset 0,0 from top left edge of the Window (the physical 0,0 point - regardless of appearance as the window may be "margined" in the graphic already)
    If one was supplied like 0,0,0,2 (as appears in CoreRPG some places), it means if I place it offset at right edge, it would be against right edge (0) but it is adjusted upwards from bottom edge (2)?

    Yeah, I am clueless with graphics and spatial geometry

    So glad started on the Lua finally after getting first tab setup... I didn't use "margins" but saw some in Core and 5E and wanted to grok WHEN you would want to use it and why?

  2. #2
    Apologies. I bookmarked this to answer earlier, but got distracted by house move, computer migration and more.

    The margins are used to apply a global offset to all controls within a window class. These top/left margins are essentially added to the position/anchor information for all the controls, and the bottom/right margins are essentially increasing the size of the window by the margin amount.

    Since top-level windows are sized based on the controls contained, the bottom/right margins allow you to force the window to be larger than the controls defined. Also, graphic frames can expand outside the field that they are defined on. This why you see so many 0,0,0,2 control margins, since this preserves the frame display on the bottom most field as well as providing vertical spacing between fields or window list items.

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in