Jump to content

Ricardo

Members
  • Content Count

    40
  • Joined

  • Last visited

Everything posted by Ricardo

  1. Thx. I have commented on the line "background: <? Pas = clBackground?>" and added .TW3Button: disabled { background: anyColor; } and it works perfect.
  2. Hi. I have this css .TW3Button { display: inline-block; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; cursor: pointer; border: 1px solid #018dc4; -webkit-border-radius: 3px; border-radius: 3px; font: normal 16px/normal Verdana, Geneva, sans-serif; color: rgba(255,255,255,0.9); -o-text-overflow: clip; text-overflow: clip; background: #007FFF; -webkit-box-shadow: 3px 3px 4px 0 rgba(0,0,0,1) ; box-shadow: 3px 3px 4px 0 rgba(0,0,0,1) ; text-shadow: -1px -1px 0 rgba(15,73,168,0.66) ; -webkit-transition: all 300ms cubic-bezier(0.42, 0, 0.58, 1); -moz-transition: all 300ms cubic-bezier(0.42, 0, 0.58, 1); -o-transition: all 300ms cubic-bezier(0.42, 0, 0.58, 1); transition: all 300ms cubic-bezier(0.42, 0, 0.58, 1); } .TW3Button:hover { background: #0048ff; } .TW3Button:focus { background: #178c19; } .TW3Button:DisabledState { background: #F0DC82; } with this result I've also tried with .TW3Button: Disabled. How to assign any background color to disabled button?
  3. Can I modify the RTL so that this value is always assigned? Or, how to find all the TW3EditBox, with a loop, of a form and change this value?
  4. At the moment, I'm using the example of the "Tabs, Scrolling and ListBox" folder, to continue (I need to finish the application this summer). But as soon as the grid is, I update everything. Thank you very much.
  5. It is not necessary, but it would be convenient. The idea is to show a list (code, customer or product name, etc. and have an onclick event to open the selected element), which is resized according to the size of the screen ... In short, make the user experience nicer. It would be fantastic!. The possibilities are many: change the color of each cell, source, etc. But, as I say, the only essential thing is: responsive columns and the onclick event. Can I expect it to be available for some date? Very, very, thanks!!
  6. Hello again. Is there any way to show a grid with the resizeable columns? I have tried TW3Grid adding columns and assigning their sizes. In resize I have assigned a percentage to each column (colCode = 5, colName = 80, colState = 15, for example) and I change the width to each of the columns: Grid1.Columns [n] .Width: = Grid.ClientWidth * colCode div 100, etc. The new columns are displayed correctly but those that already exist do not (it seems that the rows are simple concatenations of text). I do not know if it can be done with TW3CustomDBgrid, but I have not found examples. It is also important that they respond to the onClick event (if it can be per cell better than per row, if possible). Maybe it is possible to use listview with several columns?
  7. I do not have the problem in the registration of the forms, but in the first way that I indicate, if it works but in the second it does not. That is, when I follow these instructions (https://jonlennartaasenden.wordpress.com/?s=header) everything works correctly. But if I want to separate the creation of the header and its visualization, it does not work. To fix it, I have moved the createMenu execution to the Login form, after the password verification. (I guess I do not explain myself very well, I use Google translator and something will be lost)
  8. HI. I have this code and works ok (on application declaration unit) FHeader := TW3HeaderControl.Create(Display); FHeader.SetBounds(5, -10, 100, 40); FHeader.Caption := 'xxxxxx'; FHeader.BackButton.Caption := '&larr;'; //arrow left FHeader.NextButton.Caption := '&#9776;'; //hamburger menu FHeader.NextButton.OnClick := createMenu; ... procedure TApplication.CreateMenu(Sender: TObject); begin FfrmMenu := TfrmMenu.Create(Application.Display.View); FfrmMenu.Name := 'MainMenu'; Application.RegisterFormInstance(FfrmMenu, true); Application.GotoForm('MainMenu', feFromRight); Application.GotoForm('MainMenu', feFromRight); end; (the menu appears when i press next button, but the header is visible on login form .) And this one that does not FHeader := TW3HeaderControl.Create(Display); FHeader.SetBounds(5, -10, 100, 40); FHeader.Caption := 'xxxxxx'; FHeader.BackButton.Caption := '&larr;'; //arrow left FHeader.NextButton.Caption := '&#9776;'; //hamburger menu FHeader.NextButton.OnClick := OpenMenu; ... createMenu(Application) procedure TApplication.CreateMenu(Sender: TObject); begin if FfrmMenu = nil then begin ShowMessage('Control 0'); //show message FfrmMenu := TfrmMenu.Create(Application.Display.View); FfrmMenu.Name := 'MainMenu'; Application.RegisterFormInstance(FfrmMenu, true); end; end; procedure TApplication.OpenMenu; begin ShowMessage('Control 1'); //show message Application.GotoForm('MainMenu', feFromRight); //don't show form menu ShowMessage('Control 2'); //show message end; The objective is to open a login form with the header not enabled and, if the password is correct, enable the header and see a menu when clicking on the next button. I do not see what I'm doing wrong
  9. Ricardo

    button click

    Hi. I have entered the error. If you declare a FLayout in private and then add this in Resize: FLayout.Resize (Self); the buttons can not be pressed with the mouse or with your finger. Solution: Add on form Activete: FLayout: = Layout.Client (Layout.Margins (3) .Spacing (3), [ Layout.Top (W3Label1), ... ]); FLayout.Resize (Self); and, in Resize if assigned (FLayout) then FLayout.Resize (Self); I do not know if it is an bug or ignorance on my part.
  10. Ricardo

    button click

    Hi. If I insert a TW3Button and assign it an event (by double clicking on OnClick in the object inspector) the onClick event is not triggered by clicking with the mouse or with the finger on the mobile. If I set the focus on the button and press Enter it will fire. I've also tried assigning it to an onclick event in InitializebOject What do I need to add?
  11. Ricardo

    Error updating

    Ignoring: is solved. An instance of smart blocked it (it was running after an unexpected shutdown)
  12. Ricardo

    Rest Api

    For if it helps someone. The error occurred when trying to connect to the server using xxx.xxx.xxx.xxx:puerto. If I connect through Apache, the error does not occur (something about CORS)
  13. Hi. I just tried it with chrome, edge and opera and it works correctly. I was just testing it with firefox (desktop and mobile) and it is with this that it works badly. Version: 3.0.0.209 Thx
  14. Ricardo

    Rest Api

    Hi. I'm trying TRestApi and I have a problem with external browsers I have tried using TRESTApi.Post, the connection is established and works Ok using the internal browser: the server receives a POST and send me data. But if I use it from firefox or chorme, the server receives an OPTIONS (no GET, no POST) and gets into an infinite loop until I close the page. If this did not happen I could forget about the sockets, I think. With Rest the code i use is: try FRestAPI := REST[IP, URL].OnError(gestionError); FRestAPI.Call .Header('Content-Type', 'application/json') .Header('Authorization',Token) .NoRandomize .OnDone( lambda(http) parsea(http.ResponseText); end ) .Post(resultado); finally FRestApi.Free; end; Usin external navegator, the server receive this. No return data and enter on an infinite loop. OPTIONS /api/myurl HTTP/1.1 Host: 192.168.1.170:8085 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Access-Control-Request-Method: POST Access-Control-Request-Headers: authorization,content-type Origin: http://192.168.1.101:8090 Connection: keep-alive usin internal navigator, the server receive this POST /api/ myurl HTTP/1.1 Host: 192.168.1.170:8085 Connection: keep-alive Content-Length: 45 Accept: */* Authorization: ;A2 Content-Type: application/json Origin: http://192.168.1.101:8090 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36 Referer: http://192.168.1.101:8090/index.html Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8
  15. Ricardo

    POST by Sockets

    Sorry. I have connected to the url that you indicate to me (wss: //echo.websocket.org) and it has not given me any error, and show the message "Socket Connected!" . But when I connect to "myurl" I keep getting the same error. I'm sure the problem is that the server receives a GET and not a POST.
  16. Ricardo

    POST by Sockets

    Yes, i get the "Socket connected" message
  17. Ricardo

    POST by Sockets

    Hi. I have moved events to InitializeObject procedure TForm1.InitializeObject; FSocket := TW3WebSocket.Create; FSocket.OnOpen:= Procedure (Sender:TW3WebSocket) begin showmessage('Socket connected'); //Sender.Write("your data here"); end; FSocket.OnClosed:=procedure (Sender:TW3WebSocket) begin showMessage("Socket disconnected"); end; FSocket.OnMessage:= Procedure (Sender: TW3WebSocket; Message: TWebSocketMessageData) begin showMessage("Data received:" + Message.mdText); end; FSocket.OnError:= procedure (Sender: TW3WebSocket; const Error: JEvent) begin showMessage("Error"); end; and execute this code in a button click try FSocket.Connect('ws://192.168.1.170:8085/api/myurl') {,[],nil);} except On E : Exception do showMessage(E.Message); end; FSocket.Write(jso.ToJson); the program never shows the connected message ("'Socket connected"). The log show this: WebSocket connection to 'ws://192.168.1.101/api/myurl' failed: Error during WebSocket handshake: Unexpected response code: 200 [line #652] or WebSocket connection to 'ws://192.168.1.170:8085/api/myurl' failed: Error during WebSocket handshake: net::ERR_CONNECTION_CLOSED [line #652] Remember that the server waits for a POST request but receives a GET on FSocket.Connect(). The error has to occur because of this, I think
  18. Ricardo

    POST by Sockets

    I used both: FSocket.Write(jso.ToString); //try this FSocket.Write(jso.ToJson); //and this with the same result
  19. Ricardo

    POST by Sockets

    Ok, now the socket connection is established. But the server is waiting for a POST with a JSON. I have tried this var jso := TJSonObject.Create; jso.AddOrSet("Tabla", "Login" ); jso.AddOrSet("Valor", trim(edCodigo.Text)); jso.AddOrSet("Clave", trim(edClave.Text)); try FSocket.Connect('ws://192.168.1.170:8085/api/myurl',[],nil); except On E : Exception do showMessage(E.Message); end; FSocket.Write(jso.ToString); //try this FSocket.Write(jso.ToJson); //and this The server receive this: GET /api/myurl HTTP/1.1 Host: 192.168.1.170:8085 Connection: Upgrade Pragma: no-cache Cache-Control: no-cache Upgrade: websocket Origin: http://192.168.1.101:8090 Sec-WebSocket-Version: 13 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8 Sec-WebSocket-Key: SBmnhjj2RfnqapogFofwKA== Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits no json received
  20. Ricardo

    W3webSocket

    I have deleted all the folders and saved the license. I have unzipped the zip file and run smartupdate. The only available channel was ALPHA and it has been updated to 2.9.9.125. I have run smartupdate again. The only channel was still ALFA. I modified the file Settings.ini and changed the channel to BETA and re-executed. 12 files have been updated and the version is now 3.0.0.209. I have run again and it still did not work. BUT, I have captured the exception and the error was in the protocol: the address http: // xxxx was not valid. I changed to ws: // xxx and it works (nothing to do with the rtl).
  21. Ricardo

    W3webSocket

    error: Uncaught #<Object> [line #652]
  22. Ricardo

    W3webSocket

    I have uninstalled and then instaled to update to version 3.0.0.209. the line FSocket.Connect('http://192.168.1.170:8085/api/myurl'); now compile, but donĀ“t work. show my code: type TMyJsonCommand = record Tabla: String; Codigo: String; Clave: String; end; procedure TForm1.W3Button3Click(Sender: TObject); var JsonToSend: TMyJsonCommand; begin var FSocket: TW3WebSocket; FSocket := TW3WebSocket.Create; FSocket.OnOpen:= Procedure (Sender:TW3WebSocket) begin showmessage('Socket connected'); Sender.Write("your data here"); end; FSocket.OnClosed:=procedure (Sender:TW3WebSocket) begin showMessage("Socket disconnected"); end; FSocket.OnMessage:= Procedure (Sender: TW3WebSocket; Message: TWebSocketMessageData) begin showMessage("Data received:" + Message.mdText); end; FSocket.OnError:= procedure (Sender: TW3WebSocket; const Error: JEvent) begin showmessage("Socket has errors"); end; FSocket.Connect('http://192.168.1.170:8085/api/myurl'); end;
  23. Ricardo

    W3webSocket

    I have not updated,I have done a new instalation with the 3.0.0.201 In the uses area: System.Types, System.Types.Convert, System.Objects, System.Time, SmartCL.System, SmartCL.Time, SmartCL.Graphics, SmartCL.Components, SmartCL.FileUtils, SmartCL.Forms, SmartCL.Fonts, SmartCL.Theme, SmartCL.Borders, SmartCL.Application, SmartCL.Controls.Label, SmartCL.Controls.EditBox, SmartCL.Controls.Button, SmartCL.Layout, System.Encoding, System.JSON, SmartCL.net.http, SmartCL.net.Rest, SmartCL.Net.websocket; I use it like that: var FSocket: TW3WebSocket; FSocket := TW3WebSocket.Create; FSocket.Connect('http://192.168.1.170:8085/api/pedidoslogistic',[]); //does not compile if i try to FSocket.Connect('http://192.168.1.170:8085/api/pedidoslogistic',[],nil); //Complile but error in execution FSocket.Connect('http://192.168.1.170:8085/api/pedidoslogistic',); //does not compile I'm missing some unit? Can not the funcions be overloaded in RTL? This code does not compile either (error with JEvent): FSocket.OnError:= procedure (Sender: TW3WebSocket; const Error: JEvent) begin writeln("Socket has errors"); end; I have not updated,I have done a new instalation with the 3.0.0.201 In the uses area: System.Types, System.Types.Convert, System.Objects, System.Time, SmartCL.System, SmartCL.Time, SmartCL.Graphics, SmartCL.Components, SmartCL.FileUtils, SmartCL.Forms, SmartCL.Fonts, SmartCL.Theme, SmartCL.Borders, SmartCL.Application, SmartCL.Controls.Label, SmartCL.Controls.EditBox, SmartCL.Controls.Button, SmartCL.Layout, System.Encoding, System.JSON, SmartCL.net.http, SmartCL.net.Rest, SmartCL.Net.websocket; I use it like that: var FSocket: TW3WebSocket; FSocket := TW3WebSocket.Create; FSocket.Connect('http://192.168.1.170:8085/api/pedidoslogistic',[]); //does not compile if i try to FSocket.Connect('http://192.168.1.170:8085/api/pedidoslogistic',[],nil); //Complile but error in execution FSocket.Connect('http://192.168.1.170:8085/api/pedidoslogistic',); //does not compile I'm missing some unit? Can not the funcions be overloaded in RTL? This code does not compile either (error with JEvent): FSocket.OnError:= procedure (Sender: TW3WebSocket; const Error: JEvent) begin writeln("Socket has errors"); end;
×
×
  • Create New...