* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-BC_RecentList::BC_RecentList(const char *type, BC_Hash *defaults,
- BC_TextBox *textbox, int max,
- int x, int y, int w, int h)
- : BC_ListBox(x, y, w, h, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1)
+BC_RecentList::BC_RecentList(const char *type, BC_Hash *defaults,
+ BC_TextBox *textbox, int max,
+ int x, int y, int w, int h)
+ : BC_ListBox(x, y, w, h, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1)
: BC_ListBox(textbox->get_x() + textbox->get_w(), textbox->get_y(),
textbox->get_w(), RECENT_POPUP_HEIGHT,
LISTBOX_TEXT, 0, 0, 0, 1, 0, 1)
: BC_ListBox(textbox->get_x() + textbox->get_w(), textbox->get_y(),
textbox->get_w(), RECENT_POPUP_HEIGHT,
LISTBOX_TEXT, 0, 0, 0, 1, 0, 1)
: BC_ListBox(-1, -1, -1, -1, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1)
{
this->type = type;
: BC_ListBox(-1, -1, -1, -1, LISTBOX_TEXT, 0, 0, 0, 1, 0, 1)
{
this->type = type;
int BC_RecentList::handle_event() {
BC_ListBoxItem *item = get_selection(0, 0);
int BC_RecentList::handle_event() {
BC_ListBoxItem *item = get_selection(0, 0);
if (textbox) update(&items, 0, 0, 1);
return count;
if (textbox) update(&items, 0, 0, 1);
return count;
int BC_RecentList::add_item(const char *prefix, char *text) {
if (! prefix) prefix = "ANY";
int BC_RecentList::add_item(const char *prefix, char *text) {
if (! prefix) prefix = "ANY";
// remove an old item if it matches the new text
for (int i = 0; i < items.total; i++) {
BC_ListBoxItem *item = items.values[i];
// remove an old item if it matches the new text
for (int i = 0; i < items.total; i++) {
BC_ListBoxItem *item = items.values[i];