#include <menuops.h>
Inheritance diagram for OpToolSelect:
Public Member Functions | |
OpToolSelect () | |
Constructs a new OpToolSelect object: setting default operation flags, and adding it to the Live list. | |
void | Do (OpDescriptor *ToolOp) |
Sets the currently active tool based on the tool OpDescriptor passed in. | |
Static Public Member Functions | |
static BOOL | Init () |
Create OpDescriptors for each of the Tools available. | |
static OpState | GetState (String_256 *, OpDescriptor *ToolOp) |
Is called to update the state of tool represented by OpDescriptor. |
Definition at line 453 of file menuops.h.
|
Constructs a new OpToolSelect object: setting default operation flags, and adding it to the Live list.
Definition at line 306 of file menuops.cpp. 00306 : Operation() 00307 { 00308 }
|
|
Sets the currently active tool based on the tool OpDescriptor passed in.
Reimplemented from Operation. Definition at line 421 of file menuops.cpp. 00422 { 00423 UINT32 ToolId = ToolOp->GetToolID(); 00424 00425 ENSURE(Tool::Find(ToolId) != NULL, "Tool Id does not exist!"); 00426 ToolListItem * pItem = NULL; 00427 pItem = Tool::Find(ToolId); 00428 if(pItem) 00429 pItem->m_pTool->SetCurrent(); 00430 00431 //((Tool::Find(ToolId))->pTool)->SetCurrent(); 00432 00433 End(); 00434 }
|
|
Is called to update the state of tool represented by OpDescriptor.
Definition at line 385 of file menuops.cpp. 00386 { 00387 OpState mState; 00388 00389 UINT32 ToolId = ToolOp->GetToolID(); 00390 00391 ENSURE(Tool::Find(ToolId) != NULL, "Tool Id does not exist!"); 00392 00393 Tool* thisTool = ((Tool::Find(ToolId))->m_pTool); 00394 00395 if (thisTool ==((Tool::Find(ToolId))->m_pTool)->GetCurrent()) 00396 mState.Ticked = TRUE; 00397 else 00398 mState.Ticked = FALSE; 00399 00400 mState.Greyed = FALSE; 00401 00402 return mState; 00403 }
|
|
Create OpDescriptors for each of the Tools available.
Reimplemented from SimpleCCObject. Definition at line 326 of file menuops.cpp. 00327 { 00328 // Get the first tool in the tool list 00329 ToolListItem* ToolItem = Tool::GetFirstTool(); 00330 00331 ToolInfo *Info = new ToolInfo; 00332 if (Info == NULL) 00333 return FALSE; 00334 00335 while (ToolItem != NULL) 00336 { 00337 Tool* ATool = ToolItem->m_pTool; 00338 00339 //Get Tool Info 00340 Info->BubbleID=0; 00341 ATool->Describe(Info); 00342 00343 // Set up OpToken 00344 String OpToken; 00345 camSnprintf( OpToken, 16, _T("TOOL%u"), (Info->ID) ); 00346 00347 // Create an instance of the ToolOpDescriptor 00348 ToolOpDescriptor* ToolOp = new ToolOpDescriptor( 00349 Info->ID, 00350 Info->TextID, 00351 CC_RUNTIME_CLASS(OpToolSelect), 00352 OpToken, 00353 OpToolSelect::GetState, 00354 0, /* Help ID */ 00355 Info->BubbleID 00356 ); 00357 00358 ERRORIF(!ToolOp, _R(IDE_NOMORE_MEMORY), FALSE); 00359 00360 //Get the next item in the tool list 00361 ToolItem = Tool::GetNextTool(ToolItem); 00362 } 00363 00364 delete Info; 00365 00366 return TRUE; 00367 }
|