1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623
|
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 CERN
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
* @author Jean-Pierre Charras, jp.charras at wanadoo.fr
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file pagelayout_editor/events_functions.cpp
* @brief page layout editor command event functions.
*/
#include <fctsys.h>
#include <wx/treectrl.h>
#include <pgm_base.h>
#include <class_drawpanel.h>
#include <common.h>
#include <macros.h>
#include <pl_editor_frame.h>
#include <kicad_device_context.h>
#include <pl_editor_id.h>
#include <dialog_helpers.h>
#include <menus_helpers.h>
#include <worksheet_shape_builder.h>
#include <worksheet_dataitem.h>
#include <design_tree_frame.h>
#include <properties_frame.h>
#include <dialog_page_settings.h>
#include <invoke_pl_editor_dialog.h>
BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
EVT_CLOSE( PL_EDITOR_FRAME::OnCloseWindow )
// Desing tree event:
EVT_TREE_SEL_CHANGED( ID_DESIGN_TREE_FRAME, PL_EDITOR_FRAME::OnTreeSelection )
EVT_TREE_ITEM_MIDDLE_CLICK( ID_DESIGN_TREE_FRAME, PL_EDITOR_FRAME::OnTreeMiddleClick )
EVT_TREE_ITEM_RIGHT_CLICK( ID_DESIGN_TREE_FRAME, PL_EDITOR_FRAME::OnTreeRightClick )
// Menu Files:
EVT_MENU( wxID_NEW, PL_EDITOR_FRAME::Files_io )
EVT_MENU( wxID_OPEN, PL_EDITOR_FRAME::Files_io )
EVT_MENU( wxID_SAVE, PL_EDITOR_FRAME::Files_io )
EVT_MENU( wxID_SAVEAS, PL_EDITOR_FRAME::Files_io )
EVT_MENU( wxID_FILE, PL_EDITOR_FRAME::Files_io )
EVT_MENU( ID_APPEND_DESCR_FILE, PL_EDITOR_FRAME::Files_io )
EVT_MENU( ID_GEN_PLOT, PL_EDITOR_FRAME::ToPlotter )
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, PL_EDITOR_FRAME::OnFileHistory )
EVT_MENU( wxID_EXIT, PL_EDITOR_FRAME::OnQuit )
// menu Preferences
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START, ID_PREFERENCES_HOTKEY_END, PL_EDITOR_FRAME::Process_Config )
EVT_MENU( ID_MENU_PL_EDITOR_SELECT_PREFERED_EDITOR, EDA_BASE_FRAME::OnSelectPreferredEditor )
EVT_MENU( wxID_PREFERENCES, PL_EDITOR_FRAME::Process_Config )
EVT_MENU( ID_MENU_SWITCH_BGCOLOR, PL_EDITOR_FRAME::Process_Config )
EVT_MENU( ID_MENU_GRID_ONOFF, PL_EDITOR_FRAME::Process_Config )
// Menu Help
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_INDEX, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( ID_HELP_GET_INVOLVED, EDA_DRAW_FRAME::GetKicadContribute )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_TOOL( wxID_CUT, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_TOOL( wxID_UNDO, PL_EDITOR_FRAME::GetLayoutFromUndoList )
EVT_TOOL( wxID_REDO, PL_EDITOR_FRAME::GetLayoutFromRedoList )
EVT_TOOL( wxID_PRINT, PL_EDITOR_FRAME::ToPrinter )
EVT_TOOL( wxID_PREVIEW, PL_EDITOR_FRAME::ToPrinter )
EVT_TOOL( ID_SHEET_SET, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_TOOL( ID_SHOW_REAL_MODE, PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode )
EVT_TOOL( ID_SHOW_PL_EDITOR_MODE, PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode )
EVT_TOOL( ID_NO_TOOL_SELECTED, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_ZOOM_SELECTION, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_TOOL( ID_ZOOM_SELECTION, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_CHOICE( ID_SELECT_COORDINATE_ORIGIN, PL_EDITOR_FRAME::OnSelectCoordOriginCorner)
EVT_CHOICE( ID_SELECT_PAGE_NUMBER, PL_EDITOR_FRAME::Process_Special_Functions)
// the ID_NO_TOOL_SELECTED id TOOL does not existing currently, but the right click
// popup menu can generate this event.
EVT_TOOL( ID_NO_TOOL_SELECTED, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_TOOL( ID_POPUP_CANCEL_CURRENT_COMMAND, PL_EDITOR_FRAME::Process_Special_Functions )
EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE,
PL_EDITOR_FRAME::Process_Special_Functions )
EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, PL_EDITOR_FRAME::OnUpdateSelectTool )
EVT_UPDATE_UI( ID_ZOOM_SELECTION, PL_EDITOR_FRAME::OnUpdateSelectTool )
EVT_UPDATE_UI( ID_SHOW_REAL_MODE, PL_EDITOR_FRAME::OnUpdateTitleBlockDisplayNormalMode )
EVT_UPDATE_UI( ID_SHOW_PL_EDITOR_MODE, PL_EDITOR_FRAME::OnUpdateTitleBlockDisplaySpecialMode )
END_EVENT_TABLE()
/* Handles the selection of tools, menu, and popup menu commands.
*/
void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
int id = event.GetId();
int idx;
wxString msg;
WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();
WORKSHEET_DATAITEM* item = NULL;
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this );
switch( id )
{
case ID_NO_TOOL_SELECTED:
SetNoToolSelected();
break;
case ID_MENU_ZOOM_SELECTION:
case ID_ZOOM_SELECTION:
// This tool is located on the main toolbar: switch it on or off on click
if( GetToolId() != ID_ZOOM_SELECTION )
SetToolID( ID_ZOOM_SELECTION, wxCURSOR_MAGNIFIER, _( "Zoom to selection" ) );
else
SetNoToolSelected();
break;
case ID_SELECT_PAGE_NUMBER:
m_canvas->Refresh();
break;
case ID_SHEET_SET:
{
DIALOG_PAGES_SETTINGS dlg( this );
dlg.SetWksFileName( GetCurrFileName() );
dlg.EnableWksFileNamePicker( false );
dlg.ShowModal();
cmd.SetId( ID_ZOOM_PAGE );
wxPostEvent( this, cmd );
}
break;
case ID_POPUP_CANCEL_CURRENT_COMMAND:
if( m_canvas->IsMouseCaptured() )
{
m_canvas->EndMouseCapture();
SetToolID( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString );
}
else
{
SetNoToolSelected();
}
break;
case ID_POPUP_DESIGN_TREE_ITEM_DELETE:
case ID_POPUP_ITEM_DELETE:
case wxID_CUT:
// Delete item, and select the previous item
item = m_treePagelayout->GetPageLayoutSelectedItem();
if( item == NULL )
break;
SaveCopyInUndoList();
idx = pglayout.GetItemIndex( item );
pglayout.Remove( item );
RebuildDesignTree();
if( id == ID_POPUP_DESIGN_TREE_ITEM_DELETE )
{
item = pglayout.GetItem( (unsigned) (idx-1) );
if( item )
m_treePagelayout->SelectCell( item );
}
item = NULL;
OnModify();
m_canvas->Refresh();
break;
case ID_POPUP_ITEM_ADD_LINE:
SaveCopyInUndoList();
idx = m_treePagelayout->GetSelectedItemIndex();
item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_SEGMENT, idx );
if( InvokeDialogNewItem( this, item ) == wxID_CANCEL )
{
RemoveLastCommandInUndoList();
pglayout.Remove( item );
RebuildDesignTree();
item = NULL;
}
else
{
// Put the new item in move mode, after putting the cursor
// on the start point:
wxPoint position = item->GetStartPosUi();
SetCrossHairPosition( position, false );
position = GetCrossHairPosition();
if( m_canvas->IsPointOnDisplay( position ) )
m_canvas->MoveCursorToCrossHair();
else
RedrawScreen( position, true );
item->SetFlags( NEW_ITEM );
MoveItem( item );
}
break;
case ID_POPUP_ITEM_ADD_RECT:
SaveCopyInUndoList();
idx = m_treePagelayout->GetSelectedItemIndex();
item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_RECT, idx );
if( InvokeDialogNewItem( this, item ) == wxID_CANCEL )
{
RemoveLastCommandInUndoList();
pglayout.Remove( item );
RebuildDesignTree();
item = NULL;
}
else
{
// Put the new item in move mode, after putting the cursor
// on the start point:
wxPoint position = item->GetStartPosUi();
SetCrossHairPosition( position, false );
position = GetCrossHairPosition();
if( m_canvas->IsPointOnDisplay( position ) )
m_canvas->MoveCursorToCrossHair();
else
RedrawScreen( position, true );
item->SetFlags( NEW_ITEM );
MoveItem( item );
}
break;
case ID_POPUP_ITEM_ADD_TEXT:
SaveCopyInUndoList();
idx = m_treePagelayout->GetSelectedItemIndex();
item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_TEXT, idx );
if( InvokeDialogNewItem( this, item ) == wxID_CANCEL )
{
RemoveLastCommandInUndoList();
pglayout.Remove( item );
RebuildDesignTree();
item = NULL;
}
else
{
// Put the new text in move mode:
item->SetFlags( NEW_ITEM | LOCATE_STARTPOINT );
MoveItem( item );
}
break;
case ID_POPUP_ITEM_ADD_BITMAP:
SaveCopyInUndoList();
idx = m_treePagelayout->GetSelectedItemIndex();
item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_BITMAP, idx );
if( item && InvokeDialogNewItem( this, item ) == wxID_CANCEL )
{
RemoveLastCommandInUndoList();
pglayout.Remove( item );
RebuildDesignTree();
item = NULL;
}
if( item )
{
// Put the new text in move mode:
item->SetFlags( NEW_ITEM | LOCATE_STARTPOINT );
MoveItem( item );
}
break;
case ID_POPUP_ITEM_APPEND_PAGE_LAYOUT:
cmd.SetId( ID_APPEND_DESCR_FILE );
wxPostEvent( this, cmd );
break;
case ID_POPUP_ITEM_PLACE:
item = GetScreen()->GetCurItem();
PlaceItem( item );
break;
case ID_POPUP_ITEM_PLACE_CANCEL:
if( m_canvas->IsMouseCaptured() )
m_canvas->EndMouseCapture();
break;
case ID_POPUP_ITEM_MOVE_START_POINT:
item = m_treePagelayout->GetPageLayoutSelectedItem();
// Ensure flags are properly set
item->ClearFlags( LOCATE_ENDPOINT );
item->SetFlags( LOCATE_STARTPOINT );
MoveItem( item );
break;
case ID_POPUP_ITEM_MOVE_END_POINT:
item = m_treePagelayout->GetPageLayoutSelectedItem();
// Ensure flags are properly set
item->ClearFlags( LOCATE_STARTPOINT );
item->SetFlags( LOCATE_ENDPOINT );
MoveItem( item );
break;
case ID_POPUP_ITEM_MOVE:
item = m_treePagelayout->GetPageLayoutSelectedItem();
item->ClearFlags( LOCATE_ENDPOINT|LOCATE_STARTPOINT );
MoveItem( item );
break;
default:
wxMessageBox( wxT( "PL_EDITOR_FRAME::Process_Special_Functions error" ) );
break;
}
if( item )
{
OnModify();
m_propertiesPagelayout->CopyPrmsFromItemToPanel( item );
m_treePagelayout->SelectCell( item );
}
}
/*
* Function moveItem: called when the mouse cursor is moving
* moves the item currently selected (or the start point or the end point)
* to the cursor position
*/
DPOINT initialPosition; // The initial position of the item to move, in mm
wxPoint initialPositionUi; // The initial position of the item to move, in Ui
wxPoint initialCursorPosition; // The initial position of the cursor
static void moveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase )
{
PL_EDITOR_SCREEN* screen = (PL_EDITOR_SCREEN*) aPanel->GetScreen();
WORKSHEET_DATAITEM *item = screen->GetCurItem();
wxCHECK_RET( (item != NULL), wxT( "Cannot move NULL item." ) );
wxPoint position = aPanel->GetParent()->GetCrossHairPosition()
- ( initialCursorPosition - initialPositionUi );
wxPoint previous_position;
if( (item->GetFlags() & LOCATE_STARTPOINT) )
{
previous_position = item->GetStartPosUi();
item->MoveStartPointToUi( position );
}
else if( (item->GetFlags() & LOCATE_ENDPOINT) )
{
previous_position = item->GetEndPosUi();
item->MoveEndPointToUi( position );
}
else
{
previous_position = item->GetStartPosUi();
item->MoveToUi( position );
}
// Draw the item item at it's new position, if it is modified,
// (does not happen each time the mouse is moved, because the
// item is placed on grid)
// to avoid useless computation time.
if( previous_position != position )
aPanel->Refresh();
}
/*
* Function abortMoveItem: called when an item is currently moving,
* and when the user aborts the move command.
* Restores the initial position of the item
*/
static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
{
PL_EDITOR_SCREEN* screen = (PL_EDITOR_SCREEN*) aPanel->GetScreen();
WORKSHEET_DATAITEM *item = screen->GetCurItem();
if( item->GetFlags() & NEW_ITEM )
{
PL_EDITOR_FRAME* plframe = (PL_EDITOR_FRAME*) aPanel->GetParent();
plframe->RemoveLastCommandInUndoList();
WORKSHEET_LAYOUT& pglayout = WORKSHEET_LAYOUT::GetTheInstance();
pglayout.Remove( item );
plframe->RebuildDesignTree();
}
else
{
if( (item->GetFlags() & LOCATE_STARTPOINT) )
{
item->MoveStartPointTo( initialPosition );
}
else if( (item->GetFlags() & LOCATE_ENDPOINT) )
{
item->MoveEndPointTo( initialPosition );
}
else
item->MoveTo( initialPosition );
}
aPanel->SetMouseCapture( NULL, NULL );
screen->SetCurItem( NULL );
aPanel->Refresh();
}
void PL_EDITOR_FRAME::MoveItem( WORKSHEET_DATAITEM* aItem )
{
wxCHECK_RET( aItem != NULL, wxT( "Cannot move NULL item" ) );
initialPosition = aItem->GetStartPos();
initialPositionUi = aItem->GetStartPosUi();
initialCursorPosition = GetCrossHairPosition();
if( (aItem->GetFlags() & LOCATE_ENDPOINT) )
{
initialPosition = aItem->GetEndPos();
initialPositionUi = aItem->GetEndPosUi();
}
if( aItem->GetFlags() & (LOCATE_STARTPOINT|LOCATE_ENDPOINT) )
{
SetCrossHairPosition( initialPositionUi, false );
initialCursorPosition = GetCrossHairPosition();
if( m_canvas->IsPointOnDisplay( initialCursorPosition ) )
{
m_canvas->MoveCursorToCrossHair();
m_canvas->Refresh();
}
else
{
RedrawScreen( initialCursorPosition, true );
}
}
m_canvas->SetMouseCapture( moveItem, abortMoveItem );
GetScreen()->SetCurItem( aItem );
}
/**
* Save in Undo list the layout, and place an item being moved.
* @param aItem is the item moved
*/
void PL_EDITOR_FRAME::PlaceItem( WORKSHEET_DATAITEM* aItem )
{
DPOINT currStartPos = aItem->GetStartPos();
DPOINT currEndPos = aItem->GetEndPos();
aItem->ClearFlags( NEW_ITEM );
// Save the curren layout before changes
if( (aItem->GetFlags() & LOCATE_STARTPOINT) )
{
aItem->MoveStartPointTo( initialPosition );
}
else if( aItem->GetFlags() & LOCATE_ENDPOINT )
{
aItem->MoveEndPointTo( initialPosition );
}
else
aItem->MoveTo( initialPosition );
SaveCopyInUndoList();
// Re-place the item
aItem->MoveStartPointTo( currStartPos );
aItem->MoveEndPointTo( currEndPos );
m_canvas->SetMouseCapture( NULL, NULL );
GetScreen()->SetCurItem( NULL );
}
/* called when the user select one of the 4 page corner as corner
* reference (or the left top paper corner)
*/
void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event )
{
m_originSelectChoice = m_originSelectBox->GetSelection();
UpdateStatusBar(); // Update grid origin
m_canvas->Refresh();
}
void PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode( wxCommandEvent& event )
{
WORKSHEET_DATAITEM::m_SpecialMode = (event.GetId() == ID_SHOW_PL_EDITOR_MODE);
m_canvas->Refresh();
}
void PL_EDITOR_FRAME::OnQuit( wxCommandEvent& event )
{
Close( true );
}
void PL_EDITOR_FRAME::ToPlotter(wxCommandEvent& event)
{
wxMessageBox( wxT( "Not yet available" ) );
}
void PL_EDITOR_FRAME::ToPrinter(wxCommandEvent& event)
{
// static print data and page setup data, to remember settings during the session
static wxPrintData* s_PrintData;
static wxPageSetupDialogData* s_pageSetupData = (wxPageSetupDialogData*) NULL;
const PAGE_INFO& pageInfo = GetPageSettings();
if( s_PrintData == NULL ) // First print
{
s_PrintData = new wxPrintData();
s_PrintData->SetQuality( wxPRINT_QUALITY_HIGH ); // Default resolution = HIGH;
}
if( !s_PrintData->Ok() )
{
wxMessageBox( _( "Error Init Printer info" ) );
return;
}
if( s_pageSetupData == NULL )
s_pageSetupData = new wxPageSetupDialogData( *s_PrintData );
s_pageSetupData->SetPaperId( pageInfo.GetPaperId() );
s_pageSetupData->GetPrintData().SetOrientation( pageInfo.GetWxOrientation() );
if( pageInfo.IsCustom() )
{
if( pageInfo.IsPortrait() )
s_pageSetupData->SetPaperSize( wxSize( Mils2mm( pageInfo.GetWidthMils() ),
Mils2mm( pageInfo.GetHeightMils() ) ) );
else
s_pageSetupData->SetPaperSize( wxSize( Mils2mm( pageInfo.GetHeightMils() ),
Mils2mm( pageInfo.GetWidthMils() ) ) );
}
*s_PrintData = s_pageSetupData->GetPrintData();
if( event.GetId() == wxID_PREVIEW )
InvokeDialogPrintPreview( this, s_PrintData );
else
InvokeDialogPrint( this, s_PrintData, s_pageSetupData );
}
void PL_EDITOR_FRAME::OnTreeSelection( wxTreeEvent& event )
{
WORKSHEET_DATAITEM* item = GetSelectedItem();
if( item )
m_propertiesPagelayout->CopyPrmsFromItemToPanel( item );
m_canvas->Refresh();
}
void PL_EDITOR_FRAME::OnTreeMiddleClick( wxTreeEvent& event )
{
}
extern void AddNewItemsCommand( wxMenu* aMainMenu );
void PL_EDITOR_FRAME::OnTreeRightClick( wxTreeEvent& event )
{
m_treePagelayout->SelectCell( event.GetItem() );
wxMenu popMenu;
AddNewItemsCommand( &popMenu );
popMenu.AppendSeparator();
AddMenuItem( &popMenu, ID_POPUP_DESIGN_TREE_ITEM_DELETE, _( "Delete" ),
KiBitmap( delete_xpm ) );
PopupMenu( &popMenu );
}
void PL_EDITOR_FRAME::OnUpdateTitleBlockDisplayNormalMode( wxUpdateUIEvent& event )
{
event.Check( WORKSHEET_DATAITEM::m_SpecialMode == false );
}
void PL_EDITOR_FRAME::OnUpdateTitleBlockDisplaySpecialMode( wxUpdateUIEvent& event )
{
event.Check( WORKSHEET_DATAITEM::m_SpecialMode == true );
}
void PL_EDITOR_FRAME::OnUpdateSelectTool( wxUpdateUIEvent& aEvent )
{
aEvent.Check( GetToolId() == aEvent.GetId() );
}
|