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 Changes in 1.7
- irrArray: Fixed issues with push_front and reallocation - 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 Changed behavior for set_pointer and clear, when free_when_destroyed is false
- NPK (Nebula device archive) reader added, it's an uncompressed PAK-like format - NPK (Nebula device archive) reader added, it's an uncompressed PAK-like format
......
...@@ -239,6 +239,14 @@ int main() ...@@ -239,6 +239,14 @@ int main()
nodePosition.X -= MOVEMENT_SPEED * frameDeltaTime; nodePosition.X -= MOVEMENT_SPEED * frameDeltaTime;
else if(receiver.IsKeyDown(irr::KEY_KEY_D)) else if(receiver.IsKeyDown(irr::KEY_KEY_D))
nodePosition.X += MOVEMENT_SPEED * frameDeltaTime; 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); node->setPosition(nodePosition);
......
...@@ -19,7 +19,7 @@ namespace gui ...@@ -19,7 +19,7 @@ namespace gui
//! constructor //! constructor
CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) 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 #ifdef _DEBUG
setDebugName("CGUIWindow"); setDebugName("CGUIWindow");
...@@ -118,12 +118,20 @@ bool CGUIWindow::OnEvent(const SEvent& event) ...@@ -118,12 +118,20 @@ bool CGUIWindow::OnEvent(const SEvent& event)
if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUS_LOST) if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUS_LOST)
{ {
Dragging = false; Dragging = false;
IsActive = false;
} }
else else
if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUSED) if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUSED)
{ {
if (Parent && ((event.GUIEvent.Caller == this) || isMyChild(event.GUIEvent.Caller))) if (Parent && ((event.GUIEvent.Caller == this) || isMyChild(event.GUIEvent.Caller)))
{
Parent->bringToFront(this); Parent->bringToFront(this);
IsActive = true;
}
else
{
IsActive = false;
}
} }
else else
if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED) if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED)
...@@ -218,8 +226,9 @@ void CGUIWindow::draw() ...@@ -218,8 +226,9 @@ void CGUIWindow::draw()
// draw body fast // draw body fast
if ( DrawBackground ) if ( DrawBackground )
{ {
rect = skin->draw3DWindowBackground(this, DrawTitlebar, skin->getColor(EGDC_ACTIVE_BORDER), rect = skin->draw3DWindowBackground(this, DrawTitlebar,
AbsoluteRect, &AbsoluteClippingRect); skin->getColor(IsActive ? EGDC_ACTIVE_BORDER : EGDC_INACTIVE_BORDER),
AbsoluteRect, &AbsoluteClippingRect);
if (DrawTitlebar && Text.size()) if (DrawTitlebar && Text.size())
{ {
...@@ -231,7 +240,8 @@ void CGUIWindow::draw() ...@@ -231,7 +240,8 @@ void CGUIWindow::draw()
if (font) if (font)
{ {
font->draw(Text.c_str(), rect, 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 ...@@ -327,6 +337,7 @@ void CGUIWindow::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWr
IGUIWindow::deserializeAttributes(in,options); IGUIWindow::deserializeAttributes(in,options);
Dragging = false; Dragging = false;
IsActive = false;
IsDraggable = in->getAttributeAsBool("IsDraggable"); IsDraggable = in->getAttributeAsBool("IsDraggable");
DrawBackground = in->getAttributeAsBool("DrawBackground"); DrawBackground = in->getAttributeAsBool("DrawBackground");
DrawTitlebar = in->getAttributeAsBool("DrawTitlebar"); DrawTitlebar = in->getAttributeAsBool("DrawTitlebar");
......
...@@ -79,6 +79,7 @@ namespace gui ...@@ -79,6 +79,7 @@ namespace gui
bool Dragging, IsDraggable; bool Dragging, IsDraggable;
bool DrawBackground; bool DrawBackground;
bool DrawTitlebar; bool DrawTitlebar;
bool IsActive;
}; };
} // end namespace gui } // 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