Recent

Author Topic: [SOLVED] Form, Save as dialog do not accept keystrokes  (Read 455 times)

jcdammeyer

  • Full Member
  • ***
  • Posts: 119
  • Embedded System Developer
    • Automation Artisans Inc.
[SOLVED] Form, Save as dialog do not accept keystrokes
« on: December 23, 2020, 12:37:47 am »
I am having some success.  I dragged a folder from my WIN-7 system into the documents folder on the Mac.  It's a wizard to create G-Code files for LinuxCNC or MACH3 on Windows.  The program compiles and runs on the Mac without errors. 

The only issues is the form and save as dialog.  For some reason it won't accept key press or the delete key.  So I can only save the file as .ngc  The contents of the file are correct.  The buttons work.   If I run it separately from outside Lazarus it launches a terminal window and keystrokes go to it.  The file is an executable based on ls -al in the folder.

I keep pushing Lazarus as a better solution for PCs and Raspberry Pi and Beagles compared to Python.  I'm rapidly changing my mind with respect to the Apple.  It shouldn't be this hard.
« Last Edit: December 23, 2020, 09:49:58 pm by trev »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1282
  • Former Delphi 1-7, 10.2 User
Re: Form, Save as dialog do not accept keystrokes
« Reply #1 on: December 23, 2020, 07:05:46 am »
What happens if you start a new application project with a form, a couple of edit boxes and a Save as dialog? Do you still have the issue? If so, Lazarus > Project > Publish Project and upload the compressed file here.
Lazarus 2.1 r64368 FPC 3.3.1 r48100 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r64455 3.3.1 r48840   macOS 11.2.2 aarch64 Xcode 12.4
Lazarus 2.1 r61574 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 3.2.0 Win10 Parallels VM

jcdammeyer

  • Full Member
  • ***
  • Posts: 119
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Form, Save as dialog do not accept keystrokes
« Reply #2 on: December 23, 2020, 08:00:30 am »
Here's the MakeBore program.  It was whipped out really quickly in response to comments on the LinuxCNC forum that there was nothing wrong with a command line app that asked for parameters.  I disagreed and used the C code and wrote it as a Lazarus app.  Works on Windows, Beaglebone, Pi and LinuxCNC.

When I compile this I can't change the fields.  The exit button works.  The Save File opens up the dialog but won't let me change the file name.

The code is very messy.  Not my best work by any means but then it wasn't meant to be seen by anyone.
« Last Edit: December 23, 2020, 08:04:06 am by jcdammeyer »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1282
  • Former Delphi 1-7, 10.2 User
Re: Form, Save as dialog do not accept keystrokes
« Reply #3 on: December 23, 2020, 11:28:53 am »
You did not create an application bundle :)

Lazarus > Project > Project Options > Application - Create Application Bundle.

Your application then works normally.
« Last Edit: December 23, 2020, 11:31:13 am by trev »
Lazarus 2.1 r64368 FPC 3.3.1 r48100 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.1 r64455 3.3.1 r48840   macOS 11.2.2 aarch64 Xcode 12.4
Lazarus 2.1 r61574 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 3.2.0 Win10 Parallels VM

jcdammeyer

  • Full Member
  • ***
  • Posts: 119
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Form, Save as dialog do not accept keystrokes
« Reply #4 on: December 23, 2020, 06:06:33 pm »
That's odd.  Is this something unique to Mac?  I've created all sorts of apps on my WIN-7 or WIN-10 PC and then dragged the files over to a Pi or put them on a USB stick for the LinuxCNC system.  They've always run including this one.  I've never used the create application bundle.

Guess I'd better read the docs to find out specifically what that does and why it's needed.  Blindly do that operation without knowing why means I'll screw up again...

jcdammeyer

  • Full Member
  • ***
  • Posts: 119
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Form, Save as dialog do not accept keystrokes
« Reply #5 on: December 23, 2020, 06:45:42 pm »
Interesting.  The original project files on the PC that was dragged over onto the Mac did not have that macOS box checked.  Which makes sense since it wasn't targeted for the Mac.  By default the new project on the Mac does check it.  Might be useful too see a warning when compiling?

Now it not only allows data entry but runs with debugging! Yahoo!  And with include debugging in the Projects Options even does breakpoints and single stepping.   However, a watch on OutputBuffer or hovering over that objects string variable does not show the result of an assignment. 

Thanks for such a simple fix.

 

TinyPortal © 2005-2018