Jump to content

Leaderboard


Popular Content

Showing most liked content since 10/20/2017 in all areas

  1. 5 points
    Czar

    New forum software version

    So far working fine for me - an improvement over the previous forum. BTW I am loving the activity of users and admins in the forum. Hopefully it will continue to grow.
  2. 4 points
    Dennis07

    New forum software version

    Dear Smart community! we are proud to announce that we finished updating the software of our forums, as you might have noticed. If you encounter bugs, please let us know about them so that we can take care of them as soon as possible. Stuff like clearing notifications, editing profile settings, setting profile pics should work now without problems. Wishing you all the best!
  3. 4 points
    lynkfs@gmail.com

    Pagespeed ranking 98/100

    Googles PageSpeed tool (https://developers.google.com/speed/pagespeed/insights/) checks any website or webapp on various speedfactors, and returns a rating both for desktop and mobile. Most of these factors are easy to implement. Just tick the relevant minifying, packing, obfuscation boxes in the "Compiler-Code generation" section of the Project Options. The PageSpeed tool also flags un-optimised images and even optimises them to download. The more difficult option is the rule about "prioritising visible content". This is obviously difficult to do in regular SMS projects. Both the CSS and JS files generated by the compiler don't make any distinction between 'above' or 'below' the fold. To circumvent this, the following works for me : Get the generated HTML code for the first form. Easiest is execute the project in the IDE, go to the "Console section" in DevTools and type 'copy(document.body.innerHTML);' This copies the generated HTML to the clipboard. Insert this code in the HTML template in the top of the <body> section Insert the keyword 'async' in the <script> section where the main.js file is loaded This basically quickly renders the first page in HTML only and the user will see it pretty quickly. It won't do anything until the js file has loaded but that's generally ok. CSS files, unless really really big, usually don't pose a problem as they can fit into the initial congestion window (typically 14.6kB compressed) Doing this gives me a 98/100 rating both for mobile and desktop. The remaining 2% is about 'leveraging browser caching' which doesn't bother me too much. Haven't checked yet what the sms manifest file options may do to this rule.
  4. 4 points
    krolikbest

    simple game

    Hi, there is simple game i've written for my children. Hope you enjoy this game too probably a code is not mastery but it works guessing game for children.7z
  5. 4 points
    Czar

    simple game

    Either that or support this great product
  6. 3 points
    jarto

    New Alpha update

    New update available: 17.11.2017 IDE: - Major improvements to Object Inspector (enum-types) - Added more default units to uses-clauses RTL: - TW3Button rewritten. - Bug fix to TW3BitBtn. - Bug fixes to System.FileSystem.Memory.
  7. 3 points
    Thank you for doing it. I appreciate it. The aim of SMS is to solve all these kinds of issues and differences inside the RTL so that programmers don't have to write platform specific code. So I'll be more than happy to test and fix any issues like these :-)
  8. 3 points
    jarto

    Scrolling

    I spent a lot of time yesterday on native scrolling. At the moment I am in the situation, where I can prevent iOS pull to refresh. Well, at least in Safari. Have to test Chrome too. Enabling native scrolling has pros and cons. If you are using SMS to make a web site, you certainly want to enable it to make your site work nicely and as close to a normal web site as it can be. But if you are making games or web applications, native scrolling will most likely be a bad idea. By using the current TW3ScrollControl and TW3ScrollBox: You can be sure that your application works with iOS, Android and Windows 10 devices. There may be some choppy scrolling on cheaper and older devices, but even that is pretty minor. Scrolling does not always feel 100% as native to the user as real native scrolling. For example: In iOS there is a rubberband effect in all four directions. You can be sure, that scrolling works in a predictable way across all those platforms. Put a scrollable box inside another scrollable box and you can be sure that the top scrollable box scrolls only, if you scroll from there. You can control all scrolling in a very detailed way. You can do cool controls, where you have scrollable List Items inside a ListBox, which sits on a scrollable TabControl and be sure that it works in a predictable and consistent way. By using Native Scrolling: The scrolling is what the user expects it to be. The scroll bars or indicators work as the user expects them to work. The scrolling is done the same way a JS programmer expects it to be done. In iOS there are issues with "pull down to refresh page". These can be controlled, though. In Windows 10 devices there are serious problems with gestures. Swipe right and that may result in the browser going to the previous page. I've spent a lot of hours on trying to get this under control, but there does not seem to be a solution in the JS/HTML5 -world to this. If you have a scrollable area inside another scrollable area, you have no control on how the scrolling is done. Scrolling the top most box does scroll both on iOS. Other devices probably do it differently. My suggestion is, that you use TW3ScrollControl and TW3ScrollBox in your app. There are no unpleasant surprises. But I'll continue my work here so that we'll also be able to use native scrolling. After that you can decide case by case, which works best for you and your needs.
  9. 3 points
    jarto

    Smart 2.9.9 [alpha] is here!

    Almost there. Jon is finishing the Lollipop theme. If we are lucky, we can push it out today. This week anyway, for sure.
  10. 3 points
    recursiveElk

    Pagespeed ranking 98/100

    For those who are unaware, another way of performing a similar ranking with some more info (but largely the same) is to use the Chrome Developer Tools Audit functionality:
  11. 3 points
    lynkfs@gmail.com

    ReadyExecute

    https://jonlennartaasenden.wordpress.com/2015/03/08/ This method is implemented by taking a sneek peek at the DOM followed by a short wait if the control isn't found yet. procedure TControlHandleHelper.ReadyExecute(const OnReady: TProcedureRef); var LExists: Boolean; Begin asm @LExists = document.body.contains(@self); end; if LExists then OnReady() else TW3Dispatch.SetTimeout(procedure () begin ReadyExecute(OnReady); end, 100); end; This works fine. An alternative method is to use the mutation observer feature. Mutation observers observe any changes to an element and provide a list of all these changes as they occur in the DOM. A component is fully ready-to-execute when the last change has been served. The method below then dispatches a 'readyexecute' event which subsequently can be used to process a callback procedure. Code (partly lifted from SmartCL.Observer) Constructor TMutationObserver.Create; var mRef: procedure (data:Variant); mhandle: variant; begin inherited Create; mRef:=@CBMutationChange; asm @mHandle = new MutationObserver(function (_a_d) {@mRef(_a_d);}); end; Fhandle:=mHandle; end; procedure TMutationObserver.CBMutationChange(mutationRecordsList:variant); var LEvent: Variant; begin FHandle.disconnect(); asm @LEvent = new Event('readyexecute'); end; mutationRecordsList[length(mutationRecordsList)-1].target.dispatchEvent(LEvent); end; and usage (in the constructor of a CheckBox component) self.Observe; self.OnReadyExecute := procedure(sender: TObject) begin If Checked then SetProperty('background-image','url(images/checked.jpg)'); end;
  12. 3 points
    Czar

    form OnActivate / OnDeactivate ?

    Is it me you are looking for?
  13. 2 points
    Czar

    Running two IDEs

    When a second IDE is opened and a program is run you receive a bind error. Would it be possible for the second IDE to adjust the server to listen to a different port?
  14. 2 points
    jarto

    New Alpha update

    We are proud to announce an update to the Smart Mobile Studio Alpha-version. This update contains a lot of changes. We have been going through all the controls and rewritten most of them. We have also spent a lot of work on styles. This post is to help you get the update and to tell you about the biggest changes. You can update by running SmartUpdate.exe. After that go to the Themes- folder and remove these themes: Android-Holo.css, Android-HoloDark.css, Android-HoloLight.css, iOS7.css, Smart-Blue.css, Smart-Purple.css and Winphone8.css. Those are all old themes, that are not updated any more. Edit: Also remove file RTL\SmartCL.Controls.ListView.pas The new updated and maintained themes are: default.css Android.css iOS.css When it comes to styles, a control's style is now split up into a border style, background style and control's own style. In general, you don't define a background or border any more in control's own style. Instead, you can assign any of the pre-defined borders or backgrounds to your control. For example, in TW3EditBox: ThemeBorder := btEditBorder; ThemeBackground := bsEditBackground; One of the biggest changes involves borders and margins and how controls are rendered. Smart Mobile Studio will now automatically calculate and adjust controls so, that margins and paddings are respected. If a control has margins, SMS will make sure that it still fits inside its box, reducing its size, if needed. ClientRect, ClientWidth and ClientHeight return the usable client area inside the control. If the control has padding, those values automatically reflect them and are smaller. So a 100px wide control with 10px padding and 1px border will return ClientHeight as 78. A control is automatically moved so that it does not overlap padding. So the top left corner of the client area is Left: 0 and Top: 0. Width and Height give the control's outer size. ClientWidth and ClientHeight give the controls inner size. For a longer description and motives, please read For a long description, please refer to http://forums.smartmobilestudio.com/topic/4423-smart-299-alpha-is-here/?do=findComment&comment=22250 When it comes to scrolling, this version of Smart Mobile Studio lets you use native scrolling also on mobile devices. You can switch it on on any control by setting NativeScrolling := True; We've also introduced a new control: TW3NativeScrollBox. Smart Mobile Studio also has the same scroll controls as in the previous Alpha version, and these have been improved even more. Please note that when you use Native Scrolling, the browser decides how everything is done. There are pros and cons: http://forums.smartmobilestudio.com/topic/4243-scrolling/?do=findComment&comment=22220 Then we have also introduced support for font-awesome and webfonts as well as Flexbox. Jon will write more about these as well as about the styling changes. When you start using this version, you may hit some issues, that are simple to work around: Your project or some test projects may use an older theme, that has been deleted. Fix by going to Project Options, Linker and choose another theme. Application.ShowDialog uses a bit different calling style. You give the return procedure as an argument. If you can't find Application.ShowDialog, add SmartCL.Dialogs to the uses clause. Known bugs: TW3BitBtn is broken Some of the older demos do not work
  15. 2 points
    OK, I have issued a fix which should go out with the build later today or tomorrow (not my table so the manager has to deal with that). I noticed several minor mistakes. For instance, the callback "prepare" in the overloaded ShowDialog method never fired. Delayed callback failed because the method was a class method, marked as static, which means the variables are killed on exit (hence the bug above). Everything is now moved into a normal class, TW3DialogManager, which is available from TW3CustomApplication (or just, application). The Showdialog methods are still exposed as usual, so you dont need to change anything. About adjusting a dialog You asked earlier how to change the glyph and glyph color on a dialog. I must apologize because I did not know the callback didnt fire. But the way you would do this is as such: W3Button1.OnClick := procedure (Sender: TObject) begin application.ShowDialog(aoYesNoCancel, procedure (const Dialog: TW3Dialog) begin Dialog.Header.Caption := 'The header'; Dialog.Text.Caption := 'The text!'; Dialog.Glyph.GlyphType := lgtFontAwesome; Dialog.Glyph.GlyphColor := clWhite; Dialog.Glyph.GlyphId := 'fa-5x fa-exclamation-triangle'; end, procedure (const Dialog: TW3Dialog; const DialogResult: TW3DialogResult) begin writeln("You picked:" + DialogResult.ToString()); end); end; The dialog contains a "glyph" child control, this is of type TW3GlyphContainer (so you must include the unit SmartCL.GlyphContainer if you want to play with this). As you see you have properties for everything here, like GlyphColor. And you need to use the normal Font-Awesome CSS codes to pick the image you want. Simply visit: http://fontawesome.io/icons/ for a list of available glyphs, and set the code(s) as you like. The size is determined by "fa-5x" (5 times the ordinary size). Note: You can also use this in labels. If you set the caption of a label or a button caption to: W3Label1.Caption := ' <i class="fa fa-free-code-camp" aria-hidden="true"></i> Hello world!'; You get a nice fire glyph before the text The fix should be in circulation shortly -- cheers!
  16. 2 points
    I think i can fix this. From what i see above, i have used TW3Dispatch to kill the dialog after the main procedure has been closed. As I look at it now, i realize that the garbage collector can actually eat the Dialog & BlockBox objects since our "free" code executes after the procedure has exited. It would have been different had the dialog + blockbox been fields in a class, then the values would have been safely stored there -- but since they are local variables, the JS runtime gobbles them up on exit and they are in effect "NIL" when i try to access them 100ms later
  17. 2 points
    Czar

    Maximise internal Browser height

    Most of our applications use a minimum height of 768 which means that on a normal full hd screen the internal browser is unable to display the application easily. There is a lot of wasted spaced reducing the vertical space. The buttons at the top take up a great deal of space. The console is the main option it would be great if it could be attached to the side of the window. See image for suggestions http://www.numberworks.com/cloud/temp/maximisebrowser.jpg ps: can you make max attachment size a bit more than 20k? almost impossible to attach a screen shot that small.
  18. 2 points
    lennart

    New Themes ?

    RecursiveElk: Im working on the documentation, but in general: no, there is no way to set a border for everything. You will have to write your own skin for that - or do a recursive function that clears the theming from a control, and then apply your style instead. You can call the thethod "ThemeReset()" to completely remove any theming from a control. If you also set StyleClass := "" then you essentially have a clean, non styled element. Perhaps that will be easier to style if you want something unique. What I would do is the following: Start with the Default skin (ubuntu) file and check the "Use custom css" to get a copy into your project Change the theme element to use whatever palette you want Add your border somewhere (you can also just load in a second stylesheet if you like) With this done I would simply inherit out the controls for my project and use those instead. Override StyleTagObject() in each and set the theme-border to "none" then add your custom borderstyle via TagStyle.AddStyleToControl(Handle, nameofstyle). This may sound like much, but we are talking one procedure per control. You may use a 100 buttons in your program, but you only have to define it once. Writing a new themefile and adapting to the regime sounds easier to be honest. IElite: A theme is made up of smaller parts. When you think of it, a theme engine is just a clever system that keeps track of these parts and makes them available to you. So in our theme scheme we have the following parts: 14 different borders 10 different background types 4 different font sizes Each of these parts is made to be used by one of our 3 control-types. When making the theme I found that we essentially have 3 types of controls, and this seem to be how others organize their systems as well. Both Apple, Android and Linux visually operate with 3 types of controls: Normal controls (button, editbox, checkbox etc) Toolbar controls (toolbutton, seperator and whatever we add in the future) Dialog controls (dialog button and controls styled to catch the users attention). Why should I use this stuff? The idea behind the theming are many, but the jist of it always bakes down to: Make your application look good Concurrency in style Ease of use, making it possible to create new controls that adapt to whatever theme is set The concurrency part is probably the most important to get here. All the theme elements (border, background and font) is made to match its counterpart. For example, DecorativeBorder and DecorativeBackground will always compliment eachother regardless of what skin you use. Same with ButtonBorder and ButtonBackground. The important part here is that each theme-file (css file) defines the same names, but they naturally look different from theme to theme. But if you stick to the regime and try to use the pre-defined borders etc. as much as possible in your own stuff - then your customcontrols will survive between skins. So you can change between Apple, Android and Linux without problems (and more in the future). While iOS seem to be utterly flat and soul-less these days, most UI styles need different borders and small changes to create a living, vibrant look and feel. The reason I prefer the older android theme is because it has a more solid feel than the latest, which is a poor mans copy of iOS. When we made the Apple skin we essentially had to delete most of the stuff in there, because iOS is just flat as a pancake. Button-borders and list-borders are not visible etc. etc. Clearly Apple dont care about older users who might not see too good (1/3 of their userbase) or people with color-blindness (which is 1 out of 10 in the world), When making an app its important to take that into account. Most users would rather use an application that has clear distinction between UI elements, than a UI that demands you to concentrate to navigate visually. But we had to ship themefiles that follows what is modern and good, so we did that. When I have more time I will make more themes. Both the Amiga OS 4.x theme (which is really good), Windows 10 and a couple of Debian based skins is what I personally would like. Cheers Jon
  19. 2 points
    lennart

    Styling Tw3Dialog

    Hi! The dialog has a second control, which is why the text is pushed to the right. This control contains the "alert glyph" from font-awesome. Make sure that this is visible and it should look more normal. Or just inherit from the dialog, set with width of the glyph panel to 0 and that should do the trick.
  20. 2 points
    jarto

    New Alpha update

    A newer version is available: 11.11.2017 Bug fix to scrolling in older iOS devices. Fix to Keypress in Android. 9.11.2017 New demo: Featured Demos / Dialog Demo Fixed Spartacus Demo to use new Dialogs
  21. 2 points
    Hi there, since updating the new alpha Scroll is completely broken on iOS only, android is fine. When setting the Scrollbar to sbIndicator one can see that the scrollbox itself is moving but the contents within remain stuck for whatever reason. Would be great to get this sorted asap. Cheers.
  22. 2 points
    This is now fixed in 2.9.9.59.
  23. 2 points
    New update available, that fixes this.
  24. 2 points
    This is, what I wrote on the Smart Mobile Studio Facebook page a while ago: Now, when you press enter, you actually don't get 69. You get five characters: 69, 110, 116, 101, 114 When you print those characters, it's spelled out: Enter Now, well... I suppose I could convert that internally to #13 :-)
  25. 2 points
    jarto

    New Alpha update

    Found the reason for the errors during startup. An old version of ListView is causing problems. Fix it by deleting file RTL\SmartCL.Controls.ListView.pas Gonna have a look at the demos next.
  26. 2 points
    jarto

    Smart 2.9.9 [alpha] is here!

    And after I had written that one, I came up with Plan 3, which is a beauty: Still the original example: SetBounds(100,100,200,150); Margins 10px and Padding 5px, Borders 1px These are the same as in Plan2: Control Size is automatically reduced based on margins ClientWidth and ClientHeight return the usable size inside the control after padding has been taken off But then: ClientRect returns TRect(0,0,ClientWidth,ClientHeight) just like in Delphi SetBounds, SetLeft, SetTop, MoveTo automatically shift the control based on parent control's padding! So basically, you don't have to care at all about margins or padding. The control is automatically reduced and when you place something at 0,0 inside a control, it automatically moves according to the padding. And to make sure that none of this causes problems, we'll add a position mode for this: pmAbsolute: Like before. Padding etc. is up to you to handle correctly pmRelative: Relative positioning as before pmSmart (or whatever we will call it) Absolute positioning, except the RTL adjusts to margins and padding automatically. (default)
  27. 2 points
    jarto

    TW3JSONP

    Ah, got it. There are problems in both the client and the server: In the client you need to do the request like this: ws.Request('http://127.0.0.1:8099?' +'service=ADD' +'&data='+TString.EncodeUriComponent(data) +'&callback=' ); The most important thing is to actually end the request with that '&callback='. If you look at the query in the server, something like this is sent: /?service=ADD&data=%7B%22quand%22%3A%222017-11-03%22%2C%20%22note%22%3A%22%27Test%27%22%7D&callback=_TJSONP[16] On the server you also have to pay attention on how you respond. So if the request was that one above, the reply needs to be: _JSONP[16]("your answer here"); And if you use quotes in your reply, make sure to encode your answer before you send it back. For example, you're using "id"=nnn, which will cause problems to you otherwise.
  28. 2 points
    jarto

    Scrolling

    If you do not mind letting the user drag down the window in iOS, you can use this method. Then you do not need to use the ScrollController or ScrollBox.
  29. 2 points
    @lynkfs@gmail.com Just to post an update, i implemented your style with the EditableComboBox component and it worked! It looks like if you have multiple css classes in one line then it fails. For example: Doesn't work: s := #' .objecta, .objectb { color: #007cad; box-shadow: 2px 2px 2px 0 rgba(0, 142, 198, 0.4) inset; }'; browserapi.document.styleSheets[0].insertRule(s, 0); Does work: s := #' .objecta { color: #007cad; box-shadow: 2px 2px 2px 0 rgba(0, 142, 198, 0.4) inset; }'; browserapi.document.styleSheets[0].insertRule(s, 0); // ---- s := #' .objectb { color: #007cad; box-shadow: 2px 2px 2px 0 rgba(0, 142, 198, 0.4) inset; }'; browserapi.document.styleSheets[0].insertRule(s, 0); Luckily I now have a replicable way of getting this working though so thank you.
  30. 2 points
    Update - Found the easiest method for what i wanted can be done in the following way: TStrArray = array of String; TMultiStrArray = array of TStrArray; var test : TMultiStrArray; test := TMultiStrArray(JSON.Parse(#'[["test1","test2"],["test3","test4"]]'));
  31. 2 points
    jarto

    simple game

    Very nice! Actually, this game revealed a bug we had in TW3Timer. If someone tries this one and the timer runs like crazy, make this change down in the code where the delay is set: Tmr2.Delay:=0; Tmr2.Delay:=1000;
  32. 2 points
    jarto

    Scrolling

    Here's how you can use the Alpha's ScrollController to scroll form contents: Add SmartCL.Scroll.pas to the uses clause FScroller:=TW3ScrollController.Create(Self); FScroller.Direction := mdVertical; FScroller.ScrollSpeed := ssFast; FScroller.OnScrolling:=lambda ScrollInfo.ScrollTo(0,-FScroller.ContentTop); end; if ScrollInfo.ScrollHeight>Height then FScroller.MinValueY := -ScrollInfo.ScrollHeight+Height else FScroller.MinValueY:=0; Do update that MinValueY the same way in resize so the scroller knows how much it can scroll.
  33. 1 point
    recursiveElk

    Alpha 2.9.9.59 InsertRule CSS Error

    There is an issue that is very obscure with the IDE/RTL which seems to glitch out only when Project Options is not entered. The Exact steps to reproduce are shown in the demo but are also outlined here: Create New Project Add the code into InitializeObject: writeln("entered intialize object of form"); var s := #' .TW3EditBox { color: #0000ff; }'; writeln("After multi-line css"); browserapi.document.styleSheets[0].insertRule(s, 0); writeln("After insert rule css"); Compile and Run Error will show, now go to Project > Default Project Options If you do nothing but press CANCEL then it will remain broken If you do nothing but press OK then it will fix itself and successfully run every time afterwards. Demo Demo 2 showing Css is applied successfully Not sure what's going on here, very strange behaviour. Recreate able on two separate computers at Work. Luckily this is not critical.
  34. 1 point
    lennart

    Sleep?

    TW3Dispatch.Execute( procedure () begin // your code here end, 1000);
  35. 1 point
    When the following code is run within Chrome the code is run twice. Simply place a tw3button on the form or create in code. In InitializeObject add the following W3Button1.onclick := procedure(sender:tobject) begin Application.showDialog('Click yes','Are you sure you want'+#13+' to click yes?',aoYesNo, procedure(const Dialog: TW3Dialog; const DialogResult: TW3DialogResult) begin if DialogResult = roYes then writeln('IN HERE');//myarray.count); end); end; In the internal browser and in firefox we see a single "IN HERE". However, in chrome we get two reports. Chrome also throws an error index.html:83 Uncaught TypeError: Cannot read property 'Destroy' of undefined at Object.Free (index.html:83)
  36. 1 point
    jarto

    Setting TW3Label caption at design time ?

    Thanks. Will fix in next update.
  37. 1 point
    Laksekjønn

    Styling Tw3Dialog

    I sincerely appreciate a new non-visual TW3Dialog component with(Alert / Confirm / Prompt / Action Buttons / Preloader actions / Custom Modals) features. When we use modal/dialogs feature in SMS, we have greatly increased the file output size. In my experimental framework with SmartMS, see those features in ProjectSMSDialog Example: confirm modal dialog with alert myApp.confirm('Are you sure?', 'Custom Title', procedure () begin myApp.alert('You clicked Ok button'); end, procedure () begin myApp.alert('You clicked Cancel button'); end);
  38. 1 point
    lennart

    New Themes ?

    If you want to handle everything yourself, then you can shortcircuit the system with: type TMyButton = class(TW3Button) protected procedure StyleTagObject; override; end; And then just reset the whole theme: procedure TMyButton.StyleTagObject; begin inherited; ThemeReset(); end; This will kill theming on that control. But it will still try to match with a CSS style with the same name (TMybutton). Here you can just load in a stylesheet you control instead: // This code goes well in your TApplication.ApplicationStarting() // In new projects there is a "unit1.pas" file that contains your unique application object uses SmartCL.FileUtils; TW3Storage.LoadCSS('res/mycssfile.css', procedure (const FromUrl: string; const ObjectHandle: THandle; const Success: boolean) begin if Success then writeln("My css is now loaded!"); end); Once loaded the control's name will match up with the .TMyButton {} style you have defined there, and voila - you have the best of both worlds.
  39. 1 point
    lennart

    Styling Tw3Dialog

    Ill add a callback with the dialog so things like this is easier to change
  40. 1 point
    lynkfs@gmail.com

    Scrolling

    Binding to element was just for testing purposes, to document is better of course Need to test any differences a bit more .... , I'll let you know if I find any
  41. 1 point
    Yup, that is what I am getting too!
  42. 1 point
    Czar

    Unknown name "Char"

    Agreed that dropping a tw3editbox should result in system.types being added to the uses. Just got caught out on this very issue.
  43. 1 point
    jarto

    Scrolling

    @lynkfs@gmail.com You wanted to see my Safari solution to disabling pull down. Have a look at the end of SmartCL.EventManager.pas after you have updated. As I wrote before, there are some issues left, though: There does not seem to be a way to allow native scrolling and preventing gestures from doing a "back" in Windows 10 touch devices. Also, if you are at the top and try to scroll horizontally and move your finger a bit up at the same time, scrolling has to be prevented on iOS devices.
  44. 1 point
    DidierXT

    Layout Bug?

    It works if ou use 2 layout objects (like in sample demo 4): fLayoutCenter := Layout.Client( [Layout.Right(Layout.Width(75), fRightBar), Layout.Client(fBody)]); fLayout:= Layout.Client( [Layout.Top(Layout.Height(50), fHeader), Layout.Client(Layout.Width(75), fLayoutCenter), Layout.Bottom(fFooter)] );
  45. 1 point
    Dennis07

    Smart 2.9.9 [alpha] is here!

    The final steps are currently being done, the update will be pushed as soon as this has been finished. A matter of days as far as I can estimate.
  46. 1 point
    jarto

    Scrolling

    UPDATE: The post below was for versions of Smart Mobile Studio where native scrolling did not work at all. Since then proper support has been added and overriding document.ontouchmove should NOT be done any more! Also, you can enable scrolling by simply setting: YouControl.NativeScrolling := True; I've done some testing and come up with a beautiful solution, which takes 3 lines: Add this somewhere in your code where it is run once: asm document.ontouchmove = function(e) { } end; Then add this for any control that you want to make scrollable. It can be TW3Form or TW3CustomControl or whatever. We're going to add an option so, that you can decide yourself, should that blocking document.ontouchmove be there or not. It does make sense in games, but IMHO, not in normal apps.
  47. 1 point
    Understand Using the regular new alpha, the attached project works too DevSpinner.sproj
  48. 1 point
    lynkfs@gmail.com

    clear form's style ?

    https://developer.mozilla.org/en-US/docs/Web/CSS/background-image set style to 'none', not null or nil
  49. 1 point
    lynkfs@gmail.com

    Scrolling

    A reply to some of the previous comments / questions in this thread 1) Bruno said : " If you really really don't want to change an existing form but still want to use the scrollbox option, then you could use the method described in the first item of this thread. The partial class extension of TW3Form auto-magically places all elements of a form onto a scrollbox, just by adding the ScrollForm unit to a project. Note : developed for a previous version of SMS. I don't have the time to make it compatible with the latest alpha although it does compile with some minor changes. I wouldn't recommend this as a preferred developer option, but hey, if it helps it helps. PM me if you want the code. 2) Native scrolling To cut a long story short : I've become more and more frugal in using external libraries and tools. External libraries like iScroll may make life easier by hiding implementation details and smoothing out differences over multiple types of browsers, and may have other plusses as well. However cons are that these external files need to be loaded, there may be version control issues between library and browser versions and basically they are a black hole unless you read and understand minified js. To explore the idea of 'native' a bit more, I've spend some time in developing a super minimalistic framework. The idea is to use the least amount of code and still end up with a framework usable for regular project development. See shoestring demo and code. Native scrolling in this framework is based on relying on the capacities of the browser. Browsers are awesome and they are built with fast scrolling in mind. Setting the 'overflow' property of scrollable elements to 'auto' enables scrolling on most platforms. Since I'm using the word 'most', there are obviously a couple of caveats to address and in this case these are a) scrolling speed and b ) iOS A) Scrolling speed Desktop projects generally don't have a problem with scrolling longer lists or long forms. This is different on mobile where even scrolling lists of less than 100 items may become sluggish. To help the browser in this respect a simple but effective measure is to hook into the scroll event and set all display properties of items which are positioned either before or after the viewport to 'none', and only the elements which are visible in the scrolling viewport to 'inline-block'. Always making the last item in the list visible as well, even when outside the viewport, enables the browser to correctly proportion the size of the scroll-indicator. The JGrid in the component list (see demo) features a couple of hundred items, and scrolls beautifully on mobile. This holds up even to a couple of thousand. Code implementing this is available in the constructor of the JListBox unit. I'm sure more optimisations are possible but this works fine for me. B ) iOS / iPhone / iPad Native scrolling works on all desktop browsers and most mobile environments. The notable exception is iOS (safari, chrome) on iPhone and iPad. Apple requires the use of a "-webkit-overflow-scrolling: touch" entry in the css-body section. This is not supported in any w3c standard, just something Apple dreamed up. The other requirement is to handle touch-events on iOS which is a bit different than on other platforms. I've whittled it down to a couple of lines of code (7) so that magnetic scrolling on iOS is enabled by default. (still think it should be less than 7 lines, working on it).
  50. 1 point
    IElite

    Unknown name "Char"

    Sorry, I should have investigated further. <p> in the version I had before the alpha release, OnKeyPress was declared as such procedure Form1KeyPress(Sender: TObject; aChar: String); and now it is: procedure Form1KeyPress(Sender: TObject; const Character: Char); </p> You would think, if I double click on the event in the object inspector and it is added to the project code, the unit would be added......just like when i drop a component on the form and I do not have to add the componnents unit.
×