Example #1
0
/*********************************************************************\
	Function name    : CResEditBrowser::Message
	Description      :
	Created at       : 21.10.01, @ 17:23:02
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Int32 CResEditBrowser::Message(const BaseContainer &msg, BaseContainer &result)
{
	if (msg.GetId() == BFM_GETCURSORINFO && m_dirText.Content()) {
		result.SetId(msg.GetId());
		result.SetString(RESULT_BUBBLEHELP, "<b>Selected:</b> " + m_dirText.GetString());
		return true;
	}
	return GeDialog::Message(msg, result);
}
Example #2
0
Int32 CDialogPreview::Message(const BaseContainer &msg, BaseContainer &result)
{
	if (msg.GetId() == LINKBOX_ACCEPT_DRAG_OBJECT)
	{
		DebugAssert(false);
	}
	return GeDialog::Message(msg, result);
}
Example #3
0
Bool LiquidToolData::GetCursorInfo(BaseDocument* doc, BaseContainer& data, BaseDraw* bd, Float x, Float y, BaseContainer& bc)
{
	if (bc.GetId() == BFM_CURSORINFO_REMOVE)
		return true;

	bc.SetString(RESULT_BUBBLEHELP, GeLoadString(IDS_PRIMITIVETOOL));
	bc.SetInt32(RESULT_CURSOR, MOUSE_POINT_HAND);
	return true;
}
Example #4
0
	virtual Int32 Message(const BaseContainer& msg, BaseContainer& result)
	{
		switch (msg.GetId())
		{
			case BFM_WEIGHTS_CHANGED:
				// if the weights change because of user interaction you will get notified
				if (msg.GetInt32(BFM_WEIGHTS_CHANGED) == 999)
					GroupWeightsSave(999, weights);
				break;
		}
		return SubDialog::Message(msg, result);
	}
Example #5
0
Bool PickObjectTool::GetCursorInfo(BaseDocument* doc, BaseContainer& data, BaseDraw* bd, Float x, Float y, BaseContainer& bc)
{
	if (bc.GetId() == BFM_CURSORINFO_REMOVE)
	{
		_lastBaseDraw = nullptr;
	}
	else
	{
		_lastBaseDraw = bd;
		_mouseX = (Int32)x;
		_mouseY = (Int32)y;

		AutoAlloc<C4DObjectList> list;
		if (list)
		{
			// get the z position of the topmost object. The z range for objects is from -1 to 1.
			Float		 z = 1.0;
			String	 str;
			Matrix4d m;
			ViewportSelect::PickObject(bd, doc, _mouseX, _mouseY, 1, VIEWPORT_PICK_FLAGS_ALLOW_OGL | VIEWPORT_PICK_FLAGS_USE_SEL_FILTER | VIEWPORT_PICK_FLAGS_OGL_ONLY_TOPMOST, nullptr, list, &m);
			if (list->GetCount() > 0)
				z = list->GetZ(0);
			if (z < 1.0)
			{
				Vector v = GetWorldCoordinates(bd, m, x, y, z);
				char	 ch[200];
				sprintf(ch, "Mouse coordinates: (%d, %d), world coordinates: (%.4f, %.4f, %.4f)", _mouseX, _mouseY, v.x, v.y, v.z);
				str = ch;
			}
			else
			{
				str = "Mouse cursor is not over an object";
			}
			StatusSetText(str);
		}
	}
	SpecialEventAdd(EVMSG_UPDATEHIGHLIGHT);
	return true;
}
Example #6
0
/*********************************************************************\
	Function name    : CDialogArrowBtn::Load
	Description      :
	Created at       : 17.08.01, @ 12:43:50
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
Bool CDialogArrowBtn::Load(BaseContainer* bc)
{
	Int32 lType = bc->GetId();//>GetInt32(DR_TYPE);

	m_bIsPopupButton = (lType == DROLDWIN_POPUPBUTTON);
	m_lArrowType = bc->GetInt32(DR_ARROWTYPE);

//  bDelete(m_pstrChildren);
//  bDelete(m_plChildIDs);
	m_Children.Destroy();
//  m_lChildren = 0;

	BaseContainer child;
	Int32 lChildren = bc->GetInt32(DR_NUMCHILDREN);
	for (Int32 a = 0; a < lChildren; a++)
	{
		child = bc->GetContainer(DR_CHILD + a);

		//if (m_lChildren) continue;
		if (child.GetId()/*.GetInt32(DR_TYPE)*/ != DRTYPE_COMBO_POPUP_CHILDREN) continue;

		m_Children.Load(&child);

/*    Int32 lChildItems = child.GetInt32(0);
//    m_pstrChildren = bNewDeprecatedUseArraysInstead String[m_lChildren];
//    m_plChildIDs = bNewDeprecatedUseArraysInstead Int32[m_lChildren];
		for (Int32 a = 0; a < lChildItems; a++)
		{
			m_Children.AddElement(child.GetString(2 * a + 2), child.GetString(2 * a + 3));
			//m_plChildIDs[a] = child.GetInt32(2 * a + 2);
			//m_pstrChildren[a] = child.GetString(2 * a + 3);
		}*/
	}

	return CDialogItem::Load(bc);
}
Example #7
0
Int32 PaletteColor::Message(const BaseContainer& msg, BaseContainer& result)
{
	if(msg.GetId() == BFM_DRAGRECEIVE){
		Int32 type = 0;
		void *object = NULL;
		GetDragObject(msg, &type, &object);
		if(type == DRAGTYPE_RGB){
			Vector *color = static_cast<Vector*>(object);
			if(msg.GetInt32(BFM_DRAG_FINISHED)){
                switch(m_hoverState){
                    case HOVER_LEFT:
                        Palette::InsertPaletteColor(m_palette, m_colorID, Color(*color).SetSource(COLOR_SOURCE_DISPLAY));
                        break;
                    case HOVER_RIGHT:
                        Palette::InsertPaletteColor(m_palette, m_colorID+1, Color(*color).SetSource(COLOR_SOURCE_DISPLAY));
                        break;
                    case HOVER_CENTER:
                        Palette::SetPaletteColor(m_palette, m_colorID, Color(*color).SetSource(COLOR_SOURCE_DISPLAY));
                        break;
                    case HOVER_DELETE:
                        Palette::RemovePaletteColor(m_palette, m_colorID);
                        break;
                }
                m_hoverState = HOVER_NONE;
			}
			else{
				if (msg.GetInt32(BFM_DRAG_LOST)){
					m_hoverState = HOVER_NONE;
					Redraw();
				}
				else{
                    BaseContainer state;
                    if(GetInputState(BFM_INPUT_MOUSE, BFM_INPUT_MOUSELEFT, state)){
                        if((*color)[0] <0.f && ((*color)[1] < 0.f && ((*color)[2] < 0.f))){
                            m_hoverState = HOVER_DELETE;
                        }else{
                            Float sideWidth = 0.2;
                            Int32 x = state.GetInt32(BFM_INPUT_X);
                            Int32 y = state.GetInt32(BFM_INPUT_Y);
                            Global2Local(&x,&y);
                            if(x < m_w*sideWidth){
                                m_hoverState = HOVER_LEFT;
                            }
                            else{
                                if(x > m_w*(1.0-sideWidth)){
                                    m_hoverState = HOVER_RIGHT;
                                }
                                else{
                                    m_hoverState = HOVER_CENTER;
                                }
                            }
                        }
                        Redraw();
                        GeUserArea::Message(msg, result);
                        return SetDragDestination(MOUSE_POINT_HAND);
                    }
				}
			}
		}
	}

	return GeUserArea::Message(msg, result);
}