#include <ccolbar.h>
Inheritance diagram for ColourBarMsgHandler:
Public Member Functions | |
ColourBarMsgHandler () | |
Constructs a ColourBarMsgHandler, an object which, surprisingly, handles messages for its parent CColourBar. | |
Protected Member Functions | |
MsgResult | Message (Msg *Msg) |
Process messages sent to the Colour Bar. | |
Friends | |
class | CCColorBar |
Definition at line 220 of file ccolbar.h.
|
Constructs a ColourBarMsgHandler, an object which, surprisingly, handles messages for its parent CColourBar.
Definition at line 5421 of file ccolbar.cpp. 05422 : MessageHandler(CC_RUNTIME_CLASS(MessageHandler), TRUE) 05423 { 05424 }
|
|
Process messages sent to the Colour Bar.
Reimplemented from MessageHandler. Definition at line 5443 of file ccolbar.cpp. 05444 { 05445 if (MESSAGE_IS_A(Message, ColourChangingMsg)) 05446 { 05447 ColourChangingMsg *Msg = (ColourChangingMsg *) Message; 05448 switch ( Msg->State ) 05449 { 05450 case ColourChangingMsg::LISTDESELECTED: 05451 case ColourChangingMsg::SELVIEWCONTEXTCHANGE: 05452 CColourBar::PaletteHasChanged(NULL); 05453 break; 05454 05455 case ColourChangingMsg::LISTPAGED: 05456 case ColourChangingMsg::LISTUPDATED: 05457 case ColourChangingMsg::COLOURUPDATED: 05458 CColourBar::PaletteHasChanged(Msg->NewColourList); 05459 break; 05460 05461 default: 05462 break; 05463 } 05464 } 05465 // The new CommonAttrsChanged msg replaces these two messages. It handles 05466 // a change in the Current Attribute group associated with a tool as well ! 05467 // what a bargain ! 05468 /* 05469 else if (MESSAGE_IS_A(Message, SelChangingMsg)) 05470 { 05471 SelChangingMsg *Msg = (SelChangingMsg *) Message; 05472 switch ( Msg->State ) 05473 { 05474 case SelChangingMsg::SelectionState::COLOURATTCHANGED: 05475 case SelChangingMsg::SelectionState::SELECTIONCHANGED: 05476 case SelChangingMsg::SelectionState::NODECHANGED: 05477 CColourBar::SelectionHasChanged(); 05478 break; 05479 } 05480 } 05481 else if (MESSAGE_IS_A(Message, CurrentAttrChangedMsg)) 05482 { 05483 CColourBar::SelectionHasChanged(); 05484 } 05485 */ 05486 else if (MESSAGE_IS_A(Message, CommonAttrsChangedMsg)) 05487 { 05488 CColourBar::SelectionHasChanged(); 05489 } 05490 else if (MESSAGE_IS_A(Message,DragMessage)) 05491 { 05492 DragMessage *Msg = (DragMessage *) Message; 05493 05494 if (Msg->State == DragMessage::DRAGSTARTED) 05495 { 05496 if (Msg->pInfo->IsKindOf(CC_RUNTIME_CLASS(ColourDragInformation))) 05497 { 05498 ColourDragInformation *CDI = (ColourDragInformation *)Msg->pInfo; 05499 05500 if (CDI->IsLibraryColour() || CDI->GetParentDoc() == Document::GetSelected()) 05501 { 05502 // Create drag targets to recieve colour drags. We don't really care if this fails, 05503 // and the drag system will clean up any mess afterwards. 05504 EditButtonDragTarget *ButtonTarget; 05505 ButtonTarget = new EditButtonDragTarget(CColourBar::TheColourBar, 05506 &CColourBar::TheColourBar->EditButtonRect); 05507 05508 // Check that the colour being dragged is in the current colour list 05509 IndexedColour *Col = ((ColourDragInformation *) Msg->pInfo)->GetInitiallyDraggedColour(); 05510 if (Col != NULL && CColourBar::TheColourBar->m_pCurrentColourList->FindPosition(Col) < 0) 05511 Col = NULL; 05512 05513 // And if it is in the list, then allow it to be rearranged in the list 05514 if (Col != NULL) 05515 { 05516 ColourLineDragTarget *LineTarget; 05517 LineTarget = new ColourLineDragTarget(CColourBar::TheColourBar, 05518 &CColourBar::TheColourBar->StripRect); 05519 } 05520 } 05521 } 05522 } 05523 } 05524 else if (MESSAGE_IS_A(Message, DocViewMsg)) 05525 { 05526 DocViewMsg *Msg = (DocViewMsg *) Message; 05527 05528 if (Msg->State == DocViewMsg::SELCHANGED) 05529 { 05530 // Selected DocView is changing - redraw to use the new DocView's colour context 05531 BOOL DoRedraw = TRUE; 05532 if (Msg->pOldDocView != NULL && Msg->pNewDocView != NULL) 05533 { 05534 // If we know the old & new views, then see if they have the same colour 05535 // context attached - if they do, there's no need to redraw. This eliminates 05536 // flicker when swapping normal views (the most common view-swap action) 05537 // We only check the RGB context because we assume the screen is always RGB 05538 ColourContext *OldCC = Msg->pOldDocView->GetColourContext(COLOURMODEL_RGBT, TRUE); 05539 ColourContext *NewCC = Msg->pNewDocView->GetColourContext(COLOURMODEL_RGBT, TRUE); 05540 05541 if (OldCC == NewCC) 05542 DoRedraw = FALSE; 05543 } 05544 05545 if (DoRedraw) 05546 CColourBar::PaletteHasChanged(NULL); 05547 } 05548 } 05549 05550 return OK; 05551 }
|
|
|