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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...