class InstalledPopup
: public Tizen::Ui::Controls::Popup
, public virtual Tizen::Ui::IActionEventListener
+ , public virtual Tizen::Ui::IPropagatedKeyEventListener
{
public:
InstalledPopup();
virtual result OnTerminating(void);
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
-
+ virtual bool OnKeyPressed(Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;};
+ virtual bool OnKeyReleased(Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
+ virtual bool OnPreviewKeyPressed(Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;};
+ virtual bool OnPreviewKeyReleased(Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;};
private:
Tizen::Ui::Control* __pTarget;
Tizen::Base::String __installMessage;
InstalledPopup::OnInitializing(void)
{
AppLogDebug("Enter");
+ SetPropagatedKeyEventListener(this);
Label* pMessage = static_cast<Label*>(GetControl(IDC_LABEL_MESSAGE));
pMessage->SetText(__installMessage);
InstalledPopup::OnTerminating(void)
{
AppLogDebug("Enter");
+ SetPropagatedKeyEventListener(null);
return E_SUCCESS;
}
__pTarget->SendUserEvent(actionId, null);
}
}
+
+bool
+InstalledPopup::OnKeyReleased(Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo)
+{
+ AppLogDebug("%d", keyEventInfo.GetKeyCode());
+ if (keyEventInfo.GetKeyCode() == KEY_BACK)
+ {
+ SetShowState(false);
+ if (__pTarget)
+ {
+ __pTarget->SendUserEvent(IDA_BUTTON_CANCEL, null);
+ }
+ }
+
+ return false;
+}