Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form loses focus after OpenDialog closes #30

Open
zeo101 opened this issue Jun 8, 2022 · 5 comments
Open

Form loses focus after OpenDialog closes #30

zeo101 opened this issue Jun 8, 2022 · 5 comments
Assignees
Labels
Awaiting Feedback Waiting for feedback from submitter or others.

Comments

@zeo101
Copy link

zeo101 commented Jun 8, 2022

Hi everyone,
I wrote a small multi form program to stamp, split or combine pdfs using pikepdf:
These forms are called using:

def openStamper(self, Sender):
   form_stamper = Stamper_Form(Application)
   form_stamper.Show()

pdftool

If I click on "PDF auswählen" an OpenDialog shows up, that lets me pick the file which should get stamped using:

def btn_openpdfClick(self, Sender):
    self.OpenDialog1.Execute()                                              # Show open dialog to pick a file
    self.pdf_path = self.OpenDialog1.FileName                               # Get file path from open dialog
    self.edit_pdf.Text = self.pdf_path                                      # Show PDF path in disabled edit field

After choosing "open" in the dialog, the pdf_path is set correctly according to the selected file, but the stamper window loses focus and disappears behind the next open window on the desktop:
pdftool2

This is really annoying especially when the other program is in fullscreen mode. Is there any possibility to focus the window again after the OpenDialog closes?

@Priyatham10
Copy link
Member

Hi @zeo101, thank you for pointing the concern. Let me reproduce your issue and will get back to you.

@lmbelo
Copy link
Member

lmbelo commented Jun 9, 2022

Hi @zeo101,

can you share a sample code reproducing this behaviour?

@lmbelo lmbelo self-assigned this Jun 9, 2022
@lmbelo lmbelo added the Awaiting Feedback Waiting for feedback from submitter or others. label Jun 9, 2022
@zeo101
Copy link
Author

zeo101 commented Jun 9, 2022

Hey @lmbelo, I created a small form with delphi 10.4 where I experienced the same behavior as with the multi form programm:
opendialog-test-py.zip

Using:
Windows 10
Python 3.9.6
Delphi 10.4 Version 27.0.40680.4203
Delphi4Python Exporter 1.2.0
delphivcl==0.1.40

@lmbelo
Copy link
Member

lmbelo commented Jun 9, 2022

Thank you @zeo101,

we will figure out this problem.

@gguill17
Copy link

Hi everyone,
I experienced exactly the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Feedback Waiting for feedback from submitter or others.
Projects
None yet
Development

No branches or pull requests

4 participants