Jump to content

IElite

Members
  • Content Count

    1,209
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by IElite

  1. IElite

    TW3StringGrid is available

    @tristan You will need to create your own / derive your own column from TW3StringGridColumn located in the unit SmartCL.Controls.StringGrid. Take a look at the SmartCL.Controls.StringGrid unit and see how for example, the button column (TW3StringGridButtonColumn) is created TW3StringGridButtonColumn = class(TW3StringGridColumn) protected function GetClasses: String; override; public constructor Create; override; function GenerateHtml(GridLine: TW3RenderedGridLine; ColumnIndex, CurrentLeft: Integer): String; override; procedure SetColumnEvents(Sender: TW3CustomStringGrid; GridLine: TW3RenderedGridLine; ColumnIndex: Integer); override; end; { TW3StringGridButtonColumn } constructor TW3StringGridButtonColumn.Create; begin FBaseClass := 'TW3Button'; AlignText := taLeft; VAlign := tvCenter; BorderType := btLightBorderRight; BackgroundType := bsNone; end; function TW3StringGridButtonColumn.GenerateHtml(GridLine: TW3RenderedGridLine; ColumnIndex, CurrentLeft: Integer): String; begin var ItemId:=Grid.Handle.id+'_row_'+IntToStr(GridLine.DataIndex)+'_btncol_'+IntToStr(ColumnIndex); GridLine.ItemIds.Add(ItemId); result:='<input id="'+ItemId+'" type="button" class="'+GetClasses+'" style="visibility: visible; display: inline-block; overflow: hidden; left: '+IntToStr(CurrentLeft)+'px; position: absolute; width: '+IntToStr(Width)+'px; height: 100%;border-radius: 0px;" value="'+TString.EncodeTags(Grid.Cells[GridLine.DataIndex,ColumnIndex])+'"</input>'; end; function TW3StringGridButtonColumn.GetClasses: String; begin result:=inherited GetClasses+' TW3ButtonBackground'; end; procedure TW3StringGridButtonColumn.SetColumnEvents(Sender: TW3CustomStringGrid; GridLine: TW3RenderedGridLine; ColumnIndex: Integer); // Note: This is used by the combo box too var cHandle: THandle; begin try cHandle := GridLine.FixedCols.Handle.GetChildById(GridLine.ItemIds[ColumnIndex]); if not (cHandle) then cHandle := GridLine.ScrollableCols.Handle.GetChildById(GridLine.ItemIds[ColumnIndex]); cHandle['oninput'] := @Sender.HandleDataChanged; except end; end;
  2. IElite

    Issue with DEVELOPMENT-branch (was BETA) building APP

    I am using the latest and greatest - current development update 3.1.0.88 see attached project testproj.zip
  3. IElite

    Issue with DEVELOPMENT-branch (was BETA) building APP

    so does this: procedure TForm1.InitGrid; var Col_ProjectId: TW3TextColumn; begin Col_ProjectId := TW3TextColumn.Create(W3Grid1 as IW3ColumnsControl); Col_ProjectId.Header.Caption := '#'; Col_ProjectId.Header.Alignment:= taCenter; Col_ProjectId.Alignment := taCenter; Col_ProjectId.Width:= 100; W3Grid1.Columns.Add(Col_ProjectId); end; procedure TForm1.InitializeObject; begin inherited; {$I 'Form1:impl'} InitGrid; end;
  4. IElite

    Issue with DEVELOPMENT-branch (was BETA) building APP

    This works for me just fine. Not sure where you are calling InitGrid from procedure TForm1.W3Button1Click(Sender: TObject); var Col_ProjectId: TW3TextColumn; begin Col_ProjectId := TW3TextColumn.Create(W3Grid1 as IW3ColumnsControl); Col_ProjectId.Header.Caption := '#'; Col_ProjectId.Header.Alignment:= taCenter; Col_ProjectId.Alignment := taCenter; Col_ProjectId.Width:= 100; W3Grid1.Columns.Add(Col_ProjectId); end;
  5. IElite

    Building an application

    Use PhoneGap to package your project and convert to Android If you search for PhoneGap in this forum you should find a lot of threads related to it. However, I would start with the little tutorial by @jarto
  6. IElite

    Radiogroup - change items text

    There are a number of controls that do this ..i.e. have a index (array property) and then a separate property for the list of controls (e.g. RadioButtons: TW3RadioGroupItems in Delphi there is not a string array it would be something like items: TW3RadioGroupItems instead and there would be no Items: TStrArray I am sure there is a reason for this and maybe @jarto can enlighten us
  7. IElite

    Radiogroup - change items text

    W3RadioGroup1.RadioButtons[0].Label.Caption:= 'it does not work';
  8. How do you send requests from client to server? for example, if I have the example node project code procedure TNodeProgram.HandleRequest(Sender: TObject; const Request: TNJHttpRequest; const Response: TNJHttpResponse); var content: String; begin if (Request.Url = '/test') AND (Request.Method = 'POST') then begin // end; end; what UNIT in the RTL holds the classes for creating objects to make requests to the server? if I had the following Button onClick event, how would I send a request to my server procedure TForm1.W3Button1Click(Sender: TObject); begin end; Do i use TW3HttpRequest from the SmartCL.Net.Http.pas unit?
  9. IElite

    Responsive Design

    Can we see how you used the CSS grid?
  10. IElite

    Send requests to Node.js server from client?

    My ultimate goal is to do the following: 1.) Deploy JSON file with Client. Includes data and file version number { "Example": { 'fileVersion': 1.01 "data": [...] } } 2.) On Client startup, if there is a connection to do so, send a request to the server to see if the file version has changed. 3) If file version has changed, send back the new file ? is this possible? would the file be able to be written on the client side?
  11. IElite

    Send requests to Node.js server from client?

    @lynkfs I guess i was expecting to see both the request and the response in the Dev Tools? I really am only seeing the response, which i have to click on response tab to see
  12. IElite

    Send requests to Node.js server from client?

    looking for example on how to send data back in response
  13. IElite

    Send requests to Node.js server from client?

    @lynkfs It looks like my code is recongnizing the URL just fine. It is showing '/test in my debug line see attached screenshot
  14. IElite

    Send requests to Node.js server from client?

    How do I send response back? procedure TNodeProgram.HandleRequest(Sender: TObject; const Request: TNJHttpRequest; const Response: TNJHttpResponse); var content: String; begin writeln('Url: ' + Request.Url + ';Method: ' + Request.Method); if (Request.Url = '/test') AND (Request.Method = 'GET') then begin //retrieve Request data Request.Handle.on('data', procedure(data: variant) begin writeln('Request.Handle.onData'); content:= data; end); Request.Handle.on('end', procedure(data: variant) begin //something here ? writeln('Request.Handle.onEnd'); response.statusCode:= 200; response.&End(''); Request.Free; Response.Free; end); end; end;
  15. IElite

    Send requests to Node.js server from client?

    Update Maybe something like this (i found in forum) var AResponse: string; var Req:= TW3HttpRequest.Create; Req.OnDataReady := procedure(Sender: TW3HttpRequest) begin AResponse := Sender.ResponseText; end; Req.RequestHeaders.Add("Content-Type","text/plain"); Req.Open('GET', 'http://127.0.0.1:3000/test'); Req.send; writeln(AResponse);
  16. IElite

    RoadMap 2019

    @jarto Client \ Server A.) Example: Working with files? 1.) SMS Program uses a file of data (JSON) that is deployed with the program. But wants to update it if there is a newer version on the server. 2.) Client requests value from the file on the server / Client modifies the value on the server, B.) Example: CRUD on a Database? MongoDB? 1.) The client retrieves rows from Database 2.) Client Inserts a row in the database 3.) Client Edits row in the database 4.) Client Deletes row in the database showing the example request (GET, POST, etc) calls from Client and the Server receiving, acting upon, and responding to these calls
  17. What are the options for creating files and writing to files on the server side? using the TNJHTTPServer; In Delphi, of course, we would use the following methods AssignFile(); ReWrite(); Reset(); ReadLn(); WriteLn(); Eof() CloseFile(); Are these available in SMS? Or do we need to require the file system javascript library 'fs'?
  18. IElite

    Server Side file creation and writing to files

    ohhhh shoot, i just found NodeJS.fs and it looks like everything is there, including the writefile routine NodeFsAPI.writeFileSync('message.txt', 'dummy stuff');
  19. IElite

    TW3StringGrid is available

    @sibar You can use the built-in theme background from SmartCL.Theme.pas example: W3StringGrid1.RowBackgroundType:= bsDisplayBackground; W3StringGrid1.RowOddBackgroundType:= bsDisplayBackground; here are you choices/options TW3ThemeBackground = ( bsNone = 0, bsDisplayBackground, bsControlBackground, bsContainerBackground, bsListBackground, bsListItemBackground, bsDecorativeListItemBackground, bsListItemSelectedBackground, bsEditBackground, bsButtonBackground, bsDialogButtonBackground, bsDecorativeBackground, bsDecorativeInvertBackground, bsDecorativeDarkBackground, bsToolContainerBackground, bsToolButtonBackground, bsToolControlBackground, bsTransparentBackground ); you can do the same with the columns procedure TForm1.InitializeObject; var C: TW3StringGridColumn; begin inherited; {$I 'Form1:impl'} fSG:= TW3StringGrid.Create(self); C:= fSG.AddColumn; C.Caption:= 'One'; C.Width:= 100; c.BackgroundType := bsDecorativeDarkBackground; end;
  20. I can lean either way. I am not against keeping "W3" nor would I be against getting rid of it.
  21. IElite

    RoadMap 2019

    @jarto Myself, I am more interested in examples of client/server related projects (e.g. writing SMS clients for mobile devices which talk to node.js server).
  22. IElite

    RTL Search

    I use a free version of FileSeek
  23. IElite

    css styling

    Thanks, that did explain it better. Thanks for taking the time. I am interested in examining it further for sure.
  24. IElite

    css styling

    Im confused as well...I see nothing related to a 'card'
  25. IElite

    RoadMap 2019

    I just want to see more documentation and examples geared towards mobile devices.....i mean, it is called Smart Mobile Studio
×