Show
Ignore:
Timestamp:
02/06/10 09:01:31 (2 years ago)
Author:
westram
Message:
  • AW_awar / widget interaction
    • replaced AW_INSERT_BUTTON_IN_AWAR_LIST by AW_awar/tie_widget
    • link AW_widget_refresh_cb in AW_awar (leak)
    • use Widget type instead of void*
    • untie_all_widgets() in dtor
  • removed deprecated header aw_awar.hxx
  • AW_root
    • delete focus_callback_list (leak)
    • method remove_button_from_sens_list replaces AW_remove_button_from_sens_list
    • moved member 'button_list' from AW_root_Motif, renamed it into 'button_sens_list' and destroy it in dtor
    • use Widget type instead of void*
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WINDOW/AW_window.cxx

    r6674 r6675  
    1111#include "aw_commn.hxx" 
    1212#include "aw_at.hxx" 
    13 #include "aw_awar.hxx" 
     13#include "aw_nawar.hxx" 
    1414#include "aw_xfig.hxx" 
    1515#include "aw_Xm.hxx" 
     
    8484 
    8585    if (mask != AWM_ALL) { // no need to make widget sensitive, if its shown unconditionally 
    86         prvt->button_list = new AW_buttons_struct(mask, w, prvt->button_list); 
     86        button_sens_list = new AW_buttons_struct(mask, w, button_sens_list); 
    8787        if (!(mask & global_mask)) XtSetSensitive(w, False); // disable widget if mask doesn't match 
    8888    } 
     
    9999 
    100100AW_buttons_struct::~AW_buttons_struct() { 
    101     aw_assert(next == 0); // has to be removed from global list before calling dtor 
    102 } 
    103  
    104 bool AW_remove_button_from_sens_list(AW_root *root, Widget w) { 
     101    delete next; 
     102} 
     103 
     104bool AW_root::remove_button_from_sens_list(Widget button) { 
    105105    bool removed = false; 
    106     if (p_global->button_list) { 
     106    if (button_sens_list) { 
    107107        AW_buttons_struct *prev = 0; 
    108         AW_buttons_struct *bl   = p_global->button_list; 
     108        AW_buttons_struct *bl   = button_sens_list; 
    109109 
    110110        while (bl) { 
    111             if (bl->button == w) break; // found wanted widget 
     111            if (bl->button == button) break; // found wanted widget 
    112112            prev = bl; 
    113113            bl = bl->next; 
     
    116116        if (bl) { 
    117117            // remove from list 
    118             if (prev) prev->next       = bl->next; 
    119             else p_global->button_list = bl->next; 
     118            if (prev) prev->next  = bl->next; 
     119            else button_sens_list = bl->next; 
    120120 
    121121            bl->next = 0; 
     
    129129 
    130130AW_option_struct::AW_option_struct(const char *variable_valuei, 
    131         Widget choice_widgeti) : 
     131                                   Widget choice_widgeti) : 
    132132    variable_value(strdup(variable_valuei)), choice_widget(choice_widgeti), 
    133133            next(0) { 
     
    273273 
    274274AW_root::~AW_root() { 
     275    delete focus_callback_list; focus_callback_list = NULL; 
     276    delete button_sens_list;    button_sens_list    = NULL; 
     277 
    275278    exit_root(); 
    276279    exit_variables(); 
    277280    aw_assert(this == AW_root::SINGLETON); 
    278281 
    279      
    280282    delete prvt; 
    281283 
     
    14641466    p_r->fontlist = XmFontListCreate(fontstruct, XmSTRING_DEFAULT_CHARSET); 
    14651467 
    1466     p_r->button_list = 0; 
     1468    button_sens_list = 0; 
    14671469 
    14681470    p_r->last_option_menu = p_r->current_option_menu = p_r->option_menu_list = NULL; 
     
    17731775        char *var_value = is_awar->read_as_string(); 
    17741776        if (var_value) { 
    1775             aww->update_label((int*)widget, var_value); 
     1777            aww->update_label(widget, var_value); 
    17761778        } 
    17771779        else { 
    17781780            AW_ERROR("AW_label_in_awar_list:: AWAR %s not found\n", str); 
    1779             aww->update_label((int*)widget, str); 
     1781            aww->update_label(widget, str); 
    17801782        } 
    17811783        free(var_value); 
    1782         AW_INSERT_BUTTON_IN_AWAR_LIST(is_awar, 0, widget, AW_WIDGET_LABEL_FIELD, aww); 
     1784        is_awar->tie_widget(0, widget, AW_WIDGET_LABEL_FIELD, aww); 
    17831785    } 
    17841786} 
     
    26542656 
    26552657    global_mask = mask; 
    2656     for (list = p_r->button_list; list; list = list->next) { 
     2658    for (list = button_sens_list; list; list = list->next) { 
    26572659        XtSetSensitive(list->button, (list->mask & mask) ? True : False); 
    26582660    }