Jump to content
uniGUI Discussion Forums


uniGUI Subscriber
  • Content Count

  • Joined

  • Last visited

  • Days Won


Kattes last won the day on March 30

Kattes had the most liked content!

Community Reputation

26 Excellent

About Kattes

  • Rank

Recent Profile Visitors

464 profile views
  1. Kattes

    Problem with TUniComboBox, with Property: Font

    Thank you, That finally also worked for me ... Kattes procedure TMainForm.UniFormCreate(Sender: TObject); procedure AdjustDropDownFont(CB: tUniComboBox); begin // Only works if ItemIndex=0 is or if UniComboBox Style is csSimple ??? with CB do ClientEvents.UniEvents.Values['beforeInit'] := 'function beforeInit(sender, config) {'+ ' config.listConfig = {'+ ' tpl: new Ext.XTemplate('+ ' ''<tpl for="."><div class="x-boundlist-item" style="'+ Font.ToStyleString(True) +'">{val}</div></tpl>'', {'+ ' disableFormats: true'+ ' }'+ ' )'+ ' };'+ '}'; end; begin AdjustDropDownFont(UniComboBoxZahlart); AdjustDropDownFont(UniComboBoxPrintTicket); end;
  2. Kattes

    Problems with WebApplication

    Sorry, but I was too busy to care about the test case, but will do that as soon as I can... Nevertheless my issue #2 - the full screen mode problem - is solved! I found out that the full screen mode will be left only if an application does not run on a SSL connection. After I published my application on my web server (which uses SSL) the described problem #2 is gone.
  3. Kattes

    Chart Gauge for mobile

    Hi Marlon, Very nice idea! I will probably use it in one of my next projects - Thank you! https://www.w3schools.com/code/tryit.asp?filename=GFL1T4YGPANV
  4. Kattes

    Problems with WebApplication

    Hi Sherzod, I am using a P20 Pro running Android 9 and Chrome as shown above for my tests but also saw same behavior on the Apple iPhone from a friend. I will make tomorrow a test cause fore the Google Font issue.
  5. Kattes

    fontawsome & theme problems

    Hi, Directly put on the form where you want to use fontawsome a UniHTMLFrame with the following HTML content: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.9.0/css/all.css"> </head> <body> </body> </html> At least that worked fine for all of my projects.
  6. Kattes

    Problems with WebApplication

    Hi again, I recently started with my first Web-Application for mobile devices using the special mobile Components of Unigui. In general everything works fine, but I am facing two problems: I am not able to get use of Google Fonts in mobile applications - I tried all the tricks that worked for standard UniGui applications, but for whatever reason I cannot get the Google Fonts working under mobile environment. Full Screen Mode - After putting a link of my App on the home screen of my mobile it starts in full screen mode - so this works as expected. But whenever using UnimEdit, i.e. entering some text in this control it will leave full screen mode immediately , what is likely a bug. You can test this behavior quite easy with http://prime.fmsoft.net/demo/touch/mdemo65.dll/m. Just add it to your home screen of your smartphone and explore the Edit Components after starting in full screen mode.You will probably see the same problem. I hope that somebody knows a trick to avoid this? Best regards, Kattes
  7. Kattes

    Problem With ISAPI

    Although it was a lot of work to change everything to FireDAC, it seems to have been worth the effort! All problems I described before are gone! So I would like to warn everyone to use ZEOS in their uniGui projects. Something seems to be incompatible and can cause problems that are extremely difficult to understand. Once again, a big thank you to all of you who joined me on the bug search. Kind regards, Carsten - aka Kattes
  8. Kattes

    Problem With ISAPI

    Okay, I just found another important piece of the puzzle. The problem only occurs if the visual application is also running and accessing the same database. In this case the access of the second application is extremely slowed down. We are not talking about a lot of traffic. This happens already when only one visual and one non-visual application connects to the same database at the same time, but I have no idea how to prevent this. Perhaps I will try to change to Firedac instead of using ZEOS - what do you think?
  9. Kattes

    Problem With ISAPI

    @Jean Marc, I followed your advice and changed the complete server code to make it even more thread-safe (although I thought ZEOS was already thread-safe). I also tested the other solution I mentioned before overnight, which already helped to make it more stable, but that ended up with another strange effect. Everything worked fine overnight, but the response times (time between API calls and JSON's response to the PHP server) became extremely high - about 10 seconds! So let's see what will be the outcome of changing the complete code and giving each API request its own DB connection. Whatever the outcome will be, I really appreciate your help JM. @mierlp, I also want to thank you for this additional inspiration. If my last changes do not solve my problem, I will investigate in the direction you suggest.
  10. Kattes

    Problem With ISAPI

    Hi Jean-Marc, So you would suggest to keep the DB connection in the state "connected := false" as long as I do not enter UniGUIServerModuleHTTPCommand routine - so changing its state here on entry to true and before leaving to false again?
  11. Kattes

    Problem With ISAPI

    The PHP App is fed with JSON strings in a normal case, which were triggered by the API calls coming from the PHP app. But sometimes it happens that an API call does not get any response. This status of not getting any responses can stay for some minutes up to an hour. But then its starting to work again, which is very strange.
  12. Kattes

    Problem With ISAPI

    Hello, I am a bit clueless with a big problem I need to solve ASAP. The current situation is as followed. I am running on a Windows 2016 server two uniGui Applications. One works as a non visual DB server, which feeds an external PHP Shop Application with information like articles , prices, etc. The other one is a Backend Application, which handles all the articles from the shop. So this behaves more like the standard uniGui Application we all know, using all the nice uniGui visual components we all love. But my problem comes from the non visual application, which sometimes is not reachable, which means API calls from the PHP application do not get any response. Main part of this application is the Methode "UniGUIServerModuleHTTPCommand", which looks like this: procedure TUniServerModule.UniGUIServerModuleHTTPCommand(ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean); var sJSON, sParam, sRequest, s : string; i : integer; bValidRequest : boolean; begin // Examples of Supported APIs: // http://localhost:8077/v1/prom?ID=47 >> Get Details of selected event with the ID 47 // http://localhost:8077/v1/Prom/CheckAvail >> Check if server is online // http://localhost:8077/v1/Proms >> Get List of current events bValidRequest := false; if pos('/v1', ARequestInfo.URI) = 1 then // API Call found !! begin AResponseInfo.ResponseNo := 200; Handled := True; if ARequestInfo.AuthExists and (ARequestInfo.AuthPassword='wshgdaizuddsfrtG12') and (ARequestInfo.AuthUsername='XCloud') then begin sRequest := Uppercase(ARequestInfo.URI); if sRequest = Uppercase('/v1/Prom/CheckAvail') then // Checking the API accessibility during the purchase process begin bValidRequest := true; sJSON := '{"status": "online"}'; AResponseInfo.ContentText := sJSON; LogPayServer('HTTP Request "CheckAvail"', sJSON); end; if sRequest=Uppercase('/v1/Proms') then // Returns a list of all currently active proms in JSON format. begin bValidRequest := true; sJSON := GetEventsAsJSON; LogPayServer('HTTP Request "Proms"', sJSON); AResponseInfo.ContentText := sJSON; end; if sRequest=Uppercase('/v1/Prom/OrderConfirmed') then // Called after the sales process has been completed begin sJSON := ARequestInfo.RawHeaders.Values['OrderInfo']; // Process received order information LogPayServer('HTTP Request "OrderConfirmed"', sJSON); if AddJsonOrderInformationToDB2(sJSON) then begin LogPayServer('HTTP Request "OrderConfirmed"', 'bValidRequest=true'); bValidRequest := true; AResponseInfo.ContentText := '{"status": "processed"}'; // if everything is OK, than return follwing: end else LogPayServer('HTTP Request "OrderConfirmed"', 'bValidRequest=false'); end; if sRequest=Uppercase('/v1/Prom') then begin sParam := ARequestInfo.Params.Values['VoucherVal']; // Request to check the value of the given voucher if sParam <>'' then begin bValidRequest := true; // Get from DB the value of the given voucher and return it to JSON sJSON := '{"voucher value": '+GetVoucherValue(ZConnectionServerModule, sParam)+'}'; AResponseInfo.ContentText := sJSON; LogPayServer('HTTP Request "VoucherVal" ('+sParam+')', sJSON); end; sParam := ARequestInfo.Params.Values['Id']; // Returns information of the event, which was selected via its Id if sParam <>'' then begin bValidRequest := true; sJSON := GetEventDetailsJSON(sParam); AResponseInfo.ContentText := sJSON; LogPayServer('HTTP Request "Prom?Id=?"', sJSON); end; end; if not bValidRequest then begin AResponseInfo.ContentText := '<html>Not supported API-Call; Please check API documentation!</html>'; LogPayServer('HTTP Request "API ERROR"', ARequestInfo.URI); end; end else begin AResponseInfo.ContentText := '<html>Wrong or missing PW; Please use Basic Auth!</html>'; LogPayServer('HTTP Request "Invalid Caller"', 'PW / Auth wrong'); end; end; end; The Internalisation Methode is also simple and straightforward: procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin sHTML1 := tStringList.Create; sHTML2 := tStringList.Create; with ZConnectionServerModule do begin Connected := False; LibraryLocation := StartPath+'files\dll\libmysql.dll'; Protocol := 'mysql'; HostName := 'localhost'; Port := 3306; Database := 'xxxxx'; User := 'root'; Password := '-----'; Connected := true; end; LogPayServer('UniGUIServerModuleCreate','Server V'+FileVersionGet(StartPath+'AbiPaymentServer.dll')+' Created and running'); end; I am mentioning it here because as you can see it also uses a Log-Call, which writes information to a log table within my MySQL database and I can find randomly entries in the log, which show me that the application was restarted. At the moment the traffic handled by this Application is very low (less than 10 API calls per hour). Nevertheless I have the problem that the Application does not response and is not reachable sometimes. This is something I have not seen as long as I used it as standalone Application. Any comments or help are more than welcome!
  13. Thank you for this information, which solved my problem with Mime-Types, partially for my Windows 2016 server. Next to this I also needed to adjust supported Mime Types in the IIS Manager (see screen shot below).
  14. But don not waste too much of your time on it. I also found a different solution which is suitable for me . unit Main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUIRegClasses, uniGUIForm, uniPanel, uniGUIBaseClasses, uniButton, Vcl.Imaging.jpeg, uniImage, uniEdit, uniSpinEdit; type TMainForm = class(TUniForm) UniButton1: TUniButton; UniPanel1: TUniPanel; UniImage1: TUniImage; UniEdit1: TUniEdit; UniEdit2: TUniEdit; UniSpinEdit1: TUniSpinEdit; procedure UniButton1Click(Sender: TObject); private { Private declarations } bToggle : boolean; public { Public declarations } end; function MainForm: TMainForm; implementation {$R *.dfm} uses uniGUIVars, MainModule, uniGUIApplication; procedure FadeInOut(xControl: TUniControl; bFadeOut: boolean; const Duration : integer = 300); begin if bFadeOut then xControl.JSInterface.JSCode(#1'.el.fadeOut({duration: '+IntToStr(Duration)+'});') else xControl.JSInterface.JSCode(#1'.el.fadeIn({duration: '+IntToStr(Duration)+'});') end; function MainForm: TMainForm; begin Result := TMainForm(UniMainModule.GetFormInstance(TMainForm)); end; procedure TMainForm.UniButton1Click(Sender: TObject); begin bToggle := not bToggle; FadeInOut(UniPanel1, bToggle, UniSpinEdit1.Value); FadeInOut(UniImage1, bToggle, UniSpinEdit1.Value); end; initialization RegisterAppFormClass(TMainForm); end.
  15. Hi Sherzod, Please find attached a little testcase. Thank you and kind regards, Carsten UniGuiAnimattedPanel.zip