From a864dcd7cd79a4647498371133692aa629cdf61e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 22 Jul 2014 07:46:02 -0600 Subject: [PATCH] Make CTabPanel raise action event when tab is changed. Also add a function for getting the currently selected tab index. From Petteri Aimonen --- libnxwidgets/include/ctabpanel.hxx | 4 +++- libnxwidgets/src/ctabpanel.cxx | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libnxwidgets/include/ctabpanel.hxx b/libnxwidgets/include/ctabpanel.hxx index 887f66fc0..2d6b95ca5 100644 --- a/libnxwidgets/include/ctabpanel.hxx +++ b/libnxwidgets/include/ctabpanel.hxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/include/ctabpanel.hxx * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Petteri Aimonen * * Redistribution and use in source and binary forms, with or without @@ -101,6 +101,8 @@ namespace NXWidgets void setPageName(uint8_t index, const CNxString &name); void showPage(uint8_t index); + + uint8_t getCurrentPageIndex() const; }; } diff --git a/libnxwidgets/src/ctabpanel.cxx b/libnxwidgets/src/ctabpanel.cxx index ed7524edb..430093d23 100644 --- a/libnxwidgets/src/ctabpanel.cxx +++ b/libnxwidgets/src/ctabpanel.cxx @@ -1,7 +1,7 @@ /**************************************************************************** * NxWidgets/libnxwidgets/src/ctabpanel.hxx * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Petteri Aimonen * * Redistribution and use in source and binary forms, with or without @@ -123,8 +123,14 @@ void CTabPanel::handleActionEvent(const CWidgetEventArgs &e) m_buttonbar->isAnyButtonStuckDown(x, y); showPage(x); + m_widgetEventHandlers->raiseActionEvent(); } } - - +uint8_t CTabPanel::getCurrentPageIndex() const +{ + int x = 0; + int y = 0; + m_buttonbar->isAnyButtonStuckDown(x, y); + return x; +}