{
if(rootWindow != this)
{
- if(activateParent && !parent.active /*parent != parent.parent.activeChild*/)
+ if(activateParent && parent && !parent.active /*parent != parent.parent.activeChild*/)
parent.ActivateEx(true, true, moveInactive, activateRoot, external, externalSwap);
}
else if(!guiApp.fullScreenMode)
if((doActivation && (activateWindow.parent != guiApp.desktop || guiApp.fullScreen)) ||
(guiApp.interimWindow && !window.IsDescendantOf(guiApp.interimWindow)))
{
+ // Let the OnLeftButtonDown do the activating instead
+ if(method == __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftDoubleClick)
+ {
+ window = null;
+ result = true;
+ }
+ else
//if(activate)
{
incref activateWindow;
class DateDropBox : DropBox
{
+ bool dateModified;
+ void EditNotifyUpdate(EditBox editBox)
+ {
+ if(pullDown)
+ dateModified = true;
+ }
+
+ bool OnPostCreate()
+ {
+ editBox.NotifyUpdate = EditNotifyUpdate;
+ return true;
+ }
bool OnKeyDown(Key key, unichar ch)
{
- if(pullDown && (SmartKey)key == enter)
+ SmartKey sKey = (SmartKey)key;
+ if(pullDown && sKey == enter)
{
- NotifyTextEntry(master, this, null, false);
+ // Because we can still edit the date text while the calendar is dropped, enter on the date box should validate it
+ NotifyTextEntry(master, this, contents /*null*/, true);//false);
((DataBox)master).SetData(&calendar.dateValue, false);
((DataBox)master).Refresh();
+ return false;
}
return DropBox::OnKeyDown(key, ch);
}
master = this, autoCreate = false;
interim = true;
+ bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
+ {
+ if(!active)
+ {
+ DateDropBox dropBox = (DateDropBox)master;
+ Destroy(0);
+ ((DataBox)dropBox.master).Refresh();
+ *goOnWithActivation = false;
+ }
+ return true;
+ }
+
void NotifyChanged(bool close)
{
incref this;
- NotifyTextEntry(master, this, null, false);
- ((DataBox)master).SetData(&calendar.dateValue, false);
+ if(dateModified)
+ {
+ Date date = calendar.dateValue;
+ dateModified = false;
+ if(date.OnGetDataFromString(contents))
+ {
+ if(date.year || date.month || date.day)
+ {
+ calendar.dateValue = date;
+ calendar.shownMonth = date.month;
+ calendar.shownYear = date.year;
+ dateModified = true;
+ }
+ }
+ }
+ if(!dateModified)
+ NotifyTextEntry(master, this, null, false);
+ dateModified = false;
+ //((DataBox)master).SetData(&calendar.dateValue, false);
if(close)
{
OnKeyDown(enter, 0);
Window OnDropDown()
{
+ editBox.Activate();
if(contents[0])
NotifyTextEntry(master, this, contents, true);
calendar.Create();
{
if(date.OnGetDataFromString(string))
{
- // TESTING THIS COMMENTED OUT HERE:
- /*if(date.year != calendar.dateValue.year ||
+ // TESTING THIS COMMENTED OUT HERE: (Not good -- was modifying on drop down!)
+ if(date.year != calendar.dateValue.year ||
date.month != calendar.dateValue.month ||
- date.day != calendar.dateValue.day)*/
+ date.day != calendar.dateValue.day)
SetData(&date, false);
if(date.year || date.month || date.day)
{