Jump to content

artem_niko

uniGUI Subscriber
  • Posts

    635
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by artem_niko

  1. On 11/23/2022 at 5:43 PM, Sherzod said:

    Have you added this code?

    Yes, I added this line. The button appears where I wanted it to. But when I click it, the drop-down menu is not filled with a list of open tabs. There are no errors, but the list is not filled in either.

    Why?

  2. 3 minutes ago, Sherzod said:

     

    Вот и причина ошибки...

    Я заменил на это, но ничего не помогло:

        MessageDlg('Close?<br>',mtConfirmation, mbYesNo,
        procedure(Sender: TComponent; ARes: Integer)
        var
          i: Integer;
        begin
          case ARes of
            mrYes:
            begin
              UniMainModule.AllowClose:=True;
    
              i:=0;
              for i := 0 to (Sender as TUniTabSheet).ComponentCount - 1 do
              begin
                if (Sender as TUniTabSheet).Components[i] is TFDConnection then
                   ((Sender as TUniTabSheet).Components[i] as TFDConnection).Connected:=False;
    
                if (Sender as TUniTabSheet).Components[i] is TFDQuery then
                   ((Sender as TUniTabSheet).Components[i] as TFDQuery).Close;
              end;
            end;
          end;
        end
        );
        UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("Подтверждение действия")');
      end;

     

  3. 4 minutes ago, Sherzod said:

    Обратите внимание на Sender as...

    А что не так с ним?

    Просто, событие закрытия вкладки присваивается к динамически создаваемым UniTabSheet.

    Если закрываю вкладку без подтверждения, то все закрывается нормально, без ошибок.

    Кстати, сейчас заметил, что если сначала вызывается эта ошибка от браузера, то если потом нажать повторно на закрытие вкладки, то она закрывается нормально, без ошибки уже.

  4. 8 minutes ago, Sherzod said:

    In such a case, you should not use callback...

    Даже если я не использую это свойство, то все равно выдается ошибка браузера.

    Может с моим кодом что-то не то? Ведь ошибка связана с несоответствием классов каких-то, но я не вижу в коде явной ошибки...

  5. On 11/5/2021 at 7:25 PM, estrify said:

    Hi,

    One possible solution (with EnableSynchronousOperations=False) :

    ...  
    private
      { Private declarations }
      AllowClose_UniTabSheet3: Boolean;
    ...
    
    
    
    procedure TMainForm.UniTabSheet3BeforeFirstActivate(Sender: TObject; var
        AllowActivate: Boolean);
    begin
      AllowClose_UniTabSheet3:=False;
    end;
    
    
    
    procedure TMainForm.UniTabSheet3Close(Sender: TObject; var AllowClose: Boolean);
    begin
      AllowClose:=AllowClose_UniTabSheet3;
      if not AllowClose_UniTabSheet3 then
      begin
        MessageDlg('Close?', TMsgDlgType.mtInformation, mbYesNo,
          procedure(Sender: TComponent; Res: Integer)
          begin
            if Res=mrYes then
            begin
              AllowClose_UniTabSheet3:=true;
              UniTabSheet3.Close();
            end;
          end
        );
      end;
    end;

    Regards,

     

    Hello!

    My code:

    procedure TMainForm.UniTabSheet1(Sender: TObject; var AllowClose: Boolean);
    begin
      AllowClose:=UniMainModule.AllowClose;
    
      if not UniMainModule.AllowClose then
      begin
        MessageDlg('Close?',TMsgDlgType.mtConfirmation, mbYesNo,
        procedure(Sender: TComponent; Res: Integer)
        var
          i: Integer;
        begin
          if Res = mrYes then
          begin
            UniMainModule.AllowClose:=True;
    
            i:=0;
            for i := 0 to (Sender as TUniTabSheet).ComponentCount - 1 do
            begin
              if (Sender as TUniTabSheet).Components[i] is TFDConnection then
                 ((Sender as TUniTabSheet).Components[i] as TFDConnection).Connected:=False;
    
              if (Sender as TUniTabSheet).Components[i] is TFDQuery then
                 ((Sender as TUniTabSheet).Components[i] as TFDQuery).Close;
            end;
           end;
          end
        );
        UniSession.AddJS('Ext.get("messagebox-1001_header-title-textEl").setText("Подтверждение действия")');
      end;
    end;

    and I get error:

    image.png.62adea130377b70b4de574f923612008.png

    In UniMainModule:

    image.png.074d5b6bfe24d79ab9d1aa499a8d1df6.png

  6. 6 minutes ago, Sherzod said:

    This post may help you:

     

    The code on this link is good, by the way, yes, it will be useful to me later now.
    But!
    My question is not about the tab closing event, namely when the tab was already closed, after it was closed.
    I need to unload the DLL package simply.
    If I put the upload code in the tab closing event, the application freezes, because the tab is created dynamically and destroyed by clicking on the button.

    How to execute the code exactly after closing the tab?

  7. Good afternoon!

    Does UniPageControl have some kind of property, event, with which it would be possible to track the moment of closing of some tab?
    For example, if there are 3 tabs on UniPageControl now, then if some tab is closed, then execute the code.
    I don't mean the onClose event in UniTabSheet. I need to track, at the UniPageControl level, the moment that some tab closed.

  8. On 12/20/2022 at 10:54 PM, Sherzod said:

    Добрый вечер, 

    Что-то вроде этого:

     

    Так там про Google. 

    Там что, с Госуслугами, также делается?

    Мне надо просто вызвать форму авторизации на Госуслугах, чтобы пользователь ввел там свои данные, закрыть ее потом, если данные верны, сохранять мне не надо их.

  9. On 9/27/2017 at 1:18 AM, Sherzod said:

    Hi,

     

     

    At the moment you can add these CSS classes in viewer.css: (\FMSoft\Framework\uniGUI\uni-1.0.0.xxxx\pdf.js\web)

    .download {
        display:none !important;
    }
    
    .print {
        display:none !important;
    }
    
    .openFile {
        display:none !important;
    }

    Or by changing viewer.html by adding hidden class...

     

    Please, for check, do not forget to clear your browser's cache

     

    A similar request:

    http://forums.unigui.com/index.php?/topic/8894-unipdfframe-improvement-request/

     

    Try...

     

    Best regards,

    Hello!

    How hide this button?

    image.png.b91d0fe681d6e4123d4aa2eee1668516.png

  10. On 2/24/2019 at 2:59 AM, Sherzod said:

    Hello,

    Because pdfjs does not support themes, one possible solution, you need to change viewer.css ( for example in a folder \FMSoft\Framework\uniGUI\uni-1.70.0.14xx\pdf.js\web )

    Just add the following css rules at the end, and don't forget to clear your browser's cache:

    #viewer, #toolbarViewer {
        background-color: green !important
    }        
    
    .toolbarButton, .secondaryToolbarButton, .overlayButton {
       	background-color: orange !important;
    }

    pdfjsTheme.png.b38ed5ea07ca897e6e4f1d67f75f2138.png

    Hello!

    How change font color in caption and background color of popupmenu?

    image.png.07a2dbaad02377078b8ddde31194e3bd.png

  11. 10 minutes ago, Sherzod said:

    Думаю, да. Я не смотрел документацию, но мне кажется Вы должны указать конкретный домен. 

    Возможно...

    У меня есть домен, но нет пока сервера, на котором бы я расположил свой проект, т.е. Яндекс не может, скорее всего, достучаться до моего компа на локалхост

  12. 5 minutes ago, Sherzod said:

    Try adding the script directly to the HTMLFrame.

    Like this?

    <script src="https://captcha-api.yandex.ru/captcha.js" defer></script>
    <div
        id="captcha-container"
        class="smart-captcha"
        data-sitekey="cdsfdsfsdfsdfsdfsdfsdfsdfsy0JsvFRzTyZZ"
    ></div>

    As result:

    image.png.f4457aa86321afaaf224364003192092.png

×
×
  • Create New...