Jump to content

Search the Community

Showing results for tags 'Layouts'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

There are no results to display.

Forums

  • Welcome to Smart Mobile Studio
    • News and Information
    • Pre-Sales Questions
    • Smart In the Media
    • Smart Contests
    • Meta
  • Smart Mobile Studio Discussion
    • General
    • IDE
    • RTL
    • Code
    • Client Server
    • Platform
    • Graphics
    • Deployment
    • Suggestion box
  • Smart Mobile Studio support
    • Support
    • Bug report
  • General Discussion
    • Pascal
    • Delphi
    • Javascript
    • HTML/HTML5
    • CSS
  • Resources
    • Website
    • Download Smart Mobile Studio

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Company name


Position

Found 2 results

  1. IElite

    Resize method

    I have a custom control where I override the Resize method. This method works fine the very first time (i.e. the first time my form is shown) - see screenshot here If I change orientations , or layouts, or move away from form and come back, it then does NOTwork - see screenshot here all the values I use to calculate positioning - are re-initialized each time the method is called Idx:= 0; xPos:= ITEMSMARGIN; yPos:= ITEMSMARGIN; Rows:= (fMenuItems.Count Div Columns); If I click the "Reload" button, then it works - see screenshot here Here is the code procedure TsahMenu.Resize; var I, Idx: Integer; xPos, yPos: Integer; Rows: Integer; begin inherited; if not (Handle.Valid and (csReady in ComponentState)) then Exit; Idx:= 0; xPos:= ITEMSMARGIN; yPos:= ITEMSMARGIN; Rows:= (fMenuItems.Count Div Columns); fmenuItemWidth:= ((clientWidth DIV Columns) - (Columns + 1 * ITEMSMARGIN)); fmenuItemHeight:= fmenuItemWidth + LABELHEIGHT; if (fMenuItems.Count Mod Columns) > 0 then Rows:= Rows + 1; Content.SetBounds(0,0, clientWidth, (Rows * fMenuItemHeight) + ((Rows + 1) * ITEMSMARGIN) ); for I:= 0 to MenuItems.Count-1 do begin TsahMenuItem(MenuItems[I]).SetBounds(xPos, yPos, fMenuItemWidth, fMenuItemHeight); if Idx = Columns-1 then begin yPos:= yPos + fMenuItemHeight + ITEMSMARGIN; xPos:= ITEMSMARGIN; Idx:= 0; end else begin xPos:= xPos + fMenuItemWidth + ITEMSMARGIN; inc(Idx); end; end; end; What am I doing wrong? Why does the "Reload" button work? Doesn't that just call Resize?
  2. I would love to see some kind of improvement for nesting layouts. i.e. layouts that have controls in them and layouts with controls in them e,g, Layer 1 Header layout , Main Body layout , Footer layout Layer 2 - Header layout Image, Label, buttons Layer 2 - Content layout Labels, Edits, buttons Layer 2 - Footer layout Image, navigation links (labels) To implement this requires a lot of code Maybe add Layers? Or Maybe allow a Layout to include another Layout as well as controls e.g. Laying out the three layers above //layer1 fLayout:= Layout.Client( [Layout.Top(fLayer2HeaderLayout), Layout.Client(fLayer2ContentLayout), Layout.Bottom(fLayer2FooterLayout)] ); as of now, you have to write too much code, to create all the layouts and then in the resize, you only have to make one call as well if assigned(FLayout) then FLayout.Resize(self); instead of if Assigned(fLayer1Layout) then begin //resize layer 1 fLayer1Layout.Resize(self); //resize layer 2 header panel if Assigned(fLayer2HeaderLayout) then fLayer2HeaderLayout.Resize(fLayer1Header); //resize layer 2 footer panel if Assigned(fLayer2FooterLayout) then fLayer2FooterLayout.Resize(fLayer1Footer); //resize layer 2 main panel if Assigned(fLayer2MainLayout) then fLayer2MainLayout.Resize(fLayer1Main); end;
×