Jump to content

rullomare

uniGUI Subscriber
  • Posts

    131
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by rullomare

  1. Hi, yes, tomorrow I will post a new version of dbgrid with action columns. best regards
  2. hi, maybe it can help you ! http://forums.unigui.com/index.php?/topic/4130-add-action-columns-to-unidbgrid-at-runtime/ regards
  3. Hi, Lately I've read in the forum that there are some small problems with cookies. There is an alternative to Unigui cookies? I think so! : JStorage.js - store data locally with JavaScript. Definitely not elegant as the Unigui solution,but it works. I have already used Jstorage.js in Unigui test applications; seems to work fine with all browsers. Please read carefully the documentation on the site http://www.jstorage.info ,if you want to use it. So I decided to write a new "component" Unigui TBroStorage (certainly not very standart. The Unigui documentation not help much in this). The idea was to build a non-visual component, but i not find an appropriate Ext-class, so I improvised. I want to share it with the forum in the hope that some more experienced Member can improve it. Other Plugins used: lz-String.js: JavaScript compression, fast! http:\\pieroxy.net/blog/pages/lz-string/index.html Tested only with Delphi XE3 and Unigui 0.96.0.1065 I think it work with the Unigui release 0.95.0.xx I do not think there are problems with other releases of Delphi, just have to change the package : UniGUIxx.dcp, xx = Delphi release. Installation : install Brostorage.dpk (Only for Delphi XE3) Add new Path in Delphi>Tools>Delphi Options>Library Campile and Run demo TestBrojs.dpr BroStorage.zip TestBroStorage.zip Have fun! sincerely
  4. Hi, i think that the solution of Mr. Delphi Developer is fantastic : i can use it to easily change the icons of uniDBNavigator. UniSession.AddJS(UniDBNavigator1.JSName + '.items.items[5].icon = ''files/delete.png'';') ; I want to give another solution anyway. 1) Set ShowHint to true of unidbnavigator properties, you get automatically the hints (Messages) of normal dbvavigator-delphi messages (First record,Next Record, ...) 2) if you want to translate any standart Delphi messages , you can use the following code in the servermodule.pas. <<===============================================================================>> unit ServerModule; interface uses SysUtils, uniGUIServer, uniGUIMainModule, uniGUIApplication,VdbConsts,windows,consts; type TUniServerModule = class(TUniGUIServerModule) procedure UniGUIServerModuleCreate(Sender: TObject); private { Private declarations } protected procedure FirstInit; override; public { Public declarations } end; function UniServerModule: TUniServerModule; implementation {$R *.dfm} uses UniGUIVars; function UniServerModule: TUniServerModule; begin Result:=TUniServerModule(UniGUIServerInstance); end; // Add Procedure <<<======================================== procedure HookResourceString(rs: PResStringRec; newStr: PChar); var oldprotect: DWORD; begin VirtualProtect(rs, SizeOf(rs^), PAGE_EXECUTE_READWRITE, @oldProtect); rs^.Identifier := Integer(newStr); VirtualProtect(rs, SizeOf(rs^), oldProtect, @oldProtect); end; // ============================================================== procedure TUniServerModule.FirstInit; begin InitServerModule(Self); end; initialization RegisterServerModuleClass(TUniServerModule); //translate messages in VdbConsts.pas Unit ( English to Italian) HookResourceString(@SFirstRecord,pchar('Primo')); HookResourceString(@SPriorRecord,pchar('Precedente')); HookResourceString(@SNextRecord,pchar('Successivo')); HookResourceString(@SLastRecord,pchar('Ultimo')); HookResourceString(@SInsertRecord,pchar('Nuovo')); HookResourceString(@SDeleteRecord,pchar('Cancella')); HookResourceString(@SCancelEdit,pchar('Cancella Modifiche')); HookResourceString(@SEditRecord,pchar('Modifica')); HookResourceString(@SPostEdit,pchar('Conferma Modifiche')); // translate messages in Consts.pas Unit ( English to Italian) HookResourceString(@SMsgDlgWarning,pchar('Attenzione')) ; HookResourceString(@SMsgDlgInformation,pchar('Informazione')) ; HookResourceString(@SMsgDlgConfirm,pchar('Conferma')) ; HookResourceString(@SMsgDlgError,pchar('Errore')) ; end. P.s . Tested only with Delphi XE2 + Delphi XE3 Best Regards
  5. Hi, The question [uniDBGrid with button column - It this possible? ] that Mr. Stiaan place intrigued me. Although I believe his problem can be solved with UnizPopUpMenu and UniZdbgrid, I searched in the documentation Sencha to be able to add Action columns (Ext.grid.column.Action) at runtime to unidbgrid. Although not very elegant, i think I've succeeded. I apologize to Mr. Bresler has used his program for my demonstration: sorry Maikel ,but I use only MySQL as database. DemoActionColumn.zip Have fun. Salvatore Marullo P.S. only for demonstration. Production??
  6. hi, see UniZPopupMenu and UniZDBGrid. maybe can help ! http://forums.unigui.com/index.php?app=core&module=attach&section=attach&attach_id=1727 Regards
  7. Hi Zekeriye, I think yes. Zcomp16.zip No Tested !!! Installation : uninstall UniZComponents16.dpk (Delphi XE2) (TuniZdbgrid,TuniZpopupMenu,Tunizgridview) if installed. uninstall MyXUniDBGrid.dpk (Delphi XE2) (TMyunixdbgrid) if installed. install new UniZComponents16.dpk (Only for Delphi XE2) Add new Path in Delphi>Tools>Delphi Options>Library install new MyXUniDBGrid.dpk (Only for Delphi XE2) Add new Path in Delphi>Tools>Delphi Options>Library Run demo newgridx.dpr in Delphi xe2 Best Regards
  8. Hi, Error reading grid.CheckBox: CheckBox Property does not exist : Edit Main.dfm and delete checkbox Property in object grid: TMyUniXDBGrid. Sorry. Hi Mr. Bresler I'm sure the bigger job is yours!!! Thanks !! Best Regards Salvatore Marullo
  9. UniDbbgrid with Checkbox + manages the selected rows (Mr. Bresler). I will start by saying that it is not the result of my work, in fact I have only assembled a few ideas. I have only made minor changes(any lines of code) to TuniZdbgrid.pas (Mr. Farshad Mohajeri), TMyUniXdbgrid.pas (Mr. Bresler). Thanks to all !! thanks also to PatMap for UniXDbgrid. I hope that Mr. Farshad Mohajeri may have the time to provide as soon as possible a Unigui UniDBGRID component more efficient. Tested only with Delphi XE3 and Unigui 0.95.0.1046. However, I think it is pretty easy to customize for other Delphi version (replace only MyUniXdbgrid.pas,UniZdbgrid.pas) Installation : uninstall UniZComponents17.dproj (Delphi XE3) (TuniZdbgrid,TuniZpopupMenu,Tunizgridview) if installed. uninstall MyXUniDBGrid.dpk (Delphi XE3) (TMyunixdbgrid) if installed. install new UniZComponents17.dproj (Only for Delphi XE3) Add new Path in Delphi>Tools>Delphi Options>Library install new MyXUniDBGrid.dpk (Only for Delphi XE3) Add new Path in Delphi>Tools>Delphi Options>Library Run demo newgridx.dpr CheckboxGrid.zip Good fun !!! Best regards.
  10. Hi, many thanks !! Salvatore Marullo
  11. Hi, Thanks for the answer. The new jsname can be Form1_UniButton1 and Form2_UniButton1 . I mean then new Jsname is build with Form Name + Component Name. I already use this convention by Clients>Unievents>OnBeforInit : Fanagrafe_eSesso = sender.getId() ; Fanagrafe = Name of form eSesso = Name of TunidbEdit . the advantage is to be able to reference each Delphi component with a symbolic name in any js script : Ext.getCmp(Fanagrafe_eSesso).setValue("") ; Best regards Salvatore Marullo
  12. Hi Mr. Farshad Mohajeri, a question: it is possible to define the jsname of the Delphi component with the same name of the component in Delphi? Thanks Best Regards Salvatore Marullo
  13. Hi, I believe that you have problems with libray path : see in delphi Tools>Options>Delphi Options - Library Regards Salvatore Marullo
  14. Hi, maybe you can help. see : http://forums.unigui.com/index.php?/topic/2652-extra-unigui-components/?p=18280 Best regards
  15. Hi Semper, Solution for Version 0.93 ........ ........ type TxRadio = class(TUniRadioGroup); <<<<<============================= add TMainForm = class(TUniForm) UniRadioGroup1: TUniRadioGroup; ................................. ................................. ................................. procedure UniFormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; // change the name of the form if uniradiogroup1 is defined in a other Form procedure TMainForm.UniFormCreate(Sender: TObject); Var jsnameRadio : string ; begin if txradio(uniradiogroup1).GetTabControlCount = 1 then begin // I believe it's always 1 jsnameradio := txradio(uniradiogroup1).GetFormControlExtName(1) ; // set Columns of uniradioGroup1 to 4 unisession.AddJS( jsnameRadio +'.nm=' + '"' + jsnameRadio+ '";_cdo_("' +jsnameRadio+ '",' + jsnameRadio+ ',null,MainForm);' + '_coe_(MainForm,"' + jsnameRadio+ '",null,"beforerender",function(sender) {sender.columns = 4 ;' + '});' ) ; end; end; I hope can help You Reagrds , Salvatore Marullo
  16. Hi, never say never. See : http://forums.unigui.com/index.php?/topic/3699-uniradiogroup-multi-column/
  17. Hi, For version 0.94 is quite simple. Use ClientEvents.ExtEvents uses. see image attachments. For version 0.93 is a little bit complicated, let me know if you are interested in the solution for version 0.93 Regards Salvatore Marullo
  18. small tips : change tunidbnavigator icon, Border at runtime. 1) add Type txnav = class(TUniDBNavigator); <<<<<============================= TFUnitName = class(TUniForm) UniLabel1: TUniLabel; ... ... navdbgrid: TUniDBNavigator; ..... ...... end; 2) add in uses clause vcl.dbctrls; <<<<<============================ 3) add UniformCreate .......... procedure TFUnitName.UniFormCreate(Sender: TObject); var jsnameButton : String Begin // Js Solution With Border and Style jsnamebutton := txnav(navadbgrid).Buttons[nbrefresh].jsname; unisession.AddJS(jsnamebutton+'.nm=' + '"' + jsnamebutton + '";_cdo_("' +jsnamebutton + '",' + jsnamebutton + ',null,FunitName);' + '_coe_(FunitName,"' + jsnamebutton + '",null,"beforerender",function(sender,eOpts) {sender.border = 1 ;' + ' sender.style = { borderColor: ''blue'', borderStyle: ''solid''} ;' + ' sender.icon = "' + servermodule.UniServerModule.FilesFolderURL + 'nbrefreshbutton.png' + '"; });' ) ; jsnamebutton := txnav(navdbgrid).Buttons[nbcancel].jsname; unisession.AddJS(jsnamebutton+'.nm=' + '"' + jsnamebutton + '";_cdo_("' +jsnamebutton + '",' + jsnamebutton + ',null,FunitName);' + '_coe_(FunitName,"' + jsnamebutton + '",null,"beforerender",function(sender,eOpts) {sender.border = 1 ;' + ' sender.style = { borderColor: ''blue'', borderStyle: ''solid''} ;' + ' sender.icon = "' + servermodule.UniServerModule.FilesFolderURL + 'nbcancelbutton.png' + '"; });' ) ; ................. ................. ................. ................. // Delphi Solution Without Border and Style (* txnav(navdbgrid).Buttons[nbrefresh].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderpath+'nbrefreshbutton.png') ; txnav(navdbgrid).Buttons[nbcancel].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderpath+'nbcancelbutton.png') ; txnav(navdbgrid).Buttons[nbedit].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbeditbutton.png') ; txnav(navdbgrid).Buttons[nbinsert].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderURL+'nbinsertbutton.png') ; txnav(navdbgrid).Buttons[nblast].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nblastbutton.png') ; txnav(navdbgrid).Buttons[nbnext].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbnextbutton.png') ; txnav(navdbgrid).Buttons[nbprior].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbpriorbutton.png') ; txnav(navdbgrid).Buttons[nbfirst].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbfirstbutton.png') ; txnav(navdbgrid).Buttons[nbdelete].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbdeletebutton.png') ; txnav(navdbgrid).Buttons[nbpost].Glyph.LoadFromFile(servermodule.UniServerModule.FilesFolderPath+'nbpostbutton.png') ; *) end; P.s. have not been able to monitor if there are any performance issues on the Internet. Regards Salvatore Marullo
  19. Hi, probably the best solution at this time !! Regards
  20. hi Delphi Developer, simple, from js code generated by unigui in this example O32 is UniMainMenu O3A and O3F are UniMenuItem O32=new Ext.toolbar.Toolbar({id:"O32_id",height:26,items:[O3A,O3F]}); O3F=new Ext.button.Button({id:"O3F_id",text:"Test1"}); O3A=new Ext.button.Button({id:"O3A_id",text:"Test2"}); As I said this is only applicable for demonstration test, definitely not for production. 1) Start your program, looks for Jsname of UniMainMenu in Js generate code 2) change your code and add procedure TMainForm.UniFormCreate(Sender: TObject); begin unisession.addjs( 'O32.nm="O32";_cdo_("O32",O32,null,MainForm);' + '_coe_(MainForm,"O32",null,"beforerender",function(sender) {sender.height = 60;});') ; end; 3) Compile and Run : It work !!! 2 . Solution ( not tested 100% ) Add Type TZMainMenu = class(TuniMainMenu) ; ..... ........ Var JsnameMainMenu : string ; JsnameMainMenu := TZMainMenu(unimainmenu1).GetMenuControl.JSName ; // unimainmenu1 is the name of TuniMainMenu component. ============================================================================= P.S. honestly do not know how complicated is for Mr. Farshad to add the Property JSName for UniMainMenu and UniMenuItem , definitely the best solution. Regards. Salvatore Marullo
  21. Hi , I believe that the problem is not having the ability to access the properties of the jsname of UniMainMenu and UniMenuItem. Only for demonstration purposes, I have tried the following code: in my example >> O3B is the Jsname of UniMainMenu procedure TMainForm.UniFormCreate(Sender: TObject); begin unisession.addjs( 'O3B.nm="O3B";_cdo_("O3B",O3B,null,MainForm);' + '_coe_(MainForm,"O3B",null,"beforerender",function(sender) {sender.height = 60;});') ; end; this works Regards, Salvatore Marullo
  22. hi, if you want you can try : without CSS procedure TMainForm.UniFormCreate(Sender: TObject); begin unipanel1.ClientEvents.ExtEvents.Add('Onmouseover=function Onmouseove(sender) {Ext.getCmp( ' + uniimage1.jsname +'.show()); ' + 'Ext.getCmp(sender.getId()).body.setStyle(''background'',''lightblue'');} '); unipanel1.ClientEvents.ExtEvents.Add('Onmouseout=function Onmouseout(sender) {Ext.getCmp( ' + uniimage1.jsname +'.hide()); ' + 'Ext.getCmp(sender.getId()).body.setStyle(''background'',''white'');} '); uniimage1.ClientEvents.ExtEvents.Add('Onclick=function Onclick(sender) { ' + unipanel1.JSName +'.setDisabled(true) ;' + ' Ext.MessageBox.show({ msg:"you pressed on Image.",buttons:Ext.MessageBox.OK,maxWidth:300,' + ' fn:showResult , icon:Ext.MessageBox.ERROR}); function showResult(btn){ ' + unipanel1.JSName +'.setDisabled(false) ;} }') ; unipanel1.ClientEvents.ExtEvents.Add('Onclick=function Onclick(sender) { ' + ' Ext.MessageBox.show({ msg:"you pressed on Panel.",buttons:Ext.MessageBox.OK,maxWidth:300,' + ' fn:showResult , icon:Ext.MessageBox.ERROR}); function showResult(btn){} }') ; end; regards, Salvatore Marullo.
×
×
  • Create New...