delagoutte Posted October 13, 2016 Posted October 13, 2016 How having a button on a TVCLStatusPanel in a Tunistatusbar and not text. what is style option "psownerDraw" how use it ? Quote
Sherzod Posted October 14, 2016 Posted October 14, 2016 what is style option "psownerDraw" how use it ? Hi, For now can you try to use HTML style attribute? for example: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniStatusBar1.Panels[0].Text := '<span style="color: red;"><b>T</b></span>est' end; Best regards. Quote
Sherzod Posted October 14, 2016 Posted October 14, 2016 How having a button on a TVCLStatusPanel in a Tunistatusbar and not text. For now can you try this approach?!: 1. UniStatusBar -> Height = 38 2. procedure TMainForm.UniFormReady(Sender: TObject); begin UniSession.AddJS( UniStatusBar1.JSName + '.items.add(Ext.create("Ext.button.Button", {'+ ' text: "Btn",'+ ' id: "_btn1",'+ ' handler: function() {'+ ' ajaxRequest('+ MainForm.WebForm.JSName +', "_btnclick", ["btnId=" + this.id])'+ ' }'+ '})); '+ UniStatusBar1.JSName +'.doLayout();' ); end; 3. procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_btnclick' then ShowMessage('"_btn1" Clicked'); end; Best regards. Quote
delagoutte Posted October 17, 2016 Author Posted October 17, 2016 Yes it's working. a last Question : if before create the button, i have 3 vclstatuspanelthat are create on design. How can i create the button between 2 existing panel betwween 2 and 3 for exemple ? Quote
Sherzod Posted October 17, 2016 Posted October 17, 2016 a last Question : if before create the button, i have 3 vclstatuspanelthat are create on design. How can i create the button between 2 existing panel betwween 2 and 3 for exemple ? Hi, Then you should use insert() instead of add(). For example: procedure TMainForm.UniFormReady(Sender: TObject); begin UniSession.AddJS( UniStatusBar1.JSName + '.items.insert(0, Ext.create("Ext.button.Button", {'+ ... Best regards. Quote
delagoutte Posted October 17, 2016 Author Posted October 17, 2016 answer faster than lucky luck . I will try but I do not doubt that it works. thank you in advance 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.