Commit c5af97e7 authored by cutealien's avatar cutealien

Windows show now active/inactive state.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2864 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 683e1d7e
Changes in 1.7
- windows show now active/inactive state
- remove unneed drop/grab calls found by manik_sheeri
- fix rounding problem in IGUIElements which have EGUIA_SCALE alignments.
- MessageBox supports now automatic resizing and images.
Deprecated EGDS_MESSAGE_BOX_WIDTH and EGDS_MESSAGE_BOX_HEIGHT
- Let maya-cam animator react on a setTarget call to the camera which happened outside it's own control
- New contextmenue features:
automatic checking for checked flag.
close handling now customizable
serialization can handle incomplete xml's
setEventParent now in public interface
New function findItemWithCommandId
New function insertItem
- irrArray: Fixed issues with push_front and reallocation
Changed behavior for set_pointer and clear, when free_when_destroyed is false
......
......@@ -240,6 +240,14 @@ int main()
else if(receiver.IsKeyDown(irr::KEY_KEY_D))
nodePosition.X += MOVEMENT_SPEED * frameDeltaTime;
if(receiver.IsKeyDown(irr::KEY_SHIFT)) fprintf(stderr, "Shift\n");
if(receiver.IsKeyDown(irr::KEY_LSHIFT)) fprintf(stderr, "Left Shift\n");
if(receiver.IsKeyDown(irr::KEY_RSHIFT)) fprintf(stderr, "Right Shift\n");
if(receiver.IsKeyDown(irr::KEY_CONTROL)) fprintf(stderr, "Control\n");
if(receiver.IsKeyDown(irr::KEY_LCONTROL)) fprintf(stderr, "Left Control\n");
if(receiver.IsKeyDown(irr::KEY_RCONTROL)) fprintf(stderr, "Right Control\n");
if(receiver.IsKeyDown(irr::KEY_KEY_Z)) fprintf(stderr, "Z key\n");
node->setPosition(nodePosition);
driver->beginScene(true, true, video::SColor(255,113,113,133));
......
......@@ -19,7 +19,7 @@ namespace gui
//! constructor
CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIWindow(environment, parent, id, rectangle), Dragging(false), IsDraggable(true), DrawBackground(true), DrawTitlebar(true)
: IGUIWindow(environment, parent, id, rectangle), Dragging(false), IsDraggable(true), DrawBackground(true), DrawTitlebar(true), IsActive(false)
{
#ifdef _DEBUG
setDebugName("CGUIWindow");
......@@ -118,12 +118,20 @@ bool CGUIWindow::OnEvent(const SEvent& event)
if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUS_LOST)
{
Dragging = false;
IsActive = false;
}
else
if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUSED)
{
if (Parent && ((event.GUIEvent.Caller == this) || isMyChild(event.GUIEvent.Caller)))
{
Parent->bringToFront(this);
IsActive = true;
}
else
{
IsActive = false;
}
}
else
if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED)
......@@ -218,7 +226,8 @@ void CGUIWindow::draw()
// draw body fast
if ( DrawBackground )
{
rect = skin->draw3DWindowBackground(this, DrawTitlebar, skin->getColor(EGDC_ACTIVE_BORDER),
rect = skin->draw3DWindowBackground(this, DrawTitlebar,
skin->getColor(IsActive ? EGDC_ACTIVE_BORDER : EGDC_INACTIVE_BORDER),
AbsoluteRect, &AbsoluteClippingRect);
if (DrawTitlebar && Text.size())
......@@ -231,7 +240,8 @@ void CGUIWindow::draw()
if (font)
{
font->draw(Text.c_str(), rect,
skin->getColor(EGDC_ACTIVE_CAPTION), false, true, &AbsoluteClippingRect);
skin->getColor(IsActive ? EGDC_ACTIVE_CAPTION:EGDC_INACTIVE_CAPTION),
false, true, &AbsoluteClippingRect);
}
}
}
......@@ -327,6 +337,7 @@ void CGUIWindow::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWr
IGUIWindow::deserializeAttributes(in,options);
Dragging = false;
IsActive = false;
IsDraggable = in->getAttributeAsBool("IsDraggable");
DrawBackground = in->getAttributeAsBool("DrawBackground");
DrawTitlebar = in->getAttributeAsBool("DrawTitlebar");
......
......@@ -79,6 +79,7 @@ namespace gui
bool Dragging, IsDraggable;
bool DrawBackground;
bool DrawTitlebar;
bool IsActive;
};
} // end namespace gui
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment