Jump to content
uniGUI Discussion Forums

Leaderboard


Popular Content

Showing content with the highest reputation since 11/16/18 in all areas

  1. 3 points
    Another from the series "All about..." All about a Login Form with a Background video Project Repository for a Initial Login Screen for desktop projects with background video and informative DIV and pause / play button. Adapted example from W3School (http://wwww.w3schools.com). Panel with Gradient in two colors and centralized shade to facilitate the definition of your login controls. Note that it is a borderless LoginForm and properly configured to work. Author: Fred Montier / Cetera Softwares 1- Open your IDE 2- Open the project in the Source folder and compile / execute. 3- Open your browser and go to the default address. 4- EX: http: // localhost: 8077 Future versions like this example and others you will find easily in the portal http://www.unigui.com.br Source code right below... have fun. Projeto24-LoginVideoInBackground.rar
  2. 2 points
    For people who is having problems with download the zip file. UExportExcel.pas //============================================================================= // TDataSet to Excel without OLE or Excel required // Mike Heydon Dec 2002 // Adapted to Unigui with TUniDBGrid // Mauricio Naozuka - 26/04/2018 - naozuka@gmail.com //============================================================================= unit UExportExcel; // Example // // Add uses UExportExcel // //procedure TMainForm.UniButton1Click(Sender: TObject); //var url, filename, reportname : String; // exportExcel: TDataSetToExcel; // i: integer; //begin // reportname := 'ExcelReport'; // url := UniServerModule.LocalCacheURL+name+'.xls'; // filename := UniServerModule.NewCacheFileUrl(false, 'xls', reportname, '', url); // // exportExcel := TDataSetToExcel.Create; // exportExcel.WriteFile(filename, UniDBGrid1); // FreeAndNil(exportExcel); // UniSession.SendFile(filename, reportname+'.xls'); //end; interface uses Windows, SysUtils, DB, Math, uniBasicGrid, uniDBGrid; type // TDataSetToExcel TDataSetToExcel = class(TObject) protected procedure WriteToken(AToken: word; ALength: word); procedure WriteFont(const AFontName: Ansistring; AFontHeight, AAttribute: word); procedure WriteFormat(const AFormatStr: Ansistring); private FRow: word; FFieldCount: integer; FDataFile: file; FFileName: string; public constructor Create; function WriteFile(const AFileName: string; const AGrid: TUniDBGrid): boolean; end; //----------------------------------------------------------------------------- implementation const // XL Tokens XL_DIM = $00; XL_BOF = $09; XL_EOF = $0A; XL_DOCUMENT = $10; XL_FORMAT = $1E; XL_COLWIDTH = $24; XL_FONT = $31; // XL Cell Types XL_INTEGER = $02; XL_DOUBLE = $03; XL_STRING = $04; // XL Cell Formats XL_INTFORMAT = $81; XL_DBLFORMAT = $82; XL_XDTFORMAT = $83; XL_DTEFORMAT = $84; XL_TMEFORMAT = $85; XL_HEADBOLD = $40; XL_HEADSHADE = $F8; // ======================== // Create the class // ======================== constructor TDataSetToExcel.Create; begin FFieldCount := 0; end; // ==================================== // Write a Token Descripton Header // ==================================== procedure TDataSetToExcel.WriteToken(AToken: word; ALength: word); var aTOKBuffer: array[0..1] of word; begin aTOKBuffer[0] := AToken; aTOKBuffer[1] := ALength; Blockwrite(FDataFile, aTOKBuffer, SizeOf(aTOKBuffer)); end; // ==================================== // Write the font information // ==================================== procedure TDataSetToExcel.WriteFont(const AFontName: ansistring; AFontHeight, AAttribute: word); var iLen: byte; begin AFontHeight := AFontHeight * 20; WriteToken(XL_FONT, 5 + length(AFontName)); BlockWrite(FDataFile, AFontHeight, 2); BlockWrite(FDataFile, AAttribute, 2); iLen := length(AFontName); BlockWrite(FDataFile, iLen, 1); BlockWrite(FDataFile, AFontName[1], iLen); end; // ==================================== // Write the format information // ==================================== procedure TDataSetToExcel.WriteFormat(const AFormatStr: ansistring); var iLen: byte; begin WriteToken(XL_FORMAT, 1 + length(AFormatStr)); iLen := length(AFormatStr); BlockWrite(FDataFile, iLen, 1); BlockWrite(FDataFile, AFormatStr[1], iLen); end; // ==================================== // Write the XL file from data set // ==================================== function TDataSetToExcel.WriteFile(const AFilename:String; const AGrid: TUniDBGrid): boolean; var bRetvar: boolean; aDOCBuffer: array[0..1] of word; aDIMBuffer: array[0..3] of word; aAttributes: array[0..2] of byte; i: integer; iColNum, iDataLen: byte; sStrData: string; fDblData: double; wWidth: word; sStrBytes: TBytes; begin if not Assigned(AGrid) then raise Exception.Create('There is no Grid is vinculated.'); if not Assigned(AGrid.DataSource) then raise Exception.Create('There is no DataSource is vinculated to Grid ' + AGrid.Name); if not Assigned(AGrid.DataSource.DataSet) then raise Exception.Create('There is no DataSet is vinculated to DataSource ' + AGrid.DataSource.Name); bRetvar := true; FRow := 0; FillChar(aAttributes, SizeOf(aAttributes), 0); FFileName := ChangeFileExt(AFilename, '.xls'); AssignFile(FDataFile, FFileName); try Rewrite(FDataFile, 1); // Beginning of File WriteToken(XL_BOF, 4); aDOCBuffer[0] := 0; aDOCBuffer[1] := XL_DOCUMENT; Blockwrite(FDataFile, aDOCBuffer, SizeOf(aDOCBuffer)); // Font Table WriteFont('Arial', 10, 0); WriteFont('Arial', 10, 1); //WriteFont('Courier New', 11, 0); // Column widths iColNum := 0; for i := 0 to AGrid.Columns.Count-1 do begin if not AGrid.Columns[i].Visible then continue; if AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).DisplayWidth + 1 > Length(AGrid.Columns[i].Title.Caption) then begin wWidth := (AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).DisplayWidth + 1) * 256; end else begin wWidth := (Length(AGrid.Columns[i].Title.Caption) + 1) * 256; end; // Limitar o tamanho da coluna if wWidth > 80*256 then wWidth := 80*256; // if AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).DataType = ftDateTime then // inc(wWidth, 100); // if AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).DataType = ftDate then // inc(wWidth, 1050); // if AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).DataType = ftTime then // inc(wWidth, 100); WriteToken(XL_COLWIDTH, 4); BlockWrite(FDataFile, iColNum, 1); BlockWrite(FDataFile, iColNum, 1); BlockWrite(FDataFile, wWidth, 2); Inc(iColNum); end; FFieldCount := iColNum; // Column Formats WriteFormat('Geral'); WriteFormat('0'); WriteFormat('#.##0,0000'); WriteFormat('dd/mm/aaaa hh:mm:ss'); WriteFormat('dd/mm/aaaa'); WriteFormat('hh:mm:ss'); // Dimensions WriteToken(XL_DIM, 8); aDIMBuffer[0] := 0; aDIMBuffer[1] := Min(AGrid.DataSource.DataSet.RecordCount, $FFFF); aDIMBuffer[2] := 0; aDIMBuffer[3] := Min(FFieldCount - 1, $FFFF); Blockwrite(FDataFile, aDIMBuffer, SizeOf(aDIMBuffer)); // Column Headers iColNum := 0; for i := 0 to AGrid.Columns.Count-1 do begin if not AGrid.Columns[i].Visible then continue; // sStrData := FDataSet.Fields[i].DisplayName; sStrBytes := TEncoding.ANSI.GetBytes(AGrid.Columns[i].Title.Caption); iDataLen := length(sStrBytes); WriteToken(XL_STRING, iDataLen + 8); WriteToken(FRow, iColNum); aAttributes[1] := XL_HEADBOLD; //aAttributes[2] := XL_HEADSHADE; BlockWrite(FDataFile, aAttributes, SizeOf(aAttributes)); BlockWrite(FDataFile, iDataLen, SizeOf(iDataLen)); if iDataLen > 0 then BlockWrite(FDataFile, sStrBytes[0], iDataLen); aAttributes[2] := 0; Inc(iColNum); end; try AGrid.DataSource.DataSet.DisableControls; AGrid.DataSource.DataSet.First; // Data Rows while not AGrid.DataSource.DataSet.Eof do begin inc(FRow); iColNum := 0; for i := 0 to AGrid.Columns.Count-1 do begin if not AGrid.Columns[i].Visible then continue; case AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).DataType of ftBoolean, ftWideString, ftFixedChar, ftString: begin try // sStrData := FDataSet.Fields[i].AsString; sStrBytes:=TEncoding.ANSI.GetBytes(AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).AsString); iDataLen := length(sStrBytes); WriteToken(XL_STRING, iDataLen + 8); WriteToken(FRow, iColNum); aAttributes[1] := 0; BlockWrite(FDataFile, aAttributes, SizeOf(aAttributes)); BlockWrite(FDataFile, iDataLen, SizeOf(iDataLen)); if iDataLen > 0 then BlockWrite(FDataFile, sStrBytes[0], iDataLen); except on E: Exception do //ShowMessage(E.Message); raise Exception.Create('Erro Converter: ' + E.Message); end; end; ftAutoInc, ftSmallInt, ftInteger, ftWord, ftLargeInt: begin try fDblData := AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).AsFloat; iDataLen := SizeOf(fDblData); WriteToken(XL_DOUBLE, 15); WriteToken(FRow, iColNum); aAttributes[1] := XL_INTFORMAT; BlockWrite(FDataFile, aAttributes, SizeOf(aAttributes)); BlockWrite(FDataFile, fDblData, iDatalen); except on E: Exception do //ShowMessage(E.Message); raise Exception.Create('Erro Converter Inteiro: ' + E.Message); end; end; ftFloat, ftCurrency, ftBcd, ftFMTBcd: begin try fDblData := AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).AsFloat; iDataLen := SizeOf(fDblData); WriteToken(XL_DOUBLE, 15); WriteToken(FRow, iColNum); aAttributes[1] := XL_DBLFORMAT; BlockWrite(FDataFile, aAttributes, SizeOf(aAttributes)); BlockWrite(FDataFile, fDblData, iDatalen); except on E: Exception do //ShowMessage(E.Message); raise Exception.Create('Erro Converter Float: ' + E.Message); end; end; ftDateTime: begin try if not AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).IsNull then begin fDblData := AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).AsFloat; iDataLen := SizeOf(fDblData); WriteToken(XL_DOUBLE, 15); WriteToken(FRow, iColNum); aAttributes[1] := XL_XDTFORMAT; BlockWrite(FDataFile, aAttributes, SizeOf(aAttributes)); BlockWrite(FDataFile, fDblData, iDatalen); end; except on E: Exception do //ShowMessage(E.Message); raise Exception.Create('Erro Converter DateTime: ' + E.Message); end; end; ftDate: begin try if not AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).IsNull then begin fDblData := AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).AsFloat; iDataLen := SizeOf(fDblData); WriteToken(XL_DOUBLE, 15); WriteToken(FRow, iColNum); aAttributes[1] := XL_DTEFORMAT; BlockWrite(FDataFile, aAttributes, SizeOf(aAttributes)); BlockWrite(FDataFile, fDblData, iDatalen); end; except on E: Exception do //ShowMessage(E.Message); raise Exception.Create('Erro Converter Date: ' + E.Message); end; end; ftTime: begin try if not AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).IsNull then begin fDblData := AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).AsFloat; iDataLen := SizeOf(fDblData); WriteToken(XL_DOUBLE, 15); WriteToken(FRow, iColNum); aAttributes[1] := XL_TMEFORMAT; BlockWrite(FDataFile, aAttributes, SizeOf(aAttributes)); BlockWrite(FDataFile, fDblData, iDatalen); end; except on E: Exception do //ShowMessage(E.Message); raise Exception.Create('Erro Converter Time: ' + E.Message); end; end; ftMemo: begin // Does not print memo end; else raise Exception.Create('Tipo [' + AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).ClassName + '] do campo [' + AGrid.DataSource.DataSet.FieldByName(AGrid.Columns[i].FieldName).FieldName + '] não foi tratado.'); end; Inc(iColNum); end; // end of for AGrid.DataSource.DataSet.Next; end; // end of while finally AGrid.DataSource.DataSet.EnableControls; AGrid.DataSource.DataSet.First; end; // End of File WriteToken(XL_EOF, 0); CloseFile(FDataFile); except bRetvar := false; end; Result := bRetvar; end; end.
  3. 1 point
    Site: https://www.embarcadero.com/ Overview: https://www.embarcadero.com/products/rad-studio Community: https://www.embarcadero.com/products/delphi/starter Wiki: http://docwiki.embarcadero.com/RADStudio/Rio/en/Main_Page News: http://docwiki.embarcadero.com/RADStudio/Rio/en/What's_New YouTube:
  4. 1 point
    it is attach to this message framecommunication.zip in directory \exe\files\ there is the html frame page
  5. 1 point
    I enabled caching on forums. It may have an impact on speed.
  6. 1 point
    یک اینکه تعداد کاربر هم زمان مهم هست دوم بصورت Isapi کمپایل کن و تو Iis استفاده کن هم سرعتش بیشتر میشه و هم به تعداد درخواست های همزمان بیشتری پاسخ میده
  7. 1 point
    Hello, First, main new feature of version 1.50.0 is our new HyperServer technology! Main features and benefits of HyperServer: Distributing sessions among multiple Nodes. Balancing load among Nodes. Recycling Nodes when they're not needed, purged or discarded. Ability to deploy newer version of uniGUI application remotely without a need to stop the server. (Remote Deployment) Secondly, v1.50.0.1481 Of the major changes: Ext JS version upgraded to 6.6.0, JSON syntax changed to match ECMA standards, New built-in theme Graphite and others...
  8. 1 point
    I made some changes, according to the example, I moved the components of the report builder to a datamodule, instantiated the datamodule and run the report and it worked. before the components of the report builder were on the form itself.
  9. 1 point
    so you need responsive grid? I don't see any responsive site where responsive design was created "automatically" when you just only place components to page. It is hard work with CSS which can take month of work hours while you fix all bugs in different resolutions. It is impossible to implement with delphi form where you can place component whereve you want Look at TMS sample https://app.devgems.com/xdata/music/app/ - this is a braking turn-based strategy, works very slow. Yes, for this piece of shit you can do some automatic resposivity, but which sence use Delphi for so class application if you can create them in PHP for several hours. Delphi is for enterprise desktop applications. How responsivity will look with that gui? I don't understand how much time Farshad will need to implenet "automatic" responsivity for each GUI control - it is impossible and will take all he free time for year to fix bugs with that. ? https://content.screencast.com/users/p2rcoder/folders/Snagit/media/5be18435-f5f3-4ccf-8e1d-a83788af0f13/10.09.2018-16.05.png
  10. 1 point
    if I get the personal version and want to change for the professional what the amount to pay difference and how much time do I have to make the change?
  11. 1 point
    Доброго. Решил выложить инструкцию по установке uniGUI для тех, у кого только С++. Так как на сайте устарела документация. 1) Качаем с сайта и устанавливаем в директории по умолчанию сам uniGUI. 2) Теперь нам необходимо создать скрипт для компиляции bpl файлов. Для этого идем по пути C:\Program Files (x86)\FMSoft\Framework\uniGUI и смотрим нам подходящию версию .groupproj. Открывам файл в блокноте и смотрим все файлы в теге ItemGroup. 3) Из файлов что в ItemGroup собираем скрипт (для Tokyo) он будет таким. cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\uSynEdit\Packages msbuild uSynEdit_R2021.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All msbuild uSynEdit_D2021.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniTools msbuild uniTools25.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\uIndy msbuild uIndy25.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\core msbuild uniGUI25Core.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\components msbuild uniGUI25.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\vcl msbuild uniGUI25VCL.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\design msbuild uniGUI25dcl.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\components msbuild uniGUI25Chart.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\design msbuild uniGUI25Chartdcl.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\core msbuild uniGUI25mCore.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\components msbuild uniGUI25m.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All cd C:\Program Files (x86)\FMSoft\Framework\uniGUI\source\design msbuild uniGUI25mdcl.dproj /p:Configuration=Release /p:DCC_CBuilderOutput=All 4) В меню Пуск ищем программу "RAD Studio Command Prompt" (она поставляется вместес со средой..и является командной строкой). Запускаем от администратора. В нее вставляем наш скипт. Результатом будут собраны необходимые bpl. 5) Открываем среду и лезим в установку компонентов Component-> Install Packages->Add. По умолчанию .bpl будут находится по пути C:\Users\Public\Documents\Embarcadero\Studio\19.0\BPL. Нам нужны только те файлы,в котрых есть в названии dcl. PS вставил бы скриншоты действий, но правов нет
  12. 1 point
    HI Farshad, thanks :-) There are few little things that Unigui don't have for porting TOTALLY a desktop VCL application without losing any "ergonomic" features: grid scroll (virtual, without pagination), advanced lookup (with grid inside and input validation during typing), true editing in grid (cell by cell, without click or enter for edit) for a fast user input (like vcl dbgrid). With this little features, i can distribuite to my customer a web version of desktop application, without big difference and with a "wow" factor. I hope to install the same Unigui application as standalone, local network and enterprise (with HyperServer and balancing) remote farm. Please make me happy :-) Good job!
  13. 1 point
    I only wanted start grid with the grouping collapse. Workaround with: UniSession.AddJS(unidbgrid1.JSName + '.view.features[0].startCollapsed=true;') ;
  14. 1 point
    The ExtJS 6.5 mobile themes certainly help to write single web apps that can be used on desktops, tablets or smartphones. But you are limited to only 2-3 themes available that not everyone likes. Having the possibility to change colors / fonts would be a further help but at the moment we have to do everything via JS and know exactly what to declare to acces EXTJS api. However, a nice step forward compared to before ...
  15. 1 point
    Hello guys I'm sorry for delay. I'm thinking seriuosly on a new version of the Grid, in fact, a set of components for better configurations, so paginations, popupmenus and others could be made through visual components related to the Grid. What I'm thinking is to stop the maintenancy of this free version and start working on this new project that will allow me better and faster maintenancy and adding new features easier. Initial features are: - Pagination Component - Grid PopupMenu Component - Grid Seach Component These component will allow easier configuration and customization even to EXTJS and Delphi low experienced people. Any sugestion will be appreciated. Best regards
  16. 1 point
    Hi all, as far as I have read from the forum the only way to deal with big datasets and uniDbGrids is paging. This works quite well, but I would prefer another option, let me explain better. Without paging, the web server fetches the whole dataset and it gives back it to the client: DB server --> Web server (Unigui) : whole dataset Web Server (UniGUI) --> Browser: whole dataset This is the worst situation, as it implies a lot of overhead for all the actors (DB Server, Web Server, Browser, network, etc.). It should not be used for large datasets. With paging, the web server fetches the whole dataset (this is why the option FetchAll shall be set), and it gives back to the client (browser) just the current page. Therefore: DB server --> Web server (Unigui) : whole dataset Web Server (UniGUI) --> Browser: partial dataset/ curent page This is better, as it minimizes the overhead on the client side (browser), but the Web Server (UniGUI) still has to deal with a large dataset that has to be fetched entirely from the DB server and to be kept in memory. The last option, that I really miss with UniGUI, is the way that VCL DBGrid works, but it is common to find it on many websites. This is the reason why I'm asking about it, I'm confident there should be a way to work it out with UniGUI.I think that it could be called "incremental fetch". Practically, UniGUI should fetch just the first N rows and show them on the UniDbGrid component, letting the user know that there are more rows than the ones actually visible. It could be a button on the paging bar called "Load more rows". If the user clicks on that button, UniGUI should fetch N additional rows from the dataset, and then display N*2 total rows. This approach can be iterated till the whole dataset is fetched. Alternatively, without using the "Load more rows" button, it could be possible to do it in the VCL way: when the user scrolls down the grid and he reaches the last line, the "give me more lines" could be automatically fired. The "incremental fetch" solution would be the best in my opinion, as the user does not really care to know the number of pages in the grid, nor he needs to skip randonly on different pages. Usually he does want quickly the first N rows, and then the possibility to look up another N rows for a fe times. Then, if the data is not found, he would change the actual filter/selection. This would bring the following situation: DB server --> Web server (Unigui) : partial dataset Web Server (UniGUI) --> Browser: partial dataset Sorry for the long post, hoping that I was clear, thank you all. Andrea
  17. 1 point
    Calendar of Commitments with uniGUI I show in this video based on a source code provided in the Group by Robinho, how to create a calendar where you can put badges on days with appointments. I use the components of the Fênix: http://app.fenixerp.com.br/unigui/ [PT-BR] Calendário de Compromissos com uniGUI Mostro nesse vídeo com base em um código fonte fornecido no Grupo por Robinho, como criar um calendário onde você pode colocar marcações (badge) nos dias com compromissos. utilizo os componentes da Fênix: http://app.fenixerp.com.br/unigui/ VIDEO https://youtu.be/f0ws4zcuRtM Caledario2.rar
  18. 1 point
    Hi, We will check this issue. For now, can you try this approach ?: http://forums.unigui.com/index.php?/topic/6146-unitreeview-background-color-old-issue-1016/ Best regards,
  19. 1 point
    Hi, How to change the background color for a unitreeview? I tried the property color , or parent color, but always stay in white color. exactly the same error with font size. whang changing the font on design time it does not change in run time. any idea? thx eric
  20. 1 point
    I'm showing a variety of applications here, but primarily it's an application for real-time monitoring and control and management of large quantities of time-series data spread out over disparate locations. One of the frontend apps shown is specifically for greenhouse monitoring/control while some of the others are for industrial applications, e.g. SCADA and Energy Management. I'm also showing the administrative web application that allows a user to configure and manage their entire system online as well as create custom display or navigation screens (2D or 3D) for their facilities and attach live sensor values to their visual widgets via drag/drop which can change color, switch images etc. based on the real-time value of the sensor attached to it. The mobile app is just a limited version of the desktop web app. I truly don't think any of this would have been possible without UniGUI as it allowed me to port a set of very complex frontend VCL/OpenGL apps to a browser implementation fairly quickly while maintaining the use of all of my backend code. You have done magnificent work there and for that I thank you very much!!!
  21. 1 point
    Hi! For example: 1. MainForm.Script: var IDLE_TIMEOUT = 60; //seconds var _idleSecondsCounter = 0; document.onclick = function() { _idleSecondsCounter = 0; }; document.onmousemove = function() { _idleSecondsCounter = 0; }; document.onkeypress = function() { _idleSecondsCounter = 0; }; window.setInterval(CheckIdleTime, 1000); function CheckIdleTime() { _idleSecondsCounter++; var oPanel = document.getElementById("SecondsUntilExpire"); if (oPanel) oPanel.innerHTML = (IDLE_TIMEOUT - _idleSecondsCounter) + ""; if (_idleSecondsCounter >= IDLE_TIMEOUT) { //alert("Time expired!"); //document.location.href = "logout.html"; ajaxRequest(MainForm.form, '_idle_timeout', []); } } 2. MainForm->onAjaxEvent: procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_idle_timeout' then begin // your logic ShowMessage('idle_timeout'); end; end; Best regards.
  22. 1 point
    Hi, Please see these demo projects: ..\FMSoft\Framework\uniGUI\Demos\Desktop\Form Callback\frm.dpr ..\FMSoft\Framework\uniGUI\Demos\Desktop\Form Anonymous Callback\frmCallback.dpr Best regards.
  23. 1 point
    Hi, Try: procedure TMainForm.UniButton1Click(Sender: TObject); var s: string; begin s := 'something'; UniSession.AddJS(UniHTMLMemo1.JSName + '.insertAtCursor("'+ s +'")'); // or - UniSession.AddJS(UniHTMLMemo1.JSName + '.insertAtCursor("'+ s +'" + " ")'); end; Best regards.
  24. 1 point
    Your example is fantastic.....good to be transformed on a TUniMultipleUpload component.
  25. 1 point
    Hi, Perhaps this decision is not completely consistent your requirements, but try... 1. Add the following components: UniHTMLMemo1, UniFileUpload1 2. UniHTMLMemo1 -> ClientEvents -> UniEvents -> add function beforeInit: function beforeInit(sender, config) { config.listeners = { render: function(editor) { editor.getToolbar().add({ xtype: 'button', text: 'imageUpload', handler: function() { ajaxRequest(sender, 'uploadImage', []) } }); } } } 3. UniHTMLMemo1 -> OnAjaxEvent: procedure TMainForm.UniHTMLMemo1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if EventName = 'uploadImage' then begin UniFileUpload1.Execute end; end; 4. UniFileUpload1 -> OnCompleted: procedure TMainForm.UniFileUpload1Completed(Sender: TObject; AStream: TFileStream); var DestName : string; DestFolder : string; begin DestFolder:=UniServerModule.StartPath+'UploadFolder\'; DestName:=DestFolder+ExtractFileName(UniFileUpload1.FileName); CopyFile(PChar(AStream.FileName), PChar(DestName), False); UniSession.AddJS(UniHTMLMemo1.JSName + '.execCmd(''InsertHTML'', ''<img width="138" height="87" src="'+ 'UploadFolder/' + UniFileUpload1.FileName +'"></img>'')'); end; 5. MainForm -> OnCreate: procedure TMainForm.UniFormCreate(Sender: TObject); begin ForceDirectories(UniServerModule.StartPath+'UploadFolder'); end; 6. uses ... ServerModule ... Try, Best regards.
×