OpPreviewPopupCommand Class Reference

The context menu handling for the bitmap preview dialog. More...

#include <prvwmenu.h>

Inheritance diagram for OpPreviewPopupCommand:

Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

virtual void Do (OpDescriptor *pOpDesc)
 Passes the token of the selected menu command to the dialog so it can be handled there.

Static Public Member Functions

static BOOL Init (void)
 Registeres all the menu operations by calling InitPolymorphicCommand.
static OpState GetCommandState (String_256 *ShadeReason, OpDescriptor *pOpDesc)
 For finding OpPreviewPopupCommand's state. Used only to tick the proper tool, depending on the current mode.

Static Public Attributes

static BitmapExportPreviewDialogm_pDialog = NULL

Static Protected Member Functions

static BOOL InitPolymorphicCommand (TCHAR *OpToken, UINT32 MenuTextID)
 Registeres a menu operation.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpPreviewPopupCommand)

Detailed Description

The context menu handling for the bitmap preview dialog.

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com> (based on Neville's code)
Date:
11/4/97

Definition at line 144 of file prvwmenu.h.


Member Function Documentation

OpPreviewPopupCommand::CC_DECLARE_DYNCREATE OpPreviewPopupCommand   )  [private]
 

void OpPreviewPopupCommand::Do OpDescriptor pOpDesc  )  [virtual]
 

Passes the token of the selected menu command to the dialog so it can be handled there.

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/97
Parameters:
pOpDesc - the descriptor of the operation [INPUTS]
- [OUTPUTS]
Returns:
-

Reimplemented from Operation.

Definition at line 267 of file prvwmenu.cpp.

00268 {  
00269     // get the token
00270     String_256 s(pOpDesc->Token);
00271 
00272     // ask the dialog to handle it
00273     m_pDialog->DoCommand(&s);
00274 
00275     End();
00276 }

OpState OpPreviewPopupCommand::GetCommandState String_256 UIDescription,
OpDescriptor pOpDesc
[static]
 

For finding OpPreviewPopupCommand's state. Used only to tick the proper tool, depending on the current mode.

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/97
Parameters:
UIDescription - ptr to a string to place a description of what went wrong [INPUTS] (if it did!) OpDesc - The OpDescriptor for which we need the state
UIDescription is updated appropriately [OUTPUTS]
Returns:
The state of the OpPreviewPopupCommand operation for the given OpDescriptor

Definition at line 238 of file prvwmenu.cpp.

00239 {
00240     OpState OpSt;
00241     OpSt.Greyed = FALSE; //always active
00242     // tick either the push or the zoom tool depending on the current mode
00243     if (((pOpDesc->Token == String_256(OPTOKEN_PREVIEW_PUSH_TOOL)) && 
00244                 (m_pDialog->GetCurrentTool() == PREVIEW_PUSH_TOOL)) ||
00245         ((pOpDesc->Token == String_256(OPTOKEN_PREVIEW_ZOOM_TOOL)) && 
00246                 (m_pDialog->GetCurrentTool() == PREVIEW_ZOOM_TOOL)) ||
00247         ((pOpDesc->Token == String_256(OPTOKEN_PREVIEW_COLOUR_SELECTOR_TOOL)) &&
00248                 (m_pDialog->GetCurrentTool() == PREVIEW_COLOUR_SELECTOR_TOOL)))
00249         OpSt.Ticked = TRUE;
00250 
00251     return (OpSt); 
00252 }

BOOL OpPreviewPopupCommand::Init void   )  [static]
 

Registeres all the menu operations by calling InitPolymorphicCommand.

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Reimplemented from SimpleCCObject.

Definition at line 203 of file prvwmenu.cpp.

00204 {
00205     InitPolymorphicCommand(OPTOKEN_PREVIEW_ZOOM_TOOL,            _R(IDS_MENU_ZOOM));
00206     InitPolymorphicCommand(OPTOKEN_PREVIEW_PUSH_TOOL,            _R(IDS_MENU_PUSH));
00207     InitPolymorphicCommand(OPTOKEN_PREVIEW_COLOUR_SELECTOR_TOOL, _R(IDS_MENU_SELECTOR));
00208     InitPolymorphicCommand(OPTOKEN_PREVIEW_ZOOM_TO_FIT,          _R(IDS_MENU_FIT));
00209     InitPolymorphicCommand(OPTOKEN_PREVIEW_ZOOM_TO_100,          _R(IDS_MENU_100));
00210     InitPolymorphicCommand(OPTOKEN_PREVIEW_1TO1,                 _R(IDS_MENU_1TO1));
00211     InitPolymorphicCommand(OPTOKEN_PREVIEW_HELP, _R(IDS_PREVIEW_MENU_HELP));
00212 
00213     return (TRUE);
00214 }               

BOOL OpPreviewPopupCommand::InitPolymorphicCommand TCHAR OpToken,
UINT32  MenuTextID
[static, protected]
 

Registeres a menu operation.

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/97
Parameters:
OpToken - the token of a menu operation [INPUTS] MenuTextID - the resource string of the menu command
- [OUTPUTS]
Returns:
-

Definition at line 169 of file prvwmenu.cpp.

00170 {
00171     return(RegisterOpDescriptor(0,                                  // Tool ID 
00172                                 MenuTextID,                         // String resource ID
00173                                 CC_RUNTIME_CLASS(OpPreviewPopupCommand),// Runtime class
00174                                 OpToken,                            // Token string
00175                                 OpPreviewPopupCommand::GetCommandState, // GetState function
00176                                 0,                                  // help ID
00177                                 0,                                  // bubble help
00178                                 0,                                  // resource ID
00179                                 0,                                  // control ID
00180                                 SYSTEMBAR_ILLEGAL,                  // Bar ID
00181                                 FALSE,                              // Receive system messages
00182                                 FALSE,                              // Smart duplicate operation
00183                                 TRUE,                               // Clean operation
00184                                 NULL,                               // No vertical counterpart
00185                                 0,                                  // String for one copy only error
00186                                 DONT_GREY_WHEN_SELECT_INSIDE        // Auto state flags
00187                                 ));
00188 }


Member Data Documentation

BitmapExportPreviewDialog * OpPreviewPopupCommand::m_pDialog = NULL [static]
 

Definition at line 166 of file prvwmenu.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:41 2007 for Camelot by  doxygen 1.4.4