1 #include "byteorderpopup.h"
5 ByteOrderPopup::ByteOrderPopup(BC_WindowBase *parent_window,
10 this->parent_window = parent_window;
11 this->output = output;
16 ByteOrderPopup::~ByteOrderPopup()
20 for(int i = 0; i < byteorder_items.total; i++)
21 delete byteorder_items.values[i];
24 int ByteOrderPopup::create_objects()
26 byteorder_items.append(new BC_ListBoxItem(File::byteorder_to_str(0)));
27 byteorder_items.append(new BC_ListBoxItem(File::byteorder_to_str(1)));
29 parent_window->add_subwindow(textbox = new ByteOrderText(this, x, y));
30 x += textbox->get_w();
31 parent_window->add_subwindow(menu = new ByteOrderList(this, x, y));
35 ByteOrderList::ByteOrderList(ByteOrderPopup *popup, int x, int y)
41 &popup->byteorder_items,
51 int ByteOrderList::handle_event()
53 popup->textbox->update(get_selection(0, 0)->get_text());
54 popup->textbox->handle_event();
58 ByteOrderText::ByteOrderText(ByteOrderPopup *popup, int x, int y)
59 : BC_TextBox(x, y, 100, 1, File::byteorder_to_str(*popup->output))
64 int ByteOrderText::handle_event()
66 *popup->output = File::str_to_byteorder(get_text());