diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2006-05-30 13:47:28 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2006-05-30 13:47:28 +0000 |
commit | c2cdcd0c1d2950291243b3a8645b5f061a0cdb2a (patch) | |
tree | 390297160c9caa342217d481406c68343785b5f9 /CategoriesListBox.c | |
parent | a853faaa2d2d0321da0ff6f51be656fc40cf8663 (diff) |
Rename ListBox to Panel, matching dit.
Diffstat (limited to 'CategoriesListBox.c')
-rw-r--r-- | CategoriesListBox.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/CategoriesListBox.c b/CategoriesListBox.c index e846a572..2fc807f3 100644 --- a/CategoriesListBox.c +++ b/CategoriesListBox.c @@ -1,25 +1,25 @@ -#include "CategoriesListBox.h" -#include "AvailableMetersListBox.h" -#include "MetersListBox.h" -#include "DisplayOptionsListBox.h" -#include "ColumnsListBox.h" -#include "ColorsListBox.h" -#include "AvailableColumnsListBox.h" +#include "CategoriesPanel.h" +#include "AvailableMetersPanel.h" +#include "MetersPanel.h" +#include "DisplayOptionsPanel.h" +#include "ColumnsPanel.h" +#include "ColorsPanel.h" +#include "AvailableColumnsPanel.h" -#include "ListBox.h" +#include "Panel.h" #include "debug.h" #include <assert.h> /*{ -typedef struct CategoriesListBox_ { - ListBox super; +typedef struct CategoriesPanel_ { + Panel super; Settings* settings; ScreenManager* scr; -} CategoriesListBox; +} CategoriesPanel; }*/ @@ -41,36 +41,36 @@ char* ColorsFunctions[10] = {" ", " ", " ", " ", " ", " /* private property */ char* AvailableColumnsFunctions[10] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done "}; -CategoriesListBox* CategoriesListBox_new(Settings* settings, ScreenManager* scr) { - CategoriesListBox* this = (CategoriesListBox*) malloc(sizeof(CategoriesListBox)); - ListBox* super = (ListBox*) this; - ListBox_init(super, 1, 1, 1, 1, LISTITEM_CLASS, true); - ((Object*)this)->delete = CategoriesListBox_delete; +CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr) { + CategoriesPanel* this = (CategoriesPanel*) malloc(sizeof(CategoriesPanel)); + Panel* super = (Panel*) this; + Panel_init(super, 1, 1, 1, 1, LISTITEM_CLASS, true); + ((Object*)this)->delete = CategoriesPanel_delete; this->settings = settings; this->scr = scr; - super->eventHandler = CategoriesListBox_eventHandler; - ListBox_setHeader(super, "Setup"); - ListBox_add(super, (Object*) ListItem_new("Meters", 0)); - ListBox_add(super, (Object*) ListItem_new("Display options", 0)); - ListBox_add(super, (Object*) ListItem_new("Colors", 0)); - ListBox_add(super, (Object*) ListItem_new("Columns", 0)); + super->eventHandler = CategoriesPanel_eventHandler; + Panel_setHeader(super, "Setup"); + Panel_add(super, (Object*) ListItem_new("Meters", 0)); + Panel_add(super, (Object*) ListItem_new("Display options", 0)); + Panel_add(super, (Object*) ListItem_new("Colors", 0)); + Panel_add(super, (Object*) ListItem_new("Columns", 0)); return this; } -void CategoriesListBox_delete(Object* object) { - ListBox* super = (ListBox*) object; - CategoriesListBox* this = (CategoriesListBox*) object; - ListBox_done(super); +void CategoriesPanel_delete(Object* object) { + Panel* super = (Panel*) object; + CategoriesPanel* this = (CategoriesPanel*) object; + Panel_done(super); free(this); } -HandlerResult CategoriesListBox_eventHandler(ListBox* super, int ch) { - CategoriesListBox* this = (CategoriesListBox*) super; +HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) { + CategoriesPanel* this = (CategoriesPanel*) super; HandlerResult result = IGNORED; - int previous = ListBox_getSelectedIndex(super); + int previous = Panel_getSelectedIndex(super); switch (ch) { case KEY_UP: @@ -79,24 +79,24 @@ HandlerResult CategoriesListBox_eventHandler(ListBox* super, int ch) { case KEY_PPAGE: case KEY_HOME: case KEY_END: { - ListBox_onKey(super, ch); - int selected = ListBox_getSelectedIndex(super); + Panel_onKey(super, ch); + int selected = Panel_getSelectedIndex(super); if (previous != selected) { int size = ScreenManager_size(this->scr); for (int i = 1; i < size; i++) ScreenManager_remove(this->scr, 1); switch (selected) { case 0: - CategoriesListBox_makeMetersPage(this); + CategoriesPanel_makeMetersPage(this); break; case 1: - CategoriesListBox_makeDisplayOptionsPage(this); + CategoriesPanel_makeDisplayOptionsPage(this); break; case 2: - CategoriesListBox_makeColorsPage(this); + CategoriesPanel_makeColorsPage(this); break; case 3: - CategoriesListBox_makeColumnsPage(this); + CategoriesPanel_makeColumnsPage(this); break; } } @@ -107,28 +107,28 @@ HandlerResult CategoriesListBox_eventHandler(ListBox* super, int ch) { return result; } -void CategoriesListBox_makeMetersPage(CategoriesListBox* this) { - ListBox* lbLeftMeters = (ListBox*) MetersListBox_new(this->settings, "Left column", this->settings->header->leftMeters, this->scr); - ListBox* lbRightMeters = (ListBox*) MetersListBox_new(this->settings, "Right column", this->settings->header->rightMeters, this->scr); - ListBox* lbAvailableMeters = (ListBox*) AvailableMetersListBox_new(this->settings, lbLeftMeters, lbRightMeters, this->scr); +void CategoriesPanel_makeMetersPage(CategoriesPanel* this) { + Panel* lbLeftMeters = (Panel*) MetersPanel_new(this->settings, "Left column", this->settings->header->leftMeters, this->scr); + Panel* lbRightMeters = (Panel*) MetersPanel_new(this->settings, "Right column", this->settings->header->rightMeters, this->scr); + Panel* lbAvailableMeters = (Panel*) AvailableMetersPanel_new(this->settings, lbLeftMeters, lbRightMeters, this->scr); ScreenManager_add(this->scr, lbLeftMeters, FunctionBar_new(10, MetersFunctions, NULL, NULL), 20); ScreenManager_add(this->scr, lbRightMeters, FunctionBar_new(10, MetersFunctions, NULL, NULL), 20); ScreenManager_add(this->scr, lbAvailableMeters, FunctionBar_new(10, AvailableMetersFunctions, NULL, NULL), -1); } -void CategoriesListBox_makeDisplayOptionsPage(CategoriesListBox* this) { - ListBox* lbDisplayOptions = (ListBox*) DisplayOptionsListBox_new(this->settings, this->scr); +void CategoriesPanel_makeDisplayOptionsPage(CategoriesPanel* this) { + Panel* lbDisplayOptions = (Panel*) DisplayOptionsPanel_new(this->settings, this->scr); ScreenManager_add(this->scr, lbDisplayOptions, FunctionBar_new(10, DisplayOptionsFunctions, NULL, NULL), -1); } -void CategoriesListBox_makeColorsPage(CategoriesListBox* this) { - ListBox* lbColors = (ListBox*) ColorsListBox_new(this->settings, this->scr); +void CategoriesPanel_makeColorsPage(CategoriesPanel* this) { + Panel* lbColors = (Panel*) ColorsPanel_new(this->settings, this->scr); ScreenManager_add(this->scr, lbColors, FunctionBar_new(10, ColorsFunctions, NULL, NULL), -1); } -void CategoriesListBox_makeColumnsPage(CategoriesListBox* this) { - ListBox* lbColumns = (ListBox*) ColumnsListBox_new(this->settings, this->scr); - ListBox* lbAvailableColumns = (ListBox*) AvailableColumnsListBox_new(this->settings, lbColumns, this->scr); +void CategoriesPanel_makeColumnsPage(CategoriesPanel* this) { + Panel* lbColumns = (Panel*) ColumnsPanel_new(this->settings, this->scr); + Panel* lbAvailableColumns = (Panel*) AvailableColumnsPanel_new(this->settings, lbColumns, this->scr); ScreenManager_add(this->scr, lbColumns, FunctionBar_new(10, ColumnsFunctions, NULL, NULL), 20); ScreenManager_add(this->scr, lbAvailableColumns, FunctionBar_new(10, AvailableColumnsFunctions, NULL, NULL), -1); } |