kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #45027
Re: UI only updates on mouse move
-
To:
Jon Evans <jon@xxxxxxxxxxxxx>
-
From:
Markus Bonk <markus_bonk@xxxxxxxxxxxxxxx>
-
Date:
Fri, 26 Mar 2021 13:28:33 +0000
-
Accept-language:
en-US
-
Arc-authentication-results:
i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=3dconnexion.com; dmarc=pass action=none header.from=3dconnexion.com; dkim=pass header.d=3dconnexion.com; arc=none
-
Arc-message-signature:
i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mUforRskVVM42exRzbbWoNhOp9ylL0ZqaouxJL4H9dE=; b=fi7Vd8DS1rNe05/hH6yq9OSJ7YPtJ8qsd/FhqN6BL7DwRRMkdp0vP27tBDHypwch831Aa+DUWPWjLoyRRrVPtutG52QPs6HaD34owH3vU9GE1ywZD/z47oild8Gzno7k6qGMrRmXyxqlWmYubd7NBZHxyFXyuDqNfzaQy201sf0Nl+usLZ4Tvxu6F5lkNQD7oJLpKI7DLL6S04LPX0wKZkrLWo8gw6VgnfaQodMCYT17XNbJqduqqz9MM0XYf4fUPPBkRMA2AhtMOfwVWui2myBtwvZFUTDVhscPf7/dnR4dtYAdW52I1TIOa74zFG+bHDT7qKrBl/SEo4ENhy1xbw==
-
Arc-seal:
i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F3Fj1/7TknaNUDUNslfy6z+0Dzz2oOJBmgO+8i/pzqV56r+z9C79njGhVW304Xr2+9yXlnGaC1hOGt8A5sbhyaeWz+lpN8KiQpLqrN3shU2nvjZQ8cTatYP3C4gNVCFvETvXzTqynBgHiskFex+WMBqWvGY1Uq/nkcwb3peLx1h50EqN3DWTbhhkJ0E2C7deLgkH0vq+h9g6j1BP/Qpb6SNuKkarQrhwVU7uq4iT5e1qauAXO28ewJVIGOFXfOOBE8QvNXEOZf0Z3lNaDCaD8Yljt7f/nR3Y93yrHZ7n7RgegR6NtRcw7jjkH/JiIei90XbVo/RA2pEHnA/NsOS1HQ==
-
Authentication-results-original:
craftyjon.com; dkim=none (message not signed) header.d=none; craftyjon.com; dmarc=none action=none header.from=3dconnexion.com;
-
Cc:
"kicad-developers@xxxxxxxxxxxxxxxxxxx" <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
In-reply-to:
<CA+qGbCDSjhtw+uiC0Zba93nJeU2jNoOGg+TERDb6Ab+=ztDs_Q@mail.gmail.com>
-
Thread-index:
AdchgddIBtU9UduqQXeQG1wJAryHVwAOcEaAACILTXA=
-
Thread-topic:
[Kicad-developers] UI only updates on mouse move
Hi Jon,
Thanks, for the pointer.
-Markus
From: Jon Evans <jon@xxxxxxxxxxxxx>
Sent: Thursday, March 25, 2021 10:13 PM
To: Markus Bonk <markus_bonk@xxxxxxxxxxxxxxx>
Cc: kicad-developers@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Kicad-developers] UI only updates on mouse move
Hi Markus,
I assume NL_3D_VIEWER_PLUGIN_IMPL is all your custom code as it doesn't exist in KiCad's codebase.
Refreshing the display is a separate action that can be called when needed.
Some of the other actions do the refresh for you, but some do not.
It looks like you can send a EDA_3D_CONTROLLER::ZoomRedraw event to do the refresh on the 3D viewer canvas
Best,
Jon
On Thu, Mar 25, 2021 at 10:32 AM Markus Bonk <markus_bonk@xxxxxxxxxxxxxxx<mailto:markus_bonk@xxxxxxxxxxxxxxx>> wrote:
Hi,
I am calling the following code:
long NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand( std::string commandId )
{
if( commandId.empty() )
{
return 0;
}
std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
TOOL_ACTION* context = nullptr;
for( std::list<TOOL_ACTION*>::const_iterator it = actions.begin(); it != actions.end(); it++ )
{
TOOL_ACTION* action = *it;
std::string nm = action->GetName();
if( commandId == nm )
{
context = action;
}
}
if( context != nullptr )
{
wxWindow* parent = m_viewport3D->GetParent();
// Only allow command execution if the window is enabled. i.e. there is not a modal dialog
// currently active.
if( parent->IsEnabled() )
{
TOOL_MANAGER* tool_manager = static_cast<PCB_BASE_FRAME*>( parent )->GetToolManager();
if( tool_manager == nullptr )
{
return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
}
// Get the selection to use to test if the action is enabled
SELECTION& sel = tool_manager->GetToolHolder()->GetCurrentSelection();
bool runAction = true;
if( const ACTION_CONDITIONS* aCond =
tool_manager->GetActionManager()->GetCondition( *context ) )
{
runAction = aCond->enableCondition( sel );
}
if( runAction )
{
tool_manager->RunAction( *context, true );
}
}
else
{
return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
}
}
return 0;
}
The issue I am experiencing is with tool_manager->RunAction( *context, true );
If instead of true, false is specified then the action is not run until the 2D mouse is moved. Or if true then the action is run immediately, however the UI is not updated until the 2D mouse is moved (for example in the 3D-viewer when orthographic/perspective is toggled). This is on windows.
Can anyone let me know what I need to do to get the UI to update as I would expect?
Thanks
-Markus
________________________________
Markus Bonk
Senior Software Engineer
[cid:image001.gif@01D7224C.27C46440]
Clarita-Bernhard-Str. 18
81249 München
Germany
markus_bonk@xxxxxxxxxxxxxxx<mailto:markus_bonk@xxxxxxxxxxxxxxx>
www.3dconnexion.com<http://www.3dconnexion.com>
Geschäftsführer: Antonio Pascucci
Sitz der Gesellschaft: München
Registergericht: München HRB 99232
This email and any files transmitted with are from 3Dconnexion GmbH. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact 3Dconnexion GmbH by calling +49 89 8974542-0 and then delete it. Please note that neither 3Dconnexion GmbH nor the sender accepts any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. Any opinion expressed in this email are those of the individual and not necessarily those of 3Dconnexion GmbH.
3Dconnexion GmbH processes and stores for commercial purposes your personal data, collected upon your consent, in accordance with its privacy policy available at https://www.3dconnexion.eu/privacy.html, which has been drafted in accordance with Regulation (EU) no. 679/2016 and all applicable local data protection laws and regulations of the countries where the company operates. To revoke your consent or exercise all your rights with regards to personal data, please contact us at privacy@xxxxxxxxxxxxxxx<mailto:privacy@xxxxxxxxxxxxxxx>.
_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx<mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~kicad-developers
More help : https://help.launchpad.net/ListHelp
References