Jump to content

Button in statusbar


delagoutte

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...