LAMW: Adjust x/y lazarus / 43-Android ---------------------------------------------------------------------- c4p · 2017-08-22 09:54 Is there a way to resize x or y axis  on the form on smaller sized dpi phones? example: button off the end of the x axis? Thanks. ---------------------------------------------------------------------- jmpessoa · 2017-08-23 00:56 Ok, c4p. I will try some solution.... Thank you! ---------------------------------------------------------------------- c4p · 2017-08-23 08:26 I did a workaround by setting an invisible label at x 0 and entered a Text character until I reached a point I wanted (not ideal at all). Am I correct that you can't anchor an anchor to an anchor? this would solve this issue. I think the solution is being able to anchor a component to an already anchored component: Example: An editbox to the right of label, this works using raAlignBaseline/raToRightOf in PosRelativeToAnchor, then being able to anchor another component to the right of that, *does not work*, resets to the top of the form but seems to be aligned with x, so y looks like it's being lost? Basically PosRelativeToAnchor/Anchor does not seem to work if you are anchoring more than one component that is already anchored. Really pleased with LAMW and the immense work that goes into it. ---------------------------------------------------------------------- jmpessoa · 2017-08-24 01:16 QuoteBasically PosRelativeToAnchor/Anchor does not seem to work if you are anchoring more than one component that is already anchored. No. You can! Here my hints: [please, update LAMW from github] You can get some device information using "jForm" methods and handling jForm  "OnJNIPrompt event":  Self.GetScreenSize()  //"XLARGE" or "LARGE" or "NORMAL" or "SMALL"  Self.GetScreenDensity()   //"XXHIGH" or "XHIGH"  or "HIGH" or "MEDIUM" or "LOW" and property:   Self.ScreenWH.Width   Self.ScreenWH.Height And then change the components  position and layout [According to your need]   jTextView1.PosRelativeToParent:= [rpTop, rpLeft];   jTextView1.ResetAllRules();   jTextView1.UpdateLayout();   jButton1.LayoutParamWidth:= lpHalfOfParent;   jButton1.PosRelativeToParent:= [rpCenterHorizontal];   jButton1.PosRelativeToAnchor:= [raBelow];   jButton1.ResetAllRules();   jButton1.UpdateLayout(); ---------------------------------------------------------------------- c4p · 2017-08-25 06:07 Thank you! I will try this tonight. ---------------------------------------------------------------------- c4p · 2017-08-25 22:08 Hmm, still the same, cannot anchor and anchor. ScreenDensity/Size functions work great though, very useful. ---------------------------------------------------------------------- jmpessoa · 2017-08-25 22:55 Hi c4p! What layouting you need? Can you post some picture? ---------------------------------------------------------------------- c4p · 2017-08-25 23:31 Example: I anchor editbox1 to Label1....editbox1 is to the right of label so I set PosRelativeToAnchor to rAlignBaseline and raToRightOf this works perfect! If I then was to try and anchor another editbox or label to the right of editbox1, y coordinate resets to the top. Maybe this is not possible? I did a workaround by setting invisible label and setting it as an anchor and spacing out to a x position but this is not ideal as will not hold position with different screen density. Not major for me right now, but would be nice to get the anchor holding on more than one. ---------------------------------------------------------------------- jmpessoa · 2017-08-26 02:12 Please, if possible,  point in picture [attachment]  what layouting configuration parts you need... ---------------------------------------------------------------------- c4p · 2017-08-26 20:48 The graphic shows the component layout I need. I need three components side by side, middle one is anchored to left one, then right one anchored to middle one.  Right now I can only anchor middle to left but NOT right to middle. I need it this way so when using high density or low density screens that the components are uniform and don't disappear off the screen or overlap. ---------------------------------------------------------------------- jmpessoa · 2017-08-27 03:38 Ok.  Here is the picture [attachment]  and the ".lfm" code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i object AndroidModule1: TAndroidModule1  Text = 'AndroidModule1'  ActivityMode = actMain  object jTextView1: jTextView    PosRelativeToAnchor = []  PosRelativeToParent = [rpTop, rpLeft]    LayoutParamWidth = lpWrapContent    LayoutParamHeight = lpWrapContent    Text = 'jTextView1'  end  object jEditText1: jEditText    Anchor = jTextView1    PosRelativeToAnchor = [raBelow]    PosRelativeToParent = [rpLeft]    LayoutParamWidth = lpOneThirdOfParent    LayoutParamHeight = lpWrapContent    Text = 'jEditText1'  end  object jEditText2: jEditText    Anchor = jTextView1    PosRelativeToAnchor = [raBelow]  PosRelativeToParent = [rpCenterHorizontal]    LayoutParamWidth = lpOneThirdOfParent    LayoutParamHeight = lpWrapContent    Text = 'jEditText2'  end  object jEditText3: jEditText    Anchor = jTextView1    PosRelativeToAnchor = [raBelow]    PosRelativeToParent = [rpRight]    LayoutParamWidth = lpOneThirdOfParent    LayoutParamHeight = lpWrapContent    Text = 'jEditText3'  end  object jTextView2: jTextView    Anchor = jEditText2    PosRelativeToAnchor = [raAbove, raAlignLeft]    PosRelativeToParent = []    LayoutParamWidth = lpWrapContent    LayoutParamHeight = lpWrapContent    Text = 'jTextView2'  end  object jTextView3: jTextView    Anchor = jEditText3    PosRelativeToAnchor = [raAbove, raAlignLeft]    PosRelativeToParent = []    LayoutParamWidth = lpWrapContent    LayoutParamHeight = lpWrapContent    Text = 'jTextView3'  endend  Note1:  All  jEditText are "anchored"  below  jTextView1 Note2: You can use the same model for two components... only changing "LayoutParamWidth "  According to your need ---------------------------------------------------------------------- c4p · 2017-08-27 09:25 Hmmm, starting to think there may be an issue with my form then, as I cannot anchor to another anchor.