

#include "appwin.h"
#include "base/date.h"

AppWindow::AppWindow ()
    : UI_CompositeVObject (NULL, UI_Rectangle (100, 125, 110, 135))
{
    short w = _shape.Width(), h = _shape.Height();    
    _clock = new AnalogClock (this, UI_Rectangle (0,    0,  w, h), 101);
    //HideTitleBar ();
}

AppWindow::~AppWindow ()
{
}

        
bool AppWindow::Reconfigure (const UI_Rectangle&)
{
    short width = _shape.Width();
    short clkHt = _shape.Height(); // - labelHt - 5;
    _clock->Shape() = UI_Rectangle (0, 0, width, clkHt);
    return TRUE;
}


// #include <iostream.h> // DEBUG
bool AppWindow::HandleChildEvent (const UI_Event& e)
{
    if (e.Type() == Event_LButtonPress) {
        IsTitleBarShown() ? HideTitleBar() : ShowTitleBar();
    }
    return TRUE;
}

