Jump to content

MessageDlg Custom Button Captions - How ?


andyhill

Recommended Posts

With Windows EXE's I often change the MessageDlg Button Captions in code (mbYesNoCancel Captions--> "Colour", "B/W", "Cancel"), please show me how with UniGUI (I am using Mobile) - Thanks in advance.

MessageDlg('Print In ?', mtConfirmation, mbYesNoCancel, MessageDlgCallBack);

Link to comment
Share on other sites

I would like control over both ("Email PDF In", "Phone Numbers").

                MessageDlg('Email PDF In', mtConfirmation, [mbYes, mbNo, mbCancel], MessageDlgCallBack);
                UniSession.AddJS('Ext.select("#ext-messagebox .x-messageboxtitle .x-text-el").setText("Phone Numbers")');
                UniSession.AddJS('Ext.select("#ext-messagebox .x-button .x-text-el").elements[0].innerHTML="Colour"');
                UniSession.AddJS('Ext.select("#ext-messagebox .x-button .x-text-el").elements[1].innerHTML="B/W"');
                UniSession.AddJS('Ext.select("#ext-messagebox .x-button .x-text-el").elements[2].innerHTML="Cancel"');
 

Link to comment
Share on other sites

5 minutes ago, andyhill said:

I do not want this to be global, can you please show me using the Ext.select code above.

  ...
  UniSession.AddJS('Ext.select("#ext-messagebox .x-messagebox-text").elements[0].style["text-align"]="center"');

 

Link to comment
Share on other sites

On 3/26/2020 at 3:11 AM, andyhill said:

It paints the same in Mobile iOS, I need to either add an icon where I have put the red mark

One possible solution, for example:

  // 24x24 files/Status-dialog-information-icon.png
  UniSession.AddJS('Ext.select("#ext-messagebox .x-icon-el").elements[0].style["background-image"]="url(files/Status-dialog-information-icon.png)";');
  UniSession.AddJS('Ext.select("#ext-messagebox .x-icon-el").elements[0].style["height"]="24px";');
  UniSession.AddJS('Ext.select("#ext-messagebox .x-icon-el").elements[0].style["width"]="24px";');

msgboxicon.png.0c920fec39fabc5cce2902045c83700e.png

Link to comment
Share on other sites

I have been crazily busy Sherzod so test case will come shortly.

In the meantime, can I please have the same ability to Name Buttons for Desktop - thanks in advance (below only works on Mobile).

UniSession.AddJS('Ext.select("#ext-messagebox .x-button .x-text-el").elements[0].innerHTML="Colour"');
UniSession.AddJS('Ext.select("#ext-messagebox .x-button .x-text-el").elements[1].innerHTML="B/W"');
UniSession.AddJS('Ext.select("#ext-messagebox .x-button .x-text-el").elements[2].innerHTML="Cancel"');

Link to comment
Share on other sites

  //////////////////////////////////////////////////////////////////////////////
  // mbYes, mbNo, mbCancel

  // THESE FAIL
  //UniSession.AddJS('Ext.Msg.getStandardButtons().ok.text="OK"');
  //UniSession.AddJS('Ext.Msg.getStandardButtons().yes.text="Families"');
  //UniSession.AddJS('Ext.Msg.getStandardButtons().no.text="Groups"');
  //UniSession.AddJS('Ext.Msg.getStandardButtons().cancel.text="Cancel"');
 

  ?? This WORKS
  Script.Clear;
  s:= 'Ext.onReady(function() '+
      '{ '+
      '  Ext.MessageBox.buttonText = '+
      '  { '+
      '    ok: "OK", '+
      '    cancel: "Cancel", '+
      '    yes: "Families", '+
      '    no: "Groups" '+
      '  }; '+
      '} '+
      '); ';
  Script.Add(s);
 

Incidentally I want a PRIVATE solution for each use, not a Form Wide solution.

Link to comment
Share on other sites

  s:= 'Ext.onReady(function() '+
      '{ '+
      '  Ext.MessageBox.buttonText = '+
      '  { '+
      '    ok: "OK", '+
      '    cancel: "Cancel", '+
      '    yes: "Families", '+
      '    no: "Groups", '+
      '    abort: "Noticeboard" '+
      '  }; '+
      '} '+
      '); ';
 

    MessageDlg('Email PDF', mtConfirmation, [mbYes, mbNo, mbCancel, mbAbort], MessageDlgCallBack);
 

FAILS TO DISPLAY ABORT BUTTON ???

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...