Jump to content

Search the Community

Showing results for tags 'scroll'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


There are no results to display.


  • 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


Last Updated

  • Start


Filter by number of...


  • Start



Website URL



Company name


Found 7 results

  1. Ricardo

    Scroll form

    Hi. How to make a high-rise form and scroll with your fingers or the mouse? It should work on mobile devices and desktop computers (on mobile devices without scroll bars, of course). The purpose is the introduction of data Thanks in advance
  2. lynkfs


    Scrolling has been discussed extensively before in this forum and in other posts However I wanted to have a simple solution which would make standard forms scrollable without any special handling or consideration. First idea was to produce a specialised TW3Form : type TW3ScrollForm = class (TW3Form) .... end; Problem of course is that the invocation of such a form is not standard : type TForm1 = class(TW3ScrollForm) instead of the normal TForm1=class(TW3Form) The other problem is that this doesn't work when using the ide-designer. Apparently Smart expects a TW3Form exclusively, so adding elements to a TW3ScrollForm and using the designer results in errors at compile time Second idea is to use partial classes to extend the functionality of TW3Forms : type TForm1 = partial class (TW3Form) private procedure SetContentHeight(Height: Integer); protected Scroll : TW3ScrollWindow; published property ScrollHeight: Integer write setContentHeight; end; This can be made to work well enough, however the invocation is still not standard : type TForm1 = partial class(TW3Form) instead of the normal TForm1=class(TW3Form) There is a way around this by going up the component tree : TW3Form inherits from TW3CustomControl which inherits from TW3MovableControl which inherits from TW3Component which inherits from TW3TagObj In this lineage TW3CustomControl (and TW3Component) are specified as partial classes. If we move the above methods and properties up 1 step we extend TW3CustomControl TW3CustomControl = partial class(TW3MovableControl) private procedure SetContentHeight(Height: Integer); protected Scroll : TW3ScrollWindow; procedure ChangeParent (newparent:TW3ScrollWindowContent); published property ScrollHeight: Integer write setContentHeight; end; and since TW3Form is derived from TW3CustomForm we're able to use the standard invocation of type TForm1 = class(TW3Form) So far so good. The next problem is that elements created on forms have their parent set to that Form. This needs to be altered, <element>.Parent needs to be set to the scroller object "Parent" is however a read-only attribute and can't be simply altered. This code works around that : procedure TW3CustomControl.ChangeParent(newparent:TW3ScrollWindowContent) ; var x: Integer; mChild: TW3Component; begin BeginUpdate; for x := 0 to GetChildCount - 1 do begin mChild := GetChildObject(x); if (mChild.parent is TW3Form) then begin if (not (mChild is TW3ScrollWindow)) then newparent.Handle.appendChild(mChild.Handle); end; end; EndUpdate; end; . So basically this means that all standard forms in any visual project automatically become scrollable by simply adding the ScrollForm unit to the project, nothing else needed. Demo and code (based on the iScroll wrapped library) .
  3. IElite

    Touch versus scroll

    Still trying to get my touch vs scroll to work on non desktop browsers. (e.g. my androind phone). Everytime I go to scroll my lists, it thinks I am touching/selecting an item in the list. Demo Code Shane
  4. I am still having a hard time with a Listbox and distinguishing between "touch" to select and item in a listbox on a desktop/laptop browser.....and "touch" to begin scrolling (e.g. on a phone/tablet) Using a basic example listbox with 100 items procedure TForm1.Resize; var i: integer; begin inherited; W3ListBox1.Clear; for i:= 1 to 100 do W3ListBox1.Add('Item ' + inttostr(i)); W3ListBox1.SetBounds(0,0,width,height); end; When a user is using the desktop/laptop browser, I need them to be able to use both mouse and touch (case their monitor is touch) to "scroll" and "select" item.....else if using their phone or tablet, need them to be able to use "touch" to scroll and "tap" to select item I assume we dont want to use the standard OnSelected event ? W3ListBox1..OnSelected := HandleLBItemSelected; and probably want to use the OnTouchBegin & OnTouchEnd, as well as the OnMouseDown & OnMouseUp events?????? If So, how? And how do you then handle the scrolling?
  5. I need to place a large amount of text that needs to be placed in a control and placed on my form. The text needs to able to be word wrapped and scroll-able. However, I do not want visible scrollbars such as seen in a TW3Memo. Can I use TW3ScrollControl for this? I have no idea how much text will be there, but at the most three large paragraphs. The text will need to word wrap based on the size of the control holding the text. I tried using a TW3Label but it seems it has no wrapping procedure TForm1.InitializeForm; var s: string; i: integer; begin inherited; // this is a good place to initialize components fScroll.SetBounds(0,0, ClientWidth, ClientHeight); fScroll.Content.SetBounds(0,0, clientWidth, clientHeight); fText.SetBounds(0,0, fScroll.clientWidth, fScroll.clientHeight); for i:= 1 to 10000 do s:= s + intToStr(i) + ' '; fText.Caption:= s; end; procedure TForm1.InitializeObject; begin inherited; {$I 'Form1:impl'} fScroll:= TW3ScrollControl.Create(self); fText:= TW3Label.Create(fScroll.Content); end; I then tried placing it in the scroll control's InnerHtml procedure TForm1.InitializeForm; var s: string; i: integer; begin inherited; // this is a good place to initialize components fScroll.SetBounds(0,0, ClientWidth, ClientHeight); fScroll.Content.SetBounds(0,0, clientWidth, clientHeight); for i:= 1 to 10000 do s:= s + intToStr(i) + ' '; fScroll.Content.InnerHTML:= '<html> <body> <p>' + S + '</p> </body> </html>';} end; that wraps, but does not scroll beyond the height of the scroll control. Again, I do not know the height of the text at any point, cause of the device size, layout, and amount of text wrapped within. If I set it to some arbitrary such as 5000, then i have extra area to scroll - with no text e.g. fScroll.Content.SetBounds(0,0, clientWidth, 5000); is there a way to place text in a scroll, make it wrap, and make it scroll to the end of its content without any extra space at end (well, there could be a little extra) here is my code here is my demo The #1 president has a large amount of text - so when viewed in a smaller device, or resized browser window, you will see my dilema thanx
  6. using the TW3Scrollbox's Vertical and Horizontal scroll bars work great with the mouse in a browser. Both the bars can be dragged with the mouse, and the arrows at each end can be clicked to move the bars. However, they are not working in my Android Device. Do I have to utilize the Scrollbox's OnGesture or OnTouch events? If so, how do I do so. Btw, the same thing for the TW3Memo control
  7. How to hide scrollbars on TW3Memo? Or, how do I display large amounts of text with word wrap, like in the memo? code https://github.com/holmesshanea/smartmobilestudio/tree/master/preZidents test https://rawgit.com/holmesshanea/smartmobilestudio/master/preZidents/www/index.html test in mobile http://ipadpeek.com/ just select the device and orientation (rotation) What I am trying to achieve is display a large amount of text (wordwrapped) and have it display - no matter the device and orientation - and be able to scroll through the text that isn't visible on the display. Preferably with no scrollbars as is shown with the memo control. Maybe I need to display the text in a div element instead?
  • Create New...