Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

CSDragButton Class Reference

#include <CSButton.h>

Inheritance diagram for CSDragButton:

CSButton CSGrafikElement CSMessageDispatchable CSMessageListener

Public Member Functions

virtual std::string getType ()
 CSDragButton (CSIcon *icon)
void reactOnMessageDragButton (CSMessage *message)
virtual void reactOnMessage (CSMessage *message)
 to be overloaded


Static Public Attributes

const char * CLASS = "CSDragButton"
 static element, name of this class (introsepection)


Constructor & Destructor Documentation

CSDragButton::CSDragButton CSIcon icon  ) 
 

Definition at line 153 of file CSButton.cpp.

References BUTTON_DRAGGED_MESSAGE, CSGrafikElement::getLayoutDataInternal(), LOG_ENTER, LOG_EXIT, CSLayoutData::setPackedHorizontal(), CSLayoutData::setPackedVertical(), and CSMessage::setSubtype().

00153                                        : CSButton(icon)
00154 {
00155     static char *functionName="CSDragButton";
00156     LOG_ENTER 
00157     mDragging=false;
00158     MESSAGE_BUTTON_DRAGGED.setSubtype(BUTTON_DRAGGED_MESSAGE);
00159     getLayoutDataInternal()->setPackedHorizontal(false);
00160     getLayoutDataInternal()->setPackedVertical(false);
00161     LOG_EXIT
00162 }

Here is the call graph for this function:


Member Function Documentation

virtual std::string CSDragButton::getType  )  [inline, virtual]
 

Reimplemented from CSButton.

Definition at line 57 of file CSButton.h.

References CLASS.

00057 {return (std::string) CLASS;}

void CSDragButton::reactOnMessageDragButton CSMessage message  ) 
 

Definition at line 169 of file CSButton.cpp.

References GuiMessage::actionId, GuiMessage::deltaX, GuiMessage::deltaY, CSMessage::getSubtype(), CSMessage::getType(), GUI_MESSAGE, CSMessage::mIsHandled, MOUSE_BUTTON_PRESSED_MESSAGE, MOUSE_BUTTON_RELEASED_MESSAGE, MOUSE_MOTION_MESSAGE, CSButton::reactOnMessageButton(), GuiMessage::receiver, GuiMessage::screenX, GuiMessage::screenY, and CSMessageDispatchable::sendMessage().

Referenced by reactOnMessage().

00170 {
00171     static char *functionName="reactOnMessage";
00172     if (message->mIsHandled)
00173     {
00174         if (message->getType() == GUI_MESSAGE)
00175         {
00176             GuiMessage *gm = (GuiMessage *) message;
00177             if (message->getSubtype() ==  MOUSE_BUTTON_RELEASED_MESSAGE)
00178             {
00179                 mDragging = false;
00180                 gm->mIsHandled = false;
00181             }
00182         }
00183         reactOnMessageButton(message);
00184         return;
00185     }
00186     if (message->getType() == GUI_MESSAGE)
00187     {
00188         GuiMessage *gm = (GuiMessage *) message;
00189         if (message->getSubtype() ==  MOUSE_MOTION_MESSAGE)
00190         {
00191             if (mDragging)
00192             {
00193                 int deltaX = gm->screenX - mDragStartX;
00194                 int deltaY = gm->screenY - mDragStartY;
00195 
00196                 MESSAGE_BUTTON_DRAGGED.screenX = gm->screenX;
00197                 MESSAGE_BUTTON_DRAGGED.screenY = gm->screenY;
00198                 MESSAGE_BUTTON_DRAGGED.deltaX = deltaX;
00199                 MESSAGE_BUTTON_DRAGGED.deltaY = deltaY;
00200                 MESSAGE_BUTTON_DRAGGED.actionId = mActionId;
00201                 MESSAGE_BUTTON_DRAGGED.mIsHandled = false;
00202                 MESSAGE_BUTTON_DRAGGED.receiver = 0;
00203                 sendMessage(MESSAGE_BUTTON_DRAGGED);
00204 
00205                 mDragStartX = MESSAGE_BUTTON_DRAGGED.deltaX;
00206                 mDragStartY = MESSAGE_BUTTON_DRAGGED.deltaY;
00207             }
00208             gm->mIsHandled = true;
00209         }
00210         if (message->getSubtype() ==  MOUSE_BUTTON_RELEASED_MESSAGE)
00211         {
00212             mDragging = false;
00213             gm->mIsHandled = false;
00214         }
00215         if ((gm->receiver == this) || ( gm->receiver == mIcon))
00216         {
00217             switch (message->getSubtype())
00218             {
00219                 case MOUSE_BUTTON_PRESSED_MESSAGE:
00220                 {
00221                     mDragging = true;
00222                     mDragStartX = gm->screenX;
00223                     mDragStartY = gm->screenY;
00224                     gm->mIsHandled = true;
00225                     break;
00226                 }
00227             }
00228         }
00229     }
00230     reactOnMessageButton(message);
00231 }

Here is the call graph for this function:

void CSDragButton::reactOnMessage CSMessage message  )  [virtual]
 

to be overloaded

Reimplemented from CSButton.

Definition at line 164 of file CSButton.cpp.

References reactOnMessageDragButton().

00165 {
00166     reactOnMessageDragButton(message);
00167 }

Here is the call graph for this function:


Field Documentation

const char * CSDragButton::CLASS = "CSDragButton" [static]
 

static element, name of this class (introsepection)

Reimplemented from CSButton.

Definition at line 9 of file CSButton.cpp.

Referenced by CSLAF::getAreaInternal(), CSLAF::getBackgroundColorDisabledInternal(), CSLAF::getBackgroundColorEnabledInternal(), CSLAF::getBorderInternal(), CSLAF::getHorizontalElementSpacingInternal(), getType(), and CSLAF::getVerticalElementSpacingInternal().


Generated on Wed Jul 14 00:44:09 2004 for CSLib by doxygen 1.3.6