void MainErrorGUI::create_objects()
{
-
+ lock_window("MainErrorGUI::create_objects");
BC_Button *button;
add_subwindow(button = new BC_OKButton(this));
int x = 10, y = 10;
add_subwindow(title = new BC_Title(x, y, _("The following errors occurred:")));
y += title->get_h() + 5;
- add_subwindow(list = new BC_ListBox(x,
- y,
- get_w() - 20,
- button->get_y() - y - 5,
- LISTBOX_TEXT, // Display text list or icons
- &thread->errors, // Each column has an ArrayList of BC_ListBoxItems.
- 0, // Titles for columns. Set to 0 for no titles
- 0, // width of each column
- 1, // Total columns. Only 1 in icon mode
- 0, // Pixel of top of window.
- 0, // If this listbox is a popup window with a button
- LISTBOX_SINGLE, // Select one item or multiple items
- ICON_LEFT, // Position of icon relative to text of each item
+ add_subwindow(list = new BC_ListBox(x, y,
+ get_w() - 20, button->get_y() - y - 5,
+ LISTBOX_TEXT, // Display text list or icons
+ &thread->errors, // Each column has an ArrayList of BC_ListBoxItems.
+ 0, // Titles for columns. Set to 0 for no titles
+ 0, // width of each column
+ 1, // Total columns. Only 1 in icon mode
+ 0, // Pixel of top of window.
+ 0, // If this listbox is a popup window with a button
+ LISTBOX_SINGLE, // Select one item or multiple items
+ ICON_LEFT, // Position of icon relative to text of each item
0));
show_window();
+ unlock_window();
}
int MainErrorGUI::resize_event(int w, int h)
void MainError::show_error(const char *string)
{
- if( main_error )
- main_error->show_error_local(string);
- else {
- printf("%s", string);
- if( string[strlen(string) - 1] != '\n' )
- printf("\n");
- }
+ if( main_error ) main_error->show_error_local(string);
+ int len = strlen(string);
+ printf("%s%s", string, len>0 && string[len-1] == '\n' ? "" : "\n");
}