Jump to content

andyhill

uniGUI Subscriber
  • Posts

    1268
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by andyhill

  1. Using a UniDBMemo bound to a DBGrid Column - How Do We Keep The Grid Editor From Displaying Multi-Line Text (we do not want to expand the Grid Row Height - show first line only) ?
  2. Please provide a work around ASAP - Thank You. (need grid Number Editors repainted after page loaded)
  3. Thanks David but the buttons are already there, I wanted to remove one. I could of course remove all and then add but it is clearly a bug.
  4. //dblComboBoxSuppliers.HideTrigger:= True; *** HIDES ALL BUTTONS *** dblComboBoxSuppliers.ListSource:= UniMainModule.dsSuppliersLkUp; dblComboBoxSuppliers.GridMode:= lgmPostListValue; // lgmPostListValue, lgmPostKeyValue dblComboBoxSuppliers.ListOnlyMode:= lmFollowSource; // lmNoFollow, lmFollowSource (uniDBLookupHelper.pas) dblComboBoxSuppliers.ListField:= 'BusinessName'; dblComboBoxSuppliers.KeyField:= 'BusinessName'; dblComboBoxSuppliers.EndUpdate; UniMainModule.tblSuppliersLkUp.ReadOnly:= True; UniMainModule.tblSuppliersLkUp.Open;
  5. It hides BOTH DropDown and Magnifier (or it did last time I checked).
  6. When the grid is first loaded from the data-source more than 2 decimal places are shown. If I edit then after post the 2 decimal place rule is adhered to. How do I make the grid on first load paint the 2 decimal place rule ?
  7. I have a TUniDBLookupComboBox and I want to Hide DropDownTriggerButton (keep MagnifierLookUpTriggerButton) dblComboBoxSuppliers.ClientEvents.UniEvents.Clear; s:= 'beforeInit=function beforeInit(sender, config) '+ '{ '+ ' Triggers[0].hide(); '+ '} '; dblComboBoxSuppliers.ClientEvents.Add(s); Code above executes but does not hide button ?
  8. Sherzod, Farshad, please provide work around that makes UniNumberEdit used in DBGrid as an Editor paint the 2 decimal places (as programmed) - URGENT.
  9. I have a DBGrid with a TUniNumberEdit Editor for Floating Numbers set to 2 Decimal places that fails to paint only 2 decimal places, please advise - thanks. // GST nmInvEdit2.Alignment:= taRightJustify; nmInvEdit2.AllowBlank:= False; nmInvEdit2.DecimalSeparator:= '.'; nmInvEdit2.DecimalPrecision:= 2; // GST Columns.Add; Columns.Items[i].FieldName:= 'GST'; Columns.Items[i].Visible:= True; Columns.Items[i].Title.Alignment:= taRightJustify; Columns.Items[i].Title.Caption:= '$GST'; Columns.Items[i].Width:= 100; Columns.Items[i].Editor:= nmInvEdit2; //Columns.Items[i].Flex:= 1; Columns.Items[i].Font.Color:= clBlack; Columns.Items[i].Sortable:= True; Columns.Items[i].ShowSummary:= False;
  10. My hidden panels are filled with hundreds of editors, there must be a better way.
  11. How do we use this in Delphi ? editor: new Ed(new fm.NumberField({allowBlank: false,allowNegative: false,maxValue: 10, decimalPrecision: 3}))
  12. Without using an Editor can we round float columns to 2 decimal places ? If we have to use an Editor then I still need to round float value to 2 decimal places - Please show how to implement ? Do we use something like this and how do we apply it in code:- applyValue: function(value) { value = parseFloat(value); if (isNaN(value) || value === null) { value = this.getDefaultValue(); } //round the value to 1 decimal value = Math.round(value * 100) / 100; return this.callParent([value]); },
  13. "fonts" are the free font awesome files fonts.zip
  14. Thank you Sherzod, however it is not working, what have I missed:- SERVERMODULE procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); begin ////////////////////////////////////////////////////////////////////////////// // Init IgnoreAccessViolation:= False; ////////////////////////////////////////////////////////////////////////////// UniServerModule.CustomFiles.Add('<link rel="stylesheet" href="fonts/css/all.css">'); // UniServerModule.CustomCSS.Add('.redIcon { color: red; }'); // UniServerModule.CustomCSS.Add('i { '+ ' color: red; '+ ' vertical-align: sub; '+ ' font-size: 50px; '+ ' } '+ 'i::before { '+ ' font-size: 30px; '+ ' } '); ////////////////////////////////////////////////////////////////////////////// EDITORFORM procedure TfEditor.UniFormCreate(Sender: TObject); var s: String; begin ////////////////////////////////////////////////////////////////////////////// HtmlMemo.ClientEvents.ExtEvents.Clear; // Font Awesome s:= 'initialize=function initialize(sender, eOpts) '+ '{ '+ ' var _link; '+ ' document.getElementsByTagName(''head'')[0].childNodes.forEach(function(el) '+ ' { '+ ' if (el.tagName == ''LINK'' && el.href.toString().search(''/font-awesome/'') > -1) '+ ' { '+ ' _link = el.outerHTML; '+ ' } '+ ' }); '+ ' if (_link) '+ ' { '+ ' sender.iframeEl.dom.contentDocument.head.innerHTML += _link; '+ ' } '+ '} '; HtmlMemo.ClientEvents.ExtEvents.Add(s); //////////////////////////////////////////////////////////////////////////////
  15. UniServerModule.CustomFiles.Add('<link rel="stylesheet" href="fonts/css/all.css">'); s:= 'i { '+ ' color: red; '+ ' vertical-align: sub; '+ ' font-size: 50px; '+ ' } '+ 'i::before { '+ ' font-size: 30px; '+ ' } '; UniServerModule.CustomCSS.Add(s); HtmlMemo text: '... and record (<i class="fa fa-bookmark" aria-hidden="true"></i>) location<br> ...' Please show how to embed Font Awesome Symbols within HtmlMemo text - thanks.
  16. OK, the obvious onPaste --> paste (old habits). I have all events firing as expected HOWEVER I need help please in processing the oldData into newData, can someone please advise why this adjusted newData paste does not work - thanks in advance. HtmlMemo.ClientEvents.ExtEvents.Clear; // initialize s:= 'initialize=function initialize(sender, eOpts) '+ '{ '+ // dblclick ' sender.getDoc().addEventListener(''dblclick'', function() '+ ' { '+ ' if (arguments[0].target && arguments[0].target.tagName.toLowerCase()==''img'') '+ ' { '+ ' ajaxRequest(sender, ''_img_'', ["id="+arguments[0].target.getAttribute(''id'')]); '+ ' } '+ ' if (arguments[0].target && arguments[0].target.tagName.toLowerCase()==''td'') '+ ' { '+ ' ajaxRequest(sender, ''_table_'', ["id="+arguments[0].target.getAttribute(''id'')]); '+ ' } '+ ' }); '+ // keydown ' sender.iframeEl.dom.contentDocument.body.addEventListener(''keydown'', function(e) '+ ' { '+ ' if( (e.ctrlKey && e.key === ''v'') || (e.ctrlKey && e.key === ''V'') ) '+ ' { '+ //' alert(''Key''); '+ ' } '+ ' }); '+ // paste ' sender.iframeEl.dom.contentDocument.body.addEventListener(''paste'', function(e) '+ ' { '+ ' var items = e.clipboardData.items; '+ ' if(items.length === 1) '+ ' { '+ ' var str = items[0].type; '+ ' if(str.indexOf("image") !== -1) '+ ' { '+ //' alert(str); '+ ' var oldData = e.clipboardData.getData(); '+ ' var len = length(oldData)-4; '+ ' var index = oldData.indexOf("<img"); '+ // I need to scan oldData and insert id, width and height ' var newData = slice(oldData, 1, index+4) + '' id="img09" width="25" height="25" '' + slice(oldData, index+4, len); '+ ' pasteClipboardData(newData); '+ ' e.preventDefault(); '+ ' } '+ ' } '+ ' }); '+ '} '; HtmlMemo.ClientEvents.ExtEvents.Add(s);
  17. I have the Ctrl+v listening event working fine but when I try to add a Paste listening event I have a javascript issue, would someone be so kind and advise what I have done wrong please - thanks. // Catch Ctrl+V / Image Paste s:= 'initialize=function initialize(sender, eOpts) '+ '{ '+ ' sender.iframeEl.dom.contentDocument.body.addEventListener'+ ' ( '+ ' ''keydown'', function(e) '+ ' { '+ ' if( (e.ctrlKey && e.key === ''v'') || (e.ctrlKey && e.key === ''V'') ) '+ ' { '+ ' alert(''Key''); '+ ' } '+ ' } '+ ' ), '+ ' sender.iframeEl.dom.contentDocument.body.addEventListener'+ ' ( '+ ' ''onPaste'', function(e) '+ ' { '+ ' var IMAGE_MIME_REGEX = /^image\/(p?jpeg|gif|png)$/i; '+ ' var items = e.clipboardData.items; '+ ' for (var i = 0; i < items.length; i++) '+ ' { '+ ' if (IMAGE_MIME_REGEX.test(items[i].type)) '+ ' { '+ ' alert(''Img''); '+ ' } '+ ' else '+ ' { '+ ' // do nothing '+ ' } '+ ' } '+ ' ) '+ ' ; '+ '} '; HtmlMemo.ClientEvents.ExtEvents.Add(s);
  18. Sherzod - Please, I have clearly explained I know how to insert an image (most formats) as inline code - never in question. I add to my inserted image <img tag these properties id, width and height without any problems. The id helps me when my embedded image is double clicked from which I pop up a sizing window, adjust the image size and update the inline image code accordingly. HTML5 allows direct pasting of an image into the HtmlMemo as inline code MINUS <img tag properties id, width and height, and the only notification we get is when your code executes a 'change' event passing ALL the memo html bytes which adds up to hundreds of thousands of bytes to process ON EVERY KEY PRESS - NOT PRACTICAL. I want to be notified of such a Browser Image paste event so I can add the missing <img tag properties id, width and height. None of this would be needed if your HtmlMemo had the functionality to handle the sizing of images.
  19. It is totally impracticable to parse ALL of the HtmlMemo lines (via the change event) every time a key is pressed to look for unprocessed <img tags. I tried to implement a KeyUp event but it never fires (not implemented ):- procedure TfMain.HtmlMemoKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin if ssCtrl in Shift then begin // 'V', 'v' if ( (Key = 86) or (Key = 118) ) then begin // do my thing end; end; end; Farshad, Sherzod - please comment.
  20. Thank You Erich, the only issue I have with this implementation is that the user has to provide id/width/height etc. and I was trying to do this without the user having to interact with the pasted image (I want to automate it, img01, img02, img03...).
  21. Image Insert (Ctrl+v) Produces <img src="data:image/png;base64,... I Need To Catch The Image Insert And Add An id Tag To The Image Tag <img id="img2" src="data:image/png;base64,... I Need This For Inventory Purposes (later passing and extracting), I need Each Image Tag <img To Have An id Tag. The Only Event Fired Is "change" and all it does is give you the whole HtmlMemo contents, it does not distinguish one Image From Another Image. if EventName = 'change' then begin s:= Params.Values['sender']; // blank s:= Params.Values['newValue']; // new html memo source (cannot tell which is new image) s:= Params.Values['oldValue']; // old html memo source s:= Params.Values['eOpts']; // blank end; Farshad, please add this feature - thanks.
  22. Delphi 10.3 cannot compile UniGuiOS with numerous errors everywhere, do you have a Delphi 10.3, Sencha 7.0.0, UniGui 1531 version ?
×
×
  • Create New...