#include <sgmenu.h>
Inheritance diagram for OpGalleryCommand:
Public Member Functions | |
virtual void | Do (OpDescriptor *pOpDesc) |
The nudge op's Do() function. | |
Static Public Member Functions | |
static BOOL | InitPolymorphicCommand (StringBase *OpToken, UINT32 MenuTextID) |
Given a Gallery command OpToken of the form "Gallery name:Command name" this creates a new OpDescriptor for the OpGalleryCommand Op. This in turn will provide an Upcall to the named Gallery containing the given command string, whenever the Op is invoked. | |
static OpState | GetCommandState (String_256 *ShadeReason, OpDescriptor *pOpDesc) |
OpGalleryCommand initialiser method.For finding OpGalleryCommand's state. | |
Static Protected Member Functions | |
static SuperGallery * | GetGalleryAndCommand (OpDescriptor *pOpDesc, String_32 *Command) |
Given a Gallery command OpDescriptor of the form "Gallery name:Command name" this returns a pointer to the gallery to use and the string "Command name" which is the command that gallery should apply. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpGalleryCommand) |
Definition at line 239 of file sgmenu.h.
|
|
|
The nudge op's Do() function.
Reimplemented from Operation. Definition at line 362 of file sgmenu.cpp. 00363 { 00364 String_32 Command; 00365 SuperGallery *ParentGallery = GetGalleryAndCommand(pOpDesc, &Command); 00366 00367 if (ParentGallery != NULL) 00368 ParentGallery->DoCommand(&Command); 00369 00370 End(); 00371 }
|
|
OpGalleryCommand initialiser method.For finding OpGalleryCommand's state.
Definition at line 328 of file sgmenu.cpp. 00329 { 00330 String_32 Command; 00331 SuperGallery *ParentGallery = GetGalleryAndCommand(pOpDesc, &Command); 00332 00333 if (ParentGallery != NULL) 00334 return(ParentGallery->GetCommandState(&Command, UIDescription)); 00335 00336 ERROR3("Attempt to get state for non-existent Gallery command"); 00337 00338 // Return a "safe" shaded state 00339 OpState OpSt; 00340 OpSt.Greyed = TRUE; 00341 *UIDescription = ""; 00342 return (OpSt); 00343 }
|
|
Given a Gallery command OpDescriptor of the form "Gallery name:Command name" this returns a pointer to the gallery to use and the string "Command name" which is the command that gallery should apply.
Definition at line 251 of file sgmenu.cpp. 00252 { 00253 String_256 Temp = pOpDesc->Token; 00254 TCHAR *Str = (TCHAR *)Temp; 00255 00256 *Command = TEXT(""); 00257 00258 while (*Str != '\0' && *Str != ':') 00259 Str++; 00260 00261 if (*Str == '\0') 00262 return(NULL); 00263 00264 // Copy the right end of the string into Command for return 00265 *Command = (TCHAR *) (Str+1); 00266 00267 // Find the gallery referenced by the left end of the string 00268 *Str = '\0'; // NULL Terminate the left end of the string 00269 00270 String_32 Bob; 00271 Temp.Left(&Bob, 31); 00272 SuperGallery* pSuperGallery = SuperGallery::FindSuperGallery(Bob , GalleryBarNameLimitSize); 00273 00274 if (pSuperGallery != NULL && pSuperGallery->IsKindOf(CC_RUNTIME_CLASS(SuperGallery))) 00275 return((SuperGallery *) pSuperGallery); 00276 00277 // Not found, or isn't a gallery?! (eep!) 00278 return(NULL); 00279 }
|
|
Given a Gallery command OpToken of the form "Gallery name:Command name" this creates a new OpDescriptor for the OpGalleryCommand Op. This in turn will provide an Upcall to the named Gallery containing the given command string, whenever the Op is invoked.
Definition at line 208 of file sgmenu.cpp. 00209 { 00210 return(RegisterOpDescriptor(0, // Tool ID 00211 MenuTextID, // String resource ID 00212 CC_RUNTIME_CLASS(OpGalleryCommand), // Runtime class 00213 (TCHAR *) (*OpToken), // Token string 00214 OpGalleryCommand::GetCommandState, // GetState function 00215 0, // help ID 00216 0, // bubble help 00217 0, // resource ID 00218 0, // control ID 00219 SYSTEMBAR_ILLEGAL, // Bar ID 00220 FALSE, // Recieve system messages 00221 FALSE, // Smart duplicate operation 00222 TRUE, // Clean operation 00223 0, // No vertical counterpart 00224 0, // String for one copy only error 00225 DONT_GREY_WHEN_SELECT_INSIDE // Auto state flags 00226 )); 00227 }
|