#include <blnktool.h>
Inheritance diagram for BlankTool:
Public Member Functions | |
BlankTool () | |
Default Constructor. Other initialisation is done in BlankTool::Init which is called by the Tool Manager. | |
~BlankTool () | |
Destructor (Virtual). Does nothing. | |
BOOL | Init () |
Used to check if the Tool was properly constructed. | |
void | Describe (void *InfoPtr) |
Allows the tool manager to extract information about the tool. | |
UINT32 | GetID () |
void | SelectChange (BOOL isSelected) |
Starts up and closes down the blank tool. | |
void | OnClick (DocCoord, ClickType, ClickModifiers, Spread *) |
To handle a Mouse Click event for the Blank Tool. | |
void | OnMouseMove (DocCoord PointerPos, Spread *pSpread, ClickModifiers ClickMods) |
To handle a Mouse Move event for the Blank Tool. | |
void | RenderToolBlobs (Spread *pSpread, DocRect *pDocRect) |
Handles the RenderToolBlobs method. Renders the tool's blobs into the selected doc view. | |
BOOL | GetStatusLineText (String_256 *ptext, Spread *pSpread, DocCoord DocPos, ClickModifiers ClickMods) |
Returns the current status line help string. | |
Static Public Member Functions | |
static BlankInfoBarOp * | GetBlankInfoBarOp () |
static BOOL | IsCurrentTool () |
Private Member Functions | |
CC_DECLARE_MEMDUMP (BlankTool) | |
void | DisplayStatusBarHelp (DocCoord DocPos, Spread *pSpread, ClickModifiers ClickMods) |
Displays status help string for the given position in the status bar. | |
void | GetCurrentStatusText (String_256 *ptext, Spread *pSpread, DocCoord DocPos, ClickModifiers ClickMods) |
Selects a suitable string for the status line based on the current location (as input via the parameters). | |
BOOL | CreateCursors () |
Creates all the blank tool cursors. | |
void | DestroyCursors () |
Destroys all the blank tool cursors. | |
Private Attributes | |
Cursor * | m_pcNormalBlankCursor |
Cursor * | m_pcCurrentCursor |
INT32 | m_CurrentCursorID |
Static Private Attributes | |
static BOOL | s_bCurrentTool = FALSE |
static BlankInfoBarOp * | s_pBlankInfoBarOp = NULL |
static LPTSTR | FamilyName = _T("Blank Tools") |
static LPTSTR | ToolName = _T("Blank Tool") |
static LPTSTR | Purpose = _T("Blank manipulation") |
static LPTSTR | Author = _T("Buster") |
Definition at line 122 of file blnktool.h.
|
Default Constructor. Other initialisation is done in BlankTool::Init which is called by the Tool Manager.
Definition at line 145 of file blnktool.cpp. 00146 { 00147 m_pcCurrentCursor = NULL; 00148 m_pcNormalBlankCursor = NULL; 00149 }
|
|
Destructor (Virtual). Does nothing.
Definition at line 161 of file blnktool.cpp.
|
|
|
|
Creates all the blank tool cursors.
Definition at line 307 of file blnktool.cpp. 00308 { 00309 // This tool has just been selected. Create the cursors. 00310 m_pcNormalBlankCursor = new Cursor(this, _R(IDCSR_BLANKTOOLDEFAULT)); 00311 00312 if ( m_pcNormalBlankCursor==NULL || !m_pcNormalBlankCursor->IsValid()) 00313 { 00314 DestroyCursors(); 00315 return FALSE; 00316 } 00317 else 00318 return TRUE; 00319 }
|
|
Allows the tool manager to extract information about the tool.
Reimplemented from Tool_v1. Definition at line 213 of file blnktool.cpp. 00214 { 00215 // Cast structure into the latest one we understand. 00216 ToolInfo_v1* Info = (ToolInfo_v1*) InfoPtr; 00217 00218 Info->InfoVersion = 1; 00219 00220 Info->InterfaceVersion = GetToolInterfaceVersion(); // You should always have this line. 00221 00222 // These are all arbitrary at present. 00223 Info->Version = 1; 00224 Info->ID = GetID(); 00225 Info->TextID = _R(IDS_BLANK_TOOL); 00226 00227 Info->Family = FamilyName; 00228 Info->Name = ToolName; 00229 Info->Purpose = Purpose; 00230 Info->Author = Author; 00231 00232 Info->BubbleID = _R(IDBBL_BLANK_TOOLBOX); 00233 }
|
|
Destroys all the blank tool cursors.
Definition at line 335 of file blnktool.cpp. 00336 { 00337 if (m_pcNormalBlankCursor != NULL) delete m_pcNormalBlankCursor; 00338 }
|
|
Displays status help string for the given position in the status bar.
Definition at line 441 of file blnktool.cpp. 00442 { 00443 String_256 StatusMsg(_T("")); 00444 00445 // Get a string from the underlying help function and display it. 00446 GetCurrentStatusText(&StatusMsg, pSpread, DocPos, ClickMods); 00447 GetApplication()->UpdateStatusBarText(&StatusMsg); 00448 }
|
|
Definition at line 144 of file blnktool.h. 00144 { return s_pBlankInfoBarOp; }
|
|
Selects a suitable string for the status line based on the current location (as input via the parameters).
Definition at line 491 of file blnktool.cpp. 00492 { 00493 // You must use the Spread, DocCoord and ClickModifiers to select a suitable string to be 00494 // displaied in the status bar. This is usually done via some sort of switch statement. 00495 // Having selected a suitable string you should do a statement like 00496 // ptext->Load(<#Insert your string ID here #>); 00497 00498 // Delete this line when you display useful strings! 00499 ptext->Empty(); 00500 }
|
|
Reimplemented from Tool_v1. Definition at line 134 of file blnktool.h. 00134 { return TOOLID_BLANK; }; // <****** CHANGE THIS TO YOUR TOOL'S ID!!! (defined in kernel\tool.h)
|
|
Returns the current status line help string.
Reimplemented from Tool_v1. Definition at line 467 of file blnktool.cpp. 00468 { 00469 // We can call the underlying help function to get a string and return the result. 00470 GetCurrentStatusText(ptext, pSpread, DocPos, ClickMods); 00471 return TRUE; 00472 }
|
|
Used to check if the Tool was properly constructed.
Reimplemented from Tool_v1. Definition at line 178 of file blnktool.cpp. 00179 { 00180 // Declare all your ops here and only succeed if all declarations succeed 00181 00182 BOOL ok = TRUE; 00183 00184 // This section reads in the infobar definition and creates an instance of 00185 // BlankInfoBarOp. Also pBlankInfoBarOp, the ptr to the tool's infobar, is set up 00186 // after the infobar is successfully read and created. 00187 if (ok) 00188 { 00189 s_pBlankInfoBarOp = new BlankInfoBarOp(this); 00190 ERROR2IF(s_pBlankInfoBarOp==NULL, FALSE, "Can't create Blank tool Infobar"); 00191 } 00192 00193 return (ok); 00194 }
|
|
Definition at line 145 of file blnktool.h. 00145 { return s_bCurrentTool; }
|
|
To handle a Mouse Click event for the Blank Tool.
Reimplemented from Tool_v1. Definition at line 358 of file blnktool.cpp. 00360 { 00361 if (ClickMods.Menu) return; // Don't do anything if the user clicked the Menu button 00362 00363 // Make sure this click is one that we want 00364 if ( Click == CLICKTYPE_SINGLE || Click == CLICKTYPE_DOUBLE) 00365 { 00366 } 00367 00368 if ( Click == CLICKTYPE_DRAG ) 00369 { 00370 } 00371 }
|
|
To handle a Mouse Move event for the Blank Tool.
Reimplemented from Tool_v1. Definition at line 388 of file blnktool.cpp. 00389 { 00390 // You can use this func to do things like change the pointer shape, or 00391 // alter the text in the status bar 00392 00393 // Use this func to change your curor 00394 // CursorStack::GSetTop(Cursor* pCursor, CurrentCursorID) 00395 00396 // Display status bar text for the current position 00397 DisplayStatusBarHelp(PointerPos, pSpread, ClickMods); 00398 }
|
|
Handles the RenderToolBlobs method. Renders the tool's blobs into the selected doc view.
Reimplemented from Tool_v1. Definition at line 415 of file blnktool.cpp. 00416 { 00417 // Render into the selected doc view 00418 DocView* pDocView = DocView::GetSelected(); 00419 if (pDocView != NULL) 00420 { 00421 // render you tool's blobs (if any) here 00422 } 00423 }
|
|
Starts up and closes down the blank tool.
Reimplemented from Tool_v1. Definition at line 251 of file blnktool.cpp. 00252 { 00253 if (isSelected) 00254 { 00255 if (!CreateCursors()) return; 00256 m_CurrentCursorID = CursorStack::GPush(m_pcNormalBlankCursor, FALSE); // Push cursor but don't display now 00257 m_pcCurrentCursor = m_pcNormalBlankCursor; 00258 00259 // This tool is now the current one 00260 s_bCurrentTool = TRUE; 00261 00262 // Create and display the tool's info bar 00263 s_pBlankInfoBarOp->Create(); 00264 } 00265 else 00266 { 00267 // Deselection - destroy the tool's cursors, if they exist. 00268 if (m_pcCurrentCursor != NULL) 00269 { 00270 CursorStack::GPop(m_CurrentCursorID); 00271 m_pcCurrentCursor = NULL; 00272 m_CurrentCursorID = 0; 00273 } 00274 DestroyCursors(); 00275 00276 // Remove the info bar from view by deleting the actual underlying window 00277 s_pBlankInfoBarOp->Delete(); 00278 00279 // ensure any tool object blobs are removed. 00280 BlobManager* BlobMgr = GetApplication()->GetBlobManager(); 00281 if (BlobMgr != NULL) 00282 { 00283 BlobStyle bsRemoves; 00284 bsRemoves.ToolObject = TRUE; 00285 BlobMgr->RemoveInterest(bsRemoves); 00286 } 00287 00288 // No longer the current tool 00289 s_bCurrentTool = FALSE; 00290 } 00291 }
|
|
Definition at line 165 of file blnktool.h. |
|
Definition at line 162 of file blnktool.h. |
|
Definition at line 159 of file blnktool.h. |
|
Definition at line 158 of file blnktool.h. |
|
Definition at line 157 of file blnktool.h. |
|
Definition at line 164 of file blnktool.h. |
|
Definition at line 154 of file blnktool.h. |
|
Definition at line 155 of file blnktool.h. |
|
Definition at line 163 of file blnktool.h. |