Jump to content

gm3h

Members
  • Posts

    47
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by gm3h

  1. gm3h

    Visual components

    yeah, there will abundant of problem converting component targeted for Windows to UniGUI. But it's still possible to simply add properties like xxx.AsYYYY. The only problem is only with 'visual'. You need JavaScript to change/add the visual of the component. About the rights/permissions, I think Farshad will gladly to allow you to make a descendant component of uniGUI component. But for license, AFAIK, until current version (0.88.931), uniGUI still free, and it still bound to the license of extJS (if you want to make it commercial).
  2. gm3h

    Visual components

    of course you can make a descendant of TUniEdit to accomplish this. I myself, already make TUniXNumericEdit (to avoid name duplication if one day Farshad make TUniNumericEdit available to us). Several features I've made are: property: - IntValue - FloatValue - MinValue - MaxValue - DecimalSeparator/ThousandSeparator - DecimalPrecision - IntegersOnly well, not 100% optimized yet, but it works already. PS: I will not make this available to public before I get permission from Farshad.
  3. well, as I've said before, this is only for temporary solution with older version of uniGUI. Since there's a new DBGrid Editor, I think you don't need my tips above.
  4. good point Dionel, I myself at last make a conclusion like this: 1. Enter -> Next Field 2. Shift-Tab -> Prev Field (default NavKey) 3. Shift-Enter -> New Line in Memo for point 2 above, I let it like the default NavKey, since it is rarely used. The common people use is 'Enter' for next field, and 'Shift-Enter' in Memo to make a new Line. CMIIW...
  5. gm3h

    Enter Like Tab

    Agree with these too.. Thanks Farshad..... In the mean time, I manage to overcome with the following javascript that I put in the ServerModule.CustomFiles (I got this from extJS forum): Ext.override(Ext.form.FormPanel, { enterToTab:true, autoFocus: true, initEvents: Ext.form.FormPanel.prototype.initEvents.createSequence (function(){ if(this.autoFocus){ this.on('afterrender', function(){ this.focusFirstEnabledField(true, 500); },this) } }), focusFirstEnabledField: function(){ var i = this.getFirstEnabledField(); if(i){ i.focus.apply(i,arguments); } return i; }, getFirstEnabledField: function(){ var x = null; Ext.each(this.form.items.items, function(i){ if((!i.hidden)&&(!i.disabled)){ x = i; return false; } },this) return x; }, initFields:Ext.form.FormPanel.prototype.initFields.createSequence(function(ct, c) { this.form.items.each(function(f){ f.form = this.form; f.formPanel = this; var nf = this.form.items.itemAt(this.form.items.indexOf(f)+1) if (nf){ f.nextField = nf } delete nf; var pf = this.form.items.itemAt(this.form.items.indexOf(f)-1) if (pf){ f.priorField = pf } delete pf; if(this.enterToTab){ f.on('specialkey', function(field, e){ if (e.getKey() == e.RETURN){ var prop = (e.shiftKey ? 'priorField' : 'nextField'); if (field[prop]){ field[prop].focus(true); } } },this) } },this) }) }) But, there's a problem with TUniDateTimePicker, because TUniDateTimePicker is always created last with UniGUI (I've already post this on this forum), so, the TUniDateTimePicker will not get focus on enter according to its order. For other component of UniGui, it works well.
  6. Well, after working around with the plugins, I finally manage to make it work properly. No, it's not about the 'layout of the form' problem, but the 'wrap' problem. When you create a 'wrap' for a component, the resulted 'div' do not copy the 'style object' of the wrapped component. So, I have to modified the plugins to add this 'style object' i.e. the top,left,width config, from the wrapped component to the resulted wrap object. Anyway, thanks Farshad for your advise. I'll post this modified plugins after I test it thoroughly in this forum if somebody wants to use it. Cheers and Thanks for your great uniGUI, I love it very much and really unpatiently waiting for the next upgrade. Btw, here's the result now:
  7. Just want to report, here's what I got: 1. The plugins initialize correctly now. (Thanks for the 'OnBeforeInit') 2. But, there's a bit problem with the result. Here's the result: a. Output from browser: b. Capture from design time: c. Here's what I got from Chrome Inspect: Can somebody suggest me what to do? Thanks before..
  8. I try to set it onbeforerender currently. Thanks Farshad. I'll try that.
  9. I know that one day, Farshad will add any available field editor/viewer to the grid. But, for the moment it is not available. What I do is simple, setting the 'renderer' properties of the field. Here's what I do to make any Boolean field to be showed/rendered as CheckBox in the grid. 1. Set the Column Tag to 1, this is to mark that this column will be 'rendered' as CheckBox. 2. In the OnShow event of the form that contain the grid, put this code: procedure TMainForm.UniFormShow(Sender: TObject); var st,xcolheader:string; i,j:integer; begin xcolheader:=''; j:=UniDBGrid1.Columns.Count; for i := 0 to j-1 do begin If UniDBGrid1.Columns[i].Tag=1 then begin xcolheader:=xcolheader+'colModel.columns[i].header=="'+UniDBGrid1.Columns[i].Title.Caption+'"||'; end; end; xcolheader:=copy(xcolheader,1,Length(xcolheader)-2); st:='OnReconfigure=function OnReconfigure(sender, store, colModel) {'+ 'for(i=1;i<colModel.columns.length;i++) {'+ 'if ('+xcolheader+') {'+ ' colModel.columns[i].renderer=function(v, p, record){'+ ' p.css += " x-grid3-check-col-td";'+ ' return ''<div class="x-grid3-check-col''+(v == ''1''?''-on'':'''')+''"> </div>'';}'+ '}}}'; UniDBGrid1.ClientEvents.ExtEvents.Add(st); end; I'm using Firebird, so the boolean value is 0 or 1.... if you are using other DB, then you can modify the v == ''1'' above to any value that you need for 'true' condition.... Hope this can help somebody that need it. Cheers....
  10. Just FYI: To reset the validation status of every field in the form, you can use this: UniSession.AddJS(Self.WebForm.ExtForm.JSName+'.form.reset()');
  11. I'm trying to set a 'plugins' from ExtJS for TuniEdit for example. I have tried many method but without success.... But, if it is 'extension' or 'override', I've done it successfully.... For example, I try to set the plugins for TuniEdit like this: http://www.sencha.com/forum/showthread.php?77984-Field-help-text-plugin and also this: http://www.sencha.com/forum/showthread.php?125958-Simple-Field-Access-plugin-Lock-Unlock-to-restrict-or-allow-input-data All failed... Can somebody help me work it out??? Thanks before..
  12. gm3h

    Numbers

    I agree, may be something like TRzNumericEdit which accept only only numeric input, and also automatically format the value according to the decimal symbol and digit grouping symbol, in Delphi it is 'DecimalSeparator' and 'ThousandSeparator'.
  13. Thank you Farshad and Anders.. Now it works. Here's what I do. 1. in the Form1.Script i put: function zPrint(oTgt) { oTgt.focus(); oTgt.print(); } 2. in the button.ExtEvents.OnClick() i put: zPrint(iframe_UniURLFrame1); /* without the quotation mark */ Now, how about print dialog? I don't want to show the print dialog, just directly print to the default printer.
  14. thank you for your reply. But, I don't know what the id of URLFrame after uniGUI compiled the code into javascript.
  15. Can somebody tell me how to print the content of TUniURLFrame ? I've used window.print() in the onClick() event of ClientEvents.ExtEvents, but it print the whole webpage of course. I've tried Form1.urlFrame1.print(), also nothing happen. Also, if possible, is there any way I can just print directly to printer without the Print Dialog ??
  16. ok, gladly.... I attach the small project along with the database. I'm using Delphi XE, Firebird SQL Server version 2.1, and Interbase as the connection. Hope you can fix the bugs. uniGui.zip
  17. I also got the same problem with you. It's a dataset with around 5000 records. I'm using Firebird SQL Server with IBDataset on Delphi XE. Anyway, i got the solution. After opening the dataset, i issue 'dataset.Last' and then 'dataset.First'. Suddenly, the grid showing the right number of page. btw, if using TuniDBNavigator, how to set the default navigation of the TuniDBGrid to only show 'Page x of x' without any navigation ??
×
×
  • Create New...