Jump to content

Luciano França

uniGUI Subscriber
  • Posts

    280
  • Joined

  • Last visited

  • Days Won

    4

Luciano França last won the day on January 26

Luciano França had the most liked content!

Profile Information

  • Gender
    Male
  • Location
    Astorga PR. Brasil

Contact Methods

  • Yahoo
    luapfr@yahoo.com.br

Recent Profile Visitors

1212 profile views

Luciano França's Achievements

Advanced Member

Advanced Member (4/4)

32

Reputation

  1. How could I put lines in this updateRule logic ? Procedure TMainForm.UniFormCreate(Sender: TObject); Begin UniSession.AddJS('Ext.util.CSS.updateRule(''.x-myfield-focus'', ''background-color'', ''#ffcccc'')'); // As ? Add('background-image: none; '); End;
  2. Any alternative ? There should be a way to re-inject the delayed customCSS.
  3. I don't understand how this can help me. see I have appearance settings that I save in the database and I need to pass these settings to CustomCSS Can you change this attached example ? Modifed CustomCSS.7z
  4. Solution Partial Add(' const fsize = file.size; '); Add(' const Tamfile = Math.round((fsize / 1024)); '); Add(' if (Tamfile >= 8096) { '); Add(' alert("Arquivo muito grande escolha um aquivo menor que 8mb"); '); Add(' document.body.removeChild(el); '); Add(' resolve(undefined); } '); how to exchange Alert for MessageDLG in javascript
  5. Hello, after a long time I came across a problem, if a very large file is chosen, Unigui will crash. How could I check the file size and show an Alert to the User. How could I put a file size check in this code below and abort if it is too large. With FileHTMLFrame.HTML Do Begin Clear; Add('<!doctype html>'); Add('<html> '); Add(' <body> '); Add(' <button id="BtnFileHTMLFrame" style="color:black;font-size:16px;" onclick="selectFile()">Aguarde o envio do Arquivo...</button>'); Add(' <script> '); Add(' async function selectFile() { '); Add(' let file = await fetchFile() '); Add(' let filename, fileData '); Add(' let filetype = ''Unknown'' '); Add(' if(file){ '); Add(' filename = file.name '); Add(' filetype = file.type '); Add(' let reader = new FileReader(); '); Add(' reader.readAsDataURL(file); '); Add(' reader.onload = function() { '); Add(' fileData = reader.result '); Add(' let params = {"filename": filename, "filetype": filetype, "filedata": fileData} '); Add(' params= JSON.stringify(params); '); Add(' top.ajaxRequest(top.Form_UploadFileWeb.FileHTMLFrame, ''selected_file'', [''file_info=''+ params]); '); Add(' } '); Add(' reader.onerror = function() { '); Add(' let params = {"filename": filename, "filetype": filetype, "filedata": fileData} '); Add(' params= JSON.stringify(params); '); Add(' top.ajaxRequest(top.Form_UploadFileWeb.FileHTMLFrame, ''selected_file'', [''file_info=''+ params]); '); Add(' } '); Add(' } else { '); Add(' let params = {"filename": filename, "filetype": filetype, "filedata": fileData} '); Add(' params= JSON.stringify(params); '); Add(' top.ajaxRequest(top.Form_UploadFileWeb.FileHTMLFrame, ''selected_file'', [''file_info=''+ params]); '); Add(' } '); Add(' } '); Add(' const fetchFile = async () => { '); Add(' return new Promise((resolve, reject) => { '); Add(' const el = document.createElement(''input''); '); Add(' el.type = ''file''; '); Add(' el.style.opacity = ''0''; '); Add(' el.accept = "' + Ext + '"; '); Add(' el.addEventListener(''change'', () => { '); Add(' const file = el.files[0]; '); Add(' document.body.removeChild(el); '); Add(' resolve(file); '); Add(' }); '); Add(' document.body.appendChild(el); '); Add(' el.click(); '); Add(' const onFocus = () => { '); Add(' window.removeEventListener(''focus'', onFocus); '); Add(' document.body.addEventListener(''mousemove'', onMouseMove); '); Add(' }; '); Add(' const onMouseMove = () => { '); Add(' document.body.removeEventListener(''mousemove'', onMouseMove); '); Add(' if (!el.files.length) { '); Add(' document.body.removeChild(el); '); Add(' resolve(undefined); '); Add(' } else { '); Add(' resolve(el.files[0]); '); Add(' } '); Add(' } '); Add(' window.addEventListener(''focus'', onFocus); '); Add(' }); '); Add(' } '); Add(' </script> '); Add(' </body> '); Add('</html> '); End;
  6. I have several settings that I save in my database such as font sizes, colors, etc. How could I give an update on "CustomCSS" because I realize that it is only loaded when creating the "TUniServerModule" Unit ServerModule; public { Public declarations } Procedure UpdateCSS; End; Procedure TUniServerModule.UpdateCSS; Begin With Self.customCSS Do Begin Add('.x-myfield-focus { '); Add(' border-color: #7eadd9; '); Add(' background-color: #FFFFE1; '); Add(' color: #FF0000; '); Add(' background-image: none; '); Add(' } '); End; End; //============================================================================================================ Unit Main; procedure TMainForm.UniFormCreate(Sender: TObject); begin UniServerModule.UpdateCSS; UniEdit2.JSInterface.JSConfig('focusCls', ['myfield-focus']); UniComboBox1.JSInterface.JSConfig('focusCls', ['myfield-focus']); end;
  7. How do I change the color when receiving editing objects like: UniEdit UniMemo UniCombobox I found this post but it doesn't work.
  8. The color sizes are very small, how could I increase them? Grateful.
×
×
  • Create New...