KiBuzzard icon indicating copy to clipboard operation
KiBuzzard copied to clipboard

Add "Advanced Tools" from Buzzard Classic

Open NPoole opened this issue 2 years ago • 13 comments
trafficstars

  • Adds "Advanced" Checkbox which reveals advanced options pane image
  • Adds Inline Formatting from Buzzard Classic image
  • Adds Overlining using KiCad syntax and overline style selection image
  • Adds UI buttons for commonly used symbols image

NPoole avatar Nov 14 '23 21:11 NPoole

Hey, technically, I can marge this myself but if you have a sec, @arturo182 , it'd be good to have a second set of eyes Cheers,

NPoole avatar Nov 16 '23 03:11 NPoole

Sorry about that, somehow I missed the tag from last week. I have just tried it with KiCad nightly on Windows 11 and it ran into a few problems:

  1. Every time I open the dialog, it shows an error because the Thickness edit is empty which causes an Exception (even if Advanced is not checked): image image

(On a separate note, it would probably be better to make the Thickness control the same type as the other numerical controls. As you can see in my screenshot, they have the inc/dec buttons, even though they seem to be missing on your OS).

  1. Even once I put "1" into the Thickness edit, the preview doesn't refresh unless I change the Thickness value or style: kicad

arturo182 avatar Nov 23 '23 01:11 arturo182

Ah, yes, this is why I asked for another set of eyes. The screen shots that I sent you aren't current (and neither was my testing) due to some weird behavior while installing and uninstalling packages in KiCad. I should have noticed immediately. I'll update soon with the fix.

NPoole avatar Nov 23 '23 04:11 NPoole

+1

boromyr avatar Dec 01 '23 13:12 boromyr

Okay, I believe I've fixed it. The latest push (build attached here) seems to work correctly on my machine. @arturo182 please test it on your end when you have a moment. cheers, KiBuzzard-1.2.3-pcm.zip

NPoole avatar Jan 16 '24 21:01 NPoole

Thanks for the fixes :)

I have tested it and it works a lot better now!

There is something weird happening with the Padding, though. It seems the automatic Width calculation is causing issues, perhaps a circular dependency:

kicad

Even if these weird calculation issues are fixed, it seems that as long as changing the Padding updates the Width, then decreasing Left or Right padding will not have any effect because the old Width value will still be set and keeping the label wider than expected.

I also noticed that it's impossible to set Padding to 0, it will always change to 0.001, rounding/float issues.

And there is still a "FUnits" label in the Padding area which doesn't seem to do anything.

A note from a usability angle, the Special Character buttons always append the character to the text, I would expect them to insert the character at cursor position, and if there is a selection, replace the selection. That would align more with how regular typing works.

arturo182 avatar Jan 16 '24 23:01 arturo182

Excellent!

There is something weird happening with the Padding it's impossible to set Padding to 0 "FUnits" label in the Padding area

These bugs pre-exist my PR and appear to have been introduced in commit 88c4129. Fixing them seems to be outside the scope of this PR.

I agree with your usability note, it looks like wxStyledTextCtrl has a method to retrieve the caret position, so I can try inserting the symbol there.

Please advise.

NPoole avatar Jan 23 '24 21:01 NPoole

Oh, my bad, I've been using the 1.5.0 release, #99 was merged after that so I didn't realize it wasn't a part of this. Please ignore my comments regarding that, but @gregdavill, maybe we should revert that PR?

Regarding the usability, if it's not too much work to implement the changes, it would be great to get them in before merging :)

Thanks!

arturo182 avatar Jan 24 '24 01:01 arturo182

@arturo182 Whoops, looks like I didn't test that PR fully. I'll open an issue and look into it, might be easier to just fix rather than a full revert.

gregdavill avatar Feb 16 '24 01:02 gregdavill

Sure, since it's not a part of any release yet, fixing it would work too. But I would definitely advise against making a release with the current state.

arturo182 avatar Feb 16 '24 02:02 arturo182

A note from a usability angle, the Special Character buttons always append the character to the text, I would expect them to insert the character at cursor position, and if there is a selection, replace the selection.

Okay, I tried to get this to work but I can't make it work reliably. It seems like either GetCurrentPos() or GotoPos() from wx doesn't behave as expected when certain special characters are present? The first character insertion always works correctly, but subsequent character insertions will reliably skip certain positions in the string.

I am tempted to go ahead and pull this as-is, if there are no objections. If it turns out there's an alternate behavior for those buttons that people prefer (copy to clipboard?) then that can be a new Issue. I peeked at the conflicts and it'll be a quick merge.

Cheers everyone

NPoole avatar Mar 13 '24 22:03 NPoole

Sounds good, if you can resolve the conflicts and push the update, I will try it out and if all looks good, we can merge :)

arturo182 avatar Mar 14 '24 13:03 arturo182

I think I've done it @arturo182 try it out when you get a chance, thanks!

NPoole avatar Mar 19 '24 05:03 NPoole

Hi all, as it looks like we'll be working to get the "correct sizing" issue amended and then jumping into KiCad v8 compatibility, I'm going to go ahead and pull this now before it gets too far behind. It's been available for testing for a month and a half. If you find that it breaks anything, please revert.

NPoole avatar Apr 30 '24 20:04 NPoole

Thanks @NPoole! Sorry for not taking a look sooner.

As checked in this throws some errors. and notably you've not included an updated text_dialog.fbp for wxformbuilder which we use to generate text_dialog.py.

➤ pcbnew
/home/greg/Projects/KiBuzzard/KiBuzzard/dialog/compat.py:17: wxPyDeprecationWarning: Call to deprecated item. Use SetSizeHints instead.
  super(wx.Dialog, self).SetSizeHintsSz( a,b)
Exception on python action plugin code

Traceback (most recent call last):

  File "/home/greg/Projects/KiBuzzard/KiBuzzard/plugin.py", line 114, in Run
    dlg = Dialog(self._pcbnew_frame, self.config_file, Buzzard(), run_buzzard)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/greg/Projects/KiBuzzard/KiBuzzard/dialog/dialog.py", line 66, in __init__
    self.m_PaddingUnits.SetLabel("")
    ^^^^^^^^^^^^^^^^^^^

AttributeError: 'Dialog' object has no attribute 'm_PaddingUnits'

gregdavill avatar May 05 '24 05:05 gregdavill