mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-05 19:30:07 +08:00
More trailing whilespace removal
This commit is contained in:
parent
183012b6b4
commit
df6e0bd33a
@ -75,7 +75,7 @@ doxygen "${DOXYFILE}" || \
|
|||||||
{
|
{
|
||||||
echo "Failed to run doxygen"; \
|
echo "Failed to run doxygen"; \
|
||||||
exit 1;
|
exit 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cp -rf html "${DOXYGENOUTPUT_DIR}" || \
|
cp -rf html "${DOXYGENOUTPUT_DIR}" || \
|
||||||
|
@ -62,7 +62,7 @@ Kconfig
|
|||||||
libnxwidgets
|
libnxwidgets
|
||||||
|
|
||||||
The source code, header files, and build environment for NxWidgets is
|
The source code, header files, and build environment for NxWidgets is
|
||||||
provided in this directory.
|
provided in this directory.
|
||||||
|
|
||||||
UnitTests
|
UnitTests
|
||||||
|
|
||||||
|
6
TODO.txt
6
TODO.txt
@ -82,7 +82,7 @@ o NxConsole Issues
|
|||||||
will go to one NxConsole instance and the next character goes
|
will go to one NxConsole instance and the next character goes
|
||||||
to a different instance. That is correct behavior within the
|
to a different instance. That is correct behavior within the
|
||||||
current design, but not very usable. We need a mechanism to
|
current design, but not very usable. We need a mechanism to
|
||||||
assure that the top window is the one that receives all
|
assure that the top window is the one that receives all
|
||||||
eyboard input. NX already provides this capability with its
|
eyboard input. NX already provides this capability with its
|
||||||
nx_kbdin interface(), but that is not currently used. At present,
|
nx_kbdin interface(), but that is not currently used. At present,
|
||||||
NxConsoles get their input from /dev/console which is the serial
|
NxConsoles get their input from /dev/console which is the serial
|
||||||
@ -92,10 +92,10 @@ o NxConsole Issues
|
|||||||
SVN version 4755). The fixed version is available in SVN but
|
SVN version 4755). The fixed version is available in SVN but
|
||||||
won't be in a released version until NxWidgets-1.2 is released.
|
won't be in a released version until NxWidgets-1.2 is released.
|
||||||
Priority: Medium high, basically prohibits the use of multiple NSH windows.
|
Priority: Medium high, basically prohibits the use of multiple NSH windows.
|
||||||
|
|
||||||
Title: CLOSING AN NxCONSOLE
|
Title: CLOSING AN NxCONSOLE
|
||||||
Description: If you open multiple NxConsole applications, they all receive
|
Description: If you open multiple NxConsole applications, they all receive
|
||||||
serial input (as noted in the previous bug). However, if
|
serial input (as noted in the previous bug). However, if
|
||||||
you close one of the NxConsoles, then the others no longer
|
you close one of the NxConsoles, then the others no longer
|
||||||
received input (or no long generate output -- that cannot be
|
received input (or no long generate output -- that cannot be
|
||||||
distinguished).
|
distinguished).
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -67,7 +67,7 @@ static unsigned int g_mmPrevious;
|
|||||||
static unsigned int g_mmPeak;
|
static unsigned int g_mmPeak;
|
||||||
|
|
||||||
static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = {
|
static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = {
|
||||||
"=>", "A", "B", "<DEL",
|
"=>", "A", "B", "<DEL",
|
||||||
"C", "D", "E", "F",
|
"C", "D", "E", "F",
|
||||||
"G", "H", "I", "J",
|
"G", "H", "I", "J",
|
||||||
"K", "L", "M", "N",
|
"K", "L", "M", "N",
|
||||||
@ -285,7 +285,7 @@ int cbuttonarray_main(int argc, char *argv[])
|
|||||||
int clickRow;
|
int clickRow;
|
||||||
if (buttonArray->isButtonClicked(clickColumn, clickRow))
|
if (buttonArray->isButtonClicked(clickColumn, clickRow))
|
||||||
{
|
{
|
||||||
printf("cbuttonarray_main: %s: Button (%d, %d) is clicked\n",
|
printf("cbuttonarray_main: %s: Button (%d, %d) is clicked\n",
|
||||||
clickColumn == i && clickRow == j ? "OK" : "ERROR",
|
clickColumn == i && clickRow == j ? "OK" : "ERROR",
|
||||||
clickColumn, clickRow);
|
clickColumn, clickRow);
|
||||||
}
|
}
|
||||||
@ -304,10 +304,10 @@ int cbuttonarray_main(int argc, char *argv[])
|
|||||||
test->poll(buttonArray);
|
test->poll(buttonArray);
|
||||||
if (buttonArray->isButtonClicked(clickColumn, clickRow))
|
if (buttonArray->isButtonClicked(clickColumn, clickRow))
|
||||||
{
|
{
|
||||||
printf("cbuttonarray_main: ERROR: Button (%d, %d) is clicked\n",
|
printf("cbuttonarray_main: ERROR: Button (%d, %d) is clicked\n",
|
||||||
clickColumn, clickRow);
|
clickColumn, clickRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(500*1000);
|
usleep(500*1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -155,7 +155,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad)
|
|||||||
int clickRow;
|
int clickRow;
|
||||||
if (keypad->isButtonClicked(clickColumn, clickRow))
|
if (keypad->isButtonClicked(clickColumn, clickRow))
|
||||||
{
|
{
|
||||||
printf("clickButtons: %s: Button (%d, %d) is clicked\n",
|
printf("clickButtons: %s: Button (%d, %d) is clicked\n",
|
||||||
clickColumn == i && clickRow == j ? "OK" : "ERROR",
|
clickColumn == i && clickRow == j ? "OK" : "ERROR",
|
||||||
clickColumn, clickRow);
|
clickColumn, clickRow);
|
||||||
}
|
}
|
||||||
@ -174,10 +174,10 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad)
|
|||||||
test->poll(keypad);
|
test->poll(keypad);
|
||||||
if (keypad->isButtonClicked(clickColumn, clickRow))
|
if (keypad->isButtonClicked(clickColumn, clickRow))
|
||||||
{
|
{
|
||||||
printf("clickButtons: ERROR: Button (%d, %d) is clicked\n",
|
printf("clickButtons: ERROR: Button (%d, %d) is clicked\n",
|
||||||
clickColumn, clickRow);
|
clickColumn, clickRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(500*1000);
|
usleep(500*1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ void CKeypadTest::setDisplaySize(void)
|
|||||||
|
|
||||||
m_buttonWidth = windowSize.w >> 2;
|
m_buttonWidth = windowSize.w >> 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lets aim for a height of 7*32 = 224. But lets bump up the number of rows
|
// Lets aim for a height of 7*32 = 224. But lets bump up the number of rows
|
||||||
// to allow one for the text box.
|
// to allow one for the text box.
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ void CKeypadTest::showKeypad(CKeypad *keypad)
|
|||||||
keypad->redraw();
|
keypad->redraw();
|
||||||
|
|
||||||
// Then redraw the text box
|
// Then redraw the text box
|
||||||
|
|
||||||
m_textbox->enable(); // Un-necessary, the widget is enabled by default
|
m_textbox->enable(); // Un-necessary, the widget is enabled by default
|
||||||
m_textbox->enableDrawing();
|
m_textbox->enableDrawing();
|
||||||
m_textbox->redraw();
|
m_textbox->redraw();
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -67,7 +67,7 @@ static unsigned int g_mmPrevious;
|
|||||||
static unsigned int g_mmPeak;
|
static unsigned int g_mmPeak;
|
||||||
|
|
||||||
static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = {
|
static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = {
|
||||||
"=>", "A", "B", "<DEL",
|
"=>", "A", "B", "<DEL",
|
||||||
"C", "D", "E", "F",
|
"C", "D", "E", "F",
|
||||||
"G", "H", "I", "J",
|
"G", "H", "I", "J",
|
||||||
"K", "L", "M", "N",
|
"K", "L", "M", "N",
|
||||||
@ -243,12 +243,12 @@ int clatchbuttonarray_main(int argc, char *argv[])
|
|||||||
|
|
||||||
bool clicked = false;
|
bool clicked = false;
|
||||||
bool latched = false;
|
bool latched = false;
|
||||||
|
|
||||||
for (int j = 0; j < BUTTONARRAY_NROWS; j++)
|
for (int j = 0; j < BUTTONARRAY_NROWS; j++)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++)
|
for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++)
|
||||||
{
|
{
|
||||||
// Initially, this button should be neither clicked nor latched
|
// Initially, this button should be neither clicked nor latched
|
||||||
|
|
||||||
clicked = false;
|
clicked = false;
|
||||||
latched = false;
|
latched = false;
|
||||||
@ -275,7 +275,7 @@ int clatchbuttonarray_main(int argc, char *argv[])
|
|||||||
// Poll for the mouse release event (of course this can hang if something fails)
|
// Poll for the mouse release event (of course this can hang if something fails)
|
||||||
|
|
||||||
test->poll(buttonArray);
|
test->poll(buttonArray);
|
||||||
|
|
||||||
// Now it should be un-clicked and latched
|
// Now it should be un-clicked and latched
|
||||||
|
|
||||||
clicked = false;
|
clicked = false;
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -297,7 +297,7 @@ int clistbox_main(int argc, char *argv[])
|
|||||||
message("clistbox_main: %s: %d options de-selected\n",
|
message("clistbox_main: %s: %d options de-selected\n",
|
||||||
count == 5 ? "OK" : "ERROR", count);
|
count == 5 ? "OK" : "ERROR", count);
|
||||||
updateMemoryUsage(g_mmPrevious, "clistbox_main: After de-selecting options");
|
updateMemoryUsage(g_mmPrevious, "clistbox_main: After de-selecting options");
|
||||||
|
|
||||||
message("clistbox_main: Removing the selected options\n");
|
message("clistbox_main: Removing the selected options\n");
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -212,7 +212,7 @@ CRadioButton *CRadioButtonTest::newRadioButton(void)
|
|||||||
{
|
{
|
||||||
// Start the radio button group in the center of the upper, left
|
// Start the radio button group in the center of the upper, left
|
||||||
// quadrant. The initial size is 0,0 and the default style is used.
|
// quadrant. The initial size is 0,0 and the default style is used.
|
||||||
|
|
||||||
nxgl_coord_t groupX = windowSize.w >> 2;
|
nxgl_coord_t groupX = windowSize.w >> 2;
|
||||||
nxgl_coord_t groupY = windowSize.h >> 2;
|
nxgl_coord_t groupY = windowSize.h >> 2;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -87,7 +87,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: .built
|
all: .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklib
|
.PHONY: clean depend context disclean chkcxx chklib
|
||||||
|
@ -129,7 +129,7 @@ int ctextbox_main(int argc, char *argv[])
|
|||||||
|
|
||||||
usleep(500*1000);
|
usleep(500*1000);
|
||||||
test->injectChars(textbox, sizeof(string2), (FAR const uint8_t*)string2);
|
test->injectChars(textbox, sizeof(string2), (FAR const uint8_t*)string2);
|
||||||
|
|
||||||
// Clean up and exit
|
// Clean up and exit
|
||||||
|
|
||||||
sleep(2);
|
sleep(2);
|
||||||
|
@ -54,7 +54,7 @@ Installing and Building the Unit Tests
|
|||||||
Where:
|
Where:
|
||||||
|
|
||||||
<nuttx-directory-path> is the full, absolute path to the NuttX build directory
|
<nuttx-directory-path> is the full, absolute path to the NuttX build directory
|
||||||
|
|
||||||
If you are using the sim/nsh2 or stm3210e-eval configurations, then skip
|
If you are using the sim/nsh2 or stm3210e-eval configurations, then skip
|
||||||
to step 2 (Hmmm.. better check 1d) too).
|
to step 2 (Hmmm.. better check 1d) too).
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ Installing and Building the Unit Tests
|
|||||||
"Unit Test Directories"
|
"Unit Test Directories"
|
||||||
|
|
||||||
b) Enable C++ Support
|
b) Enable C++ Support
|
||||||
|
|
||||||
If you are not using the sim/nsh2 or stm3210e-eval, you will need to add
|
If you are not using the sim/nsh2 or stm3210e-eval, you will need to add
|
||||||
the following definitions to the NuttX configuration at nuttx/.config to
|
the following definitions to the NuttX configuration at nuttx/.config to
|
||||||
enable C++ support:
|
enable C++ support:
|
||||||
@ -81,17 +81,17 @@ Installing and Building the Unit Tests
|
|||||||
enable debug symbols:
|
enable debug symbols:
|
||||||
|
|
||||||
CONFIG_DEBUG_SYMBOLS=y
|
CONFIG_DEBUG_SYMBOLS=y
|
||||||
|
|
||||||
Then you can run the simulation using GDB or DDD which is a very powerful
|
Then you can run the simulation using GDB or DDD which is a very powerful
|
||||||
debugging environment!
|
debugging environment!
|
||||||
|
|
||||||
d) Special configuration requirements for the nxwm unit test:
|
d) Special configuration requirements for the nxwm unit test:
|
||||||
|
|
||||||
CONFIG_NXCONSOLE=y
|
CONFIG_NXCONSOLE=y
|
||||||
CONFIG_NX_MULTIUSER=y
|
CONFIG_NX_MULTIUSER=y
|
||||||
|
|
||||||
e) Other .config file changes -- NSH configurations only.
|
e) Other .config file changes -- NSH configurations only.
|
||||||
|
|
||||||
If the configuration that you are using supports NSH and NSH built-in tasks
|
If the configuration that you are using supports NSH and NSH built-in tasks
|
||||||
then all is well. If it is an NSH configuration, then you will have to define
|
then all is well. If it is an NSH configuration, then you will have to define
|
||||||
the following in your nuttx/.config file as well (if it is not already defined):
|
the following in your nuttx/.config file as well (if it is not already defined):
|
||||||
@ -134,7 +134,7 @@ Installing and Building the Unit Tests
|
|||||||
The following step will then install the new, correct directory containing
|
The following step will then install the new, correct directory containing
|
||||||
the user_start function for the selected unit test. If you see that NSH
|
the user_start function for the selected unit test. If you see that NSH
|
||||||
is configured:
|
is configured:
|
||||||
|
|
||||||
CONFIG_EXAMPLES_NSH=y ## DO NOT REMOVE
|
CONFIG_EXAMPLES_NSH=y ## DO NOT REMOVE
|
||||||
|
|
||||||
Then go back and re-read e) above.
|
Then go back and re-read e) above.
|
||||||
@ -148,7 +148,7 @@ Installing and Building the Unit Tests
|
|||||||
|
|
||||||
cd <nxwidgets-directory>/tools
|
cd <nxwidgets-directory>/tools
|
||||||
./install.sh <apps-directory-path> <test-sub-directory>
|
./install.sh <apps-directory-path> <test-sub-directory>
|
||||||
|
|
||||||
Where:
|
Where:
|
||||||
|
|
||||||
<apps-directory-path> is the full, absolute path to the NuttX apps/ directory
|
<apps-directory-path> is the full, absolute path to the NuttX apps/ directory
|
||||||
@ -209,7 +209,7 @@ Build Issues
|
|||||||
$(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
$(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||||
|
|
||||||
2. Stack Size Issues with the X11 Simulation
|
2. Stack Size Issues with the X11 Simulation
|
||||||
|
|
||||||
When you run the NuttX simulation, it uses stacks allocated by NuttX from the
|
When you run the NuttX simulation, it uses stacks allocated by NuttX from the
|
||||||
NuttX heap. The memory management model is exactly the same in the simulation
|
NuttX heap. The memory management model is exactly the same in the simulation
|
||||||
as it is real, target system. This is good because this produces a higher
|
as it is real, target system. This is good because this produces a higher
|
||||||
@ -375,7 +375,7 @@ Example
|
|||||||
./nuttx
|
./nuttx
|
||||||
|
|
||||||
NuttShell (NSH) NuttX-6.9
|
NuttShell (NSH) NuttX-6.9
|
||||||
nsh>
|
nsh>
|
||||||
|
|
||||||
b. Execute NuttX
|
b. Execute NuttX
|
||||||
Where: NSH command prompt
|
Where: NSH command prompt
|
||||||
@ -401,7 +401,7 @@ Example
|
|||||||
The I/O with the Linux/Cygwin simulation is blocking. So while NSH is
|
The I/O with the Linux/Cygwin simulation is blocking. So while NSH is
|
||||||
waiting for input nothing can run (see configs/sim/README.txt for more info).
|
waiting for input nothing can run (see configs/sim/README.txt for more info).
|
||||||
One way to make NSH stop asking for input is to sleep.
|
One way to make NSH stop asking for input is to sleep.
|
||||||
|
|
||||||
nsh> sleep 10
|
nsh> sleep 10
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
@ -433,7 +433,7 @@ Example
|
|||||||
In order to debug, you have to have build with CONFIG_DEBUG_SYMBOLS=y.
|
In order to debug, you have to have build with CONFIG_DEBUG_SYMBOLS=y.
|
||||||
This setting is preselected in the sim/nsh2 configuration so that
|
This setting is preselected in the sim/nsh2 configuration so that
|
||||||
you don't have to do anything.
|
you don't have to do anything.
|
||||||
|
|
||||||
Then under Linux or in a Cygwin X11 window, you can start the graphic
|
Then under Linux or in a Cygwin X11 window, you can start the graphic
|
||||||
debugger like:
|
debugger like:
|
||||||
|
|
||||||
|
@ -1,59 +1,59 @@
|
|||||||
NxWidgets Test Status
|
NxWidgets Test Status
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
At this point, the NXWidgets GUI toolkit code complete but still not
|
At this point, the NXWidgets GUI toolkit code complete but still not
|
||||||
completely tested. This is a list of testing issues that still need to be
|
completely tested. This is a list of testing issues that still need to be
|
||||||
addressed.
|
addressed.
|
||||||
|
|
||||||
The following Widgets have been have completed unit testing. The level of
|
The following Widgets have been have completed unit testing. The level of
|
||||||
unit testing is, however, superficial. Many features have not yet been
|
unit testing is, however, superficial. Many features have not yet been
|
||||||
tested:
|
tested:
|
||||||
|
|
||||||
- CLabel
|
- CLabel
|
||||||
- CTextBox
|
- CTextBox
|
||||||
- CButton
|
- CButton
|
||||||
- CButtonArray
|
- CButtonArray
|
||||||
- CKeypad
|
- CKeypad
|
||||||
- CRadioButton (and CRadioButtonGoup)
|
- CRadioButton (and CRadioButtonGoup)
|
||||||
- CGlyphButton
|
- CGlyphButton
|
||||||
- CLatchButton (and CStickyButton)
|
- CLatchButton (and CStickyButton)
|
||||||
- CLatchButtonArray (and CStickyButtonArray)
|
- CLatchButtonArray (and CStickyButtonArray)
|
||||||
- CCheckBox
|
- CCheckBox
|
||||||
- CProgressBar
|
- CProgressBar
|
||||||
- CImage
|
- CImage
|
||||||
- CSliderHorizontal (and CSliderHorizontalGrip)
|
- CSliderHorizontal (and CSliderHorizontalGrip)
|
||||||
- CSliderVertical (and CSliderVerticalGrip)
|
- CSliderVertical (and CSliderVerticalGrip)
|
||||||
- CScrollBarHorizontal (except paging buttons)
|
- CScrollBarHorizontal (except paging buttons)
|
||||||
- CScrollBarVertical (except paging buttons)
|
- CScrollBarVertical (except paging buttons)
|
||||||
|
|
||||||
The following components have unit test in place, but do not successfully
|
The following components have unit test in place, but do not successfully
|
||||||
pass the test:
|
pass the test:
|
||||||
|
|
||||||
- CListBox (and CListBoxDataItem) which also tests:
|
- CListBox (and CListBoxDataItem) which also tests:
|
||||||
o CText
|
o CText
|
||||||
o CList and CListDataItem
|
o CList and CListDataItem
|
||||||
o CScrollingPanel
|
o CScrollingPanel
|
||||||
|
|
||||||
The following no unit tests (and, hence, are probably non-functional):
|
The following no unit tests (and, hence, are probably non-functional):
|
||||||
|
|
||||||
Infrastructure (won't have their own unit tests)
|
Infrastructure (won't have their own unit tests)
|
||||||
- CScrollBarPanel
|
- CScrollBarPanel
|
||||||
|
|
||||||
Widgets that need unit tests:
|
Widgets that need unit tests:
|
||||||
- CCycleButton
|
- CCycleButton
|
||||||
- CScrollingTextBox
|
- CScrollingTextBox
|
||||||
- CMultiLineTextBox
|
- CMultiLineTextBox
|
||||||
- CScrollingListBox
|
- CScrollingListBox
|
||||||
|
|
||||||
There are things that require testing after all widgets complete their unit
|
There are things that require testing after all widgets complete their unit
|
||||||
tests as well. As examples:
|
tests as well. As examples:
|
||||||
|
|
||||||
- Need to verify that a screen with many widgets works correctly. That
|
- Need to verify that a screen with many widgets works correctly. That
|
||||||
focus is correctly handled when widgets are removed. etc.
|
focus is correctly handled when widgets are removed. etc.
|
||||||
- Need to verify that widget with many children work correctly together.
|
- Need to verify that widget with many children work correctly together.
|
||||||
- Need to verfiy that a display with many windows with multiple wigets
|
- Need to verfiy that a display with many windows with multiple wigets
|
||||||
per window works okay.
|
per window works okay.
|
||||||
|
|
||||||
Most unit-level testing was performed in a simulated environment driven by
|
Most unit-level testing was performed in a simulated environment driven by
|
||||||
simulated mouse and keyboard input. So many features are not tested that
|
simulated mouse and keyboard input. So many features are not tested that
|
||||||
require human interaction ... such grabbing and dragging scrollbars.
|
require human interaction ... such grabbing and dragging scrollbars.
|
||||||
|
@ -101,7 +101,7 @@ STACKSIZE = 2048
|
|||||||
|
|
||||||
# Common build
|
# Common build
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
|
|
||||||
all: chkcxx chklibnxwidgets chklibnxwm .built
|
all: chkcxx chklibnxwidgets chklibnxwm .built
|
||||||
.PHONY: clean depend context disclean chkcxx chklibnxwidgets chklibnxwm
|
.PHONY: clean depend context disclean chkcxx chklibnxwidgets chklibnxwm
|
||||||
|
@ -67,4 +67,4 @@
|
|||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -89,7 +89,7 @@ namespace NXWidgets
|
|||||||
CWidgetControl *m_widgetControl; /**< The controlling widget for the window */
|
CWidgetControl *m_widgetControl; /**< The controlling widget for the window */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Obtains the background window from server and wraps
|
* Constructor. Obtains the background window from server and wraps
|
||||||
* the window as CBgWindow. Creates an uninitialized instance of the
|
* the window as CBgWindow. Creates an uninitialized instance of the
|
||||||
@ -112,13 +112,13 @@ namespace NXWidgets
|
|||||||
* @param hNxServer Handle to the NX server.
|
* @param hNxServer Handle to the NX server.
|
||||||
* @param widgetControl Controlling widget for this window.
|
* @param widgetControl Controlling widget for this window.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CBgWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl);
|
CBgWindow(NXHANDLE hNxServer, CWidgetControl *widgetControl);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor. Returns the background window to the server.
|
* Destructor. Returns the background window to the server.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual ~CBgWindow(void);
|
virtual ~CBgWindow(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -147,7 +147,7 @@ namespace NXWidgets
|
|||||||
*
|
*
|
||||||
* @return True on success, false on any failure.
|
* @return True on success, false on any failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool requestPosition(void);
|
bool requestPosition(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -174,7 +174,7 @@ namespace NXWidgets
|
|||||||
* @param pPos The new position of the window.
|
* @param pPos The new position of the window.
|
||||||
* @return True on success, false on any failure.
|
* @return True on success, false on any failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool setPosition(FAR const struct nxgl_point_s *pPos);
|
bool setPosition(FAR const struct nxgl_point_s *pPos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -185,7 +185,7 @@ namespace NXWidgets
|
|||||||
* @param pSize The new size of the window.
|
* @param pSize The new size of the window.
|
||||||
* @return True on success, false on any failure.
|
* @return True on success, false on any failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool setSize(FAR const struct nxgl_size_s *pSize);
|
bool setSize(FAR const struct nxgl_size_s *pSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -87,11 +87,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -118,7 +118,7 @@ namespace NXWidgets
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
const struct SBitmap *m_bitmap; /**< The bitmap that is being managed */
|
const struct SBitmap *m_bitmap; /**< The bitmap that is being managed */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy constructor is protected to prevent usage.
|
* Copy constructor is protected to prevent usage.
|
||||||
*/
|
*/
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -87,11 +87,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -195,7 +195,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the button.
|
* Redraws the button.
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -53,11 +53,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -140,7 +140,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the button.
|
* Redraws the button.
|
||||||
*
|
*
|
||||||
@ -149,7 +149,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the button.
|
* Redraws the button.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -87,11 +87,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -91,11 +91,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -111,7 +111,7 @@ namespace NXWidgets
|
|||||||
* through its available options.
|
* through its available options.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CCycleButton : public CButton, public IListDataEventHandler
|
class CCycleButton : public CButton, public IListDataEventHandler
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onPreRelease(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the button.
|
* Redraws the button.
|
||||||
*
|
*
|
||||||
@ -211,7 +211,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual ~CCycleButton(void) { }
|
virtual ~CCycleButton(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new option to the widget.
|
* Add a new option to the widget.
|
||||||
*
|
*
|
||||||
|
@ -73,18 +73,18 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "csliderhorizontal.hxx"
|
#include "csliderhorizontal.hxx"
|
||||||
#include "cglyphsliderhorizontalgrip.hxx"
|
#include "cglyphsliderhorizontalgrip.hxx"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -111,7 +111,7 @@ namespace NXWidgets
|
|||||||
nxwidget_pixel_t m_fillColor; /**< Fill color for left side of "fuel gague" */
|
nxwidget_pixel_t m_fillColor; /**< Fill color for left side of "fuel gague" */
|
||||||
bool m_fill; /**< Set true if fill is active */
|
bool m_fill; /**< Set true if fill is active */
|
||||||
uint32_t m_barThickness; /**< Thickness (in pixels) of the bar */
|
uint32_t m_barThickness; /**< Thickness (in pixels) of the bar */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the maximum possible value that the slider can represent. Useful when
|
* Get the maximum possible value that the slider can represent. Useful when
|
||||||
* using the slider as a scrollbar, as the height of the grip prevents the full
|
* using the slider as a scrollbar, as the height of the grip prevents the full
|
||||||
@ -159,7 +159,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the grip towards the mouse.
|
* Moves the grip towards the mouse.
|
||||||
*
|
*
|
||||||
|
@ -73,18 +73,18 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "csliderhorizontalgrip.hxx"
|
#include "csliderhorizontalgrip.hxx"
|
||||||
#include "cimage.hxx"
|
#include "cimage.hxx"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -134,7 +134,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts dragging the grip and redraws it.
|
* Starts dragging the grip and redraws it.
|
||||||
*
|
*
|
||||||
@ -175,7 +175,7 @@ namespace NXWidgets
|
|||||||
nxgl_coord_t vX, nxgl_coord_t vY);
|
nxgl_coord_t vX, nxgl_coord_t vY);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -98,7 +98,7 @@ namespace NXWidgets
|
|||||||
class CNxString;
|
class CNxString;
|
||||||
class CRect;
|
class CRect;
|
||||||
struct SBitmap;
|
struct SBitmap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CGraphicsPort is the interface between a NXwidget and NX layer.
|
* CGraphicsPort is the interface between a NXwidget and NX layer.
|
||||||
*/
|
*/
|
||||||
@ -158,7 +158,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const nxgl_coord_t getX(void) const;
|
const nxgl_coord_t getX(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the absolute y coordinate of the upper left hand corner of the
|
* Return the absolute y coordinate of the upper left hand corner of the
|
||||||
* underlying window.
|
* underlying window.
|
||||||
@ -363,7 +363,7 @@ namespace NXWidgets
|
|||||||
void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font,
|
void drawText(struct nxgl_point_s *pos, CRect *bound, CNxFont *font,
|
||||||
const CNxString &string, int startIndex, int length,
|
const CNxString &string, int startIndex, int length,
|
||||||
nxgl_mxpixel_t color, nxgl_mxpixel_t background);
|
nxgl_mxpixel_t color, nxgl_mxpixel_t background);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw an opaque bitmap to the window.
|
* Draw an opaque bitmap to the window.
|
||||||
*
|
*
|
||||||
@ -436,7 +436,7 @@ namespace NXWidgets
|
|||||||
void copy(nxgl_coord_t sourceX, nxgl_coord_t sourceY,
|
void copy(nxgl_coord_t sourceX, nxgl_coord_t sourceY,
|
||||||
nxgl_coord_t destX, nxgl_coord_t destY,
|
nxgl_coord_t destX, nxgl_coord_t destY,
|
||||||
nxgl_coord_t width, nxgl_coord_t height);
|
nxgl_coord_t width, nxgl_coord_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move a region by a specified distance in two dimensions.
|
* Move a region by a specified distance in two dimensions.
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -52,11 +52,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -83,7 +83,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void configureKeypadMode(void);
|
void configureKeypadMode(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy constructor is protected to prevent usage.
|
* Copy constructor is protected to prevent usage.
|
||||||
*/
|
*/
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -87,11 +87,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -53,11 +53,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -92,11 +92,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -147,7 +147,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onClick(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onClick(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selects the clicked item and deselects all others.
|
* Selects the clicked item and deselects all others.
|
||||||
*
|
*
|
||||||
@ -175,7 +175,7 @@ namespace NXWidgets
|
|||||||
inline CListBox(const CListBox &listBox) : CScrollingPanel(listBox) { }
|
inline CListBox(const CListBox &listBox) : CScrollingPanel(listBox) { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
@ -309,7 +309,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual const CListBoxDataItem *getSelectedOption(void) const;
|
virtual const CListBoxDataItem *getSelectedOption(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether multiple selections are possible or not.
|
* Sets whether multiple selections are possible or not.
|
||||||
*
|
*
|
||||||
|
@ -1,180 +1,180 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/clistboxdataitem.hxx
|
* include/clistboxdataitem.hxx
|
||||||
* NxWidgets/libnxwidgets/
|
* NxWidgets/libnxwidgets/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
||||||
* me be used to endorse or promote products derived from this software
|
* me be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
||||||
* portions are original efforts. It is difficult to determine at this
|
* portions are original efforts. It is difficult to determine at this
|
||||||
* point what parts are original efforts and which parts derive from Woopsi.
|
* point what parts are original efforts and which parts derive from Woopsi.
|
||||||
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
||||||
* in most NxWidget files. Thanks Antony!
|
* in most NxWidget files. Thanks Antony!
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007-2011, Antony Dzeryn
|
* Copyright (c) 2007-2011, Antony Dzeryn
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* * Redistributions of source code must retain the above copyright
|
* * Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __INCLUDE_CLISTBOXDATAITEM_HXX
|
#ifndef __INCLUDE_CLISTBOXDATAITEM_HXX
|
||||||
#define __INCLUDE_CLISTBOXDATAITEM_HXX
|
#define __INCLUDE_CLISTBOXDATAITEM_HXX
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
|
|
||||||
#include "clistdataitem.hxx"
|
#include "clistdataitem.hxx"
|
||||||
#include "cnxstring.hxx"
|
#include "cnxstring.hxx"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Class representing a data item within a ListBox.
|
* Class representing a data item within a ListBox.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CListBoxDataItem : public CListDataItem
|
class CListBoxDataItem : public CListDataItem
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
nxwidget_pixel_t m_normalTextColor; /**< Color used for text when not selected. */
|
nxwidget_pixel_t m_normalTextColor; /**< Color used for text when not selected. */
|
||||||
nxwidget_pixel_t m_normalBackColor; /**< Color used for background when not selected. */
|
nxwidget_pixel_t m_normalBackColor; /**< Color used for background when not selected. */
|
||||||
nxwidget_pixel_t m_selectedTextColor; /**< Color used for text when selected. */
|
nxwidget_pixel_t m_selectedTextColor; /**< Color used for text when selected. */
|
||||||
nxwidget_pixel_t m_selectedBackColor; /**< Color used for background when selected. */
|
nxwidget_pixel_t m_selectedBackColor; /**< Color used for background when selected. */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param text The text to display in the item.
|
* @param text The text to display in the item.
|
||||||
* @param value The value of the item.
|
* @param value The value of the item.
|
||||||
* @param normalTextColor Color to draw the text with when not selected.
|
* @param normalTextColor Color to draw the text with when not selected.
|
||||||
* @param normalBackColor Color to draw the background with when not selected.
|
* @param normalBackColor Color to draw the background with when not selected.
|
||||||
* @param selectedTextColor Color to draw the text with when selected.
|
* @param selectedTextColor Color to draw the text with when selected.
|
||||||
* @param selectedBackColor Color to draw the background with when selected.
|
* @param selectedBackColor Color to draw the background with when selected.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CListBoxDataItem(const CNxString &text, const uint32_t value,
|
CListBoxDataItem(const CNxString &text, const uint32_t value,
|
||||||
const nxwidget_pixel_t normalTextColor,
|
const nxwidget_pixel_t normalTextColor,
|
||||||
const nxwidget_pixel_t normalBackColor,
|
const nxwidget_pixel_t normalBackColor,
|
||||||
const nxwidget_pixel_t selectedTextColor,
|
const nxwidget_pixel_t selectedTextColor,
|
||||||
const nxwidget_pixel_t selectedBackColor);
|
const nxwidget_pixel_t selectedBackColor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the color used for text when the item is unselected.
|
* Get the color used for text when the item is unselected.
|
||||||
*
|
*
|
||||||
* @return The text color when the item is unselected.
|
* @return The text color when the item is unselected.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline nxwidget_pixel_t getNormalTextColor(void) const
|
inline nxwidget_pixel_t getNormalTextColor(void) const
|
||||||
{
|
{
|
||||||
return m_normalTextColor;
|
return m_normalTextColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the color used for the background when the item is unselected.
|
* Get the color used for the background when the item is unselected.
|
||||||
*
|
*
|
||||||
* @return The background color when the item is unselected.
|
* @return The background color when the item is unselected.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline nxwidget_pixel_t getNormalBackColor(void) const
|
inline nxwidget_pixel_t getNormalBackColor(void) const
|
||||||
{
|
{
|
||||||
return m_normalBackColor;
|
return m_normalBackColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the color used for text when the item is selected.
|
* Get the color used for text when the item is selected.
|
||||||
*
|
*
|
||||||
* @return The text color when the item is selected.
|
* @return The text color when the item is selected.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline nxwidget_pixel_t getSelectedTextColor(void) const
|
inline nxwidget_pixel_t getSelectedTextColor(void) const
|
||||||
{
|
{
|
||||||
return m_selectedTextColor;
|
return m_selectedTextColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the color used for the background when the item is selected.
|
* Get the color used for the background when the item is selected.
|
||||||
*
|
*
|
||||||
* @return The background color when the item is selected.
|
* @return The background color when the item is selected.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline nxwidget_pixel_t getSelectedBackColor(void) const
|
inline nxwidget_pixel_t getSelectedBackColor(void) const
|
||||||
{
|
{
|
||||||
return m_selectedBackColor;
|
return m_selectedBackColor;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#endif // __INCLUDE_CLISTBOXDATAITEM_HXX
|
#endif // __INCLUDE_CLISTBOXDATAITEM_HXX
|
||||||
|
|
||||||
|
@ -1,351 +1,351 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* NxWidgets/libnxwidgets/include/clistdata.hxx
|
* NxWidgets/libnxwidgets/include/clistdata.hxx
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
||||||
* me be used to endorse or promote products derived from this software
|
* me be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
||||||
* portions are original efforts. It is difficult to determine at this
|
* portions are original efforts. It is difficult to determine at this
|
||||||
* point what parts are original efforts and which parts derive from Woopsi.
|
* point what parts are original efforts and which parts derive from Woopsi.
|
||||||
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
||||||
* in most NxWidget files. Thanks Antony!
|
* in most NxWidget files. Thanks Antony!
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007-2011, Antony Dzeryn
|
* Copyright (c) 2007-2011, Antony Dzeryn
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* * Redistributions of source code must retain the above copyright
|
* * Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __INCLUDE_CLISTDATA_HXX
|
#ifndef __INCLUDE_CLISTDATA_HXX
|
||||||
#define __INCLUDE_CLISTDATA_HXX
|
#define __INCLUDE_CLISTDATA_HXX
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
|
|
||||||
#include "tnxarray.hxx"
|
#include "tnxarray.hxx"
|
||||||
#include "ilistdataeventhandler.hxx"
|
#include "ilistdataeventhandler.hxx"
|
||||||
#include "clistdataitem.hxx"
|
#include "clistdataitem.hxx"
|
||||||
#include "cnxstring.hxx"
|
#include "cnxstring.hxx"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Class representing a list of items. Designed to be used by the
|
* Class representing a list of items. Designed to be used by the
|
||||||
* CListBox class, etc, to store its data. Fires events to notify
|
* CListBox class, etc, to store its data. Fires events to notify
|
||||||
* listeners when the list changes or a new selection is made.
|
* listeners when the list changes or a new selection is made.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CListData
|
class CListData
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
TNxArray<CListDataItem*> m_items; /**< Collection of list data items. */
|
TNxArray<CListDataItem*> m_items; /**< Collection of list data items. */
|
||||||
TNxArray<IListDataEventHandler*> m_listDataEventhandlers; /**< Collection of event handlers. */
|
TNxArray<IListDataEventHandler*> m_listDataEventhandlers; /**< Collection of event handlers. */
|
||||||
bool m_allowMultipleSelections; /**< If true, multiple options can
|
bool m_allowMultipleSelections; /**< If true, multiple options can
|
||||||
be selected. */
|
be selected. */
|
||||||
bool m_sortInsertedItems; /**< Automatically sorts items on
|
bool m_sortInsertedItems; /**< Automatically sorts items on
|
||||||
insertion if true. */
|
insertion if true. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Quick sort the items using their compareTo() methods.
|
* Quick sort the items using their compareTo() methods.
|
||||||
*
|
*
|
||||||
* @param start The index to start sorting at.
|
* @param start The index to start sorting at.
|
||||||
* @param end The index to stop sorting at.
|
* @param end The index to stop sorting at.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void quickSort(const int start, const int end);
|
virtual void quickSort(const int start, const int end);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swap the locations of two items in the array.
|
* Swap the locations of two items in the array.
|
||||||
*
|
*
|
||||||
* @param index1 The index of the first item to swap.
|
* @param index1 The index of the first item to swap.
|
||||||
* @param index2 The index of the second item to swap.
|
* @param index2 The index of the second item to swap.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void swapItems(const int index1, const int index2);
|
virtual void swapItems(const int index1, const int index2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the index that an item should be inserted at to maintain a sorted list of data.
|
* Return the index that an item should be inserted at to maintain a sorted list of data.
|
||||||
*
|
*
|
||||||
* @param item The item to insert.
|
* @param item The item to insert.
|
||||||
* @return The index that the item should be imserted into at.
|
* @return The index that the item should be imserted into at.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const int getSortedInsertionIndex(const CListDataItem *item) const;
|
const int getSortedInsertionIndex(const CListDataItem *item) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raise a data changed event.
|
* Raise a data changed event.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void raiseDataChangedEvent(void);
|
void raiseDataChangedEvent(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raise a selection changed event.
|
* Raise a selection changed event.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void raiseSelectionChangedEvent(void);
|
void raiseSelectionChangedEvent(void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
CListData(void);
|
CListData(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
virtual ~CListData(void);
|
virtual ~CListData(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new item.
|
* Add a new item.
|
||||||
*
|
*
|
||||||
* @param text Text to show in the option.
|
* @param text Text to show in the option.
|
||||||
* @param value The value of the option.
|
* @param value The value of the option.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void addItem(const CNxString &text, const uint32_t value);
|
virtual void addItem(const CNxString &text, const uint32_t value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an existing item. CListData becomes the owner of the option and will delete it
|
* Add an existing item. CListData becomes the owner of the option and will delete it
|
||||||
* when the list is deleted.
|
* when the list is deleted.
|
||||||
*
|
*
|
||||||
* @param item The item to add.
|
* @param item The item to add.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void addItem(CListDataItem *item);
|
virtual void addItem(CListDataItem *item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove an item by its index.
|
* Remove an item by its index.
|
||||||
*
|
*
|
||||||
* @param index The index of the option to remove.
|
* @param index The index of the option to remove.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void removeItem(const int index);
|
virtual void removeItem(const int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select an item by its index.
|
* Select an item by its index.
|
||||||
*
|
*
|
||||||
* @param index The index of the item to select.
|
* @param index The index of the item to select.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void selectItem(const int index);
|
virtual void selectItem(const int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deselect an item by its index.
|
* Deselect an item by its index.
|
||||||
*
|
*
|
||||||
* @param index The index of the item to select.
|
* @param index The index of the item to select.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void deselectItem(const int index);
|
virtual void deselectItem(const int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all items.
|
* Remove all items.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void removeAllItems(void);
|
virtual void removeAllItems(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the selected index. Returns -1 if nothing is selected. If more than one
|
* Get the selected index. Returns -1 if nothing is selected. If more than one
|
||||||
* item is selected, the index of the first selected item is returned.
|
* item is selected, the index of the first selected item is returned.
|
||||||
*
|
*
|
||||||
* @return The selected index.
|
* @return The selected index.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual const int getSelectedIndex(void) const;
|
virtual const int getSelectedIndex(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the selected index. Specify -1 to select nothing. Resets any
|
* Sets the selected index. Specify -1 to select nothing. Resets any
|
||||||
* other selected items to deselected.
|
* other selected items to deselected.
|
||||||
*
|
*
|
||||||
* @param index The selected index.
|
* @param index The selected index.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void setSelectedIndex(const int index);
|
virtual void setSelectedIndex(const int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the selected item. Returns NULL if nothing is selected.
|
* Get the selected item. Returns NULL if nothing is selected.
|
||||||
*
|
*
|
||||||
* @return The selected option.
|
* @return The selected option.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual const CListDataItem *getSelectedItem(void) const;
|
virtual const CListDataItem *getSelectedItem(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether multiple selections are possible or not.
|
* Sets whether multiple selections are possible or not.
|
||||||
*
|
*
|
||||||
* @param allowMultipleSelections True to allow multiple selections.
|
* @param allowMultipleSelections True to allow multiple selections.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void
|
virtual inline void
|
||||||
setAllowMultipleSelections(const bool allowMultipleSelections)
|
setAllowMultipleSelections(const bool allowMultipleSelections)
|
||||||
{
|
{
|
||||||
m_allowMultipleSelections = allowMultipleSelections;
|
m_allowMultipleSelections = allowMultipleSelections;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the specified item.
|
* Get the specified item.
|
||||||
*
|
*
|
||||||
* @return The specified item.
|
* @return The specified item.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline const CListDataItem *getItem(const int index) const
|
virtual inline const CListDataItem *getItem(const int index) const
|
||||||
{
|
{
|
||||||
return m_items[index];
|
return m_items[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort the items using their compareTo() methods.
|
* Sort the items using their compareTo() methods.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void sort(void);
|
virtual void sort(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the total number of items.
|
* Get the total number of items.
|
||||||
*
|
*
|
||||||
* @return The number of items.
|
* @return The number of items.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline const int getItemCount(void) const
|
virtual inline const int getItemCount(void) const
|
||||||
{
|
{
|
||||||
return m_items.size();
|
return m_items.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select all items. Does nothing if the list does not allow
|
* Select all items. Does nothing if the list does not allow
|
||||||
* multiple selections.
|
* multiple selections.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void selectAllItems(void);
|
virtual void selectAllItems(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deselect all items.
|
* Deselect all items.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void deselectAllItems(void);
|
virtual void deselectAllItems(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select or deselect an item by its index. Does not deselect any
|
* Select or deselect an item by its index. Does not deselect any
|
||||||
* other selected items. Set index to -1 to select nothing.
|
* other selected items. Set index to -1 to select nothing.
|
||||||
*
|
*
|
||||||
* @param index The index of the item to select.
|
* @param index The index of the item to select.
|
||||||
* @param selected True to select the item, false to deselect it.
|
* @param selected True to select the item, false to deselect it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void setItemSelected(const int index, const bool selected);
|
virtual void setItemSelected(const int index, const bool selected);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether multiple selections are possible or not.
|
* Returns whether multiple selections are possible or not.
|
||||||
*
|
*
|
||||||
* @return True if multiple selections are allowed.
|
* @return True if multiple selections are allowed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline const bool allowsMultipleSelections(void) const
|
virtual inline const bool allowsMultipleSelections(void) const
|
||||||
{
|
{
|
||||||
return m_allowMultipleSelections;
|
return m_allowMultipleSelections;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether or not items added to the list are automatically
|
* Sets whether or not items added to the list are automatically
|
||||||
* sorted on insert or not.
|
* sorted on insert or not.
|
||||||
*
|
*
|
||||||
* @param sortInsertedItems True to enable sort on insertion.
|
* @param sortInsertedItems True to enable sort on insertion.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void setSortInsertedItems(const bool sortInsertedItems)
|
virtual inline void setSortInsertedItems(const bool sortInsertedItems)
|
||||||
{
|
{
|
||||||
m_sortInsertedItems = sortInsertedItems;
|
m_sortInsertedItems = sortInsertedItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an event handler.
|
* Add an event handler.
|
||||||
*
|
*
|
||||||
* @param eventHandler The event handler to add.
|
* @param eventHandler The event handler to add.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline void addListDataEventHandler(IListDataEventHandler *eventHandler)
|
inline void addListDataEventHandler(IListDataEventHandler *eventHandler)
|
||||||
{
|
{
|
||||||
m_listDataEventhandlers.push_back(eventHandler);
|
m_listDataEventhandlers.push_back(eventHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove an event handler.
|
* Remove an event handler.
|
||||||
*
|
*
|
||||||
* @param eventHandler The event handler to remove.
|
* @param eventHandler The event handler to remove.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void removeListDataEventHandler(IListDataEventHandler *eventHandler);
|
void removeListDataEventHandler(IListDataEventHandler *eventHandler);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#endif // __INCLUDE_CLISTDATA_HXX
|
#endif // __INCLUDE_CLISTDATA_HXX
|
||||||
|
@ -1,121 +1,121 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* NxWidgets/libnxwidgets/include/clistdataeventargs.hxx
|
* NxWidgets/libnxwidgets/include/clistdataeventargs.hxx
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
||||||
* me be used to endorse or promote products derived from this software
|
* me be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
||||||
* portions are original efforts. It is difficult to determine at this
|
* portions are original efforts. It is difficult to determine at this
|
||||||
* point what parts are original efforts and which parts derive from Woopsi.
|
* point what parts are original efforts and which parts derive from Woopsi.
|
||||||
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
||||||
* in most NxWidget files. Thanks Antony!
|
* in most NxWidget files. Thanks Antony!
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007-2011, Antony Dzeryn
|
* Copyright (c) 2007-2011, Antony Dzeryn
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* * Redistributions of source code must retain the above copyright
|
* * Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __INCLUDE_CLISTDATAEVENTARGS_HXX
|
#ifndef __INCLUDE_CLISTDATAEVENTARGS_HXX
|
||||||
#define __INCLUDE_CLISTDATAEVENTARGS_HXX
|
#define __INCLUDE_CLISTDATAEVENTARGS_HXX
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "teventargs.hxx"
|
#include "teventargs.hxx"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
{
|
{
|
||||||
class CListData;
|
class CListData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event arguments passed to listeners when a CListData object raises an
|
* Event arguments passed to listeners when a CListData object raises an
|
||||||
* event.
|
* event.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CListDataEventArgs : public TEventArgs<CListData*>
|
class CListDataEventArgs : public TEventArgs<CListData*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param source Pointer to the CListData object that raised the event.
|
* @param source Pointer to the CListData object that raised the event.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline CListDataEventArgs(CListData *source) : TEventArgs<CListData*>(source)
|
inline CListDataEventArgs(CListData *source) : TEventArgs<CListData*>(source)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#endif // __INCLUDE_CLISTDATAEVENTARGS_HXX
|
#endif // __INCLUDE_CLISTDATAEVENTARGS_HXX
|
||||||
|
@ -1,189 +1,189 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* NxWidgets/libnxwidgets/include/clistdataitem.hxx
|
* NxWidgets/libnxwidgets/include/clistdataitem.hxx
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
||||||
* me be used to endorse or promote products derived from this software
|
* me be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
||||||
* portions are original efforts. It is difficult to determine at this
|
* portions are original efforts. It is difficult to determine at this
|
||||||
* point what parts are original efforts and which parts derive from Woopsi.
|
* point what parts are original efforts and which parts derive from Woopsi.
|
||||||
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
||||||
* in most NxWidget files. Thanks Antony!
|
* in most NxWidget files. Thanks Antony!
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007-2011, Antony Dzeryn
|
* Copyright (c) 2007-2011, Antony Dzeryn
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* * Redistributions of source code must retain the above copyright
|
* * Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __INCLUDE_CLISTDATAITEM_HXX
|
#ifndef __INCLUDE_CLISTDATAITEM_HXX
|
||||||
#define __INCLUDE_CLISTDATAITEM_HXX
|
#define __INCLUDE_CLISTDATAITEM_HXX
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
|
|
||||||
#include "cnxstring.hxx"
|
#include "cnxstring.hxx"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Class representing a data item within a list. Intended for use within
|
* Class representing a data item within a list. Intended for use within
|
||||||
* the CListData class.
|
* the CListData class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CListDataItem
|
class CListDataItem
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
CNxString m_text; /**< Text to display for option. */
|
CNxString m_text; /**< Text to display for option. */
|
||||||
uint32_t m_value; /**< Option value. */
|
uint32_t m_value; /**< Option value. */
|
||||||
bool m_isSelected; /**< True if the option is selected. */
|
bool m_isSelected; /**< True if the option is selected. */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param text The text to display in the item.
|
* @param text The text to display in the item.
|
||||||
* @param value The value of the item.
|
* @param value The value of the item.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CListDataItem(const CNxString &text, const uint32_t value);
|
CListDataItem(const CNxString &text, const uint32_t value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual ~CListDataItem(void);
|
virtual ~CListDataItem(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the item's text.
|
* Get the item's text.
|
||||||
*
|
*
|
||||||
* @return The item's text.
|
* @return The item's text.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline const CNxString &getText(void) const
|
inline const CNxString &getText(void) const
|
||||||
{
|
{
|
||||||
return m_text;
|
return m_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the item's value.
|
* Get the item's value.
|
||||||
*
|
*
|
||||||
* @return The item's value.
|
* @return The item's value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline const uint32_t getValue(void) const
|
inline const uint32_t getValue(void) const
|
||||||
{
|
{
|
||||||
return m_value;
|
return m_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the item's selection state.
|
* Get the item's selection state.
|
||||||
*
|
*
|
||||||
* @return True if the item is selected; false if not.
|
* @return True if the item is selected; false if not.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline const bool isSelected(void) const
|
inline const bool isSelected(void) const
|
||||||
{
|
{
|
||||||
return m_isSelected;
|
return m_isSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the item's selection state.
|
* Set the item's selection state.
|
||||||
*
|
*
|
||||||
* @param selected True to select the item; false to deselect it.
|
* @param selected True to select the item; false to deselect it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline void setSelected(bool selected)
|
inline void setSelected(bool selected)
|
||||||
{
|
{
|
||||||
m_isSelected = selected;
|
m_isSelected = selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare the item with another. Comparison is based on the text of
|
* Compare the item with another. Comparison is based on the text of
|
||||||
* the item. Returns 0 if the text in the two items is the same,
|
* the item. Returns 0 if the text in the two items is the same,
|
||||||
* a value less than 0 if this item is less than the argument, and
|
* a value less than 0 if this item is less than the argument, and
|
||||||
* a value greater than 0 if this item is greater than the argument.
|
* a value greater than 0 if this item is greater than the argument.
|
||||||
*
|
*
|
||||||
* @param item An item to compare this object with.
|
* @param item An item to compare this object with.
|
||||||
* @return 0 if the text in the two items is the same,
|
* @return 0 if the text in the two items is the same,
|
||||||
* a value less than 0 if this item is less than the argument, and
|
* a value less than 0 if this item is less than the argument, and
|
||||||
* a value greater than 0 if this item is greater than the argument.
|
* a value greater than 0 if this item is greater than the argument.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual int compareTo(const CListDataItem *item) const;
|
virtual int compareTo(const CListDataItem *item) const;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#endif // __INCLUDE_CLISTDATAITEM_HXX
|
#endif // __INCLUDE_CLISTDATAITEM_HXX
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -100,7 +100,7 @@
|
|||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
{
|
{
|
||||||
class CNxTimer;
|
class CNxTimer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,7 +112,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class CMultiLineTextBox : public ITextBox, public CScrollingPanel,
|
class CMultiLineTextBox : public ITextBox, public CScrollingPanel,
|
||||||
public CWidgetEventHandler
|
public CWidgetEventHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the dragging system.
|
* Starts the dragging system.
|
||||||
*
|
*
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -89,11 +89,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -135,15 +135,15 @@ namespace NXWidgets
|
|||||||
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
||||||
|
|
||||||
virtual void handleClickEvent(const CWidgetEventArgs &e);
|
virtual void handleClickEvent(const CWidgetEventArgs &e);
|
||||||
|
|
||||||
virtual void handleReleaseEvent(const CWidgetEventArgs &e);
|
virtual void handleReleaseEvent(const CWidgetEventArgs &e);
|
||||||
|
|
||||||
virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e);
|
virtual void handleReleaseOutsideEvent(const CWidgetEventArgs &e);
|
||||||
|
|
||||||
virtual void handleActionEvent(const CWidgetEventArgs &e);
|
virtual void handleActionEvent(const CWidgetEventArgs &e);
|
||||||
|
|
||||||
virtual void handleDragEvent(const CWidgetEventArgs &e);
|
virtual void handleDragEvent(const CWidgetEventArgs &e);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy constructor is protected to prevent usage.
|
* Copy constructor is protected to prevent usage.
|
||||||
*/
|
*/
|
||||||
@ -192,19 +192,19 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void setFont(CNxFont *font);
|
virtual void setFont(CNxFont *font);
|
||||||
|
|
||||||
inline int getValue() const { return m_value; }
|
inline int getValue() const { return m_value; }
|
||||||
void setValue(int value);
|
void setValue(int value);
|
||||||
|
|
||||||
inline int getMaximum() const { return m_maximum; }
|
inline int getMaximum() const { return m_maximum; }
|
||||||
inline void setMaximum(int value) { m_maximum = value; setValue(m_value); }
|
inline void setMaximum(int value) { m_maximum = value; setValue(m_value); }
|
||||||
|
|
||||||
inline int getMinimum() const { return m_minimum; }
|
inline int getMinimum() const { return m_minimum; }
|
||||||
inline void setMinimum(int value) { m_minimum = value; setValue(m_value); }
|
inline void setMinimum(int value) { m_minimum = value; setValue(m_value); }
|
||||||
|
|
||||||
inline int getIncrement() const { return m_increment; }
|
inline int getIncrement() const { return m_increment; }
|
||||||
inline void setIncrement(int value) { m_increment = value; setValue(m_value); }
|
inline void setIncrement(int value) { m_increment = value; setValue(m_value); }
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -111,7 +111,7 @@ namespace NXWidgets
|
|||||||
*
|
*
|
||||||
* @return The current drawing color.
|
* @return The current drawing color.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline const nxgl_mxpixel_t getColor() const
|
inline const nxgl_mxpixel_t getColor() const
|
||||||
{
|
{
|
||||||
return m_fontColor;
|
return m_fontColor;
|
||||||
@ -133,17 +133,17 @@ namespace NXWidgets
|
|||||||
* color.
|
* color.
|
||||||
* @return The transparent background color.
|
* @return The transparent background color.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline const nxgl_mxpixel_t getTransparentColor() const
|
inline const nxgl_mxpixel_t getTransparentColor() const
|
||||||
{
|
{
|
||||||
return m_transparentColor;
|
return m_transparentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the transparent background color to a new value.
|
* Sets the transparent background color to a new value.
|
||||||
* @param color The new background color.
|
* @param color The new background color.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline void setTransparentColor(const nxgl_mxpixel_t color)
|
inline void setTransparentColor(const nxgl_mxpixel_t color)
|
||||||
{
|
{
|
||||||
m_transparentColor = color;
|
m_transparentColor = color;
|
||||||
@ -157,7 +157,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void drawChar(FAR SBitmap *bitmap, nxwidget_char_t letter);
|
void drawChar(FAR SBitmap *bitmap, nxwidget_char_t letter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the width of a string in pixels when drawn with this font.
|
* Get the width of a string in pixels when drawn with this font.
|
||||||
*
|
*
|
||||||
@ -176,7 +176,7 @@ namespace NXWidgets
|
|||||||
* @param length The length of the substring in chars.
|
* @param length The length of the substring in chars.
|
||||||
* @return The width of the substring in pixels.
|
* @return The width of the substring in pixels.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nxgl_coord_t getStringWidth(const CNxString& text,
|
nxgl_coord_t getStringWidth(const CNxString& text,
|
||||||
int startIndex, int length) const;
|
int startIndex, int length) const;
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ namespace NXWidgets
|
|||||||
* @param letter The letter to get the height of.
|
* @param letter The letter to get the height of.
|
||||||
* @return The height of the character in pixels.
|
* @return The height of the character in pixels.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline nxgl_coord_t getCharHeight(nxwidget_char_t letter) const;
|
inline nxgl_coord_t getCharHeight(nxwidget_char_t letter) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -118,7 +118,7 @@ namespace NXWidgets
|
|||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
~CNxTkWindow(void);
|
~CNxTkWindow(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,7 +141,7 @@ namespace NXWidgets
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a toolbar on the framed window. This method both instantiates
|
* Open a toolbar on the framed window. This method both instantiates
|
||||||
* the toolbar object AND calls the INxWindow::open() method to
|
* the toolbar object AND calls the INxWindow::open() method to
|
||||||
* create the toolbar. The toolbar is ready for use upon return.
|
* create the toolbar. The toolbar is ready for use upon return.
|
||||||
*
|
*
|
||||||
* @param height. The height in rows of the tool bar
|
* @param height. The height in rows of the tool bar
|
||||||
@ -199,7 +199,7 @@ namespace NXWidgets
|
|||||||
* @param pos The new position of the window.
|
* @param pos The new position of the window.
|
||||||
* @return True on success, false on any failure.
|
* @return True on success, false on any failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool setPosition(FAR const struct nxgl_point_s *pos);
|
bool setPosition(FAR const struct nxgl_point_s *pos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -208,7 +208,7 @@ namespace NXWidgets
|
|||||||
* @param size The new size of the window.
|
* @param size The new size of the window.
|
||||||
* @return True on success, false on any failure.
|
* @return True on success, false on any failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool setSize(FAR const struct nxgl_size_s *size);
|
bool setSize(FAR const struct nxgl_size_s *size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -56,7 +56,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -101,14 +101,14 @@ namespace NXWidgets
|
|||||||
* @param widgetControl Controlling widget for this toolbar.
|
* @param widgetControl Controlling widget for this toolbar.
|
||||||
* @param height The height of the toolbar.
|
* @param height The height of the toolbar.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CNxToolbar(CNxTkWindow *pNxTkWindow, NXTKWINDOW hNxTkWindow,
|
CNxToolbar(CNxTkWindow *pNxTkWindow, NXTKWINDOW hNxTkWindow,
|
||||||
CWidgetControl *pWidgetControl, nxgl_coord_t height);
|
CWidgetControl *pWidgetControl, nxgl_coord_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
~CNxToolbar(void);
|
~CNxToolbar(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -163,7 +163,7 @@ namespace NXWidgets
|
|||||||
* @param pPos The new position of the toolbar.
|
* @param pPos The new position of the toolbar.
|
||||||
* @return Always returns false.
|
* @return Always returns false.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool setPosition(FAR const struct nxgl_point_s *pPos);
|
bool setPosition(FAR const struct nxgl_point_s *pPos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -173,7 +173,7 @@ namespace NXWidgets
|
|||||||
* @param pPos The new position of the toolbar.
|
* @param pPos The new position of the toolbar.
|
||||||
* @return Always returns false.
|
* @return Always returns false.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool setSize(FAR const struct nxgl_size_s *pSize);
|
bool setSize(FAR const struct nxgl_size_s *pSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -95,11 +95,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -192,7 +192,7 @@ namespace NXWidgets
|
|||||||
CWidgetEventHandlerList *m_widgetEventHandlers; /**< List of event handlers. */
|
CWidgetEventHandlerList *m_widgetEventHandlers; /**< List of event handlers. */
|
||||||
|
|
||||||
// Double-clicking
|
// Double-clicking
|
||||||
|
|
||||||
struct timespec m_lastClickTime; /**< System timer when last clicked. */
|
struct timespec m_lastClickTime; /**< System timer when last clicked. */
|
||||||
nxgl_coord_t m_lastClickX; /**< X coordinate of last click. */
|
nxgl_coord_t m_lastClickX; /**< X coordinate of last click. */
|
||||||
nxgl_coord_t m_lastClickY; /**< Y coordinate of last click. */
|
nxgl_coord_t m_lastClickY; /**< Y coordinate of last click. */
|
||||||
@ -281,7 +281,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onClick(nxgl_coord_t x, nxgl_coord_t y) { }
|
virtual inline void onClick(nxgl_coord_t x, nxgl_coord_t y) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget is double-clicked. Override this when
|
* Called when the widget is double-clicked. Override this when
|
||||||
* creating new widgets if the widget should exhibit additional
|
* creating new widgets if the widget should exhibit additional
|
||||||
@ -305,7 +305,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onPreRelease(nxgl_coord_t x, nxgl_coord_t y) { }
|
virtual inline void onPreRelease(nxgl_coord_t x, nxgl_coord_t y) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called just after the widget is released; the widget will be in the
|
* Called just after the widget is released; the widget will be in the
|
||||||
* released stated. Override this when creating new widgets if the
|
* released stated. Override this when creating new widgets if the
|
||||||
@ -316,7 +316,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onRelease(nxgl_coord_t x, nxgl_coord_t y) { }
|
virtual inline void onRelease(nxgl_coord_t x, nxgl_coord_t y) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget is released outside of its boundaries.
|
* Called when the widget is released outside of its boundaries.
|
||||||
* Override this when creating new widgets if the widget should exhibit
|
* Override this when creating new widgets if the widget should exhibit
|
||||||
@ -327,7 +327,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) { }
|
virtual inline void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget is dragged. Override this when creating new
|
* Called when the widget is dragged. Override this when creating new
|
||||||
* widgets if the widget should exhibit additional behaviour when it is
|
* widgets if the widget should exhibit additional behaviour when it is
|
||||||
@ -341,7 +341,7 @@ namespace NXWidgets
|
|||||||
|
|
||||||
virtual inline void onDrag(nxgl_coord_t x, nxgl_coord_t y,
|
virtual inline void onDrag(nxgl_coord_t x, nxgl_coord_t y,
|
||||||
nxgl_coord_t vX, nxgl_coord_t vY) { }
|
nxgl_coord_t vX, nxgl_coord_t vY) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget starts being dragged. Override this when
|
* Called when the widget starts being dragged. Override this when
|
||||||
* creating new widgets if the widget should exhibit additional
|
* creating new widgets if the widget should exhibit additional
|
||||||
@ -349,7 +349,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onDragStart(void) { }
|
virtual inline void onDragStart(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget stops being dragged. Override this when
|
* Called when the widget stops being dragged. Override this when
|
||||||
* creating new widgets if the widget should exhibit additional
|
* creating new widgets if the widget should exhibit additional
|
||||||
@ -357,7 +357,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onDragStop(void) { }
|
virtual inline void onDragStop(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget gains focus. Override this when creating new
|
* Called when the widget gains focus. Override this when creating new
|
||||||
* widgets if the widget should exhibit additional behaviour when
|
* widgets if the widget should exhibit additional behaviour when
|
||||||
@ -365,7 +365,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onFocus(void) { }
|
virtual inline void onFocus(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget loses focus. Override this when creating new
|
* Called when the widget loses focus. Override this when creating new
|
||||||
* widgets if the widget should exhibit additional behaviour when
|
* widgets if the widget should exhibit additional behaviour when
|
||||||
@ -381,7 +381,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onEnable(void) { }
|
virtual inline void onEnable(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget is disabled. Override this when creating new
|
* Called when the widget is disabled. Override this when creating new
|
||||||
* widgets if the widget should exhibit additional behaviour when
|
* widgets if the widget should exhibit additional behaviour when
|
||||||
@ -389,7 +389,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline void onDisable(void) { }
|
virtual inline void onDisable(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the widget is resized. Override this when creating new
|
* Called when the widget is resized. Override this when creating new
|
||||||
* widgets if the widget should exhibit additional behaviour when
|
* widgets if the widget should exhibit additional behaviour when
|
||||||
@ -478,7 +478,7 @@ namespace NXWidgets
|
|||||||
/**
|
/**
|
||||||
* Has the widget been marked for deletion? This function recurses up the widget
|
* Has the widget been marked for deletion? This function recurses up the widget
|
||||||
* hierarchy and only returns true if all of the widgets in the ancestor
|
* hierarchy and only returns true if all of the widgets in the ancestor
|
||||||
* chain are not deleted.
|
* chain are not deleted.
|
||||||
*
|
*
|
||||||
* Widgets marked for deletion are automatically deleted and should not be
|
* Widgets marked for deletion are automatically deleted and should not be
|
||||||
* interacted with.
|
* interacted with.
|
||||||
@ -798,11 +798,11 @@ namespace NXWidgets
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the style used by this widget
|
* Get the style used by this widget
|
||||||
*
|
*
|
||||||
* @return Const pointer to CWidgetStyle stored inside this widget.
|
* @return Const pointer to CWidgetStyle stored inside this widget.
|
||||||
*/
|
*/
|
||||||
inline const CWidgetStyle *getWidgetStyle() const { return &m_style; }
|
inline const CWidgetStyle *getWidgetStyle() const { return &m_style; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets this widget's border state.
|
* Sets this widget's border state.
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -112,13 +112,13 @@ namespace NXWidgets
|
|||||||
* @param hNxServer Handle to the NX server.
|
* @param hNxServer Handle to the NX server.
|
||||||
* @param widgetControl Controlling widget for this window.
|
* @param widgetControl Controlling widget for this window.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl);
|
CNxWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
~CNxWindow(void);
|
~CNxWindow(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -172,7 +172,7 @@ namespace NXWidgets
|
|||||||
* @param pPos The new position of the window.
|
* @param pPos The new position of the window.
|
||||||
* @return True on success, false on any failure.
|
* @return True on success, false on any failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool setPosition(FAR const struct nxgl_point_s *pPos);
|
bool setPosition(FAR const struct nxgl_point_s *pPos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -181,7 +181,7 @@ namespace NXWidgets
|
|||||||
* @param pSize The new size of the window.
|
* @param pSize The new size of the window.
|
||||||
* @return True on success, false on any failure.
|
* @return True on success, false on any failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool setSize(FAR const struct nxgl_size_s *pSize);
|
bool setSize(FAR const struct nxgl_size_s *pSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -86,11 +86,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -191,7 +191,7 @@ namespace NXWidgets
|
|||||||
|
|
||||||
inline const int16_t getValue(void) const
|
inline const int16_t getValue(void) const
|
||||||
{
|
{
|
||||||
return m_value;
|
return m_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -217,7 +217,7 @@ namespace NXWidgets
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value that of the progress bar.
|
* Set the value that of the progress bar.
|
||||||
*
|
*
|
||||||
* @param value The new value.
|
* @param value The new value.
|
||||||
*/
|
*/
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -88,7 +88,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -107,7 +107,7 @@ namespace NXWidgets
|
|||||||
* The mu state cannot be enabled by a user - it can only be set by the
|
* The mu state cannot be enabled by a user - it can only be set by the
|
||||||
* developer.
|
* developer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CRadioButton : public CButton
|
class CRadioButton : public CButton
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -149,7 +149,7 @@ namespace NXWidgets
|
|||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline ~CRadioButton() { }
|
virtual inline ~CRadioButton() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -109,7 +109,7 @@ namespace NXWidgets
|
|||||||
* it is necessary to set the state via the radio button, not the group.
|
* it is necessary to set the state via the radio button, not the group.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CRadioButtonGroup : public CNxWidget, public CWidgetEventHandler
|
class CRadioButtonGroup : public CNxWidget, public CWidgetEventHandler
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
CWidgetControl *m_pWidgetControl; /**< The controlling widget */
|
CWidgetControl *m_pWidgetControl; /**< The controlling widget */
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -85,7 +85,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -54,11 +54,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -92,7 +92,7 @@ namespace NXWidgets
|
|||||||
|
|
||||||
FAR const struct SRlePaletteBitmapEntry *data;
|
FAR const struct SRlePaletteBitmapEntry *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class providing bitmap accessor for a bitmap represented by SRlePaletteBitmap.
|
* Class providing bitmap accessor for a bitmap represented by SRlePaletteBitmap.
|
||||||
*/
|
*/
|
||||||
@ -141,7 +141,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool skipPixels(nxgl_coord_t npixels);
|
bool skipPixels(nxgl_coord_t npixels);
|
||||||
|
|
||||||
/** Seek to the beginning of the next row
|
/** Seek to the beginning of the next row
|
||||||
*
|
*
|
||||||
* @return False if this was the last row of the image
|
* @return False if this was the last row of the image
|
||||||
|
@ -108,7 +108,7 @@ namespace NXWidgets
|
|||||||
* @param row - The pointer to the row in the row cache to use
|
* @param row - The pointer to the row in the row cache to use
|
||||||
* @param column - The non-integer column offset
|
* @param column - The non-integer column offset
|
||||||
* @param outcolor - The returned, interpolated color
|
* @param outcolor - The returned, interpolated color
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool rowColor(FAR uint8_t *row, b16_t column,
|
bool rowColor(FAR uint8_t *row, b16_t column,
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -89,11 +89,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -245,7 +245,7 @@ namespace NXWidgets
|
|||||||
|
|
||||||
void setPageSize(const nxgl_coord_t pageSize);
|
void setPageSize(const nxgl_coord_t pageSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process events fired by the grip.
|
* Process events fired by the grip.
|
||||||
*
|
*
|
||||||
* @param e The event details.
|
* @param e The event details.
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -89,11 +89,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -223,7 +223,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void setValue(const nxgl_coord_t value);
|
void setValue(const nxgl_coord_t value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value that of the slider. This will reposition and redraw
|
* Set the value that of the slider. This will reposition and redraw
|
||||||
* the grip. The supplied value should be bitshifted left 16 places.
|
* the grip. The supplied value should be bitshifted left 16 places.
|
||||||
@ -244,7 +244,7 @@ namespace NXWidgets
|
|||||||
|
|
||||||
void setPageSize(const nxgl_coord_t pageSize);
|
void setPageSize(const nxgl_coord_t pageSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process events fired by the grip.
|
* Process events fired by the grip.
|
||||||
*
|
*
|
||||||
* @param e The event details.
|
* @param e The event details.
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -92,11 +92,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -136,7 +136,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
@ -298,7 +298,7 @@ namespace NXWidgets
|
|||||||
{
|
{
|
||||||
return m_listbox->getSelectedOption();
|
return m_listbox->getSelectedOption();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether multiple selections are possible or not.
|
* Sets whether multiple selections are possible or not.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -88,11 +88,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -152,7 +152,7 @@ namespace NXWidgets
|
|||||||
|
|
||||||
virtual void onDrag(nxgl_coord_t x, nxgl_coord_t y,
|
virtual void onDrag(nxgl_coord_t x, nxgl_coord_t y,
|
||||||
nxgl_coord_t vX, nxgl_coord_t vY);
|
nxgl_coord_t vX, nxgl_coord_t vY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the dragging system.
|
* Starts the dragging system.
|
||||||
*
|
*
|
||||||
@ -217,7 +217,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void scroll(int32_t dx, int32_t dy);
|
virtual void scroll(int32_t dx, int32_t dy);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reposition the panel's scrolling region to the specified coordinates.
|
* Reposition the panel's scrolling region to the specified coordinates.
|
||||||
*
|
*
|
||||||
@ -259,7 +259,7 @@ namespace NXWidgets
|
|||||||
{
|
{
|
||||||
return m_canvasX;
|
return m_canvasX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the y coordinate of the virtual canvas.
|
* Gets the y coordinate of the virtual canvas.
|
||||||
*
|
*
|
||||||
@ -281,7 +281,7 @@ namespace NXWidgets
|
|||||||
{
|
{
|
||||||
return m_canvasWidth;
|
return m_canvasWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the height of the virtual canvas.
|
* Gets the height of the virtual canvas.
|
||||||
*
|
*
|
||||||
@ -353,7 +353,7 @@ namespace NXWidgets
|
|||||||
{
|
{
|
||||||
m_canvasWidth = width;
|
m_canvasWidth = width;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the height of the virtual canvas.
|
* Sets the height of the virtual canvas.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -90,11 +90,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -134,7 +134,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
@ -240,7 +240,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void appendText(const CNxString &text);
|
virtual void appendText(const CNxString &text);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all characters from the string from the start index onwards.
|
* Remove all characters from the string from the start index onwards.
|
||||||
*
|
*
|
||||||
@ -336,7 +336,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void insertText(const CNxString &text, const unsigned int index);
|
virtual void insertText(const CNxString &text, const unsigned int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert text at the current cursor position.
|
* Insert text at the current cursor position.
|
||||||
*
|
*
|
||||||
@ -368,7 +368,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual const int32_t getCanvasX(void) const;
|
virtual const int32_t getCanvasX(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the y coordinate of the virtual canvas.
|
* Gets the y coordinate of the virtual canvas.
|
||||||
*
|
*
|
||||||
@ -384,7 +384,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual const int32_t getCanvasWidth(void) const;
|
virtual const int32_t getCanvasWidth(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the height of the virtual canvas.
|
* Gets the height of the virtual canvas.
|
||||||
*
|
*
|
||||||
@ -401,7 +401,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void scroll(int32_t dx, int32_t dy);
|
virtual void scroll(int32_t dx, int32_t dy);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reposition the panel's scrolling region to the specified coordinates.
|
* Reposition the panel's scrolling region to the specified coordinates.
|
||||||
*
|
*
|
||||||
@ -434,7 +434,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void setCanvasWidth(const int32_t width);
|
virtual void setCanvasWidth(const int32_t width);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the height of the virtual canvas.
|
* Sets the height of the virtual canvas.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -88,11 +88,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -119,7 +119,7 @@ namespace NXWidgets
|
|||||||
int32_t m_gutterWidth; /**< Width of the gutter, taking into account
|
int32_t m_gutterWidth; /**< Width of the gutter, taking into account
|
||||||
any adjustments made to the width of the grip. */
|
any adjustments made to the width of the grip. */
|
||||||
uint32_t m_contentSize; /**< Number of values in the min/max range. */
|
uint32_t m_contentSize; /**< Number of values in the min/max range. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the maximum possible value that the slider can represent. Useful when
|
* Get the maximum possible value that the slider can represent. Useful when
|
||||||
* using the slider as a scrollbar, as the height of the grip prevents the full
|
* using the slider as a scrollbar, as the height of the grip prevents the full
|
||||||
@ -167,7 +167,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
virtual void onResize(nxgl_coord_t width, nxgl_coord_t height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the grip towards the mouse.
|
* Moves the grip towards the mouse.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -86,11 +86,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -102,7 +102,7 @@ namespace NXWidgets
|
|||||||
* slider.
|
* slider.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CSliderHorizontalGrip : public CNxWidget
|
class CSliderHorizontalGrip : public CNxWidget
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onClick(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onClick(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the grip.
|
* Redraws the grip.
|
||||||
*
|
*
|
||||||
@ -143,7 +143,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the grip.
|
* Redraws the grip.
|
||||||
*
|
*
|
||||||
@ -152,7 +152,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the grip to follow the mouse.
|
* Moves the grip to follow the mouse.
|
||||||
*
|
*
|
||||||
@ -173,7 +173,7 @@ namespace NXWidgets
|
|||||||
: CNxWidget(sliderHorizontalGrip) { }
|
: CNxWidget(sliderHorizontalGrip) { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -88,11 +88,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -293,7 +293,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void setValue(const nxgl_coord_t value);
|
void setValue(const nxgl_coord_t value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value that of the slider. This will reposition and redraw
|
* Set the value that of the slider. This will reposition and redraw
|
||||||
* the grip. The supplied value should be bitshifted left 16 places.
|
* the grip. The supplied value should be bitshifted left 16 places.
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -86,11 +86,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -134,7 +134,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onClick(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onClick(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the grip.
|
* Redraws the grip.
|
||||||
*
|
*
|
||||||
@ -143,7 +143,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onRelease(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redraws the grip.
|
* Redraws the grip.
|
||||||
*
|
*
|
||||||
@ -152,7 +152,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y);
|
virtual void onReleaseOutside(nxgl_coord_t x, nxgl_coord_t y);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the grip to follow the mouse.
|
* Moves the grip to follow the mouse.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -87,11 +87,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -211,7 +211,7 @@ namespace NXWidgets
|
|||||||
void setStuckDown(bool stuckDown);
|
void setStuckDown(bool stuckDown);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles the key's stuck down state.
|
* Toggles the key's stuck down state.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline void toggleStuckDown(void)
|
inline void toggleStuckDown(void)
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -53,11 +53,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -92,7 +92,7 @@
|
|||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
{
|
{
|
||||||
class CNxString;
|
class CNxString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used to efficiently iterate over the characters in a CNxString
|
* Class used to efficiently iterate over the characters in a CNxString
|
||||||
* object. The CNxString is a Unicode string that uses the fixed-width
|
* object. The CNxString is a Unicode string that uses the fixed-width
|
||||||
@ -162,7 +162,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool moveTo(int index);
|
bool moveTo(int index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current position of the iterator within the string.
|
* Get the current position of the iterator within the string.
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -56,11 +56,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -72,7 +72,7 @@ namespace NXWidgets
|
|||||||
class CWidgetControl;
|
class CWidgetControl;
|
||||||
class CRect;
|
class CRect;
|
||||||
class CStickyButtonArray;
|
class CStickyButtonArray;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tab panel, with tabs at the top and a panel at the bottom.
|
* Tab panel, with tabs at the top and a panel at the bottom.
|
||||||
*/
|
*/
|
||||||
@ -82,12 +82,12 @@ namespace NXWidgets
|
|||||||
protected:
|
protected:
|
||||||
TNxArray<CNxWidget*> m_tabpages;
|
TNxArray<CNxWidget*> m_tabpages;
|
||||||
CLatchButtonArray *m_buttonbar;
|
CLatchButtonArray *m_buttonbar;
|
||||||
|
|
||||||
virtual void handleActionEvent(const CWidgetEventArgs &e);
|
virtual void handleActionEvent(const CWidgetEventArgs &e);
|
||||||
|
|
||||||
virtual void drawContents(CGraphicsPort* port) {}
|
virtual void drawContents(CGraphicsPort* port) {}
|
||||||
virtual void drawBorder(CGraphicsPort* port) {}
|
virtual void drawBorder(CGraphicsPort* port) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTabPanel(CWidgetControl *pWidgetControl, uint8_t numPages,
|
CTabPanel(CWidgetControl *pWidgetControl, uint8_t numPages,
|
||||||
nxgl_coord_t x, nxgl_coord_t y,
|
nxgl_coord_t x, nxgl_coord_t y,
|
||||||
@ -95,11 +95,11 @@ namespace NXWidgets
|
|||||||
nxgl_coord_t buttonHeight,
|
nxgl_coord_t buttonHeight,
|
||||||
FAR const CWidgetStyle *style = (FAR const CWidgetStyle *)NULL
|
FAR const CWidgetStyle *style = (FAR const CWidgetStyle *)NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
inline CNxWidget &page(uint8_t index) { return *m_tabpages.at(index); }
|
inline CNxWidget &page(uint8_t index) { return *m_tabpages.at(index); }
|
||||||
|
|
||||||
void setPageName(uint8_t index, const CNxString &name);
|
void setPageName(uint8_t index, const CNxString &name);
|
||||||
|
|
||||||
void showPage(uint8_t index);
|
void showPage(uint8_t index);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -105,7 +105,7 @@ namespace NXWidgets
|
|||||||
* height in pixels, calculate the width of a row, etc.
|
* height in pixels, calculate the width of a row, etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CText : public CNxString
|
class CText : public CNxString
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ namespace NXWidgets
|
|||||||
int index;
|
int index;
|
||||||
uint8_t width;
|
uint8_t width;
|
||||||
} LongestLine;
|
} LongestLine;
|
||||||
|
|
||||||
CNxFont *m_font; /**< Font to be used for output */
|
CNxFont *m_font; /**< Font to be used for output */
|
||||||
TNxArray<int> m_linePositions; /**< Array containing start indexes
|
TNxArray<int> m_linePositions; /**< Array containing start indexes
|
||||||
of each wrapped line */
|
of each wrapped line */
|
||||||
@ -209,7 +209,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void remove(const int startIndex, const int count);
|
virtual void remove(const int startIndex, const int count);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the vertical spacing between rows of text.
|
* Set the vertical spacing between rows of text.
|
||||||
*
|
*
|
||||||
@ -219,7 +219,7 @@ namespace NXWidgets
|
|||||||
void setLineSpacing(uint8_t lineSpacing);
|
void setLineSpacing(uint8_t lineSpacing);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the pixel width of the text; text wider than
|
* Sets the pixel width of the text; text wider than
|
||||||
* this will automatically wrap.
|
* this will automatically wrap.
|
||||||
*
|
*
|
||||||
* @param width Maximum pixel width of the text.
|
* @param width Maximum pixel width of the text.
|
||||||
@ -344,7 +344,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void stripTopLines(const int lines);
|
void stripTopLines(const int lines);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrap all of the text.
|
* Wrap all of the text.
|
||||||
*/
|
*/
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -90,11 +90,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -206,7 +206,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual nxgl_coord_t getCursorWidth(void) const;
|
virtual nxgl_coord_t getCursorWidth(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the horizontal position of the string based on its length
|
* Calculate the horizontal position of the string based on its length
|
||||||
* and the alignment options. Alignment options are overridden if the
|
* and the alignment options. Alignment options are overridden if the
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -97,7 +97,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -84,11 +84,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -108,13 +108,13 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
inline CWidgetEventHandler() { }
|
inline CWidgetEventHandler() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline ~CWidgetEventHandler() { }
|
virtual inline ~CWidgetEventHandler() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a mouse button click event.
|
* Handle a mouse button click event.
|
||||||
*
|
*
|
||||||
@ -128,7 +128,7 @@ namespace NXWidgets
|
|||||||
*
|
*
|
||||||
* @param e The event data.
|
* @param e The event data.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void handleDragEvent(const CWidgetEventArgs &e) { }
|
virtual void handleDragEvent(const CWidgetEventArgs &e) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -87,11 +87,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -116,7 +116,7 @@ namespace NXWidgets
|
|||||||
*
|
*
|
||||||
* @param widget The owning widget.
|
* @param widget The owning widget.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CWidgetEventHandlerList(CNxWidget *widget);
|
CWidgetEventHandlerList(CNxWidget *widget);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,7 +124,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
~CWidgetEventHandlerList(void) { }
|
~CWidgetEventHandlerList(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the object raises events or not.
|
* Check if the object raises events or not.
|
||||||
*
|
*
|
||||||
@ -161,7 +161,7 @@ namespace NXWidgets
|
|||||||
* all events raised by this object.
|
* all events raised by this object.
|
||||||
* @param eventHandler A pointer to the event handler.
|
* @param eventHandler A pointer to the event handler.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void addWidgetEventHandler(CWidgetEventHandler *eventHandler);
|
void addWidgetEventHandler(CWidgetEventHandler *eventHandler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,135 +1,135 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* NxWidgets/libnxwidgets/include/cwidgetstyle.hxx
|
* NxWidgets/libnxwidgets/include/cwidgetstyle.hxx
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
* 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
|
||||||
* me be used to endorse or promote products derived from this software
|
* me be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
*
|
*
|
||||||
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
* Portions of this package derive from Woopsi (http://woopsi.org/) and
|
||||||
* portions are original efforts. It is difficult to determine at this
|
* portions are original efforts. It is difficult to determine at this
|
||||||
* point what parts are original efforts and which parts derive from Woopsi.
|
* point what parts are original efforts and which parts derive from Woopsi.
|
||||||
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
* However, in any event, the work of Antony Dzeryn will be acknowledged
|
||||||
* in most NxWidget files. Thanks Antony!
|
* in most NxWidget files. Thanks Antony!
|
||||||
*
|
*
|
||||||
* Copyright (c) 2007-2011, Antony Dzeryn
|
* Copyright (c) 2007-2011, Antony Dzeryn
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* * Redistributions of source code must retain the above copyright
|
* * Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
* * Neither the names "Woopsi", "Simian Zombie" nor the
|
||||||
* names of its contributors may be used to endorse or promote products
|
* names of its contributors may be used to endorse or promote products
|
||||||
* derived from this software without specific prior written permission.
|
* derived from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
* THIS SOFTWARE IS PROVIDED BY Antony Dzeryn ``AS IS'' AND ANY
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
* DISCLAIMED. IN NO EVENT SHALL Antony Dzeryn BE LIABLE FOR ANY
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __INCLUDE_CWIDGETSTYLE_HXX
|
#ifndef __INCLUDE_CWIDGETSTYLE_HXX
|
||||||
#define __INCLUDE_CWIDGETSTYLE_HXX
|
#define __INCLUDE_CWIDGETSTYLE_HXX
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
{
|
{
|
||||||
class CNxFont;
|
class CNxFont;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class containing all colors that a widget depends on.
|
* Class containing all colors that a widget depends on.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CWidgetColors
|
class CWidgetColors
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nxgl_mxpixel_t background; /**< Color used for a normal background */
|
nxgl_mxpixel_t background; /**< Color used for a normal background */
|
||||||
nxgl_mxpixel_t selectedBackground; /**< Color used for a selected background */
|
nxgl_mxpixel_t selectedBackground; /**< Color used for a selected background */
|
||||||
nxgl_mxpixel_t shineEdge; /**< Color used as light bevel edge */
|
nxgl_mxpixel_t shineEdge; /**< Color used as light bevel edge */
|
||||||
nxgl_mxpixel_t shadowEdge; /**< Color used as dark bevel edge */
|
nxgl_mxpixel_t shadowEdge; /**< Color used as dark bevel edge */
|
||||||
nxgl_mxpixel_t highlight; /**< Color used as highlighted elements */
|
nxgl_mxpixel_t highlight; /**< Color used as highlighted elements */
|
||||||
nxgl_mxpixel_t disabledText; /**< Color used for text in a disabled widget */
|
nxgl_mxpixel_t disabledText; /**< Color used for text in a disabled widget */
|
||||||
nxgl_mxpixel_t enabledText; /**< Color used for text in a enabled widget */
|
nxgl_mxpixel_t enabledText; /**< Color used for text in a enabled widget */
|
||||||
nxgl_mxpixel_t selectedText; /**< Color used for text in a clicked widget */
|
nxgl_mxpixel_t selectedText; /**< Color used for text in a clicked widget */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class providing the default colors and fonts for all widgets. This
|
* Class providing the default colors and fonts for all widgets. This
|
||||||
* information is copied into the widgets when they are constructed, so you
|
* information is copied into the widgets when they are constructed, so you
|
||||||
* will need to change these values *before* creating any widgets if you
|
* will need to change these values *before* creating any widgets if you
|
||||||
* want those widgets to use the altered colors.
|
* want those widgets to use the altered colors.
|
||||||
*
|
*
|
||||||
* If the font objects are set, NXWidgets will use them in preference to the
|
* If the font objects are set, NXWidgets will use them in preference to the
|
||||||
* default system fonts.
|
* default system fonts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CWidgetStyle
|
class CWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CWidgetColors colors; /**< Default widget colors */
|
CWidgetColors colors; /**< Default widget colors */
|
||||||
CNxFont *font; /**< Default font */
|
CNxFont *font; /**< Default font */
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
||||||
#endif // __INCLUDE_CWIDGETSTYLE_HXX
|
#endif // __INCLUDE_CWIDGETSTYLE_HXX
|
||||||
|
@ -41,15 +41,15 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "nxconfig.hxx"
|
#include "nxconfig.hxx"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -69,13 +69,13 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
inline CWindowEventHandler() { }
|
inline CWindowEventHandler() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor.
|
* Destructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline ~CWindowEventHandler() { }
|
virtual inline ~CWindowEventHandler() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a NX window redraw request event
|
* Handle a NX window redraw request event
|
||||||
*/
|
*/
|
||||||
@ -85,7 +85,7 @@ namespace NXWidgets
|
|||||||
/**
|
/**
|
||||||
* Handle a NX window position/size change event
|
* Handle a NX window position/size change event
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void handleGeometryEvent(void) { }
|
virtual void handleGeometryEvent(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,7 +111,7 @@ namespace NXWidgets
|
|||||||
*
|
*
|
||||||
* @param arg - User provided argument (see nx_block or nxtk_block)
|
* @param arg - User provided argument (see nx_block or nxtk_block)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void handleBlockedEvent(FAR void *arg) { }
|
virtual void handleBlockedEvent(FAR void *arg) { }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -53,11 +53,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -75,7 +75,7 @@ namespace NXWidgets
|
|||||||
/**
|
/**
|
||||||
* Return the index to the window event handler.
|
* Return the index to the window event handler.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool findWindowEventHandler(CWindowEventHandler *eventHandler, int &index);
|
bool findWindowEventHandler(CWindowEventHandler *eventHandler, int &index);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -85,7 +85,7 @@ namespace NXWidgets
|
|||||||
*
|
*
|
||||||
* @param widget The owning widget.
|
* @param widget The owning widget.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CWindowEventHandlerList(void) { }
|
CWindowEventHandlerList(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -93,7 +93,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
inline ~CWindowEventHandlerList(void) { }
|
inline ~CWindowEventHandlerList(void) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the event handler at the specified index.
|
* Get the event handler at the specified index.
|
||||||
*
|
*
|
||||||
@ -122,7 +122,7 @@ namespace NXWidgets
|
|||||||
* all events raised by this object.
|
* all events raised by this object.
|
||||||
* @param eventHandler A pointer to the event handler.
|
* @param eventHandler A pointer to the event handler.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void addWindowEventHandler(CWindowEventHandler *eventHandler);
|
void addWindowEventHandler(CWindowEventHandler *eventHandler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -86,11 +86,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Abstract Base Classes
|
* Abstract Base Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -218,7 +218,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual const CListBoxDataItem *getSelectedOption(void) const = 0;
|
virtual const CListBoxDataItem *getSelectedOption(void) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether multiple selections are possible or not.
|
* Sets whether multiple selections are possible or not.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -84,11 +84,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Abstract Base Classes
|
* Abstract Base Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -99,7 +99,7 @@ namespace NXWidgets
|
|||||||
* Base IListDataEventHandler class, intended to be subclassed. Any class
|
* Base IListDataEventHandler class, intended to be subclassed. Any class
|
||||||
* that needs to listen for CListData events should inherit from this class.
|
* that needs to listen for CListData events should inherit from this class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class IListDataEventHandler
|
class IListDataEventHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
@ -99,7 +99,7 @@ namespace NXWidgets
|
|||||||
*
|
*
|
||||||
* @return True if the window was successfully created.
|
* @return True if the window was successfully created.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual bool open(void) = 0;
|
virtual bool open(void) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -144,7 +144,7 @@ namespace NXWidgets
|
|||||||
* @param pPos The new position of the window.
|
* @param pPos The new position of the window.
|
||||||
* @return True on success, false on failure.
|
* @return True on success, false on failure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual bool setPosition(FAR const struct nxgl_point_s *pPos) = 0;
|
virtual bool setPosition(FAR const struct nxgl_point_s *pPos) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -153,7 +153,7 @@ namespace NXWidgets
|
|||||||
* @param pSize The new size of the window.
|
* @param pSize The new size of the window.
|
||||||
* @return OK on success; ERROR on failure with errno set appropriately.
|
* @return OK on success; ERROR on failure with errno set appropriately.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual bool setSize(FAR const struct nxgl_size_s *pSize) = 0;
|
virtual bool setSize(FAR const struct nxgl_size_s *pSize) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -84,11 +84,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -118,7 +118,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual const int32_t getCanvasX(void) const = 0;
|
virtual const int32_t getCanvasX(void) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the y coordinate of the virtual canvas.
|
* Gets the y coordinate of the virtual canvas.
|
||||||
*
|
*
|
||||||
@ -134,7 +134,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual const int32_t getCanvasWidth(void) const = 0;
|
virtual const int32_t getCanvasWidth(void) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the height of the virtual canvas.
|
* Gets the height of the virtual canvas.
|
||||||
*
|
*
|
||||||
@ -151,7 +151,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void scroll(int32_t dx, int32_t dy) = 0;
|
virtual void scroll(int32_t dx, int32_t dy) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Repositions the virtual canvas to the specified coordinates.
|
* Repositions the virtual canvas to the specified coordinates.
|
||||||
*
|
*
|
||||||
@ -200,7 +200,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void setCanvasWidth(const int32_t width) = 0;
|
virtual void setCanvasWidth(const int32_t width) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the height of the virtual canvas.
|
* Sets the height of the virtual canvas.
|
||||||
*
|
*
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -84,11 +84,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Abstract Base Classes
|
* Abstract Base Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -88,11 +88,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Abstract Base Classes
|
* Abstract Base Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -147,7 +147,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void setText(const CNxString &text) = 0;
|
virtual void setText(const CNxString &text) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append new text to the end of the current text displayed in the
|
* Append new text to the end of the current text displayed in the
|
||||||
* label.
|
* label.
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -84,11 +84,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -82,11 +82,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
@ -103,7 +103,7 @@ namespace NXWidgets
|
|||||||
T m_source; /**< The object that raised the event */
|
T m_source; /**< The object that raised the event */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
* @param source The object that raised the event.
|
* @param source The object that raised the event.
|
||||||
@ -119,7 +119,7 @@ namespace NXWidgets
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline ~TEventArgs() { }
|
virtual inline ~TEventArgs() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the source object that raised the event.
|
* Get the source object that raised the event.
|
||||||
*/
|
*/
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -84,11 +84,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Implementation Classes
|
* Implementation Classes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -104,7 +104,7 @@
|
|||||||
* the array with large amounts of data. Adding new data to the linked list is
|
* the array with large amounts of data. Adding new data to the linked list is
|
||||||
* very inexpensive.
|
* very inexpensive.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class TNxArray
|
class TNxArray
|
||||||
{
|
{
|
||||||
@ -286,7 +286,7 @@ void TNxArray<T>::pop_back(void)
|
|||||||
{
|
{
|
||||||
// We can just reduce the used size of the array, as the value
|
// We can just reduce the used size of the array, as the value
|
||||||
// will get overwritten automatically
|
// will get overwritten automatically
|
||||||
|
|
||||||
m_size--;
|
m_size--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -63,7 +63,7 @@ using namespace NXWidgets;
|
|||||||
* @param hNxServer Handle to the NX server.
|
* @param hNxServer Handle to the NX server.
|
||||||
* @param widgetControl Controlling widget for this window.
|
* @param widgetControl Controlling widget for this window.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CBgWindow::CBgWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl)
|
CBgWindow::CBgWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl)
|
||||||
: CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hWindow(0),
|
: CCallback(pWidgetControl), m_hNxServer(hNxServer), m_hWindow(0),
|
||||||
m_widgetControl(pWidgetControl)
|
m_widgetControl(pWidgetControl)
|
||||||
@ -76,7 +76,7 @@ CBgWindow::CBgWindow(NXHANDLE hNxServer, CWidgetControl *pWidgetControl)
|
|||||||
/**
|
/**
|
||||||
* Destructor. Returns the background window to the server.
|
* Destructor. Returns the background window to the server.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CBgWindow::~CBgWindow(void)
|
CBgWindow::~CBgWindow(void)
|
||||||
{
|
{
|
||||||
// Release the background. We do not release the widget control
|
// Release the background. We do not release the widget control
|
||||||
@ -134,7 +134,7 @@ CWidgetControl *CBgWindow::getWidgetControl(void) const
|
|||||||
*
|
*
|
||||||
* @return Always returns true.
|
* @return Always returns true.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool CBgWindow::requestPosition(void)
|
bool CBgWindow::requestPosition(void)
|
||||||
{
|
{
|
||||||
// The background window is always at {0,0} and the size never changes.
|
// The background window is always at {0,0} and the size never changes.
|
||||||
@ -178,7 +178,7 @@ bool CBgWindow::getSize(FAR struct nxgl_size_s *pSize)
|
|||||||
* @param pPos The new position of the window.
|
* @param pPos The new position of the window.
|
||||||
* @return Always returns false.
|
* @return Always returns false.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool CBgWindow::setPosition(FAR const struct nxgl_point_s *pPos)
|
bool CBgWindow::setPosition(FAR const struct nxgl_point_s *pPos)
|
||||||
{
|
{
|
||||||
// The position of the background cannot be changed
|
// The position of the background cannot be changed
|
||||||
@ -194,7 +194,7 @@ bool CBgWindow::setPosition(FAR const struct nxgl_point_s *pPos)
|
|||||||
* @param pSize The new size of the window.
|
* @param pSize The new size of the window.
|
||||||
* @return Always returns false.
|
* @return Always returns false.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool CBgWindow::setSize(FAR const struct nxgl_size_s *pSize)
|
bool CBgWindow::setSize(FAR const struct nxgl_size_s *pSize)
|
||||||
{
|
{
|
||||||
// The position of the background cannot be changed
|
// The position of the background cannot be changed
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Method Implementations
|
* Method Implementations
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -180,7 +180,7 @@ bool CBitmap::getRun(nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width,
|
|||||||
// is an even multiple of bytes).
|
// is an even multiple of bytes).
|
||||||
|
|
||||||
FAR uint8_t *start = (FAR uint8_t*)m_bitmap->data +
|
FAR uint8_t *start = (FAR uint8_t*)m_bitmap->data +
|
||||||
y * m_bitmap->stride +
|
y * m_bitmap->stride +
|
||||||
((x * m_bitmap->bpp) >> 3);
|
((x * m_bitmap->bpp) >> 3);
|
||||||
|
|
||||||
// Get the number of bytes to copy.
|
// Get the number of bytes to copy.
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -140,12 +140,12 @@ void CButton::drawOutline(CGraphicsPort *port, bool useClicked)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Work out which colors to use
|
// Work out which colors to use
|
||||||
|
|
||||||
nxgl_coord_t color1;
|
nxgl_coord_t color1;
|
||||||
nxgl_coord_t color2;
|
nxgl_coord_t color2;
|
||||||
|
|
||||||
if (useClicked)
|
if (useClicked)
|
||||||
{
|
{
|
||||||
// Bevelled into the screen
|
// Bevelled into the screen
|
||||||
@ -160,7 +160,7 @@ void CButton::drawOutline(CGraphicsPort *port, bool useClicked)
|
|||||||
color1 = getShineEdgeColor();
|
color1 = getShineEdgeColor();
|
||||||
color2 = getShadowEdgeColor();
|
color2 = getShadowEdgeColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2);
|
port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* CButtonArray Method Implementations
|
* CButtonArray Method Implementations
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -79,7 +79,7 @@ CButtonArray::CButtonArray(CWidgetControl *pWidgetControl,
|
|||||||
nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight,
|
nxgl_coord_t buttonWidth, nxgl_coord_t buttonHeight,
|
||||||
CWidgetStyle *style)
|
CWidgetStyle *style)
|
||||||
: CNxWidget(pWidgetControl, x, y,
|
: CNxWidget(pWidgetControl, x, y,
|
||||||
buttonColumns * buttonWidth + 2, buttonRows * buttonHeight + 2,
|
buttonColumns * buttonWidth + 2, buttonRows * buttonHeight + 2,
|
||||||
0, style)
|
0, style)
|
||||||
{
|
{
|
||||||
// Save configuration
|
// Save configuration
|
||||||
@ -367,7 +367,7 @@ void CButtonArray::drawContents(CGraphicsPort *port)
|
|||||||
{
|
{
|
||||||
int column;
|
int column;
|
||||||
int row;
|
int row;
|
||||||
|
|
||||||
// Just one. Get the row/column indices from the last click
|
// Just one. Get the row/column indices from the last click
|
||||||
|
|
||||||
(void)posToButton(m_clickX, m_clickY, column, row);
|
(void)posToButton(m_clickX, m_clickY, column, row);
|
||||||
@ -452,7 +452,7 @@ void CButtonArray::drawButton(CGraphicsPort *port, int column, int row, bool use
|
|||||||
if (useClicked || isCursorPosition(column, row))
|
if (useClicked || isCursorPosition(column, row))
|
||||||
{
|
{
|
||||||
// "Selected" text color on unique "Selected" background color
|
// "Selected" text color on unique "Selected" background color
|
||||||
|
|
||||||
backColor = getSelectedBackgroundColor();
|
backColor = getSelectedBackgroundColor();
|
||||||
textColor = getSelectedTextColor();
|
textColor = getSelectedTextColor();
|
||||||
}
|
}
|
||||||
@ -465,7 +465,7 @@ void CButtonArray::drawButton(CGraphicsPort *port, int column, int row, bool use
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pick the border colors. Should we use the 'clicked' button style?
|
// Pick the border colors. Should we use the 'clicked' button style?
|
||||||
|
|
||||||
if (useClicked)
|
if (useClicked)
|
||||||
{
|
{
|
||||||
// Yes.. Bevelled into the screen
|
// Yes.. Bevelled into the screen
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -305,7 +305,7 @@ void CCycleButton::getPreferredDimensions(CRect &rect) const
|
|||||||
void CCycleButton::drawContents(CGraphicsPort *port)
|
void CCycleButton::drawContents(CGraphicsPort *port)
|
||||||
{
|
{
|
||||||
// Get the drawing region (excluding any border)
|
// Get the drawing region (excluding any border)
|
||||||
|
|
||||||
CRect rect;
|
CRect rect;
|
||||||
getRect(rect);
|
getRect(rect);
|
||||||
|
|
||||||
@ -393,12 +393,12 @@ void CCycleButton::drawOutline(CGraphicsPort *port)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Work out which colors to use
|
// Work out which colors to use
|
||||||
|
|
||||||
nxgl_coord_t color1;
|
nxgl_coord_t color1;
|
||||||
nxgl_coord_t color2;
|
nxgl_coord_t color2;
|
||||||
|
|
||||||
if (isClicked())
|
if (isClicked())
|
||||||
{
|
{
|
||||||
// Bevelled into the screen
|
// Bevelled into the screen
|
||||||
@ -413,7 +413,7 @@ void CCycleButton::drawOutline(CGraphicsPort *port)
|
|||||||
color1 = getShineEdgeColor();
|
color1 = getShineEdgeColor();
|
||||||
color2 = getShadowEdgeColor();
|
color2 = getShadowEdgeColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2);
|
port->drawBevelledRect(getX(), getY(), getWidth(), getHeight(), color1, color2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +447,7 @@ void CCycleButton::onPreRelease(nxgl_coord_t x, nxgl_coord_t y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
|
|
||||||
CButton::onPreRelease(x, y);
|
CButton::onPreRelease(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user