Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 10/19/2018 in all areas

  1. 4 points
    jarto

    Yikes!!!

    I'm sad to see Jon leave his baby like this, but I do respect his decision. What I can say is, that SMS is not dying here. I've been waiting a few weeks already to push a new update, but have not been able to get any answers from Jon, if he'd also want to include some changes. I believe things look worse to you guys than they really are. A lot of RTL work and especially bug fixes was done by me during the last year and almost all the IDE improvements and bug fixes by Primoz. Jon did pretty much all the NodeJS work, so we'll miss him most there. If I look at this optimistically, Jon's donating his shares to two young and talented Delphi programmers is a very nice thing and may give them a possibility to spend more time on SMS. But hey, hang on there and lets hope that this divorce will not be too ugly.
  2. 2 points
    lynkfs

    Calendar Control

    a quicky calendar : function jQuery(aTagObj: TW3TagObj): Variant; function jQueryExternal(v: Variant): Variant; external '$'; implementation { TForm1 } function jQuery(aTagObj: TW3TagObj): Variant; begin result := jQueryExternal(aTagObj.handle); end; procedure TForm1.InitializeForm; begin inherited; // this is a good place to initialize components MyBox := TW3EditBox.Create(self); MyBox.Text := 'Date'; MyBox.SetBounds(20,20,200,40); var props : Variant := TVariant.Create; props['dateFormat'] := 'dd/mm/yy'; jQuery( MyBox ).datepicker(props); // or alternatively // jQuery( MyBox ).datepicker(); // jQuery( MyBox ).datepicker("option", "dateFormat", "dd/mm/yy"); end; and add this to your custom template <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> there are many options for this widget demo here (based on older post)
  3. 2 points
    In the next release there's a new OnCellControlCreated -event in TW3Column. It can be used to set properties for the button. For example: ButtonCol := TW3ButtonColumn.Create(W3Grid1 as IW3ColumnsControl); ButtonCol.OnButtonClick := procedure(Sender: TObject) begin WriteLn('Click on row '+IntToStr(TW3Button(Sender).TagValue)); end; ButtonCol.OnCellControlCreated := procedure(Sender: TObject) begin TW3Button(Sender).TagValue:=W3Grid1.RowCount; end;
  4. 2 points
    lynkfs

    no-code

    I had an idea of how to approach the concept of a 'no-code' / 'lo-code' framework, which involved a modelling exercise done from different viewpoints. The idea was to base this on a graph-based domain model and some defined aspect-models derived from that. The following link contains bit of a write-up : preamble, framework basics, domain model, data model, process model, beginnings of workflow model. Event-, processor- and objectives model unfinished. demo showing how the design efforts of these models might look like (in broad terms) demo of how the generated app from these models could look like Sometimes an idea can only be validated by making it work. Or if it doesn't work out then obviously it was a bad idea to begin with. Not making a final call yet as I haven't finished this proof of concept (only about half ready), but so far no reason to abandon. Comments welcome
  5. 2 points
    Here's an example on how to create a form inside a div: Create a new project Add a W3DIVHtmlElement1 (from Elements-tab) to Form1 Add a new form (Form2) and put some controls inside it (label, button etc.) Go to Project Options/Forms and uncheck the Auto for Form2 Add Form2 to the uses clause in Form1 Add a Button to Form1 and make a onclick -event for it: procedure TForm1.W3Button1Click(Sender: TObject); begin var frm2:=TForm2.Create(W3DIVHtmlElement1); frm2.SetBounds(W3DIVHtmlElement1.ClientRect); end; Run the program and click on the button -> Form2 is created inside the div you made.
  6. 2 points
    I've found and fixed the bug. I hope to be able to push an update within a few days.
  7. 2 points
    DavidRM

    Yikes!!!

    I'm working on a project with SMS and have a couple more planned. I'm looking forward to the next update. I also expect to renew my subscription, which I think ends soon. Just saying. Also, if you need any help from the hoi polloi, let me know. -David
  8. 2 points
    every time you add a row, fill the tagid of the row with the row number. TagId is a field (string) present in all component descendants in which you can save things. Then in an onclick handler read that field to retrieve the clicked on rownr. (MyGrid.Row[MyGrid.LastAddedRow] as TW3CustomControl).TagId := inttostr(MyGrid.LastAddedRow); (MyGrid.Row[MyGrid.LastAddedRow] as TW3CustomControl).onClick := procedure(sender:TObject)  begin browserapi.window.alert((Sender as TW3CustomControl).TagId); end; (Alternatively you can use the data- attribute as temporary storage).
  9. 1 point
    IElite

    Calendar Control

    I would like to see a calendar control (TW3Calendar) in the RTL. Possibly derive it from TW3Grid? It would be nice to make it like the Delphi version, but I dont think it has to be as elaborate. I think you could keep the Month, Year, and Navigation controls off from the calendar and just make the Month and Year properties and the navigation routines. I would like to see at least the Month view (BONUS: year, and day view as well) I have looked at a lot of javascript versions and most are too bloated for me to attempt to port over. Features I would like to see: - should show the one or more days of previous month if current months first day starts on anything other than the first day of the week - should show the one or more days of next month if current months last day falls on anything other than the last day of the week - should be able to navigate through the years, months - should be able to highlight the current day - clickable days BONUS: able to set and highlight a range of days. Click and Drag
  10. 1 point
    lynkfs

    Calendar Control

    I suppose marrying third-party controls means living with it (up to a point) In this case jQuery offers themeRoller, which generates a theme. The resulting css spec can then be included Otherwise individual control classes can be overridden. JQuery style : jQueryExternal(browserapi.Document.getElementById("ui-datepicker-div")).addClass( "my-ui-widget-header" ); or RTL style TW3TagStyle.AddClassToControl(browserapi.Document.getElementById("ui-datepicker-div"), "my-ui-widget-header"); or browserapi.Document.getElementById("ui-datepicker-div").setAttribute("style", "background:red; border: 1px solid blue;"); (btw : link to older post )
  11. 1 point
    jarto

    Calendar Control

    I suppose it'd be best for us to use an existing js calendar control. We're already doing that with Google maps and the next update will have Openmaps (through the Leaflet library). Any suggestions on which one to wrap?
  12. 1 point
    JaredD

    Should the Debugger work?

    @jarto Thank you. that does help! I have struggled with this seemingly work randomly. As feedback it might be useful to re-caption "Add Source Map (for debugging)" since it appears to break debugging.
  13. 1 point
    lynkfs

    no-code

    Setting up a blog in WordPress is a no-brainer of course. Setting one up in Smart is pretty easy too. This one repurposes a treeview as a vertical collapsible menu and a series of Google docs in an iFrame. Using Google docs is a bit of a short-cut but it does provide the basics in a single package : perfect formatting capabilities, editing online and authorisation for editing source, or able to comment, or viewing for anyone. As for the subject (a no-code/lo-code framework) this obviously is unfinished ('intro' and the beginning of 'framework' entries only). I may do some more work on it when time permits. If you have thoughts on the subject and make it a collaborative effort then let me know. By the way, the form under 'Design' is a proof of concept for using the jsPlumb library (included in Smart in the libraries directory). A very useful library, check it out. Panels are draggable, links are connectable by mouse and touch etc...
  14. 1 point
    Igor Savkic

    no-code

    As always, your demos are quite interesting, looking forward to next upate. On the matter itself, there's been (or are) dozen of solutions that offer some kind of noCode data building and they generally work well unless you need something specific and that's the main weak point of such solution. NoCode solution can solve business problems to a degree, but they do tend to become complex as well. And they do require a knowlegable person to set it up and maintain it.
  15. 1 point
    jarto

    New to Node

    Nodejs has changed a bit since the tutorial was written. If you look at the code that is generated when you make a nodejs-app: constructor TNodeProgram.Create; begin inherited Create; FServer := TNJHTTPServer.Create; FServer.Port := 1881; FServer.OnAfterServerStarted := HandleServerStarted; FServer.OnRequest := HandleRequest; end; You can see here that the post 1881 is set here. Port 80 is not used as default as many do run a http server on their computer on port 80. So using another port is a good way to avoid conflicts. procedure TNodeProgram.HandleRequest(Sender: TObject; const Request: TNJHttpRequest; const Response: TNJHttpResponse); begin // Just end the request by sending the headers back as a string response.&End(request.Headers.ToString()); end; Here you can see how the default is to return the headers. If you want your "Hello world!", just do: response.&End("Hello world!");
  16. 1 point
    jarto

    Help me understand how FORMS are used

    Yeah, in the first versions of Smart Mobile Studio you had to create the forms in code. Now the creation of forms is automatic based on the Project options. The code that does it is in SmartCL.Application. There are situations when you want to create forms in code. For example, the TabControl lets you add forms as tabs. You can also create a form inside other controls, like for example a div. When you do that, make sure to not autocreate the form in Project Options.
  17. 1 point
    jarto

    TW3Grid Additions

    Thanks, I'll have a look at this.
  18. 1 point
    jarto

    Yikes!!!

    Definitely, thank you. Guys, I really appreciate the community we have here and will continue to do my best to help you and to develop SMS. And if any of you want to contribute or take on a role, don't hesitate to contact me.
  19. 1 point
    IElite

    Yikes!!!

    @Czar Yes, if it does fold, I too would love to see it placed in OpenSource out on Git and have a governing body over it
  20. 1 point
    Czar

    Yikes!!!

    I just read the news and I believe you are correct IELite. Without Jon's major input the project feels like it will fold. Jarto is the only other member that I am aware of. If the other shareholder's don't show some significant leadership then it will flounder. Personally I hope it doesn't disappear and perhaps a better solution would be to opensource everything. SMS is a product we use everyday and it fits very well into part of our development requirements. Shame to see it end.
  21. 1 point
    Update......couple changes changed TagId to TagValue (work with integers instead of strings) when prepping the row procedure TSelGrid.Add(AGrade, AClasses, AStudents, AProgram: String); begin fGrid.AddRow; (fGrid.Row[fGrid.LastAddedRow] as TW3CustomControl).TagValue := fGrid.LastAddedRow; '''''' end; Next, in order to get the row index from the TagValue property, I just did a cascading look into all the parents Button --> Cell -- > Row procedure TSelGrid.HandleDeleteClick(sender: TObject); var RowId: integer; begin RowId:= Tw3Row(TW3Cell(TW3Button(sender).Parent).Parent).TagValue; fGrid.DeleteRow(RowId); end; I would still be interested in knowing if there is an easier solution to get the row. Maybe add the property to the grids TW3Cell? TW3Column
  22. 1 point
    jarto

    Buttons in SMS Browser vs Chrome/Edge

    You're reading aButton.Width and aButton.Height. If you do that while the buttons are still being created in the DOM, the values returned may be unpredictable. In your code you're also doing a SetBounds without changing the button size. It's more efficient to use aButton.MoveTo() And in the end you're setting the container size depending on the button sizes. Basically, I'd rather first set the container to the desired size and then resize the buttons based on that: SetSize(DesiredContainerWidth, DesiredContainerHeight); var cw:=ClientWidth; //Actual width we can use inside the container var ch:=ClientHeight; //Actual height we can use var x:=0; for bb := 0 to ButtonCount - 1 do begin aButton := Button[bb]; var bw:=(cw-x) div (ButtonCount-bb); aButton.SetBounds(x,0,bw,ch); inc(x,bw); end; Another possibility is to use flexbox, which takes care of the resizing itself.
  23. 1 point
    jarto

    How to add a CSS file to a project?

    A third option is to add a stylesheet in code: Add SmartCL.Css.Stylesheet to uses clauses and do: var MyStylesheet := TW3StyleSheet.Create; MyStylesheet.InnerHtml := #".TMyControlStyle { font-size: small; text-align: center; text-decoration: none; padding: 0; border: 1px solid #bbb; background-color: #C3D9FF; } .TMyOtherStyle { ..... }";
  24. 0 points
    IElite

    Yikes!!!

    Yikes! Jon is leaving! https://jonlennartaasenden.wordpress.com/2018/10/30/leaving-the-smart-company/
  25. 0 points
    IElite

    Yikes!!!

    @Igor Savkic My intuition is that this will fold. It seems all the team members are only part of this as a secondary project to what they are actually involved in. One only has to look at the history of this site. On this forum, it's the same 4 or 5 people who actively use the product. Hardly any team members ACTIVELY use the forum to answer questions (aside from @jarto & @lennart ) and when they do, it seems to be very selective. I have, I don't know, 4 questions, that no one has touched except @lynkfs who I am sure isnt a team member (maybe I'm wrong). There seems to be no marketing, social networking, or articles being written (except when Jon writes them and posts them on his personal page). They haven't done ANY new documentation for 3.0 (and the old was never completed either). The book that was started was never finished. The team member that started it said that his other project was more important. In the overall scheme of things, the product (as great as it is), never did live up to its name. It really is not a tool for creating applications for smartphones. It has a LONG way to go to be able to be known for that. I mean, it can do that, but NOT as EASY as the web page portrays it. However, It is a great tool for creating websites (that need a lot of logic and functionality that are too hard to program from NON-JAVASCRIPT experts). It is a shame. I do hope that this project continues to live and improve, BUT, i am not betting on it that it does.
×