mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 14:16:09 -06:00
46 lines
724 B
C++
46 lines
724 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.PopUp(owner, c);
|
|
}
|
|
|
|
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);
|
|
}
|
|
|