← Back to team overview

kicad-developers team mailing list archive

Re: Modedit graphical item properties dialog patch

 

Hi all,

As we discussed attached is a patch to correct SetFocus issues and the
CancelButtonIssue.

SetFocus requires DLGSHIM_USE_SETFOCUS to be set, which is only set when
__WXMAC__ is defined.
I've tested this on my system and it is working -> example is the eeschema
edit reference value dialog which was still not working...

FixCancelButtonIssue() is now called from DIALOG_SHIM::Show and was removed
from all the dialogs. Should it be made private?
This is working for all the created dialogs, apart from
the wxTextEntryDialog default dialogs... Although the issue can be fixed by
the same trick.

I've also noticed the pcbnew/dialog_track_via_properties is not
autoresizing well in every system... Like the graphical lines is... This is
not related with this patch... Should this also be addressed?

There are also some SetFocus optimisations I will work on. Like track_vias
and graphical items to select the first coordinate. And also SetSelection
to select the text...

BR,
Diogo





On Thu, Jan 26, 2017 at 4:13 PM, Wayne Stambaugh <stambaughw@xxxxxxxxx>
wrote:

> On 1/26/2017 10:06 AM, Diogo Condeço wrote:
> > @Orson yes moving it into Show seems to work. I will remove the
> > FixOSXCancelButtonIssue() call from other dialogs to test it further...
> >
> > The only dialog I found this doesn't work is the new input for a new
> > footprint on the module editor...
> >
> > @Wayne this is the cancel (cmd-c) button issue... I don't see how the
> > SetFocus can be resolved in this DIALOG_SHIM since the field to have
> > focus is different from dialog to dialog...
>
> If a control (wxWindow) has the focus set in the dialog constructor, I'm
> guessing that wxWindow::FindFocus() will return that window called from
> Show() so you do not need direct access to the pointer to the control.
> I could be wrong but it should be fairly easy to test.
>
> >
> > On Thu, Jan 26, 2017 at 2:26 PM, Wayne Stambaugh <stambaughw@xxxxxxxxx
> > <mailto:stambaughw@xxxxxxxxx>> wrote:
> >
> >     On 1/26/2017 2:52 AM, Maciej Sumiński wrote:
> >     > On 01/25/2017 08:14 PM, Diogo Condeço wrote:
> >     >> Hi all,
> >     >>
> >     >> This patch corrects the CMD+C cancel dialog bug on macos... There
> are still
> >     >> some both in the footprint editor, and the board editor. I will
> try to
> >     >> patch them once i can get some free time.
> >     >
> >     > I wonder if FixOSXCancelButtonIssue() call could be moved to OnShow
> >     > event handler in DIALOG_SHIM. This way it would be invoked
> automatically
> >     > for every dialog inheriting from DIALOG_SHIM (and I guess this
> covers
> >     > majority of cases) without manually fixing them one by one.
> >     >
> >     >> There is still the setfocus issue, which I will try to get later
> on... But
> >     >> I would like to go through the code, since I don't really know if
> there is
> >     >> the need to have two different classes for
> graphical_item_properties... One
> >     >> for the FP editor another for the Board Editor... << Any input on
> this?
> >     >
> >     > There is a lot of repeated code, but also a few subtle
> differences. If
> >     > everything could be covered by the same code, I am for it.
> >
> >     I was thinking the same thing as each of these patches has very
> similar
> >     code.  This is why DIALOG_SHIM exists to provide features and fixes
> to
> >     wxDialog.  If they osx focus fix can be handled in DIALOG_SHIM, than
> I
> >     would prefer it be fixed there rather than every single dialog
> >     source file.
> >
> >     >
> >     > Regards,
> >     > Orson
> >     >
> >     >> Thanks,
> >     >>
> >     >>
> >     >>
> >     >> _______________________________________________
> >     >> Mailing list: https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     >> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >     >> Unsubscribe : https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     >> More help   : https://help.launchpad.net/ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >     >>
> >     >
> >     >
> >     >
> >     >
> >     > _______________________________________________
> >     > Mailing list: https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >     > Unsubscribe : https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     > More help   : https://help.launchpad.net/ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >     >
> >
> >     _______________________________________________
> >     Mailing list: https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >     Unsubscribe : https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     More help   : https://help.launchpad.net/ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >
> >
> >
> >
> > --
> > Diogo Condeço
>



-- 
Diogo Condeço

Attachment: 0001-MACOS-Setfocus-and-CancelButtonIssue-moved-into-dial.patch
Description: Binary data


Follow ups

References