Make CTabPanel raise action event when tab is changed. Also add a function for getting the currently selected tab index. From Petteri Aimonen

This commit is contained in:
Gregory Nutt 2014-07-22 07:46:02 -06:00
parent ad2aa947f1
commit a864dcd7cd
2 changed files with 12 additions and 4 deletions

View File

@ -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 <jpa@kapsi.fi>
*
* 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;
};
}

View File

@ -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 <jpa@kapsi.fi>
*
* 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;
}