ultimatepp/bazaar/CtrlPropTest/edit.cpp
kohait 308edc1f5d various fixes and reworks
bazaar: Gen: Ctrl::LogPos RichValue expose (needs my forum patch with template<> SetNull);
WhitEnterAction: fixes LostFocus useless double invokes
PopUpC: higly customizable now, supports Accept/Reject/Backup/Restore behaviour similar to TopWindow, WithCloserKeys template mapps the ENTER/ESC key functionality without ok/cancel/exit buttons
LogPosCtrl: major extend, supports new PopUpC, closer buttons gone, uses RichValue<Ctrl::LogPos>
ValueCtrl: port to new PopUpC
CtrProp: port to use new PopUpCand RichValue<Ctrl::LogPos>


git-svn-id: svn://ultimatepp.org/upp/trunk@3820 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-09-04 22:16:18 +00:00

53 lines
874 B
C++

#include "CtrlPropTest.h"
void CtrlPropTest::DoEdit(Ctrl& c)
{
if(pe.IsOpen()) return;
Ctrl* owner = Ctrl::GetActiveWindow();
if(!owner)
{
Exclamation("No Active Window");
return;
}
pe.pec.SetCtrl(&c);
pe.Backup();
pe.PopUp(owner);
}
void CtrlPropTest::DoList(Ctrl& c)
{
if(pl.IsOpen()) return;
Ctrl* owner = Ctrl::GetActiveWindow();
if(!owner)
{
Exclamation("No Active Window");
return;
}
pl.PopUp(owner, c);
}
bool CtrlPropTest::CanEdit()
{
if(pe.IsOpen() || pl.IsOpen()) return false;
return true;
}
void CtrlPropTest::OnCtrlRight(Ctrl& c, Point p, dword keyflags)
{
if(&c == &hk) return;
if(!CanEdit()) return;
if(keyflags & K_SHIFT)
DoList(c);
else
DoEdit(c);
}
void CtrlPropTest::OnMoveAction()
{
if(hk.GetCtrl() && hk.GetCtrl() == pe.pec.GetCtrl())
pe.pec.Update();
}