예제 #1
0
void KVLVContainer::DoDoubleClick(TGFrame* f, Int_t but, Int_t , Int_t)
{
    // Perform 'default' action when user double-left-clicks an object in the list.
    // By default, this calls the Browse(TBrowser*) method of the object (defined for TObject,
    // overridden in child classes).
    // If SetDoubleClickAction() was called, the DoubleClickAction(TObject*) signal
    // will be emitted with the address of the selected object.
    // Calling AllowDoubleClick(kFALSE) will disable this.

    if (!fAllowDoubleClick) return;

    if (but == kButton1) {
        TGLVEntry* el = (TGLVEntry*)f;
        TObject* ob = (TObject*)el->GetUserData();
        if (ob) {
            if (fUserDoubleClickAction) DoubleClickAction(ob);
            else ob->Browse(0);
        }
    }
}