mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-09-07 09:16:32 +00:00
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:
parent
ad2aa947f1
commit
a864dcd7cd
2 changed files with 12 additions and 4 deletions
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue