Index: mysql-gui-common/library_gc/source/myx_gc_connection.cpp =================================================================== --- mysql-gui-common/library_gc/source/myx_gc_connection.cpp (revision 1224) +++ mysql-gui-common/library_gc/source/myx_gc_connection.cpp (working copy) @@ -534,17 +534,17 @@ //---------------------------------------------------------------------------------------------------------------------- -/** - * Triggers the actions of the connection instance that is located at the given location. The given coordinates are - * in view space but are implicitely converted by the figure instances. - * Only actions with the correct trigger conditions are executed. - * - * @param button The mouse button which triggered the call. - * @param event The event which triggered the action. - * @param modifiers Any combination of Alt, Control and Shift key. - * @param coords The mouse coordinates in element space. - * @return The last executed action or NULL if none. - */ +/** + * Triggers the actions of the connection instance that is located at the given location. The given coordinates are + * in view space but are implicitely converted by the figure instances. + * Only actions with the correct trigger conditions are executed. + * + * @param button The mouse button which triggered the call. + * @param event The event which triggered the action. + * @param modifiers Any combination of Alt, Control and Shift key. + * @param coords The mouse coordinates in element space. + * @return The last executed action or NULL if none. + */ TAction* CConnectionInstance::executeAssociatedActions(TMouseButton button, TMouseEvent event, TModifierKey modifiers, TVertex& coords) { TAction* lastAction = NULL; @@ -557,16 +557,22 @@ // Decorations and labels. They may not always be assigned. if (lastAction == NULL && FEnd1Decoration != NULL) lastAction = FEnd1Decoration->executeAssociatedActions(button, event, modifiers, coords); - if (lastAction == NULL && FEnd1Label != NULL) - lastAction = FEnd1Label->executeAssociatedActions(button, event, modifiers, coords - FLabel1Offset); + if (lastAction == NULL && FEnd1Label != NULL) { + coords = coords - FLabel1Offset; + lastAction = FEnd1Label->executeAssociatedActions(button, event, modifiers, coords); + } if (lastAction == NULL && FCenterDecoration != NULL) lastAction = FCenterDecoration->executeAssociatedActions(button, event, modifiers, coords); - if (lastAction == NULL && FCenterLabel != NULL) - lastAction = FCenterLabel->executeAssociatedActions(button, event, modifiers, coords - FCenterLabelOffset); + if (lastAction == NULL && FCenterLabel != NULL) { + coords = coords - FCenterLabelOffset; + lastAction = FCenterLabel->executeAssociatedActions(button, event, modifiers, coords); + } if (lastAction == NULL && FEnd2Decoration != NULL) lastAction = FEnd2Decoration->executeAssociatedActions(button, event, modifiers, coords); - if (lastAction == NULL && FEnd2Label != NULL) - lastAction = FEnd2Label->executeAssociatedActions(button, event, modifiers, coords - FLabel2Offset); + if (lastAction == NULL && FEnd2Label != NULL) { + coords = coords - FLabel2Offset; + lastAction = FEnd2Label->executeAssociatedActions(button, event, modifiers, coords); + } return lastAction; } @@ -1030,11 +1036,11 @@ /** * Returns info about the connection at the specified point. * - * @param modifiers Any combination of Alt, Control and Shift key. + * @param modifiers Any combination of Alt, Control and Shift key. * @param coords The coordinates to check against. * @return The requested info. */ -TFeedbackInfo CConnectionInstance::getFeedbackInfo(int modifiers, TVertex& coords) +TFeedbackInfo CConnectionInstance::getFeedbackInfo(TModifierKey modifiers, TVertex& coords) { TFeedbackInfo result; @@ -1046,16 +1052,22 @@ // Decorations and labels. They may not always be assigned. if (result == GC_FI_NONE && FEnd1Decoration != NULL) result = FEnd1Decoration->getFeedbackInfo(modifiers, coords); - if (result == GC_FI_NONE && FEnd1Label != NULL) - result = FEnd1Label->getFeedbackInfo(modifiers, coords - FLabel1Offset); + if (result == GC_FI_NONE && FEnd1Label != NULL) { + coords = coords - FLabel1Offset; + result = FEnd1Label->getFeedbackInfo(modifiers, coords); + } if (result == GC_FI_NONE && FCenterDecoration != NULL) result = FCenterDecoration->getFeedbackInfo(modifiers, coords); - if (result == GC_FI_NONE && FCenterLabel != NULL) - result = FCenterLabel->getFeedbackInfo(modifiers, coords - FCenterLabelOffset); + if (result == GC_FI_NONE && FCenterLabel != NULL) { + coords = coords - FCenterLabelOffset; + result = FCenterLabel->getFeedbackInfo(modifiers, coords); + } if (result == GC_FI_NONE && FEnd2Decoration != NULL) result = FEnd2Decoration->getFeedbackInfo(modifiers, coords); - if (result == GC_FI_NONE && FEnd2Label != NULL) - result = FEnd2Label->getFeedbackInfo(modifiers, coords - FLabel2Offset); + if (result == GC_FI_NONE && FEnd2Label != NULL) { + coords = coords - FLabel2Offset; + result = FEnd2Label->getFeedbackInfo(modifiers, coords); + } if (result == GC_FI_NONE) { @@ -1695,7 +1707,7 @@ void CConnectionLayer::CConnectionInstanceListener::onDestroy(CGCBase* object) { CConnectionInstance* instance = (CConnectionInstance*) object; - layer->removeInstance((CConnectionInstance*) object); + layer->removeInstance((CConnectionInstance*) instance); } //---------------------------------------------------------------------------------------------------------------------- @@ -1908,11 +1920,11 @@ /** * Checks the given position and hit element for a detailed hit information. * - * @param modifiers Any combination of Alt, Control and Shift key. + * @param modifiers Any combination of Alt, Control and Shift key. * @param coords The position to test against. * @return Info about the hit if any. */ -TFeedbackInfo CConnectionLayer::getFeedbackInfo(int modifiers, TVertex& coords) +TFeedbackInfo CConnectionLayer::getFeedbackInfo(TModifierKey modifiers, TVertex& coords) { TFeedbackInfo result = GC_FI_NONE; @@ -1983,7 +1995,7 @@ //---------------------------------------------------------------------------------------------------------------------- -bool CConnectionLayer::handleMouseDown(TMouseButton button, int modifiers, int windowX, int windowY, TVertex& viewCoords) +bool CConnectionLayer::handleMouseDown(TMouseButton button, TModifierKey modifiers, int windowX, int windowY, TVertex& viewCoords) { bool result = false; bool keepHitInfo = false; @@ -2046,7 +2058,7 @@ //---------------------------------------------------------------------------------------------------------------------- -bool CConnectionLayer::handleMouseMove(int modifiers, int windowX, int windowY, TVertex& viewCoords) +bool CConnectionLayer::handleMouseMove(TModifierKey modifiers, int windowX, int windowY, TVertex& viewCoords) { bool result = false; @@ -2138,7 +2150,7 @@ //---------------------------------------------------------------------------------------------------------------------- -bool CConnectionLayer::handleMouseUp(TMouseButton button, int modifiers, int windowX, int windowY, TVertex& viewCoords) +bool CConnectionLayer::handleMouseUp(TMouseButton button, TModifierKey modifiers, int windowX, int windowY, TVertex& viewCoords) { bool result = false; Index: mysql-gui-common/library_gc/source/myx_gc_figure.cpp =================================================================== --- mysql-gui-common/library_gc/source/myx_gc_figure.cpp (revision 1224) +++ mysql-gui-common/library_gc/source/myx_gc_figure.cpp (working copy) @@ -1287,7 +1287,7 @@ style(newStyle); } else - error(this, ("CFigureElement: invalid element path %s", utf16ToUtf8(action->parameters[0])).c_str()); + error(this, ("CFigureElement: invalid element path %s" + utf16ToUtf8(action->parameters[0])).c_str()); } else error(this, "CFigureElement: invalid # of parameters to toggle action"); @@ -1623,7 +1623,7 @@ * @param coords The mouse coordinates in element space. * @return The last executed action or NULL if none. */ -TAction* CFigureElement::executeAssociatedActions(TMouseButton button, TMouseEvent event, int modifiers, TVertex& coords) +TAction* CFigureElement::executeAssociatedActions(TMouseButton button, TMouseEvent event, TModifierKey modifiers, TVertex& coords) { TAction* result = NULL; @@ -1773,7 +1773,7 @@ * @param coords The mouse coordinates in element space. * @return Returns a TFeedbackInfo result specifying what action could take place at the given location. */ -TFeedbackInfo CFigureElement::getFeedbackInfo(int modifiers, const TVertex& coords) +TFeedbackInfo CFigureElement::getFeedbackInfo(TModifierKey modifiers, const TVertex& coords) { TFeedbackInfo result = GC_FI_NONE; @@ -3092,7 +3092,7 @@ */ void CFigureInstance::makeShadow(void) { - static int shadowOffset = 10; +//static int shadowOffset = 10; static int shadowSize = 6; if (FFigure != NULL && canvas()->supportsExtension(GC_OE_FRAME_BUFFER_OBJECTS)) @@ -3396,7 +3396,7 @@ * @param coords The mouse coordinates in element space. * @return The last executed action or NULL if none. */ -TAction* CFigureInstance::executeAssociatedActions(TMouseButton button, TMouseEvent event, int modifiers, TVertex& coords) +TAction* CFigureInstance::executeAssociatedActions(TMouseButton button, TMouseEvent event, TModifierKey modifiers, TVertex& coords) { TAction* result = NULL; @@ -3421,7 +3421,7 @@ * @param coords The coordinates in space of the view to which this instance belongs. * @return Returns a TFeedbackInfo result specifying what action could take place at the given location. */ -TFeedbackInfo CFigureInstance::getFeedbackInfo(int modifiers, TVertex& coords) +TFeedbackInfo CFigureInstance::getFeedbackInfo(TModifierKey modifiers, TVertex& coords) { if (FFigure != NULL && FFigure->FContent != NULL) { Index: mysql-gui-common/library_gc/include/myx_gc_datatypes.h =================================================================== --- mysql-gui-common/library_gc/include/myx_gc_datatypes.h (revision 1224) +++ mysql-gui-common/library_gc/include/myx_gc_datatypes.h (working copy) @@ -581,7 +581,7 @@ { TMouseButton button; TMouseEvent event; - int modifiers; + TModifierKey modifiers; } TTrigger; typedef vector CTriggers; Index: mysql-gui-common/library_gc/include/myx_gc_connection.h =================================================================== --- mysql-gui-common/library_gc/include/myx_gc_connection.h (revision 1224) +++ mysql-gui-common/library_gc/include/myx_gc_connection.h (working copy) @@ -148,7 +148,7 @@ virtual CFigureInstance* __cdecl endPoint1(void) { return FEnd1; }; virtual CFigureInstance* __cdecl endPoint2(void) { return FEnd2; }; TConnectionDirection getDirection(CFigureInstance* point); - virtual TFeedbackInfo __cdecl getFeedbackInfo(int modifiers, TVertex& coords); + virtual TFeedbackInfo __cdecl getFeedbackInfo(TModifierKey modifiers, TVertex& coords); TConnectionPart labelPartFromPoint(float x, float y); virtual TConnectionLineStyle __cdecl lineStyleGet(void) { return FLineStyle; }; virtual void __cdecl lineStyleSet(TConnectionLineStyle newStyle); @@ -221,12 +221,12 @@ virtual ~CConnectionLayer(void); CConnectionInstance* createInstance(CConnection* connection, CFigureInstance* endPoint1, CFigureInstance* endPoint2); - TFeedbackInfo getFeedbackInfo(int modifiers, TVertex& coords); + TFeedbackInfo getFeedbackInfo(TModifierKey modifiers, TVertex& coords); void getHitTestInfoAt(CHitResults* hits, TVertex point, bool singleHit); void handleChange(CConnectionInstance* instance, TGCChangeReason reason); - bool handleMouseDown(TMouseButton button, int modifiers, int windowX, int windowY, TVertex& viewCoords); - bool handleMouseMove(int modifiers, int windowX, int windowY, TVertex& viewCoords); - bool handleMouseUp(TMouseButton button, int modifiers, int windowX, int windowY, TVertex& viewCoords); + bool handleMouseDown(TMouseButton button, TModifierKey modifiers, int windowX, int windowY, TVertex& viewCoords); + bool handleMouseMove(TModifierKey modifiers, int windowX, int windowY, TVertex& viewCoords); + bool handleMouseUp(TMouseButton button, TModifierKey modifiers, int windowX, int windowY, TVertex& viewCoords); void removeInstance(CConnectionInstance* instance); void validateEndPoint(CFigureInstance* point, bool handleSelfReferences); void workspaceChanged(void); Index: mysql-gui-common/library_gc/include/myx_gc_figure.h =================================================================== --- mysql-gui-common/library_gc/include/myx_gc_figure.h (revision 1224) +++ mysql-gui-common/library_gc/include/myx_gc_figure.h (working copy) @@ -266,13 +266,13 @@ CFigureElement* elementFromId(wstring id); CFigureElement* elementFromPoint(TVertex coords); TVertex elementToFigure(TVertex coords); - TAction* executeAssociatedActions(TMouseButton button, TMouseEvent event, int modifiers, TVertex& coords); + TAction* executeAssociatedActions(TMouseButton button, TMouseEvent event, TModifierKey modifiers, TVertex& coords); TAction* executeAction(TActionType action); void expanded(bool isExpanded); bool expanded(void) { return FExpanded; }; CFigure* figure(void) { return FFigure; }; TVertex figureToElement(TVertex coords); - virtual TFeedbackInfo __cdecl getFeedbackInfo(int modifiers, const TVertex& coords); + virtual TFeedbackInfo __cdecl getFeedbackInfo(TModifierKey modifiers, const TVertex& coords); TFigureElementLayout layout(void) { return FLayout; }; virtual void __cdecl makeDirty(TGCChangeReason reason = GC_CHANGE_NONE); virtual TGCVariant __cdecl propertyGet(const char* name, unsigned int index); @@ -415,9 +415,9 @@ virtual ~CFigureInstance(void); virtual CFigureElement* __cdecl elementFromPoint(TVertex coords); - virtual TAction* __cdecl executeAssociatedActions(TMouseButton button, TMouseEvent event, int modifiers, TVertex& coords); + virtual TAction* __cdecl executeAssociatedActions(TMouseButton button, TMouseEvent event, TModifierKey modifiers, TVertex& coords); virtual CFigure* __cdecl figure(void) { return FFigure; }; - virtual TFeedbackInfo __cdecl getFeedbackInfo(int modifiers, TVertex& coords); + virtual TFeedbackInfo __cdecl getFeedbackInfo(TModifierKey modifiers, TVertex& coords); virtual TVertex __cdecl instanceToView(TVertex coords); virtual CLayer* __cdecl layer(void) { return FLayer; }; virtual TBoundingBox __cdecl localBounds(void);