Jump to content

Изменение Title в showmessage в Mobile Aplication


Sergii

Recommended Posts

ДОброго времени суток

Столкнулся с проблемой. Способ изменения Title в showmessage (Mobile Application) выдает ошибку.

showmessage('Пример');
UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("Пример")');

Тестовый пример ниже. Как полечить?

image.png.704ade3d0ea26873a04e3002aeef4dbe.png

Example.rar

Link to comment
Share on other sites

Здравствуйте,

procedure TMainmForm.UnimButton5Click(Sender: TObject);
begin
  ShowMessage('Привет!');
  UniSession.AddJS('Ext.select("#ext-messagebox .x-messageboxtitle .x-text-el").setText("Привет!")');
end;

 

Link to comment
Share on other sites

procedure MyMessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; CallBack: TUniDialogCallBackAnonProc);
begin
  MessageDlg(Msg, DlgType, Buttons, CallBack);

// далее локализация и кастомизация диалога

  if not UniMainModule.IsMobilePlatform then
  begin// десктоп
    UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("' + constAttention + '")');// внимание
  end
  else
    begin// смартфон
      UniSession.AddJS('Ext.select("#ext-messagebox .x-messageboxtitle .x-text-el").setText("' + constAttention + '")');// внимание

      if Buttons = mbYesNo then
      begin
        UniSession.AddJS('Ext.select("#ext-messagebox .x-button .x-text-el").elements[0].innerHTML="' + constBtnYes + '"');// да
        UniSession.AddJS('Ext.select("#ext-messagebox .x-button .x-text-el").elements[1].innerHTML="' + constBtnNo + '"');// нет
      end;

      UniSession.AddJS('Ext.select("#ext-messagebox .x-icon-el").elements[0].style["background-image"]="url(files/dialoginfo24.png)";');// моя иконка
    end;
end;

 

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