estrify Posted May 17, 2013 Posted May 17, 2013 (edited) Hi, This is a sample of how to use tool buttons in form's title. Regards, 20191219_Tools_Usage_Demo.rar Edited December 19, 2019 by estrify Updated to work with UniGUI 1.90.0.1514 3 Quote
David Oliveira Posted June 4, 2014 Posted June 4, 2014 Hi, Very cool, In unigui beta version 0.95.0.1046 not work, so based on that, I made a small adjustment to function properly: In the Form ClientEvents.UniEvents Create a beforeInit event, the contents of this event should look like this: function window.beforeInit(sender) { Ext.apply (sender, { tools: [{ type: 'pin', tooltip: 'tooltip of pin', handler: function(event, toolEl, panel){ ajaxRequest(sender, 'tool', [ 'btn=pin' ] ); } }, { type: 'refresh', tooltip: 'tooltip of refresh', handler: function(event, toolEl, panel){ ajaxRequest(sender, 'tool', [ 'btn=refresh' ] ); } },{ type: 'search', tooltip: 'tooltip of search', handler: function(event, toolEl, panel){ ajaxRequest(sender, 'tool', [ 'btn=search' ] ); } },{ type: 'save', tooltip: 'tooltip of save', handler: function(event, toolEl, panel){ ajaxRequest(sender, 'tool', [ 'btn=save' ] ); } }] }); } And OnAjaxEvent event look like this: procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if EventName='tool' then ShowMessage('Button '+Params.Values['btn']+' pressed'); end; I have helped those who had the same problem I had. Hugs! Quote
estrify Posted December 19, 2019 Author Posted December 19, 2019 Updated to work with UniGUI 1.90.0.1514 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.