本文整理汇总了C++中BASE_SCREEN::IsBlockActive方法的典型用法代码示例。如果您正苦于以下问题:C++ BASE_SCREEN::IsBlockActive方法的具体用法?C++ BASE_SCREEN::IsBlockActive怎么用?C++ BASE_SCREEN::IsBlockActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BASE_SCREEN
的用法示例。
在下文中一共展示了BASE_SCREEN::IsBlockActive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMouseEvent
//.........这里部分代码省略.........
/*******************************/
// Command block can't start if mouse is dragging a new panel
static EDA_DRAW_PANEL* lastPanel;
if( lastPanel != this )
{
m_minDragEventCount = 0;
m_canStartBlock = -1;
}
/* A new command block can start after a release buttons
* and if the drag is enough
* This is to avoid a false start block when a dialog box is dismissed,
* or when changing panels in hierarchy navigation
* or when clicking while and moving mouse
*/
if( !event.LeftIsDown() && !event.MiddleIsDown() )
{
m_minDragEventCount = 0;
m_canStartBlock = 0;
/* Remember the last cursor position when a drag mouse starts
* this is the last position ** before ** clicking a button
* this is useful to start a block command from the point where the
* mouse was clicked first
* (a filter creates a delay for the real block command start, and
* we must remember this point)
*/
m_CursorStartPos = GetParent()->GetCrossHairPosition();
}
if( m_enableBlockCommands && !(localbutt & GR_M_DCLICK) )
{
if( !screen->IsBlockActive() )
{
screen->m_BlockLocate.SetOrigin( m_CursorStartPos );
}
if( event.LeftDown() )
{
if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE )
{
SetAutoPanRequest( false );
GetParent()->HandleBlockPlace( &DC );
m_ignoreNextLeftButtonRelease = true;
}
}
else if( ( m_canStartBlock >= 0 ) && event.LeftIsDown() && !IsMouseCaptured() )
{
// Mouse is dragging: if no block in progress, start a block command.
if( screen->m_BlockLocate.GetState() == STATE_NO_BLOCK )
{
// Start a block command
int cmd_type = kbstat;
// A block command is started if the drag is enough. A small
// drag is ignored (it is certainly a little mouse move when
// clicking) not really a drag mouse
if( m_minDragEventCount < MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND )
m_minDragEventCount++;
else
{
auto cmd = (GetParent()->GetToolId() == ID_ZOOM_SELECTION) ? BLOCK_ZOOM : 0;
if( !GetParent()->HandleBlockBegin( &DC, cmd_type, m_CursorStartPos, cmd ) )
{
示例2: OnMouseEvent
//.........这里部分代码省略.........
/*******************************/
// Command block can't start if mouse is dragging a new panel
static EDA_DRAW_PANEL* lastPanel;
if( lastPanel != this )
{
m_minDragEventCount = 0;
m_canStartBlock = -1;
}
/* A new command block can start after a release buttons
* and if the drag is enough
* This is to avoid a false start block when a dialog box is dismissed,
* or when changing panels in hierarchy navigation
* or when clicking while and moving mouse
*/
if( !event.LeftIsDown() && !event.MiddleIsDown() )
{
m_minDragEventCount = 0;
m_canStartBlock = 0;
/* Remember the last cursor position when a drag mouse starts
* this is the last position ** before ** clicking a button
* this is useful to start a block command from the point where the
* mouse was clicked first
* (a filter creates a delay for the real block command start, and
* we must remember this point)
*/
m_CursorStartPos = GetParent()->GetCrossHairPosition();
}
if( m_enableBlockCommands && !(localbutt & GR_M_DCLICK) )
{
if( !screen->IsBlockActive() )
{
screen->m_BlockLocate.SetOrigin( m_CursorStartPos );
}
if( event.LeftDown() || ( !m_enableMiddleButtonPan && event.MiddleDown() ) )
{
if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE )
{
m_requestAutoPan = false;
GetParent()->HandleBlockPlace( &DC );
m_ignoreNextLeftButtonRelease = true;
}
}
else if( ( m_canStartBlock >= 0 )
&& ( event.LeftIsDown() || ( !m_enableMiddleButtonPan && event.MiddleIsDown() ) )
&& !IsMouseCaptured() )
{
// Mouse is dragging: if no block in progress, start a block command.
if( screen->m_BlockLocate.GetState() == STATE_NO_BLOCK )
{
// Start a block command
int cmd_type = kbstat;
if( !m_enableMiddleButtonPan && event.MiddleIsDown() )
cmd_type |= MOUSE_MIDDLE;
// A block command is started if the drag is enough. A small
// drag is ignored (it is certainly a little mouse move when
// clicking) not really a drag mouse
if( m_minDragEventCount < MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND )
m_minDragEventCount++;
else