#include <statline.h>
Inheritance diagram for StatusLine:

Public Member Functions | |
| StatusLine () | |
| Constructor for StatusLine. | |
| ~StatusLine () | |
| destructor for StatusLine | |
| MsgResult | Message (Msg *Msg) |
| handle system messages | |
| BOOL | UpdateText (String_256 *ptext, BOOL PrefixSelDesc=TRUE) |
| BOOL | UpdateTextForColourPicker (String_256 *ptext, BOOL PrefixSelDesc=TRUE) |
| BOOL | UpdateMousePosAndSnap (DocCoord *pDocCoord, Spread *pSpread, DocView *pDocView, BOOL Snapped) |
| Update mouse position pane, and snapped indicator If pDocCoord==NULL && pSpread==NULL && Snapped==FALSE, the mouse pos will be blanked. | |
| BOOL | UpdateSolidDragIndicator (BOOL bSolidAllowed, BOOL bSolid) |
| Update mouse position pane, and snapped indicator If pDocCoord==NULL && pSpread==NULL && Snapped==FALSE, the mouse pos will be blanked. | |
| BOOL | SetRenderIndicator (RenderState Action) |
| Change state of the render indicator. | |
| void | FlagMousePosNeedsUpdating () |
| BOOL | MousePosNeedsUpdating () |
| void | FlagMousePosPaneNeedsUpdating () |
| BOOL | RestrictStatusLineFunctionsToColourPicker (CWindowID colourPicker) |
| When the user is dragging a colour picker control, we need to restrict access to status line functionality to only the colour picker. | |
| BOOL | RestoreStatusLineFunctions (CWindowID colourPicker) |
| BOOL | IsRestrictedAccessToColourPicker () |
| BOOL | LockOutControlHelp () |
| BOOL | UnlockControlHelp () |
| BOOL | AllowControlHelp () |
| void | SetNeedsUpdate (BOOL Immediate=FALSE) |
| Indicate the status line needs an update. | |
| BOOL | ShowProgress (BOOL Show=TRUE, StringBase *JobDescrip=NULL) |
| Creates a window and associates it with this CProgressBar object. The window appears immediately over the status bar. Notes: This currently assumes that it'll only ever be opened at the bottom of the Main Frame window. | |
| INT32 | GetPercent () const |
| BOOL | SetPercent (INT32 Percent, BOOL RedrawBackground=FALSE, StringBase *JobDescrip=NULL) |
| Sets the currently displayed percentage of the progress bar. The bar will be immediately redrawn to reflect the new value. Values outside the range 0..99 (inclusive) are clipped to 0 or 99. No redraw will be done if NewPercent equals the currently displayed value. | |
| BOOL | IsProgressShown () const |
Static Public Member Functions | |
| static void | SetPrefix (const StringBase &str) |
| Overrides the default behaviour of showing the selection state as the prefix on the status line. SetDefaultPrefix restores the default behaviour of (usually) showing the selection state as the prefix. | |
| static void | SetDefaultPrefix () |
| Undoes a call to SetPrefix, restoring the default behaviour of showing the selection state as a prefix on the status line. | |
| static INT32 | GetPrefixWidth () |
| static StatusLine * | Get () |
Protected Member Functions | |
| BOOL | OnIdleEvent () |
| Idle event handler for status line Updates the text on the status bar if 'TextDelay' has elapsed since it was last changed. Also updates the mouse position pane. | |
| BOOL | SetMousePosPaneWidth (Spread *pSpread) |
| Set the mouse position pane width to be large enough to hold any coord in the spread in the current preference units Also gets, and caches, the number of decimal places required to resolve 1 pixel. | |
| BOOL | RefreshHelpText () |
| refresh the help text pane of the status line | |
| BOOL | GetMousePosText (String_256 *pText, DocCoord MousePos, Spread *pSread, INT32 dp=-1) |
| get mouse position as a string | |
| BOOL | TruncateTextToWidth (String_256 *pText, INT32 width) |
| if too long for the given width, truncate the given text at one of the specified delimiters | |
| BOOL | SetStatusText (const String_256 &text) |
| Sets the status line text. Records it. Puts it in the gadget and invalidates it if the gadget is shown. | |
| void | OnTimer () |
| CC_DECLARE_DYNCREATE (StatusLine) | |
Protected Attributes | |
| Cursor * | pSnappedCursor |
| INT32 | SnappedCursorID |
| MonotonicTime | TextTimer |
| MonotonicTime | RenderTimer |
| BOOL | MousePosPaneNeedsResizing |
| BOOL | MousePosNeedsUpdatingFlag |
| INT32 | RenderAnimationState |
| INT32 | MousePosDP |
| INT32 | OldMemory |
| INT32 | CurrentPercent |
| String_256 * | JobDescription |
| BOOL | ProgressShown |
| String_256 | StatusText |
| String_256 | m_MousePosText |
| StatusTimer | m_Timer |
Static Private Attributes | |
| static String_256 | m_strPrefix |
| static BOOL | restrictStatusLineFunctionsToColourPicker = FALSE |
| static BOOL | DoControlHelp = TRUE |
| static StatusLine * | s_pStatusLine = NULL |
Classes | |
| class | StatusTimer |
Definition at line 137 of file statline.h.
|
|
Constructor for StatusLine.
Definition at line 208 of file statline.cpp. 00208 : m_Timer(this) 00209 { 00210 // ensure initial updates 00211 OldMemory=0; 00212 MousePosDP=2; 00213 TextTimer.Sample(); 00214 RenderTimer.Sample(); 00215 RenderAnimationState=0; 00216 MousePosNeedsUpdatingFlag=TRUE; 00217 MousePosPaneNeedsResizing=TRUE; 00218 // TransparencyNeedsUpdating=TRUE; 00219 00220 // create a 'snapped' mouse pointer 00221 pSnappedCursor = new Cursor(_R(IDCSR_SNAPPED)); 00222 SnappedCursorID = 0; 00223 00224 JobDescription=NULL; 00225 CurrentPercent=-1; 00226 ProgressShown=FALSE; 00227 00228 GetApplication()->RegisterIdleProcessor(IDLEPRIORITY_LOW, this); 00229 }
|
|
|
destructor for StatusLine
Definition at line 240 of file statline.cpp. 00241 { 00242 if (pSnappedCursor != NULL) 00243 { 00244 delete pSnappedCursor; 00245 pSnappedCursor = NULL; 00246 } 00247 00248 if (JobDescription != NULL) 00249 { 00250 delete JobDescription; 00251 JobDescription = NULL; 00252 } 00253 00254 if (this == s_pStatusLine) 00255 { 00256 // Only zap it out if there is a live status line. Status line objects 00257 // are temporarily created when invoking bar closure 00258 s_pStatusLine = NULL; 00259 } 00260 00261 GetApplication()->RemoveIdleProcessor(IDLEPRIORITY_LOW, this); 00262 }
|
|
|
Definition at line 168 of file statline.h. 00168 { return (DoControlHelp); }
|
|
|
|
|
|
Definition at line 149 of file statline.h. 00149 { MousePosNeedsUpdatingFlag=TRUE; };
|
|
|
Definition at line 152 of file statline.h. 00152 {MousePosPaneNeedsResizing=TRUE;};
|
|
|
Definition at line 205 of file statline.h. 00205 {return s_pStatusLine;}
|
|
||||||||||||||||||||
|
get mouse position as a string
Definition at line 918 of file statline.cpp. 00919 { 00920 ERROR2IF( pText==NULL,FALSE,"StatusLine::GetMousePosText() - pText==NULL"); 00921 ERROR2IF( pSpread==NULL,FALSE,"StatusLine::GetMousePosText() - pSpread==NULL"); 00922 00923 if (dp == -1) 00924 dp = MousePosDP; 00925 00926 String_256 yPos(""); 00927 if (pSpread->SpreadCoordToText(pText,&yPos,MousePos,FALSE,TRUE,dp)==FALSE) 00928 return FALSE; 00929 00930 *pText+=String_64(_R(IDS_K_STATLINE_POSITIONSEP)); 00931 *pText+=yPos; 00932 return TRUE; 00933 }
|
|
|
Definition at line 211 of file statline.h. 00211 {return CurrentPercent;}
|
|
|
Definition at line 646 of file statline.cpp. 00647 { 00648 PORTNOTE("StatusLine", "Removed use of CCStatusBar") 00649 #ifndef EXCLUDE_FROM_XARALX 00650 CCStatusBar* pb = GetApplication()->GetpCCStatusBar(); 00651 return pb && !m_strPrefix.IsEmpty() ? 4 + pb->GetTextWidth(&m_strPrefix, TRUE) : 0; 00652 #else 00653 return 0; 00654 #endif 00655 }
|
|
|
Definition at line 214 of file statline.h. 00214 {return ProgressShown;}
|
|
|
Definition at line 164 of file statline.h. 00164 { return restrictStatusLineFunctionsToColourPicker; }
|
|
|
Definition at line 166 of file statline.h. 00166 { DoControlHelp = FALSE; return (TRUE); }
|
|
|
handle system messages
Reimplemented from StandardBar. Definition at line 1044 of file statline.cpp. 01045 { 01046 // FixFPControlRegister(); 01047 ERROR2IF( pMsg==NULL,FAIL,"StatusLine::Message() - pMsg==NULL"); 01048 01049 if (IS_OUR_DIALOG_MSG(pMsg)) 01050 { 01051 DialogMsg* Msg = (DialogMsg*)pMsg; 01052 01053 switch(Msg->DlgMsg) 01054 { 01055 case DIM_CREATE: 01056 { 01057 if (s_pStatusLine) 01058 { 01059 ERROR3("Two status lines - that isn't meant to happen"); 01060 delete s_pStatusLine; 01061 } 01062 s_pStatusLine = this; 01063 SetGadgetBitmap(_R(IDB_SL_SNAP), _R(IDB_SL_SNAPN)); // turn snap off by default 01064 nobreak; // FALL THROUGH! 01065 } 01066 case DIM_DLG_RESIZED: 01067 { 01068 if (!ProgressShown) 01069 { 01070 // For some reason we need to do a relayout with the gadgets shown 01071 HideGadget(_R(IDC_SL_PROGRESSGAUGE), FALSE); 01072 HideGadget(_R(IDC_SL_PROGRESSPERCENT), FALSE); 01073 Layout(); 01074 HideGadget(_R(IDC_SL_PROGRESSGAUGE), !ProgressShown); 01075 HideGadget(_R(IDC_SL_PROGRESSPERCENT), !ProgressShown); 01076 } 01077 break; 01078 } 01079 default: 01080 break; 01081 01082 } 01083 // Else fall through 01084 } 01085 01086 01087 01088 // if pref units changed, or zoom changed flag mouse pos pane needs resizing 01089 if (MESSAGE_IS_A(pMsg,OptionsChangingMsg) /* && ((OptionsChangingMsg*)pMsg)->State==OptionsChangingMsg::NEWUNITS */ 01090 || MESSAGE_IS_A(pMsg,DocChangingMsg) && ((DocChangingMsg*)pMsg)->State==DocChangingMsg::SELCHANGED 01091 || MESSAGE_IS_A(pMsg,DocViewMsg) && ((DocViewMsg*)pMsg)->State==DocViewMsg::SCALECHANGED) 01092 MousePosPaneNeedsResizing=TRUE; 01093 01094 // if doc changing flag transparency needs updating & mouse pos pane needs resizing 01095 if (MESSAGE_IS_A(pMsg,DocChangingMsg) && ((DocChangingMsg*)pMsg)->State==DocChangingMsg::SELCHANGED) 01096 { 01097 //TransparencyNeedsUpdating=TRUE; 01098 MousePosPaneNeedsResizing=TRUE; 01099 } 01100 01101 if (MESSAGE_IS_A(pMsg, DocViewMsg) && ((DocViewMsg*)pMsg)->State==DocViewMsg::SELCHANGED) 01102 { 01103 CCamFrame* pMainFrame = GetMainFrame(); 01104 if (pMainFrame) 01105 { 01106 DocView* pView = ((DocViewMsg*)pMsg)->pNewDocView; 01107 BOOL bState = TRUE; 01108 String_256 sPlateName; 01109 if (pView) 01110 { 01111 ColourPlateType PlateType = COLOURPLATE_NONE; 01112 ColourContext *cc = pView->GetColourContext(COLOURMODEL_RGBT); 01113 if (cc && cc->GetColourPlate()) 01114 { 01115 PlateType = cc->GetColourPlate()->GetType(); 01116 } 01117 01118 switch (PlateType) 01119 { 01120 case COLOURPLATE_CYAN: 01121 sPlateName.Load(_R(IDS_PLATENAME_CYAN)); 01122 break; 01123 01124 case COLOURPLATE_MAGENTA: 01125 sPlateName.Load(_R(IDS_PLATENAME_MAGENTA)); 01126 break; 01127 01128 case COLOURPLATE_YELLOW: 01129 sPlateName.Load(_R(IDS_PLATENAME_YELLOW)); 01130 break; 01131 01132 case COLOURPLATE_KEY: 01133 sPlateName.Load(_R(IDS_PLATENAME_KEY)); 01134 break; 01135 01136 case COLOURPLATE_COMPOSITE: 01137 sPlateName.Load(_R(IDS_PLATENAME_COMPOSITE)); 01138 break; 01139 01140 case COLOURPLATE_SPOT: 01141 { 01142 IndexedColour* pSpotColour = cc->GetColourPlate()->GetSpotColour(); 01143 if (pSpotColour) 01144 sPlateName = *(pSpotColour->GetName()); 01145 } 01146 break; 01147 01148 default: 01149 bState = FALSE; 01150 break; 01151 } 01152 } 01153 else 01154 { 01155 bState = FALSE; 01156 } 01157 PORTNOTE("printing", "Removed SetPrinterColourStatus"); 01158 #ifndef EXCLUDE_FROM_XARALX 01159 pMainFrame->SetPrinterColourStatus(bState, &sPlateName); 01160 #endif 01161 } 01162 01163 } 01164 01165 return StandardBar::Message(pMsg); 01166 }
|
|
|
Definition at line 150 of file statline.h. 00150 { return MousePosNeedsUpdatingFlag; };
|
|
|
Idle event handler for status line Updates the text on the status bar if 'TextDelay' has elapsed since it was last changed. Also updates the mouse position pane.
Reimplemented from Operation. Definition at line 281 of file statline.cpp. 00282 { 00283 if (PrintMonitor::IsPrintingNow()) 00284 return FALSE; 00285 00286 // Don't do any status line updates if the timer is running 00287 if (!m_Timer.IsRunning()) 00288 { 00289 00290 // If the current doc doesn't have a doc view (e.g. it's a clipboard doc), then there's no point 00291 // carrying on, because it's not a proper document, hence doen't require up-to-date status bar info. 00292 if (DocView::GetSelected() == NULL) 00293 return FALSE; 00294 00295 00296 #ifndef STANDALONE 00297 // if mouse position pane needs resizing, do it (ensuring it's enabled) 00298 if (MousePosPaneNeedsResizing) 00299 { 00300 MousePosPaneNeedsResizing=FALSE; 00301 Spread* pSpread=Document::GetSelectedSpread(); 00302 if (pSpread) 00303 { 00304 SetMousePosPaneWidth(pSpread); 00305 PORTNOTE("StatusLine", "Removed use of CCStatusBar") 00306 #ifndef EXCLUDE_FROM_XARALX 00307 if (pCCStatusBar->PaneState(_R(IDS_SL_MOUSEPOS),Enable)==Fail) 00308 ReturnValue=FALSE; 00309 #endif 00310 } 00311 } 00312 #endif 00313 00314 RefreshHelpText(); 00315 00316 #ifdef _STATUSLINE_MEMORYPANE 00317 // establish if amount of memory changed BODGE 00318 MEMORYSTATUS MemState; 00319 MemState.dwLength=sizeof(MEMORYSTATUS); 00320 GlobalMemoryStatus(&MemState); 00321 INT32 Memory=MemState.dwAvailPhys; 00322 BOOL MemoryChanged=(OldMemory!=Memory); 00323 OldMemory=Memory; 00324 00325 if (MemoryChanged) 00326 { 00327 // If this ever appears in retail builds it will have to be rewritten properly (it 00328 // isn't internationally portable at the moment). 00329 String_256 StrBuf(TEXT("")); 00330 camSnprintf(StrBuf, 256, TEXT("%dK"), Memory / 1024); 00331 if (StrBuf.Length()>4) 00332 StrBuf.Insert(&String_8(TEXT(",")),StrBuf.Length()-4); 00333 BOOL ok = SetStringGadgetValue(_R(IDS_SL_MEMORY),StrBuf); 00334 if (ok) 00335 PaintGadgetNow(_R(IDS_SL_MEMORY)) 00336 else 00337 ReturnValue=FALSE; 00338 } 00339 #endif // _STATUSLINE_MEMORYPANE 00340 00341 // The timer had expired, so we need to indicate we need another update 00342 SetNeedsUpdate(); 00343 } 00344 00345 // Always say we don't need more idle events 00346 return FALSE; 00347 }
|
|
|
Definition at line 224 of file statline.h. 00225 { 00226 GetApplication()->NeedMoreIdles(); 00227 }
|
|
|
refresh the help text pane of the status line
Definition at line 385 of file statline.cpp. 00386 { 00387 // if drag op in progress, don't slow it down, just exit 00388 if (Operation::GetCurrentDragOp()) 00389 return TRUE; 00390 00391 BOOL ReturnValue=TRUE; 00392 BOOL PrefixSelDesc=STATUSLINE_SELDESC_DEFAULT; 00393 String_256 text(_T("")); 00394 BOOL TextValid=FALSE; 00395 00396 // for new custom colour picker tool .... 00397 // (do NOT update status text if this tool is active!) 00398 00399 if (IsRestrictedAccessToColourPicker () == TRUE) 00400 { 00401 return (TRUE); 00402 } 00403 00404 if (!TextValid) 00405 { 00406 TextValid=BaseBar::GetStatusLineText(&text); // try bar drag 00407 if (TextValid) 00408 PrefixSelDesc=STATUSLINE_SELDESC_BARDRAG; 00409 } 00410 00411 WinCoord WndPos(0,0); 00412 CWindowID WinID=DialogManager::GetWindowUnderPointer(&WndPos); 00413 DocView* pDocView=NULL; 00414 Spread* pSpread=NULL; 00415 DocCoord DocPos(0,0); 00416 00417 // if no valid text so far (and valid current doc else something deep down goes BANG) 00418 // get mouse pos (in DocCoords), handle of window it is over, DocView ptr, spread ptr 00419 if (!TextValid && Document::GetCurrent()!=NULL) 00420 { 00421 00422 if (WinID != NULL) 00423 pDocView=CCamView::GetDocViewFromWindowID(WinID); 00424 00425 if (pDocView != NULL) 00426 { 00427 OilCoord OilPos = WndPos.ToOil(pDocView, TRUE); 00428 pSpread = pDocView->OilToSpreadCoord(OilPos, &DocPos); 00429 } 00430 } 00431 00432 // if no text so far, try drag ops 00433 if (!TextValid) 00434 { 00435 Operation* pDragOp=Operation::GetCurrentDragOp(); 00436 if (pDragOp) 00437 { 00438 TextValid=pDragOp->GetStatusLineText(&text,pSpread,DocPos,ClickModifiers::GetClickModifiers()); 00439 ERROR3IF(!TextValid,"StatusLine::RefreshHelpText() - pDragOp->GetStatusLineText() failed"); 00440 PrefixSelDesc=STATUSLINE_SELDESC_DRAGOPS; 00441 // drag op in progress so we must have valid text (stops tool being interogated) 00442 if (!TextValid) 00443 { 00444 text=_T(""); 00445 TextValid=TRUE; 00446 } 00447 } 00448 } 00449 00450 // if no text so far, try other bits! 00451 if (!TextValid) 00452 { 00453 BOOL OverSelectedDoc=FALSE; 00454 if (pDocView) 00455 { 00456 if (pDocView==DocView::GetSelected()) 00457 { 00458 OverSelectedDoc=TRUE; 00459 Tool* pTool=Tool::GetCurrent(); 00460 ERROR3IF(pTool==NULL,"StatusLine::RefreshHelpText() - no selected tool"); 00461 if (pTool) 00462 { 00463 TextValid=pTool->GetStatusLineText(&text,pSpread,DocPos,ClickModifiers::GetClickModifiers()); 00464 if (TextValid) 00465 PrefixSelDesc=STATUSLINE_SELDESC_SELDOC; 00466 } 00467 else 00468 ReturnValue=FALSE; 00469 } 00470 else 00471 { 00472 TextValid=text.Load(_R(IDS_CLICKHERETOSELECTDOC)); // over unselected doc 00473 if (!TextValid) 00474 ReturnValue=FALSE; 00475 else 00476 PrefixSelDesc=STATUSLINE_SELDESC_OTHERDOC; 00477 } 00478 } 00479 00480 PORTNOTE("statline", "Removed use of ControlHelper") 00481 #if !defined(EXCLUDE_FROM_XARALX) 00482 if (!TextValid) 00483 { 00484 TextValid=ControlHelper::GetStatusLineText(&text,WinID); // try buttons/bars 00485 if (TextValid) 00486 PrefixSelDesc=STATUSLINE_SELDESC_BUTTONS; 00487 } 00488 #endif 00489 00490 if (!TextValid) 00491 { 00492 TextValid=DialogManager::GetStatusLineText(&text,NULL); 00493 if (TextValid) 00494 PrefixSelDesc=STATUSLINE_SELDESC_BUTTONS; 00495 } 00496 00497 #ifndef STANDALONE 00498 if (!TextValid) 00499 { 00500 TextValid=CColourBar::GetStatusLineText(&text); // try ColourBar 00501 if (TextValid) 00502 PrefixSelDesc=STATUSLINE_SELDESC_COLBAR; 00503 } 00504 00505 if (!TextValid) 00506 { 00507 TextValid=ColourPicker::GetStatusLineText(&text); // try Colour Editor 00508 if (TextValid) 00509 PrefixSelDesc=STATUSLINE_SELDESC_COLBAR; 00510 } 00511 00512 #endif //STANDALONE 00513 00514 PORTNOTE("StatusLine", "Removed use of PreviewDlg") 00515 #ifndef EXCLUDE_FROM_XARALX 00516 if (!TextValid) 00517 { 00518 TextValid=PreviewDialog::GetStatusLineText(&text); // try Preview Dialog 00519 if (TextValid) 00520 PrefixSelDesc=STATUSLINE_SELDESC_PREVIEWDLG; 00521 } 00522 #endif 00523 00524 // WEBSTER - markn 15/1/97 00525 // No rulers in webster 00526 PORTNOTE("StatusLine", "Removed use of Rulers") 00527 #ifndef EXCLUDE_FROM_XARALX 00528 #ifndef WEBSTER 00529 if (!TextValid) 00530 { 00531 DocView* pDocView = DocView::GetSelected(); 00532 RulerPair* pRulerPair = NULL; 00533 if (pDocView!=NULL) 00534 pRulerPair = pDocView->GetpRulerPair(); 00535 if (pRulerPair!=NULL) 00536 TextValid = pRulerPair->GetStatusLineText(&text,WndPos,WinID); // try Rulers 00537 if (TextValid) 00538 PrefixSelDesc=STATUSLINE_SELDESC_STATBAR; 00539 } 00540 #endif // WEBSTER 00541 #endif 00542 00543 PORTNOTE("StatusLine", "Removed use of Galleries") 00544 #ifndef EXCLUDE_FROM_XARALX 00545 #ifndef EXCLUDE_GALS 00546 if (!TextValid && WinID!=NULL) 00547 { 00548 // Lets try the Galleries .... 00549 // ** This uses Naughty Oily stuff. (Bodge for the Viewer). 00550 CWindowID ParentWnd = ::GetParent(WinID); 00551 if (ParentWnd != NULL) 00552 { 00553 DialogBarOp* pBar = DialogBarOp::FindDialogBarOp((UINT32)ParentWnd); 00554 if (pBar != NULL && pBar->IS_KIND_OF(SuperGallery)) 00555 { 00556 CRect TargetRect; 00557 ::GetWindowRect(WinID, &TargetRect); 00558 00559 // Get the screen DPI 00560 INT32 DPI = 96; 00561 HDC ScreenDC = CreateCompatibleDC(NULL); 00562 if (ScreenDC == NULL) 00563 ERROR2(FALSE, "Unable to create screen DC"); 00564 DPI = GetDeviceCaps(ScreenDC, LOGPIXELSY); 00565 DeleteDC(ScreenDC); 00566 00567 INT32 WindowHeight = TargetRect.Height(); 00568 00569 DocCoord KernelMousePos; 00570 KernelMousePos.x = ((WndPos.x) * 72000) / DPI; 00571 KernelMousePos.y = ((WindowHeight - WndPos.y) * 72000) / DPI; 00572 00573 TextValid = ((SuperGallery*)pBar)->GetStatusLineHelp(&KernelMousePos, &text); 00574 if (TextValid) 00575 PrefixSelDesc=STATUSLINE_SELDESC_STATBAR; 00576 } 00577 } 00578 } 00579 #endif 00580 #endif 00581 00582 #ifndef STANDALONE 00583 // blank mouse pos if not over selected doc 00584 if (!OverSelectedDoc) 00585 if (UpdateMousePosAndSnap(NULL,NULL,pDocView,FALSE)==FALSE) 00586 ReturnValue=FALSE; 00587 #endif 00588 } 00589 00590 // actually update the text 00591 if (!TextValid) 00592 text=_T(""); 00593 if (!UpdateText(&text,PrefixSelDesc)) 00594 ReturnValue=FALSE; 00595 00596 return ReturnValue; 00597 }
|
|
|
Definition at line 708 of file statline.cpp. 00709 { 00710 // firstly, lets check for obvious insanity 00711 00712 PORTNOTE("StatusLine", "Removed use of ColourPicker") 00713 #ifndef EXCLUDE_FROM_XARALX 00714 String_256 ClassNameStr; // The control type 00715 00716 // Find out the class type of the gadget 00717 GetClassName (colourPicker, (TCHAR*) ClassNameStr, 255); 00718 00719 if (ClassNameStr == String_8(TEXT("cc_colPicker"))) 00720 { 00721 //if (restrictStatusLineFunctionsToColourPicker == TRUE) 00722 //{ 00723 restrictStatusLineFunctionsToColourPicker = FALSE; 00724 return (TRUE); 00725 //} 00726 } 00727 00728 ENSURE(FALSE, "RestoreStatusLineFunctions called for invalid colour picker control"); 00729 #endif 00730 return (FALSE); 00731 }
|
|
|
When the user is dragging a colour picker control, we need to restrict access to status line functionality to only the colour picker.
Definition at line 670 of file statline.cpp. 00671 { 00672 // firstly, lets check for obvious insanity 00673 00674 PORTNOTE("StatusLine", "Removed use of ColourPicker") 00675 #ifndef EXCLUDE_FROM_XARALX 00676 String_256 ClassNameStr; // The control type 00677 00678 // Find out the class type of the gadget 00679 GetClassName (colourPicker, (TCHAR*) ClassNameStr, 255); 00680 00681 if (ClassNameStr == String_8(TEXT("cc_colPicker"))) 00682 { 00683 //if (restrictStatusLineFunctionsToColourPicker == FALSE) 00684 //{ 00685 restrictStatusLineFunctionsToColourPicker = TRUE; 00686 return (TRUE); 00687 //} 00688 } 00689 00690 ENSURE(FALSE, "RestrictStatusLineFunctionsToColourPicker called for invalid colour picker control"); 00691 #endif 00692 return (FALSE); 00693 }
|
|
|
Undoes a call to SetPrefix, restoring the default behaviour of showing the selection state as a prefix on the status line.
Definition at line 630 of file statline.cpp. 00631 { 00632 m_strPrefix.Empty(); 00633 }
|
|
|
Set the mouse position pane width to be large enough to hold any coord in the spread in the current preference units Also gets, and caches, the number of decimal places required to resolve 1 pixel.
Definition at line 954 of file statline.cpp. 00955 { 00956 ERROR2IF( pSpread==NULL,FALSE,"StatusLine::SetMousePosPaneWidth() - pSpread==NULL"); 00957 00958 // find/cache number of decimal places required to resolve a pixel with current units & scale 00959 INT32 dp=2; 00960 INT32 ReturnValue=TRUE; 00961 if (pSpread->GetDecimalPlacesForPixelResolution(DocView::GetSelected(), &dp)) 00962 MousePosDP=dp; 00963 else 00964 ReturnValue=FALSE; 00965 00966 // get dimensions of spread PasteRect converted (in DocCoords) 00967 DocRect PasteRect=pSpread->GetPasteboardRect(); 00968 DocCoord PasteSize(PasteRect.Width(),PasteRect.Height()); 00969 00970 // get min coord as text, then find it's width 00971 String_256 MousePosText(""); 00972 if (GetMousePosText(&MousePosText,DocCoord(0,0),pSpread,0)==FALSE) 00973 return FALSE; 00974 00975 String_256 DPSChar(_R(IDS_CONVERT_DP_CHAR)); 00976 00977 String_256 ZeroChar(_R(IDS_CONVERT_ZERO_CHAR)); 00978 00979 INT32 i; 00980 for (i=0;i<dp;i++) 00981 { 00982 MousePosText += ZeroChar; 00983 MousePosText += ZeroChar; 00984 00985 } 00986 00987 MousePosText += DPSChar; 00988 MousePosText += DPSChar; 00989 00990 PORTNOTE("StatusLine", "Removed use of CCStatusBar") 00991 #ifndef EXCLUDE_FROM_XARALX 00992 INT32 MinCoordTextWidth=pCCStatusBar->GetTextWidth(&MousePosText); 00993 #else 00994 INT32 MinCoordTextWidth=100; 00995 #endif 00996 00997 if (MinCoordTextWidth==-1) 00998 return FALSE; 00999 01000 // get max coord as text, then find it's width 01001 if (GetMousePosText(&MousePosText,PasteSize,pSpread,0)==FALSE) 01002 return FALSE; 01003 01004 for (i=0;i<dp;i++) 01005 { 01006 MousePosText += ZeroChar; 01007 MousePosText += ZeroChar; 01008 } 01009 01010 MousePosText += DPSChar; 01011 MousePosText += DPSChar; 01012 01013 PORTNOTE("StatusLine", "Removed use of CCStatusBar") 01014 #ifndef EXCLUDE_FROM_XARALX 01015 INT32 MaxCoordTextWidth=pCCStatusBar->GetTextWidth(&MousePosText) ; 01016 #else 01017 INT32 MaxCoordTextWidth=100; 01018 #endif 01019 01020 if (MaxCoordTextWidth==-1) 01021 return FALSE; 01022 01023 // set pane width 01024 PORTNOTE("StatusLine", "Removed use of CCStatusBar") 01025 #ifndef EXCLUDE_FROM_XARALX 01026 INT32 TextWidth = max(MaxCoordTextWidth,MinCoordTextWidth); 01027 if (pCCStatusBar->SetPaneWidth(TextWidth,_R(IDS_SL_MOUSEPOS))==FALSE) 01028 return FALSE; 01029 #endif 01030 return ReturnValue; 01031 }
|
|
|
Indicate the status line needs an update.
Definition at line 360 of file statline.cpp. 00361 { 00362 if (Immediate) 00363 { 00364 // Simulate a timer event 00365 m_Timer.Stop(); 00366 OnTimer(); 00367 return; 00368 } 00369 00370 m_Timer.Start(1000, TRUE); 00371 }
|
|
||||||||||||||||
|
Sets the currently displayed percentage of the progress bar. The bar will be immediately redrawn to reflect the new value. Values outside the range 0..99 (inclusive) are clipped to 0 or 99. No redraw will be done if NewPercent equals the currently displayed value.
JobDescrip - NULL, or a pointer to a new job description - pass NULL if this hasn't changed, as it makes a copy of the new string every time it is changed. If this is non-NULL, then the ClearBackground flag will be forced to TRUE to draw the new text.
Definition at line 1451 of file statline.cpp. 01456 { 01457 if (NewPercent < 0) NewPercent = 0; 01458 if (NewPercent > 99) NewPercent = 99; 01459 01460 // If there's no change, don't bother updating 01461 if (JobDescrip == NULL && NewPercent == CurrentPercent) 01462 return(TRUE); 01463 01464 CurrentPercent = NewPercent; 01465 01466 String_64 PercentString; 01467 PercentString.MakePercent(CurrentPercent); 01468 SetStringGadgetValue(_R(IDC_SL_PROGRESSPERCENT), PercentString); 01469 SetLongGadgetValue(_R(IDC_SL_PROGRESSGAUGE), CurrentPercent); 01470 01471 // If there is a new Job Description, change to use it 01472 if (JobDescrip != NULL) 01473 { 01474 delete JobDescription; 01475 JobDescription = new String_256(*JobDescrip); 01476 01477 if (JobDescription) 01478 { 01479 SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), ProgressShown?*JobDescription:StatusText); 01480 } 01481 else 01482 { 01483 SetStringGadgetValue(_R(IDC_SL_STATUSTEXT), ProgressShown?String_256(_T("")):StatusText); 01484 } 01485 01486 InvalidateGadget(0, TRUE); // Repaint the whole bar 01487 PaintGadgetNow(0); 01488 } 01489 else 01490 { 01491 // Just repaint the gauge 01492 InvalidateGadget(_R(IDC_SL_PROGRESSGAUGE), ClearBackground); 01493 InvalidateGadget(_R(IDC_SL_PROGRESSPERCENT), ClearBackground); 01494 PaintGadgetNow(_R(IDC_SL_PROGRESSGAUGE)); 01495 PaintGadgetNow(_R(IDC_SL_PROGRESSPERCENT)); 01496 } 01497 01498 return(TRUE); 01499 }
|
|
|
Overrides the default behaviour of showing the selection state as the prefix on the status line. SetDefaultPrefix restores the default behaviour of (usually) showing the selection state as the prefix.
Definition at line 614 of file statline.cpp. 00615 { 00616 m_strPrefix = str; 00617 }
|
|
|
Change state of the render indicator.
Definition at line 1335 of file statline.cpp. 01336 { 01337 INT32 RenderAnimationStates=sizeof(RenderAnimation)/sizeof(UINT32); 01338 UINT32 BitmapID=0; 01339 switch (Action) 01340 { 01341 case NotRendering: 01342 BitmapID=_R(IDB_SL_RENDN); 01343 RenderAnimationState=0; 01344 break; 01345 case Paused: 01346 BitmapID=_R(IDB_SL_RENDP); 01347 break; 01348 |